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

Unified Diff: tools/clang/plugins/ChromeClassTester.cpp

Issue 2265093002: clang plugin: Remove follow-macro-expansion toggle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/clang/plugins/FindBadConstructsAction.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/clang/plugins/ChromeClassTester.cpp
diff --git a/tools/clang/plugins/ChromeClassTester.cpp b/tools/clang/plugins/ChromeClassTester.cpp
index 08e0d40d0a94ac5d985ab0e30c497fc02c85c548..e8f1507447b92f39dfd8caa63a67ea744242df1d 100644
--- a/tools/clang/plugins/ChromeClassTester.cpp
+++ b/tools/clang/plugins/ChromeClassTester.cpp
@@ -197,30 +197,20 @@ bool ChromeClassTester::HasIgnoredBases(const CXXRecordDecl* record) {
bool ChromeClassTester::InImplementationFile(SourceLocation record_location) {
std::string filename;
- if (options_.follow_macro_expansion) {
- // If |record_location| is a macro, check the whole chain of expansions.
- const SourceManager& source_manager = instance_.getSourceManager();
- while (true) {
- if (GetFilename(record_location, &filename)) {
- if (ends_with(filename, ".cc") || ends_with(filename, ".cpp") ||
- ends_with(filename, ".mm")) {
- return true;
- }
- }
- if (!record_location.isMacroID()) {
- break;
+ // If |record_location| is a macro, check the whole chain of expansions.
+ const SourceManager& source_manager = instance_.getSourceManager();
+ while (true) {
+ if (GetFilename(record_location, &filename)) {
+ if (ends_with(filename, ".cc") || ends_with(filename, ".cpp") ||
+ ends_with(filename, ".mm")) {
+ return true;
}
- record_location =
- source_manager.getImmediateExpansionRange(record_location).first;
}
- } else {
- if (!GetFilename(record_location, &filename))
- return false;
-
- if (ends_with(filename, ".cc") || ends_with(filename, ".cpp") ||
- ends_with(filename, ".mm")) {
- return true;
+ if (!record_location.isMacroID()) {
+ break;
}
+ record_location =
+ source_manager.getImmediateExpansionRange(record_location).first;
}
return false;
« no previous file with comments | « no previous file | tools/clang/plugins/FindBadConstructsAction.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698