[llvm-commits] [llvm] r41001 - in /llvm/trunk: include/llvm/PassManagers.h lib/Analysis/IPA/CallGraphSCCPass.cpp lib/VMCore/PassManager.cpp
Devang Patel
dpatel at apple.com
Fri Aug 10 11:29:32 PDT 2007
Author: dpatel
Date: Fri Aug 10 13:29:32 2007
New Revision: 41001
URL: http://llvm.org/viewvc/llvm-project?rev=41001&view=rev
Log:
Do not overuse std::string. Pass around char * directly.
Modified:
llvm/trunk/include/llvm/PassManagers.h
llvm/trunk/lib/Analysis/IPA/CallGraphSCCPass.cpp
llvm/trunk/lib/VMCore/PassManager.cpp
Modified: llvm/trunk/include/llvm/PassManagers.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/PassManagers.h?rev=41001&r1=41000&r2=41001&view=diff
==============================================================================
--- llvm/trunk/include/llvm/PassManagers.h (original)
+++ llvm/trunk/include/llvm/PassManagers.h Fri Aug 10 13:29:32 2007
@@ -221,8 +221,7 @@
void removeNotPreservedAnalysis(Pass *P);
/// Remove dead passes
- void removeDeadPasses(Pass *P, const std::string &Msg,
- enum PassDebuggingString);
+ void removeDeadPasses(Pass *P, const char *Msg, enum PassDebuggingString);
/// Add pass P into the PassVector. Update
/// AvailableAnalysis appropriately if ProcessAnalysis is true.
@@ -277,7 +276,7 @@
void dumpLastUses(Pass *P, unsigned Offset) const;
void dumpPassArguments() const;
void dumpPassInfo(Pass *P, enum PassDebuggingString S1,
- enum PassDebuggingString S2, const std::string &Msg);
+ enum PassDebuggingString S2, const char *Msg);
void dumpAnalysisSetInfo(const char *Msg, Pass *P,
const std::vector<AnalysisID> &Set) const;
Modified: llvm/trunk/lib/Analysis/IPA/CallGraphSCCPass.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IPA/CallGraphSCCPass.cpp?rev=41001&r1=41000&r2=41001&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/IPA/CallGraphSCCPass.cpp (original)
+++ llvm/trunk/lib/Analysis/IPA/CallGraphSCCPass.cpp Fri Aug 10 13:29:32 2007
@@ -107,7 +107,7 @@
for (unsigned i = 0, e = SCC.size(); i != e; ++i) {
Function *F = SCC[i]->getFunction();
if (F) {
- dumpPassInfo(P, EXECUTION_MSG, ON_FUNCTION_MSG, F->getName());
+ dumpPassInfo(P, EXECUTION_MSG, ON_FUNCTION_MSG, F->getNameStart());
Changed |= FPP->runOnFunction(*F);
}
}
Modified: llvm/trunk/lib/VMCore/PassManager.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/PassManager.cpp?rev=41001&r1=41000&r2=41001&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/PassManager.cpp (original)
+++ llvm/trunk/lib/VMCore/PassManager.cpp Fri Aug 10 13:29:32 2007
@@ -650,7 +650,7 @@
}
/// Remove analysis passes that are not used any longer
-void PMDataManager::removeDeadPasses(Pass *P, const std::string &Msg,
+void PMDataManager::removeDeadPasses(Pass *P, const char *Msg,
enum PassDebuggingString DBG_STR) {
SmallVector<Pass *, 12> DeadPasses;
@@ -856,7 +856,7 @@
void PMDataManager::dumpPassInfo(Pass *P, enum PassDebuggingString S1,
enum PassDebuggingString S2,
- const std::string &Msg) {
+ const char *Msg) {
if (PassDebugging < Executions)
return;
cerr << (void*)this << std::string(getDepth()*2+1, ' ');
@@ -961,7 +961,7 @@
AnalysisUsage AnUsage;
BP->getAnalysisUsage(AnUsage);
- dumpPassInfo(BP, EXECUTION_MSG, ON_BASICBLOCK_MSG, I->getName());
+ dumpPassInfo(BP, EXECUTION_MSG, ON_BASICBLOCK_MSG, I->getNameStart());
dumpAnalysisSetInfo("Required", BP, AnUsage.getRequiredSet());
initializeAnalysisImpl(BP);
@@ -971,13 +971,13 @@
if (TheTimeInfo) TheTimeInfo->passEnded(BP);
if (Changed)
- dumpPassInfo(BP, MODIFICATION_MSG, ON_BASICBLOCK_MSG, I->getName());
+ dumpPassInfo(BP, MODIFICATION_MSG, ON_BASICBLOCK_MSG, I->getNameStart());
dumpAnalysisSetInfo("Preserved", BP, AnUsage.getPreservedSet());
verifyPreservedAnalysis(BP);
removeNotPreservedAnalysis(BP);
recordAvailableAnalysis(BP);
- removeDeadPasses(BP, I->getName(), ON_BASICBLOCK_MSG);
+ removeDeadPasses(BP, I->getNameStart(), ON_BASICBLOCK_MSG);
}
return Changed |= doFinalization(F);
@@ -1159,7 +1159,7 @@
AnalysisUsage AnUsage;
FP->getAnalysisUsage(AnUsage);
- dumpPassInfo(FP, EXECUTION_MSG, ON_FUNCTION_MSG, F.getName());
+ dumpPassInfo(FP, EXECUTION_MSG, ON_FUNCTION_MSG, F.getNameStart());
dumpAnalysisSetInfo("Required", FP, AnUsage.getRequiredSet());
initializeAnalysisImpl(FP);
@@ -1169,13 +1169,13 @@
if (TheTimeInfo) TheTimeInfo->passEnded(FP);
if (Changed)
- dumpPassInfo(FP, MODIFICATION_MSG, ON_FUNCTION_MSG, F.getName());
+ dumpPassInfo(FP, MODIFICATION_MSG, ON_FUNCTION_MSG, F.getNameStart());
dumpAnalysisSetInfo("Preserved", FP, AnUsage.getPreservedSet());
verifyPreservedAnalysis(FP);
removeNotPreservedAnalysis(FP);
recordAvailableAnalysis(FP);
- removeDeadPasses(FP, F.getName(), ON_FUNCTION_MSG);
+ removeDeadPasses(FP, F.getNameStart(), ON_FUNCTION_MSG);
}
return Changed;
}
@@ -1228,7 +1228,7 @@
AnalysisUsage AnUsage;
MP->getAnalysisUsage(AnUsage);
- dumpPassInfo(MP, EXECUTION_MSG, ON_MODULE_MSG, M.getModuleIdentifier());
+ dumpPassInfo(MP, EXECUTION_MSG, ON_MODULE_MSG, M.getModuleIdentifier().c_str());
dumpAnalysisSetInfo("Required", MP, AnUsage.getRequiredSet());
initializeAnalysisImpl(MP);
@@ -1238,13 +1238,13 @@
if (TheTimeInfo) TheTimeInfo->passEnded(MP);
if (Changed)
- dumpPassInfo(MP, MODIFICATION_MSG, ON_MODULE_MSG, M.getModuleIdentifier());
+ dumpPassInfo(MP, MODIFICATION_MSG, ON_MODULE_MSG, M.getModuleIdentifier().c_str());
dumpAnalysisSetInfo("Preserved", MP, AnUsage.getPreservedSet());
verifyPreservedAnalysis(MP);
removeNotPreservedAnalysis(MP);
recordAvailableAnalysis(MP);
- removeDeadPasses(MP, M.getModuleIdentifier(), ON_MODULE_MSG);
+ removeDeadPasses(MP, M.getModuleIdentifier().c_str(), ON_MODULE_MSG);
}
return Changed;
}
More information about the llvm-commits
mailing list