aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/LevelRaise.cpp2
-rw-r--r--lib/Transforms/Utils/BasicBlockUtils.cpp6
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/Transforms/LevelRaise.cpp b/lib/Transforms/LevelRaise.cpp
index ebd9829b4c..a3b8a9b64d 100644
--- a/lib/Transforms/LevelRaise.cpp
+++ b/lib/Transforms/LevelRaise.cpp
@@ -253,7 +253,7 @@ bool RPR::PeepholeOptimize(BasicBlock *BB, BasicBlock::iterator &BI) {
if (!Src->hasName() && CI->hasName()) {
std::string Name = CI->getName();
CI->setName("");
- Src->setName(Name, &BB->getParent()->getSymbolTable());
+ Src->setName(Name);
}
// DCE the instruction now, to avoid having the iterative version of DCE
diff --git a/lib/Transforms/Utils/BasicBlockUtils.cpp b/lib/Transforms/Utils/BasicBlockUtils.cpp
index ab315b6b75..bf1e3612b2 100644
--- a/lib/Transforms/Utils/BasicBlockUtils.cpp
+++ b/lib/Transforms/Utils/BasicBlockUtils.cpp
@@ -34,9 +34,9 @@ void llvm::ReplaceInstWithValue(BasicBlock::InstListType &BIL,
// Delete the unnecessary instruction now...
BI = BIL.erase(BI);
- // Make sure to propagate a name if there is one already...
- if (OldName.size() && !V->hasName())
- V->setName(OldName, &BIL.getParent()->getSymbolTable());
+ // Make sure to propagate a name if there is one already.
+ if (!OldName.empty() && !V->hasName())
+ V->setName(OldName);
}