diff options
author | Devang Patel <dpatel@apple.com> | 2009-11-13 02:27:33 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2009-11-13 02:27:33 +0000 |
commit | 76a06074eb3b1bbaf4f72fca817af3eb31a889d0 (patch) | |
tree | bd3878cd8f44a32066d70cdf2bd0f521b1489356 /llvm/lib/Analysis/DebugInfo.cpp | |
parent | 97f99fa554cfddfd4b323b973d4509054cb5dfb8 (diff) | |
download | bcm5719-llvm-76a06074eb3b1bbaf4f72fca817af3eb31a889d0.tar.gz bcm5719-llvm-76a06074eb3b1bbaf4f72fca817af3eb31a889d0.zip |
Revert r87059 for now. It is failing clang tests.
llvm-svn: 87070
Diffstat (limited to 'llvm/lib/Analysis/DebugInfo.cpp')
-rw-r--r-- | llvm/lib/Analysis/DebugInfo.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/DebugInfo.cpp b/llvm/lib/Analysis/DebugInfo.cpp index 047837c2fb2..1b58b5ed57f 100644 --- a/llvm/lib/Analysis/DebugInfo.cpp +++ b/llvm/lib/Analysis/DebugInfo.cpp @@ -608,7 +608,9 @@ void DIVariable::dump() const { DIFactory::DIFactory(Module &m) : M(m), VMContext(M.getContext()), StopPointFn(0), FuncStartFn(0), RegionStartFn(0), RegionEndFn(0), - DeclareFn(0) {} + DeclareFn(0) { + EmptyStructPtr = PointerType::getUnqual(StructType::get(VMContext)); +} Constant *DIFactory::GetTagConstant(unsigned TAG) { assert((TAG & LLVMDebugVersionMask) == 0 && @@ -1035,7 +1037,10 @@ void DIFactory::InsertRegionEnd(DIDescriptor D, BasicBlock *BB) { /// InsertDeclare - Insert a new llvm.dbg.declare intrinsic call. Instruction *DIFactory::InsertDeclare(Value *Storage, DIVariable D, - Instruction *InsertBefore) { + Instruction *InsertBefore) { + // Cast the storage to a {}* for the call to llvm.dbg.declare. + Storage = new BitCastInst(Storage, EmptyStructPtr, "", InsertBefore); + if (!DeclareFn) DeclareFn = Intrinsic::getDeclaration(&M, Intrinsic::dbg_declare); @@ -1045,7 +1050,10 @@ Instruction *DIFactory::InsertDeclare(Value *Storage, DIVariable D, /// InsertDeclare - Insert a new llvm.dbg.declare intrinsic call. Instruction *DIFactory::InsertDeclare(Value *Storage, DIVariable D, - BasicBlock *InsertAtEnd) { + BasicBlock *InsertAtEnd) { + // Cast the storage to a {}* for the call to llvm.dbg.declare. + Storage = new BitCastInst(Storage, EmptyStructPtr, "", InsertAtEnd); + if (!DeclareFn) DeclareFn = Intrinsic::getDeclaration(&M, Intrinsic::dbg_declare); |