[llvm-commits] [llvm-gcc-4.2] r46010 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
Chris Lattner
sabre at nondot.org
Tue Jan 15 13:35:54 PST 2008
Author: lattner
Date: Tue Jan 15 15:35:53 2008
New Revision: 46010
URL: http://llvm.org/viewvc/llvm-project?rev=46010&view=rev
Log:
Add support for builtin_trap, which was basically just broken before.
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=46010&r1=46009&r2=46010&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Tue Jan 15 15:35:53 2008
@@ -4199,11 +4199,18 @@
}
case BUILT_IN_FLT_ROUNDS: {
Result = Builder.CreateCall(Intrinsic::getDeclaration(TheModule,
- Intrinsic::flt_rounds),
+ Intrinsic::flt_rounds),
"tmp");
Result = BitCastToType(Result, ConvertType(TREE_TYPE(exp)));
return true;
}
+ case BUILT_IN_TRAP:
+ Builder.CreateCall(Intrinsic::getDeclaration(TheModule, Intrinsic::trap));
+ // Emit an explicit unreachable instruction.
+ Builder.CreateUnreachable();
+ EmitBlock(new BasicBlock(""));
+ return true;
+
#if 1 // FIXME: Should handle these GCC extensions eventually.
case BUILT_IN_APPLY_ARGS:
case BUILT_IN_APPLY:
@@ -4218,7 +4225,6 @@
case BUILT_IN_SETJMP_RECEIVER:
case BUILT_IN_LONGJMP:
case BUILT_IN_UPDATE_SETJMP_BUF:
- case BUILT_IN_TRAP:
// FIXME: HACK: Just ignore these.
{
More information about the llvm-commits
mailing list