[PATCH] D23734: Add -fprofile-dir= to clang.

Saleem Abdulrasool via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 29 17:42:59 PDT 2016


compnerd added a subscriber: compnerd.

================
Comment at: lib/Transforms/Instrumentation/GCOVProfiling.cpp:121
@@ -120,2 +120,3 @@
 
-  std::string mangleName(const DICompileUnit *CU, const char *NewStem);
+  enum GCovFileType { GCNO, GCDA };
+  std::string mangleName(const DICompileUnit *CU, GCovFileType NewStem);
----------------
Might be nice to use `enum class`.

================
Comment at: lib/Transforms/Instrumentation/GCOVProfiling.cpp:422
@@ -420,3 +421,3 @@
 std::string GCOVProfiler::mangleName(const DICompileUnit *CU,
-                                     const char *NewStem) {
+                                     GCovFileType NewStem) {
   if (NamedMDNode *GCov = M->getNamedMetadata("llvm.gcov")) {
----------------
I think that `NewStem` is no longer appropriate.

================
Comment at: lib/Transforms/Instrumentation/GCOVProfiling.cpp:447
@@ -432,3 +446,3 @@
         return Filename.str();
       }
     }
----------------
It really feels like these two cases can be collapsed.

================
Comment at: tools/clang/lib/CodeGen/CodeGenModule.cpp:4221
@@ +4220,3 @@
+  llvm::LLVMContext &Ctx = TheModule.getContext();
+  llvm::MDString *CoverageDataFile =
+      llvm::MDString::get(Ctx, getCodeGenOpts().CoverageDataFile);
----------------
`auto *CoverageDataFile` perhaps?

================
Comment at: tools/clang/lib/CodeGen/CodeGenModule.cpp:4223
@@ +4222,3 @@
+      llvm::MDString::get(Ctx, getCodeGenOpts().CoverageDataFile);
+  llvm::MDString *CoverageNotesFile =
+      llvm::MDString::get(Ctx, getCodeGenOpts().CoverageNotesFile);
----------------
Similar.

================
Comment at: tools/clang/lib/Driver/Tools.cpp:3621
@@ -3621,1 +3620,3 @@
+        OutputFilename = llvm::sys::path::filename(Output.getBaseInput());
       }
+      SmallString<128> CoverageFilename = OutputFilename;
----------------
Unnecessary braces.


https://reviews.llvm.org/D23734





More information about the cfe-commits mailing list