[llvm] r316644 - Tidy up CountingFunctionInserter a little. NFC.
Hans Wennborg via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 26 01:29:08 PDT 2017
Author: hans
Date: Thu Oct 26 01:29:08 2017
New Revision: 316644
URL: http://llvm.org/viewvc/llvm-project?rev=316644&view=rev
Log:
Tidy up CountingFunctionInserter a little. NFC.
Use StringRef for CountingFunctionName, remove erroneous comment
copied from InstructionNamer, and drop some trailing whitespace.
Modified:
llvm/trunk/lib/CodeGen/CountingFunctionInserter.cpp
Modified: llvm/trunk/lib/CodeGen/CountingFunctionInserter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/CountingFunctionInserter.cpp?rev=316644&r1=316643&r2=316644&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/CountingFunctionInserter.cpp (original)
+++ llvm/trunk/lib/CodeGen/CountingFunctionInserter.cpp Thu Oct 26 01:29:08 2017
@@ -27,13 +27,13 @@ namespace {
CountingFunctionInserter() : FunctionPass(ID) {
initializeCountingFunctionInserterPass(*PassRegistry::getPassRegistry());
}
-
+
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.addPreserved<GlobalsAAWrapperPass>();
}
bool runOnFunction(Function &F) override {
- std::string CountingFunctionName =
+ StringRef CountingFunctionName =
F.getFnAttribute("counting-function").getValueAsString();
if (CountingFunctionName.empty())
return false;
@@ -46,17 +46,13 @@ namespace {
return true;
}
};
-
+
char CountingFunctionInserter::ID = 0;
}
-INITIALIZE_PASS(CountingFunctionInserter, "cfinserter",
+INITIALIZE_PASS(CountingFunctionInserter, "cfinserter",
"Inserts calls to mcount-like functions", false, false)
-//===----------------------------------------------------------------------===//
-//
-// CountingFunctionInserter - Give any unnamed non-void instructions "tmp" names.
-//
FunctionPass *llvm::createCountingFunctionInserterPass() {
return new CountingFunctionInserter();
}
More information about the llvm-commits
mailing list