Commit 3fc38173 authored by thakis's avatar thakis Committed by Commit bot

clang plugin: Remove follow-macro-expansion toggle

It has been enabled by default since
https://codereview.chromium.org/1529323002/

BUG=156590

Review-Url: https://codereview.chromium.org/2265093002
Cr-Commit-Position: refs/heads/master@{#413461}
parent 7bdd9928
...@@ -197,30 +197,20 @@ bool ChromeClassTester::HasIgnoredBases(const CXXRecordDecl* record) { ...@@ -197,30 +197,20 @@ bool ChromeClassTester::HasIgnoredBases(const CXXRecordDecl* record) {
bool ChromeClassTester::InImplementationFile(SourceLocation record_location) { bool ChromeClassTester::InImplementationFile(SourceLocation record_location) {
std::string filename; std::string filename;
if (options_.follow_macro_expansion) { // If |record_location| is a macro, check the whole chain of expansions.
// If |record_location| is a macro, check the whole chain of expansions. const SourceManager& source_manager = instance_.getSourceManager();
const SourceManager& source_manager = instance_.getSourceManager(); while (true) {
while (true) { if (GetFilename(record_location, &filename)) {
if (GetFilename(record_location, &filename)) { if (ends_with(filename, ".cc") || ends_with(filename, ".cpp") ||
if (ends_with(filename, ".cc") || ends_with(filename, ".cpp") || ends_with(filename, ".mm")) {
ends_with(filename, ".mm")) { return true;
return true;
}
}
if (!record_location.isMacroID()) {
break;
} }
record_location =
source_manager.getImmediateExpansionRange(record_location).first;
} }
} else { if (!record_location.isMacroID()) {
if (!GetFilename(record_location, &filename)) break;
return false;
if (ends_with(filename, ".cc") || ends_with(filename, ".cpp") ||
ends_with(filename, ".mm")) {
return true;
} }
record_location =
source_manager.getImmediateExpansionRange(record_location).first;
} }
return false; return false;
......
...@@ -58,7 +58,8 @@ bool FindBadConstructsAction::ParseArgs(const CompilerInstance& instance, ...@@ -58,7 +58,8 @@ bool FindBadConstructsAction::ParseArgs(const CompilerInstance& instance,
} else if (args[i] == "check-templates") { } else if (args[i] == "check-templates") {
options_.check_templates = true; options_.check_templates = true;
} else if (args[i] == "follow-macro-expansion") { } else if (args[i] == "follow-macro-expansion") {
options_.follow_macro_expansion = true; // TODO(thakis): This is now always on. Remove support for this flag once
// the build no longer passes it in.
} else if (args[i] == "no-realpath") { } else if (args[i] == "no-realpath") {
options_.no_realpath = true; options_.no_realpath = true;
} else if (args[i] == "check-ipc") { } else if (args[i] == "check-ipc") {
......
...@@ -13,7 +13,6 @@ struct Options { ...@@ -13,7 +13,6 @@ struct Options {
bool enforce_in_thirdparty_webkit = false; // Use in Blink code itself bool enforce_in_thirdparty_webkit = false; // Use in Blink code itself
bool check_enum_last_value = false; bool check_enum_last_value = false;
bool check_templates = false; bool check_templates = false;
bool follow_macro_expansion = false;
// This is needed for some distributed build-sytems to respect banned // This is needed for some distributed build-sytems to respect banned
// paths. See https://crbug.com/583454 for details. // paths. See https://crbug.com/583454 for details.
bool no_realpath = false; bool no_realpath = false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment