Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(269)

Side by Side Diff: tools/clang/plugins/FindBadConstructsAction.cpp

Issue 1504033010: Follow macro invocations when checking if a violation happened in a .cc file. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkcr
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "FindBadConstructsAction.h" 5 #include "FindBadConstructsAction.h"
6 6
7 #include "clang/AST/ASTConsumer.h" 7 #include "clang/AST/ASTConsumer.h"
8 #include "clang/Frontend/FrontendPluginRegistry.h" 8 #include "clang/Frontend/FrontendPluginRegistry.h"
9 9
10 #include "FindBadConstructsConsumer.h" 10 #include "FindBadConstructsConsumer.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 options_.enforce_in_thirdparty_webkit = true; 55 options_.enforce_in_thirdparty_webkit = true;
56 options_.enforce_overriding_blink = true; 56 options_.enforce_overriding_blink = true;
57 } else if (args[i] == "check-enum-last-value") { 57 } else if (args[i] == "check-enum-last-value") {
58 // TODO(tsepez): Enable this by default once http://crbug.com/356815 58 // TODO(tsepez): Enable this by default once http://crbug.com/356815
59 // and http://crbug.com/356816 are fixed. 59 // and http://crbug.com/356816 are fixed.
60 options_.check_enum_last_value = true; 60 options_.check_enum_last_value = true;
61 } else if (args[i] == "with-ast-visitor") { 61 } else if (args[i] == "with-ast-visitor") {
62 options_.with_ast_visitor = true; 62 options_.with_ast_visitor = true;
63 } else if (args[i] == "check-templates") { 63 } else if (args[i] == "check-templates") {
64 options_.check_templates = true; 64 options_.check_templates = true;
65 } else if (args[i] == "follow-macro-expansion") {
66 options_.follow_macro_expansion = true;
65 } else { 67 } else {
66 parsed = false; 68 parsed = false;
67 llvm::errs() << "Unknown clang plugin argument: " << args[i] << "\n"; 69 llvm::errs() << "Unknown clang plugin argument: " << args[i] << "\n";
68 } 70 }
69 } 71 }
70 72
71 return parsed; 73 return parsed;
72 } 74 }
73 75
74 } // namespace chrome_checker 76 } // namespace chrome_checker
75 77
76 static FrontendPluginRegistry::Add<chrome_checker::FindBadConstructsAction> X( 78 static FrontendPluginRegistry::Add<chrome_checker::FindBadConstructsAction> X(
77 "find-bad-constructs", 79 "find-bad-constructs",
78 "Finds bad C++ constructs"); 80 "Finds bad C++ constructs");
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698