diff options
author | Chris Lattner <sabre@nondot.org> | 2009-10-28 23:59:40 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-10-28 23:59:40 +0000 |
commit | 6c4d255bf3d64fd2ecb48334e780c87f060f1280 (patch) | |
tree | d89f05cd759ed3e4900f018b4a0e546745eb1f43 /clang/lib/CodeGen/CGStmt.cpp | |
parent | 48d9995d2ba86daf86396dbe847235fcf492bbbe (diff) | |
download | bcm5719-llvm-6c4d255bf3d64fd2ecb48334e780c87f060f1280.tar.gz bcm5719-llvm-6c4d255bf3d64fd2ecb48334e780c87f060f1280.zip |
Implement clang support for indirect branch and address of label
using the new LLVM support for this. This is temporarily hiding
behind horrible and ugly #ifdefs until the time when the optimizer
is stable (hopefully a week or so). Until then, lets make it "opt in" :)
llvm-svn: 85446
Diffstat (limited to 'clang/lib/CodeGen/CGStmt.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGStmt.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGStmt.cpp b/clang/lib/CodeGen/CGStmt.cpp index f58b5792678..9126c2c99cd 100644 --- a/clang/lib/CodeGen/CGStmt.cpp +++ b/clang/lib/CodeGen/CGStmt.cpp @@ -287,8 +287,13 @@ void CodeGenFunction::EmitIndirectGotoStmt(const IndirectGotoStmt &S) { // Emit initial switch which will be patched up later by // EmitIndirectSwitches(). We need a default dest, so we use the // current BB, but this is overwritten. +#ifndef USEINDIRECTBRANCH llvm::Value *V = Builder.CreatePtrToInt(EmitScalarExpr(S.getTarget()), llvm::Type::getInt32Ty(VMContext), +#else + llvm::Value *V = Builder.CreateBitCast(EmitScalarExpr(S.getTarget()), + llvm::Type::getInt8PtrTy(VMContext), +#endif "addr"); llvm::BasicBlock *CurBB = Builder.GetInsertBlock(); |