Author: jbcoe Date: Tue Feb 7 00:19:38 2017 New Revision: 294283 URL: http://llvm.org/viewvc/llvm-project?rev=294283&view=rev Log: [clang-tidy] Cleanup of no-assembler check
Address outstanding comments from https://reviews.llvm.org/D29267 Modified: clang-tools-extra/trunk/clang-tidy/safety/NoAssemblerCheck.cpp Modified: clang-tools-extra/trunk/clang-tidy/safety/NoAssemblerCheck.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/safety/NoAssemblerCheck.cpp?rev=294283&r1=294282&r2=294283&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-tidy/safety/NoAssemblerCheck.cpp (original) +++ clang-tools-extra/trunk/clang-tidy/safety/NoAssemblerCheck.cpp Tue Feb 7 00:19:38 2017 @@ -10,7 +10,6 @@ #include "NoAssemblerCheck.h" #include "clang/AST/ASTContext.h" #include "clang/ASTMatchers/ASTMatchFinder.h" -#include "clang/Lex/Lexer.h" using namespace clang::ast_matchers; @@ -33,7 +32,7 @@ void NoAssemblerCheck::registerMatchers( } void NoAssemblerCheck::check(const MatchFinder::MatchResult &Result) { - Optional<SourceLocation> ASMLocation; + SourceLocation ASMLocation; if (const auto *ASM = Result.Nodes.getNodeAs<AsmStmt>("asm-stmt")) ASMLocation = ASM->getAsmLoc(); else if (const auto *ASM = @@ -44,7 +43,7 @@ void NoAssemblerCheck::check(const Match else llvm_unreachable("Unhandled case in matcher."); - diag(*ASMLocation, "do not use inline assembler in safety-critical code"); + diag(ASMLocation, "do not use inline assembler in safety-critical code"); } } // namespace safety _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits