Skip to content

Commit

Permalink
Tidy up CountingFunctionInserter a little. NFC.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
zmodem committed Oct 26, 2017
1 parent e1b56f0 commit ddfb984
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions lib/CodeGen/CountingFunctionInserter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();
}

0 comments on commit ddfb984

Please sign in to comment.