Commit 5ca9109f authored by hans@chromium.org's avatar hans@chromium.org

Style plugin: remove temporary flag for checking inner classes.

The flag was there to make checking of inner classes optional
until all inner classes could be fixed.

We must still parse the flag until this has been rolled in and
plugin_flags.sh has been updated not to pass in the flag anymore.

BUG=136863


Review URL: https://chromiumcodereview.appspot.com/10837254

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151727 0039d316-1c4b-4281-b951-d872f2087c98
parent 66d3a0cf
...@@ -37,11 +37,9 @@ bool ends_with(const std::string& one, const std::string& two) { ...@@ -37,11 +37,9 @@ bool ends_with(const std::string& one, const std::string& two) {
} // namespace } // namespace
ChromeClassTester::ChromeClassTester(CompilerInstance& instance, ChromeClassTester::ChromeClassTester(CompilerInstance& instance,
bool check_inner_classes,
bool check_cc_directory) bool check_cc_directory)
: instance_(instance), : instance_(instance),
diagnostic_(instance.getDiagnostics()), diagnostic_(instance.getDiagnostics()),
check_inner_classes_(check_inner_classes),
check_cc_directory_(check_cc_directory) { check_cc_directory_(check_cc_directory) {
BuildBannedLists(); BuildBannedLists();
} }
...@@ -49,13 +47,7 @@ ChromeClassTester::ChromeClassTester(CompilerInstance& instance, ...@@ -49,13 +47,7 @@ ChromeClassTester::ChromeClassTester(CompilerInstance& instance,
ChromeClassTester::~ChromeClassTester() {} ChromeClassTester::~ChromeClassTester() {}
void ChromeClassTester::HandleTagDeclDefinition(TagDecl* tag) { void ChromeClassTester::HandleTagDeclDefinition(TagDecl* tag) {
if (check_inner_classes_) { pending_class_decls_.push_back(tag);
// Defer processing of this tag until its containing top-level
// declaration has been fully parsed. See crbug.com/136863.
pending_class_decls_.push_back(tag);
} else {
CheckTag(tag);
}
} }
bool ChromeClassTester::HandleTopLevelDecl(DeclGroupRef group_ref) { bool ChromeClassTester::HandleTopLevelDecl(DeclGroupRef group_ref) {
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
class ChromeClassTester : public clang::ASTConsumer { class ChromeClassTester : public clang::ASTConsumer {
public: public:
explicit ChromeClassTester(clang::CompilerInstance& instance, explicit ChromeClassTester(clang::CompilerInstance& instance,
bool check_inner_classes,
bool check_cc_directory); bool check_cc_directory);
virtual ~ChromeClassTester(); virtual ~ChromeClassTester();
...@@ -82,9 +81,6 @@ class ChromeClassTester : public clang::ASTConsumer { ...@@ -82,9 +81,6 @@ class ChromeClassTester : public clang::ASTConsumer {
// List of decls to check once the current top-level decl is parsed. // List of decls to check once the current top-level decl is parsed.
std::vector<clang::TagDecl*> pending_class_decls_; std::vector<clang::TagDecl*> pending_class_decls_;
// TODO: Remove once all inner classes are cleaned up.
bool check_inner_classes_;
// TODO(jamesr): Remove once cc/ directory compiles without warnings. // TODO(jamesr): Remove once cc/ directory compiles without warnings.
bool check_cc_directory_; bool check_cc_directory_;
}; };
......
...@@ -51,9 +51,8 @@ class FindBadConstructsConsumer : public ChromeClassTester { ...@@ -51,9 +51,8 @@ class FindBadConstructsConsumer : public ChromeClassTester {
FindBadConstructsConsumer(CompilerInstance& instance, FindBadConstructsConsumer(CompilerInstance& instance,
bool check_refcounted_dtors, bool check_refcounted_dtors,
bool check_virtuals_in_implementations, bool check_virtuals_in_implementations,
bool check_inner_classes,
bool check_cc_directory) bool check_cc_directory)
: ChromeClassTester(instance, check_inner_classes, check_cc_directory), : ChromeClassTester(instance, check_cc_directory),
check_refcounted_dtors_(check_refcounted_dtors), check_refcounted_dtors_(check_refcounted_dtors),
check_virtuals_in_implementations_(check_virtuals_in_implementations) { check_virtuals_in_implementations_(check_virtuals_in_implementations) {
} }
...@@ -398,7 +397,6 @@ class FindBadConstructsAction : public PluginASTAction { ...@@ -398,7 +397,6 @@ class FindBadConstructsAction : public PluginASTAction {
FindBadConstructsAction() FindBadConstructsAction()
: check_refcounted_dtors_(true), : check_refcounted_dtors_(true),
check_virtuals_in_implementations_(true), check_virtuals_in_implementations_(true),
check_inner_classes_(false),
check_cc_directory_(false) { check_cc_directory_(false) {
} }
...@@ -408,7 +406,7 @@ class FindBadConstructsAction : public PluginASTAction { ...@@ -408,7 +406,7 @@ class FindBadConstructsAction : public PluginASTAction {
llvm::StringRef ref) { llvm::StringRef ref) {
return new FindBadConstructsConsumer( return new FindBadConstructsConsumer(
instance, check_refcounted_dtors_, check_virtuals_in_implementations_, instance, check_refcounted_dtors_, check_virtuals_in_implementations_,
check_inner_classes_, check_cc_directory_); check_cc_directory_);
} }
virtual bool ParseArgs(const CompilerInstance& instance, virtual bool ParseArgs(const CompilerInstance& instance,
...@@ -421,7 +419,7 @@ class FindBadConstructsAction : public PluginASTAction { ...@@ -421,7 +419,7 @@ class FindBadConstructsAction : public PluginASTAction {
} else if (args[i] == "skip-virtuals-in-implementations") { } else if (args[i] == "skip-virtuals-in-implementations") {
check_virtuals_in_implementations_ = false; check_virtuals_in_implementations_ = false;
} else if (args[i] == "check-inner-classes") { } else if (args[i] == "check-inner-classes") {
check_inner_classes_ = true; // TODO(hans): Remove this once it's removed from plugin_flags.sh.
} else if (args[i] == "check-cc-directory") { } else if (args[i] == "check-cc-directory") {
check_cc_directory_ = true; check_cc_directory_ = true;
} else { } else {
...@@ -436,7 +434,6 @@ class FindBadConstructsAction : public PluginASTAction { ...@@ -436,7 +434,6 @@ class FindBadConstructsAction : public PluginASTAction {
private: private:
bool check_refcounted_dtors_; bool check_refcounted_dtors_;
bool check_virtuals_in_implementations_; bool check_virtuals_in_implementations_;
bool check_inner_classes_;
bool check_cc_directory_; bool check_cc_directory_;
}; };
......
...@@ -25,8 +25,6 @@ usage() { ...@@ -25,8 +25,6 @@ usage() {
do_testcase() { do_testcase() {
local output="$("${CLANG_DIR}"/bin/clang -c -Wno-c++11-extensions \ local output="$("${CLANG_DIR}"/bin/clang -c -Wno-c++11-extensions \
-Xclang -load -Xclang "${CLANG_DIR}"/lib/libFindBadConstructs.${LIB} \ -Xclang -load -Xclang "${CLANG_DIR}"/lib/libFindBadConstructs.${LIB} \
-Xclang -plugin-arg-find-bad-constructs \
-Xclang check-inner-classes \
-Xclang -plugin -Xclang find-bad-constructs ${1} 2>&1)" -Xclang -plugin -Xclang find-bad-constructs ${1} 2>&1)"
local diffout="$(echo "${output}" | diff - "${2}")" local diffout="$(echo "${output}" | diff - "${2}")"
if [ "${diffout}" = "" ]; then if [ "${diffout}" = "" ]; then
......
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