[PATCH] D29267: [clang-tidy] safety-no-assembler
Jonathan B Coe via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Feb 6 22:33:57 PST 2017
jbcoe marked an inline comment as done.
jbcoe added inline comments.
================
Comment at: clang-tools-extra/clang-tidy/safety/NoAssemblerCheck.cpp:13
+#include "clang/ASTMatchers/ASTMatchFinder.h"
+#include "clang/Lex/Lexer.h"
+
----------------
Eugene.Zelenko wrote:
> aaron.ballman wrote:
> > Is this include needed?
> Will be good idea to run Include What You Use.
Fixed unnecessary include.
================
Comment at: clang-tools-extra/clang-tidy/safety/NoAssemblerCheck.cpp:36
+void NoAssemblerCheck::check(const MatchFinder::MatchResult &Result) {
+ Optional<SourceLocation> ASMLocation;
+ if (const auto *ASM = Result.Nodes.getNodeAs<AsmStmt>("asm-stmt"))
----------------
aaron.ballman wrote:
> No need for this to be an `Optional`, is there?
I think optional makes intent clearer but am used to dealing with immutable objects.
I've changed the code to just use SourceLocation.
Repository:
rL LLVM
https://reviews.llvm.org/D29267
More information about the cfe-commits
mailing list