diff options
| author | Serge Pavlov <sepavloff@gmail.com> | 2015-12-06 14:32:39 +0000 |
|---|---|---|
| committer | Serge Pavlov <sepavloff@gmail.com> | 2015-12-06 14:32:39 +0000 |
| commit | 3a5614599a10ad4a58431d739ce49e87ce4e0ee7 (patch) | |
| tree | 32fe488dd0a143130e22d0a852ccc34ee161fb93 /clang/lib/CodeGen/CodeGenFunction.cpp | |
| parent | 41ecf460fa71fb76f215ea103d39c3c2e34f75d1 (diff) | |
| download | bcm5719-llvm-3a5614599a10ad4a58431d739ce49e87ce4e0ee7.tar.gz bcm5719-llvm-3a5614599a10ad4a58431d739ce49e87ce4e0ee7.zip | |
[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
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
| -rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index 31a93e001f8..048a04328fc 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -957,8 +957,7 @@ void CodeGenFunction::GenerateCode(GlobalDecl GD, llvm::Function *Fn, StartFunction(GD, ResTy, Fn, FnInfo, Args, Loc, BodyRange.getBegin()); // Generate the body of the function. - PGO.checkGlobalDecl(GD); - PGO.assignRegionCounters(GD.getDecl(), CurFn); + PGO.assignRegionCounters(GD, CurFn); if (isa<CXXDestructorDecl>(FD)) EmitDestructorBody(Args); else if (isa<CXXConstructorDecl>(FD)) |

