23 SourceLocation ASMLocation;
24 if (
const auto *ASM = Result.Nodes.getNodeAs<AsmStmt>(
"asm-stmt"))
25 ASMLocation = ASM->getAsmLoc();
26 else if (
const auto *ASM =
27 Result.Nodes.getNodeAs<FileScopeAsmDecl>(
"asm-file-scope"))
28 ASMLocation = ASM->getAsmLoc();
29 else if (
const auto *ASM = Result.Nodes.getNodeAs<VarDecl>(
"asm-var"))
30 ASMLocation = ASM->getLocation();
32 llvm_unreachable(
"Unhandled case in matcher.");
34 diag(ASMLocation,
"do not use inline assembler in safety-critical code");