[clang] [compiler-rt] [clang-tools-extra] [PGO] Exposing PGO's Counter Reset and File Dumping APIs (PR #76471)

Qiongsi Wu via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 28 17:07:27 PST 2023


================
@@ -1364,12 +1364,22 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
   TI.getTargetDefines(LangOpts, Builder);
 }
 
+static void InitializePGOProfileMacros(const CodeGenOptions &CodeGenOpts,
+                                       MacroBuilder &Builder) {
+  if (CodeGenOpts.hasProfileInstr())
+    Builder.defineMacro("__LLVM_INSTR_PROFILE_GENERATE");
----------------
qiongsiwu wrote:

Ahh this is a good idea! Documentation added at https://github.com/llvm/llvm-project/pull/76471/files#diff-7389be311daf0b9b476c876bef04245fa3c0ad9337ce865682174bd77d53b648R2812. 

https://github.com/llvm/llvm-project/pull/76471


More information about the cfe-commits mailing list