diff options
-rw-r--r-- | tools/clang/plugins/ChromeClassTester.cpp | 13 | ||||
-rw-r--r-- | tools/clang/plugins/ChromeClassTester.h | 2 |
2 files changed, 7 insertions, 8 deletions
diff --git a/tools/clang/plugins/ChromeClassTester.cpp b/tools/clang/plugins/ChromeClassTester.cpp index 7a3b89e..49c5ce4 100644 --- a/tools/clang/plugins/ChromeClassTester.cpp +++ b/tools/clang/plugins/ChromeClassTester.cpp @@ -91,12 +91,12 @@ void ChromeClassTester::emitWarning(SourceLocation loc, DiagnosticsEngine::Error : DiagnosticsEngine::Warning; unsigned id = diagnostic().getCustomDiagID(level, err); - DiagnosticBuilder B = diagnostic().Report(full, id); + DiagnosticBuilder builder = diagnostic().Report(full, id); } bool ChromeClassTester::InBannedNamespace(const Decl* record) { std::string n = GetNamespace(record); - if (n != "") { + if (!n.empty()) { return std::find(banned_namespaces_.begin(), banned_namespaces_.end(), n) != banned_namespaces_.end(); } @@ -110,9 +110,8 @@ std::string ChromeClassTester::GetNamespace(const Decl* record) { bool ChromeClassTester::InImplementationFile(SourceLocation record_location) { std::string filename; - if (!GetFilename(record_location, &filename)) { + if (!GetFilename(record_location, &filename)) return false; - } if (ends_with(filename, ".cc") || ends_with(filename, ".cpp") || ends_with(filename, ".mm")) { @@ -267,9 +266,9 @@ bool ChromeClassTester::IsIgnoredType(const std::string& base_name) { bool ChromeClassTester::GetFilename(SourceLocation loc, std::string* filename) { - const SourceManager &SM = instance_.getSourceManager(); - SourceLocation spelling_location = SM.getSpellingLoc(loc); - PresumedLoc ploc = SM.getPresumedLoc(spelling_location); + const SourceManager& source_manager = instance_.getSourceManager(); + SourceLocation spelling_location = source_manager.getSpellingLoc(loc); + PresumedLoc ploc = source_manager.getPresumedLoc(spelling_location); if (ploc.isInvalid()) { // If we're in an invalid location, we're looking at things that aren't // actually stated in the source. diff --git a/tools/clang/plugins/ChromeClassTester.h b/tools/clang/plugins/ChromeClassTester.h index 5994a71..f6d2e68 100644 --- a/tools/clang/plugins/ChromeClassTester.h +++ b/tools/clang/plugins/ChromeClassTester.h @@ -21,7 +21,7 @@ class ChromeClassTester : public clang::ASTConsumer { explicit ChromeClassTester(clang::CompilerInstance& instance); virtual ~ChromeClassTester(); - // ASTConsumer: + // clang::ASTConsumer: virtual void HandleTagDeclDefinition(clang::TagDecl* tag); protected: |