diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-07-26 08:34:35 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-07-26 08:34:35 +0000 |
commit | f0443c1eb44d737d9bd78962932fc80f74c6113c (patch) | |
tree | e6509e65f5b9f1349ac35796122422273fbf2d08 /lib/Transforms/Scalar/SimplifyLibCalls.cpp | |
parent | 92fbbc75889918036035581ef0aa5d6510b2f8d9 (diff) |
Remove Value::getNameLen
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77148 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/SimplifyLibCalls.cpp')
-rw-r--r-- | lib/Transforms/Scalar/SimplifyLibCalls.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/Transforms/Scalar/SimplifyLibCalls.cpp b/lib/Transforms/Scalar/SimplifyLibCalls.cpp index 9a5ed456ba..e48b14c2cd 100644 --- a/lib/Transforms/Scalar/SimplifyLibCalls.cpp +++ b/lib/Transforms/Scalar/SimplifyLibCalls.cpp @@ -31,6 +31,7 @@ #include "llvm/ADT/Statistic.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/Debug.h" +#include "llvm/Support/raw_ostream.h" #include "llvm/Config/config.h" using namespace llvm; @@ -1655,20 +1656,18 @@ bool SimplifyLibCalls::runOnFunction(Function &F) { continue; // Ignore unknown calls. - const char *CalleeName = Callee->getNameStart(); - StringMap<LibCallOptimization*>::iterator OMI = - Optimizations.find(StringRef(CalleeName, Callee->getNameLen())); - if (OMI == Optimizations.end()) continue; + LibCallOptimization *LCO = Optimizations.lookup(Callee->getName()); + if (!LCO) continue; // Set the builder to the instruction after the call. Builder.SetInsertPoint(BB, I); // Try to optimize this call. - Value *Result = OMI->second->OptimizeCall(CI, TD, Builder); + Value *Result = LCO->OptimizeCall(CI, TD, Builder); if (Result == 0) continue; - DEBUG(DOUT << "SimplifyLibCalls simplified: " << *CI; - DOUT << " into: " << *Result << "\n"); + DEBUG(errs() << "SimplifyLibCalls simplified: " << *CI; + errs() << " into: " << *Result << "\n"); // Something changed! Changed = true; |