Remove Value::getNameLen

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77148 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Daniel Dunbar
2009-07-26 08:34:35 +00:00
parent 92fbbc7588
commit f0443c1eb4
6 changed files with 62 additions and 120 deletions

View File

@ -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;