mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-03 13:31:05 +00:00
Remove unnecessary llvm.dbg.declare bitcast
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87059 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
5ccac24726
commit
0418c102dd
@ -467,7 +467,6 @@ namespace llvm {
|
|||||||
LLVMContext& VMContext;
|
LLVMContext& VMContext;
|
||||||
|
|
||||||
// Cached values for uniquing and faster lookups.
|
// Cached values for uniquing and faster lookups.
|
||||||
const Type *EmptyStructPtr; // "{}*".
|
|
||||||
Function *StopPointFn; // llvm.dbg.stoppoint
|
Function *StopPointFn; // llvm.dbg.stoppoint
|
||||||
Function *FuncStartFn; // llvm.dbg.func.start
|
Function *FuncStartFn; // llvm.dbg.func.start
|
||||||
Function *RegionStartFn; // llvm.dbg.region.start
|
Function *RegionStartFn; // llvm.dbg.region.start
|
||||||
|
@ -608,9 +608,7 @@ void DIVariable::dump() const {
|
|||||||
DIFactory::DIFactory(Module &m)
|
DIFactory::DIFactory(Module &m)
|
||||||
: M(m), VMContext(M.getContext()), StopPointFn(0), FuncStartFn(0),
|
: M(m), VMContext(M.getContext()), StopPointFn(0), FuncStartFn(0),
|
||||||
RegionStartFn(0), RegionEndFn(0),
|
RegionStartFn(0), RegionEndFn(0),
|
||||||
DeclareFn(0) {
|
DeclareFn(0) {}
|
||||||
EmptyStructPtr = PointerType::getUnqual(StructType::get(VMContext));
|
|
||||||
}
|
|
||||||
|
|
||||||
Constant *DIFactory::GetTagConstant(unsigned TAG) {
|
Constant *DIFactory::GetTagConstant(unsigned TAG) {
|
||||||
assert((TAG & LLVMDebugVersionMask) == 0 &&
|
assert((TAG & LLVMDebugVersionMask) == 0 &&
|
||||||
@ -1037,10 +1035,7 @@ void DIFactory::InsertRegionEnd(DIDescriptor D, BasicBlock *BB) {
|
|||||||
|
|
||||||
/// InsertDeclare - Insert a new llvm.dbg.declare intrinsic call.
|
/// InsertDeclare - Insert a new llvm.dbg.declare intrinsic call.
|
||||||
Instruction *DIFactory::InsertDeclare(Value *Storage, DIVariable D,
|
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)
|
if (!DeclareFn)
|
||||||
DeclareFn = Intrinsic::getDeclaration(&M, Intrinsic::dbg_declare);
|
DeclareFn = Intrinsic::getDeclaration(&M, Intrinsic::dbg_declare);
|
||||||
|
|
||||||
@ -1050,10 +1045,7 @@ Instruction *DIFactory::InsertDeclare(Value *Storage, DIVariable D,
|
|||||||
|
|
||||||
/// InsertDeclare - Insert a new llvm.dbg.declare intrinsic call.
|
/// InsertDeclare - Insert a new llvm.dbg.declare intrinsic call.
|
||||||
Instruction *DIFactory::InsertDeclare(Value *Storage, DIVariable D,
|
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)
|
if (!DeclareFn)
|
||||||
DeclareFn = Intrinsic::getDeclaration(&M, Intrinsic::dbg_declare);
|
DeclareFn = Intrinsic::getDeclaration(&M, Intrinsic::dbg_declare);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user