Use LLVM_BUILTIN_TRAP instead of lame volatile int traps.

(from a todo mentioned in r159469 & originally suggested by Chandler Carruth)

llvm-svn: 162302
This commit is contained in:
David Blaikie 2012-08-21 18:56:49 +00:00
parent 9c7226b456
commit 5bd4c2ace4
2 changed files with 2 additions and 2 deletions

View File

@ -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);

View File

@ -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();