30 SourceLocation ASMLocation;
31 if (
const auto *ASM = Result.Nodes.getNodeAs<AsmStmt>(
"asm-stmt"))
32 ASMLocation = ASM->getAsmLoc();
33 else if (
const auto *ASM =
34 Result.Nodes.getNodeAs<FileScopeAsmDecl>(
"asm-file-scope"))
35 ASMLocation = ASM->getAsmLoc();
36 else if (
const auto *ASM = Result.Nodes.getNodeAs<VarDecl>(
"asm-var"))
37 ASMLocation = ASM->getLocation();
39 llvm_unreachable(
"Unhandled case in matcher.");
41 diag(ASMLocation,
"do not use inline assembler in safety-critical code");