Skip to content
This repository was archived by the owner on Mar 28, 2020. It is now read-only.

Commit ddfb984

Browse files
committed
Tidy up CountingFunctionInserter a little. NFC.
Use StringRef for CountingFunctionName, remove erroneous comment copied from InstructionNamer, and drop some trailing whitespace. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316644 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent e1b56f0 commit ddfb984

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

lib/CodeGen/CountingFunctionInserter.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ namespace {
2727
CountingFunctionInserter() : FunctionPass(ID) {
2828
initializeCountingFunctionInserterPass(*PassRegistry::getPassRegistry());
2929
}
30-
30+
3131
void getAnalysisUsage(AnalysisUsage &AU) const override {
3232
AU.addPreserved<GlobalsAAWrapperPass>();
3333
}
3434

3535
bool runOnFunction(Function &F) override {
36-
std::string CountingFunctionName =
36+
StringRef CountingFunctionName =
3737
F.getFnAttribute("counting-function").getValueAsString();
3838
if (CountingFunctionName.empty())
3939
return false;
@@ -46,17 +46,13 @@ namespace {
4646
return true;
4747
}
4848
};
49-
49+
5050
char CountingFunctionInserter::ID = 0;
5151
}
5252

53-
INITIALIZE_PASS(CountingFunctionInserter, "cfinserter",
53+
INITIALIZE_PASS(CountingFunctionInserter, "cfinserter",
5454
"Inserts calls to mcount-like functions", false, false)
5555

56-
//===----------------------------------------------------------------------===//
57-
//
58-
// CountingFunctionInserter - Give any unnamed non-void instructions "tmp" names.
59-
//
6056
FunctionPass *llvm::createCountingFunctionInserterPass() {
6157
return new CountingFunctionInserter();
6258
}

0 commit comments

Comments
 (0)