]> granicus.if.org Git - llvm/commitdiff
Tidy up CountingFunctionInserter a little. NFC.
authorHans Wennborg <hans@hanshq.net>
Thu, 26 Oct 2017 08:29:08 +0000 (08:29 +0000)
committerHans Wennborg <hans@hanshq.net>
Thu, 26 Oct 2017 08:29:08 +0000 (08:29 +0000)
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

lib/CodeGen/CountingFunctionInserter.cpp

index 7f7350f5fb5cd97454e05a0cc1beb7827f9e686d..15af09807ba62376e37b44c6ce5dfa3124082f80 100644 (file)
@@ -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();
 }