diff options
author | Justin Bogner <mail@justinbogner.com> | 2014-04-15 21:22:35 +0000 |
---|---|---|
committer | Justin Bogner <mail@justinbogner.com> | 2014-04-15 21:22:35 +0000 |
commit | e2ef2a09ef265fe854f160d127537dc243d1ffc4 (patch) | |
tree | 4b2e76c2775910359017a1e038e77899fb134f08 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 3f0c79ce8df08f2cb56f48a3dfe3051305ade54d (diff) | |
download | llvm-e2ef2a09ef265fe854f160d127537dc243d1ffc4.zip llvm-e2ef2a09ef265fe854f160d127537dc243d1ffc4.tar.gz llvm-e2ef2a09ef265fe854f160d127537dc243d1ffc4.tar.bz2 |
CodeGen: Emit warnings for out of date profile data during PGO
This adds a warning that triggers when profile data doesn't match for
the source that's being compiled with -fprofile-instr-use=. This fires
only once per translation unit, as warning on every mismatched
function would be quite noisy.
llvm-svn: 206322
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 6ea60ba..d4daaa5 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -286,6 +286,9 @@ void CodeGenModule::Release() { if (getCodeGenOpts().ProfileInstrGenerate) if (llvm::Function *PGOInit = CodeGenPGO::emitInitialization(*this)) AddGlobalCtor(PGOInit, 0); + if (PGOData && PGOStats.isOutOfDate()) + getDiags().Report(diag::warn_profile_data_out_of_date) + << PGOStats.Visited << PGOStats.Missing << PGOStats.Mismatched; EmitCtorList(GlobalCtors, "llvm.global_ctors"); EmitCtorList(GlobalDtors, "llvm.global_dtors"); EmitGlobalAnnotations(); |