[llvm] r217536 - Remember to eraseFromParent after replaceAllUsesWith.
Rafael Espindola
rafael.espindola at gmail.com
Wed Sep 10 12:39:41 PDT 2014
Author: rafael
Date: Wed Sep 10 14:39:41 2014
New Revision: 217536
URL: http://llvm.org/viewvc/llvm-project?rev=217536&view=rev
Log:
Remember to eraseFromParent after replaceAllUsesWith.
Modified:
llvm/trunk/test/tools/gold/alias.ll
llvm/trunk/tools/gold/gold-plugin.cpp
Modified: llvm/trunk/test/tools/gold/alias.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/gold/alias.ll?rev=217536&r1=217535&r2=217536&view=diff
==============================================================================
--- llvm/trunk/test/tools/gold/alias.ll (original)
+++ llvm/trunk/test/tools/gold/alias.ll Wed Sep 10 14:39:41 2014
@@ -2,10 +2,12 @@
; RUN: llvm-as %p/Inputs/alias-1.ll -o %t2.o
; RUN: ld -shared -o %t3.o -plugin %llvmshlibdir/LLVMgold.so %t2.o %t.o \
; RUN: -plugin-opt=emit-llvm
-; RUN: llvm-dis %t3.o -o - | FileCheck %s
+; RUN: llvm-dis < %t3.o -o - | FileCheck %s
+; CHECK-NOT: alias
; CHECK: @a = global i32 42
-; CHECK: @b = global i32 1
+; CHECK-NEXT: @b = global i32 1
+; CHECK-NOT: alias
@a = weak alias i32* @b
@b = global i32 1
Modified: llvm/trunk/tools/gold/gold-plugin.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/gold/gold-plugin.cpp?rev=217536&r1=217535&r2=217536&view=diff
==============================================================================
--- llvm/trunk/tools/gold/gold-plugin.cpp (original)
+++ llvm/trunk/tools/gold/gold-plugin.cpp Wed Sep 10 14:39:41 2014
@@ -457,6 +457,7 @@ static void drop(GlobalValue &GV) {
/*Initializer*/ nullptr);
Var->takeName(&Alias);
Alias.replaceAllUsesWith(Var);
+ Alias.eraseFromParent();
}
static const char *getResolutionName(ld_plugin_symbol_resolution R) {
More information about the llvm-commits
mailing list