diff --git a/clang/lib/Lex/Pragma.cpp b/clang/lib/Lex/Pragma.cpp index c9cc4adf4019..b7f7d1d4a90e 100644 --- a/clang/lib/Lex/Pragma.cpp +++ b/clang/lib/Lex/Pragma.cpp @@ -1009,7 +1009,7 @@ struct PragmaDebugHandler : public PragmaHandler { if (II->isStr("assert")) { llvm_unreachable("This is an assertion!"); } else if (II->isStr("crash")) { - *(volatile int*) 0x11 = 0; + LLVM_BUILTIN_TRAP; } else if (II->isStr("parser_crash")) { Token Crasher; Crasher.setKind(tok::annot_pragma_parser_crash); diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index 4129950ea6e9..85d3f5a7da7b 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/lib/Parse/ParseDecl.cpp @@ -4351,7 +4351,7 @@ void Parser::ParseDirectDeclarator(Declarator &D) { D.SetIdentifier(0, Tok.getLocation()); } else { if (Tok.getKind() == tok::annot_pragma_parser_crash) - *(volatile int*) 0x11 = 0; + LLVM_BUILTIN_TRAP; if (D.getContext() == Declarator::MemberContext) Diag(Tok, diag::err_expected_member_name_or_semi) << D.getDeclSpec().getSourceRange();