diff options
author | Bob Wilson <bob.wilson@apple.com> | 2014-03-06 04:55:35 +0000 |
---|---|---|
committer | Bob Wilson <bob.wilson@apple.com> | 2014-03-06 04:55:35 +0000 |
commit | 83717113c57b1f9f7be295b007d60b44ac13f404 (patch) | |
tree | f782a951a92ac08de6b27d80d6ebaf07da050850 /lib/CodeGen/CodeGenPGO.h | |
parent | 4b1cb4e3c05e23d84a02c2120d1a5467e6d3e0eb (diff) |
Refactor PGO code in preparation for handling non-C/C++ code.
Move the PGO.assignRegionCounters() call out of StartFunction, because that
function is called from many places where it does not make sense to do PGO
instrumentation (e.g., compiler-generated helper functions). Change several
functions to take a StringRef argument for the unique name associated with
a function, so that the name can be set differently for things like Objective-C
methods and block literals.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203073 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenPGO.h')
-rw-r--r-- | lib/CodeGen/CodeGenPGO.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/CodeGen/CodeGenPGO.h b/lib/CodeGen/CodeGenPGO.h index 5f7da4c79a..6af25b4205 100644 --- a/lib/CodeGen/CodeGenPGO.h +++ b/lib/CodeGen/CodeGenPGO.h @@ -118,9 +118,9 @@ public: /// 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(GlobalDecl &GD); + void assignRegionCounters(const Decl *D, StringRef Name); /// Emit code to write counts for a given function to disk, if necessary. - void emitWriteoutFunction(GlobalDecl &GD); + void emitWriteoutFunction(StringRef Name); /// Clean up region counter state. Must be called if assignRegionCounters is /// used. void destroyRegionCounters(); @@ -131,7 +131,7 @@ public: private: void mapRegionCounters(const Decl *D); void computeRegionCounts(const Decl *D); - void loadRegionCounts(GlobalDecl &GD, PGOProfileData *PGOData); + void loadRegionCounts(StringRef Name, PGOProfileData *PGOData); void emitCounterVariables(); /// Emit code to increment the counter at the given index |