diff options
| author | Jonathan Coe <jbcoe@me.com> | 2017-02-07 06:19:38 +0000 |
|---|---|---|
| committer | Jonathan Coe <jbcoe@me.com> | 2017-02-07 06:19:38 +0000 |
| commit | 5f1a2c2e0acb610f31596a44bce8e18ec8728a36 (patch) | |
| tree | f9bd1cfd0adcf906ea1f4f14850f49bff58997f3 /clang-tools-extra | |
| parent | ecb6e7b83cd540576613443b2d40d10f658e5cbc (diff) | |
| download | bcm5719-llvm-5f1a2c2e0acb610f31596a44bce8e18ec8728a36.tar.gz bcm5719-llvm-5f1a2c2e0acb610f31596a44bce8e18ec8728a36.zip | |
[clang-tidy] Cleanup of no-assembler check
Address outstanding comments from https://reviews.llvm.org/D29267
llvm-svn: 294283
Diffstat (limited to 'clang-tools-extra')
| -rw-r--r-- | clang-tools-extra/clang-tidy/safety/NoAssemblerCheck.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/clang-tools-extra/clang-tidy/safety/NoAssemblerCheck.cpp b/clang-tools-extra/clang-tidy/safety/NoAssemblerCheck.cpp index ee40cf312aa..880feb7cad5 100644 --- a/clang-tools-extra/clang-tidy/safety/NoAssemblerCheck.cpp +++ b/clang-tools-extra/clang-tidy/safety/NoAssemblerCheck.cpp @@ -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(MatchFinder *Finder) { } 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 MatchFinder::MatchResult &Result) { 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 |

