summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenFunction.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-10-28 23:59:40 +0000
committerChris Lattner <sabre@nondot.org>2009-10-28 23:59:40 +0000
commit6c4d255bf3d64fd2ecb48334e780c87f060f1280 (patch)
treed89f05cd759ed3e4900f018b4a0e546745eb1f43 /clang/lib/CodeGen/CodeGenFunction.h
parent48d9995d2ba86daf86396dbe847235fcf492bbbe (diff)
downloadbcm5719-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/CodeGenFunction.h')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h
index f290571b7d7..1fba3f971e7 100644
--- a/clang/lib/CodeGen/CodeGenFunction.h
+++ b/clang/lib/CodeGen/CodeGenFunction.h
@@ -183,13 +183,26 @@ public:
void PopConditionalTempDestruction();
private:
+#ifndef USEINDIRECTBRANCH
CGDebugInfo* DebugInfo;
+#else
+ CGDebugInfo *DebugInfo;
+#endif
+#ifndef USEINDIRECTBRANCH
/// LabelIDs - Track arbitrary ids assigned to labels for use in implementing
/// the GCC address-of-label extension and indirect goto. IDs are assigned to
/// labels inside getIDForAddrOfLabel().
std::map<const LabelStmt*, unsigned> LabelIDs;
+#else
+ /// IndirectBranch - The first time an indirect goto is seen we create a
+ /// block with an indirect branch. Every time we see the address of a label
+ /// taken, we add the label to the indirect goto. Every subsequent indirect
+ /// goto is codegen'd as a jump to the IndirectBranch's basic block.
+ llvm::IndirectBrInst *IndirectBranch;
+#endif
+#ifndef USEINDIRECTBRANCH
/// IndirectGotoSwitch - The first time an indirect goto is seen we create a
/// block with the switch for the indirect gotos. Every time we see the
/// address of a label taken, we add the label to the indirect goto. Every
@@ -197,6 +210,7 @@ private:
/// IndirectGotoSwitch's basic block.
llvm::SwitchInst *IndirectGotoSwitch;
+#endif
/// LocalDeclMap - This keeps track of the LLVM allocas or globals for local C
/// decls.
llvm::DenseMap<const Decl*, llvm::Value*> LocalDeclMap;
@@ -558,7 +572,11 @@ public:
/// the input field number being accessed.
static unsigned getAccessedFieldNo(unsigned Idx, const llvm::Constant *Elts);
+#ifndef USEINDIRECTBRANCH
unsigned GetIDForAddrOfLabel(const LabelStmt *L);
+#else
+ llvm::BlockAddress *GetAddrOfLabel(const LabelStmt *L);
+#endif
llvm::BasicBlock *GetIndirectGotoBlock();
/// EmitMemSetToZero - Generate code to memset a value of the given type to 0.
OpenPOWER on IntegriCloud