summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-03-07 21:54:50 +0000
committerChris Lattner <sabre@nondot.org>2004-03-07 21:54:50 +0000
commit6770842b67204013181b55dd182471306c108502 (patch)
tree0bb6554d34ed07031aa36e3994638c5adac43001 /llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
parent1f607f2f2e7567530d0e0aa91af1fc4e8d16499d (diff)
downloadbcm5719-llvm-6770842b67204013181b55dd182471306c108502.tar.gz
bcm5719-llvm-6770842b67204013181b55dd182471306c108502.zip
Fix a minor bug and turn debug output into, well, debug output.
llvm-svn: 12195
Diffstat (limited to 'llvm/lib/Transforms/IPO/ArgumentPromotion.cpp')
-rw-r--r--llvm/lib/Transforms/IPO/ArgumentPromotion.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
index 2745af893be..639c5180378 100644
--- a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
+++ b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
@@ -93,7 +93,7 @@ bool ArgPromotion::run(Module &M) {
// See if we can transform all users to use the function directly.
while (!CPR->use_empty()) {
User *TheUser = CPR->use_back();
- if (!isa<Constant>(TheUser)) {
+ if (!isa<Constant>(TheUser) && !isa<GlobalVariable>(TheUser)) {
Changed = true;
TheUser->replaceUsesOfWith(CPR, I);
} else {
@@ -312,7 +312,7 @@ void ArgPromotion::DoPromotion(Function *F, std::vector<Argument*> &Args2Prom) {
// Otherwise, if we promoted this argument, then all users are load
// instructions, and all loads should be using the new argument that we
// added.
- /*DEBUG*/(std::cerr << "*** Promoted argument '" << I->getName()
+ DEBUG(std::cerr << "*** Promoted argument '" << I->getName()
<< "' of function '" << F->getName() << "'\n");
I2->setName(I->getName()+".val");
while (!I->use_empty()) {
OpenPOWER on IntegriCloud