From 3a5614599a10ad4a58431d739ce49e87ce4e0ee7 Mon Sep 17 00:00:00 2001 From: Serge Pavlov Date: Sun, 6 Dec 2015 14:32:39 +0000 Subject: [PGO] Instrument only base constructors and destructors. Constructors and destructors may be represented by several functions in IR. Only base structors correspond to source code, others are small pieces of code and eventually call the base variant. In this case instrumentation of non-base structors has little sense, this fix remove it. Now profile data of a declaration corresponds to exactly one function in IR, it agrees with the current logic of the profile data loading. This change fixes PR24996. Differential Revision: http://reviews.llvm.org/D15158 llvm-svn: 254876 --- clang/lib/CodeGen/CodeGenPGO.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'clang/lib/CodeGen/CodeGenPGO.h') diff --git a/clang/lib/CodeGen/CodeGenPGO.h b/clang/lib/CodeGen/CodeGenPGO.h index 350cdcce3e8..6bf29ecaa7c 100644 --- a/clang/lib/CodeGen/CodeGenPGO.h +++ b/clang/lib/CodeGen/CodeGenPGO.h @@ -78,13 +78,11 @@ public: setCurrentRegionCount(*Count); } - /// Check if we need to emit coverage mapping for a given declaration - void checkGlobalDecl(GlobalDecl GD); /// Assign counters to regions and configure them for PGO of a given /// function. Does nothing if instrumentation is not enabled and either /// generates global variables or associates PGO data with each of the /// counters depending on whether we are generating or using instrumentation. - void assignRegionCounters(const Decl *D, llvm::Function *Fn); + void assignRegionCounters(GlobalDecl GD, llvm::Function *Fn); /// Emit a coverage mapping range with a counter zero /// for an unused declaration. void emitEmptyCounterMapping(const Decl *D, StringRef FuncName, -- cgit v1.2.3