[llvm-commits] [llvm] r99227 - in /llvm/trunk: lib/CodeGen/MachineModuleInfo.cpp test/CodeGen/Generic/addr-label.ll
Chris Lattner
sabre at nondot.org
Mon Mar 22 16:15:57 PDT 2010
Author: lattner
Date: Mon Mar 22 18:15:57 2010
New Revision: 99227
URL: http://llvm.org/viewvc/llvm-project?rev=99227&view=rev
Log:
Fix PR6673: updating the callback should not clear the map.
Modified:
llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp
llvm/trunk/test/CodeGen/Generic/addr-label.ll
Modified: llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp?rev=99227&r1=99226&r2=99227&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp Mon Mar 22 18:15:57 2010
@@ -44,6 +44,10 @@
MMIAddrLabelMapCallbackPtr() : Map(0) {}
MMIAddrLabelMapCallbackPtr(Value *V) : CallbackVH(V), Map(0) {}
+ void setPtr(BasicBlock *BB) {
+ ValueHandleBase::operator=(BB);
+ }
+
void setMap(MMIAddrLabelMap *map) { Map = map; }
virtual void deleted();
@@ -209,7 +213,7 @@
// If New is not address taken, just move our symbol over to it.
if (NewEntry.Symbols.isNull()) {
- BBCallbacks[OldEntry.Index] = New; // Update the callback.
+ BBCallbacks[OldEntry.Index].setPtr(New); // Update the callback.
NewEntry = OldEntry; // Set New's entry.
return;
}
Modified: llvm/trunk/test/CodeGen/Generic/addr-label.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/addr-label.ll?rev=99227&r1=99226&r2=99227&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Generic/addr-label.ll (original)
+++ llvm/trunk/test/CodeGen/Generic/addr-label.ll Mon Mar 22 18:15:57 2010
@@ -56,3 +56,26 @@
ret i32 -1
}
+
+; PR6673
+
+define i64 @test4a() {
+ %target = bitcast i8* blockaddress(@test4b, %usermain) to i8*
+ %ret = call i64 @test4b(i8* %target)
+
+ ret i64 %ret
+}
+
+define i64 @test4b(i8* %Code) {
+entry:
+ indirectbr i8* %Code, [label %usermain]
+usermain:
+ br label %label_line_0
+
+label_line_0:
+ br label %label_line_1
+
+label_line_1:
+ %target = ptrtoint i8* blockaddress(@test4b, %label_line_0) to i64
+ ret i64 %target
+}
More information about the llvm-commits
mailing list