summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDebugInfo.cpp
diff options
context:
space:
mode:
authorDjordje Todorovic <djordje.todorovic@rt-rk.com>2019-11-15 10:47:35 +0100
committerDjordje Todorovic <djordje.todorovic@rt-rk.com>2019-11-15 11:10:19 +0100
commit1643734741d2f2957206774a50960ba335a36a0c (patch)
treed4c3a3ffd3a68a3103a0c202fecc543c7f2faf9d /clang/lib/CodeGen/CGDebugInfo.cpp
parent9e37892773c0954a15f84b011223da1e707ab3bf (diff)
downloadbcm5719-llvm-1643734741d2f2957206774a50960ba335a36a0c.tar.gz
bcm5719-llvm-1643734741d2f2957206774a50960ba335a36a0c.zip
[clang] Remove the DIFlagArgumentNotModified debug info flag
It turns out that the ExprMutationAnalyzer can be very slow when AST gets huge in some cases. The idea is to move this analysis to the LLVM back-end level (more precisely, in the LiveDebugValues pass). The new approach will remove the performance regression, simplify the implementation and give us front-end independent implementation. Differential Revision: https://reviews.llvm.org/D68206
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp42
1 files changed, 0 insertions, 42 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index 75c4b2ae233..399fa95c3e0 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -18,7 +18,6 @@
#include "CodeGenFunction.h"
#include "CodeGenModule.h"
#include "ConstantEmitter.h"
-#include "clang/Analysis/Analyses/ExprMutationAnalyzer.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/DeclFriend.h"
#include "clang/AST/DeclObjC.h"
@@ -3686,15 +3685,6 @@ void CGDebugInfo::EmitFunctionStart(GlobalDecl GD, SourceLocation Loc,
if (HasDecl && isa<FunctionDecl>(D))
DeclCache[D->getCanonicalDecl()].reset(SP);
- // We use the SPDefCache only in the case when the debug entry values option
- // is set, in order to speed up parameters modification analysis.
- //
- // FIXME: Use AbstractCallee here to support ObjCMethodDecl.
- if (CGM.getCodeGenOpts().EnableDebugEntryValues && HasDecl)
- if (auto *FD = dyn_cast<FunctionDecl>(D))
- if (FD->hasBody() && !FD->param_empty())
- SPDefCache[FD].reset(SP);
-
// Push the function onto the lexical block stack.
LexicalBlockStack.emplace_back(SP);
@@ -4089,11 +4079,6 @@ llvm::DILocalVariable *CGDebugInfo::EmitDeclare(const VarDecl *VD,
llvm::DebugLoc::get(Line, Column, Scope, CurInlinedAt),
Builder.GetInsertBlock());
- if (CGM.getCodeGenOpts().EnableDebugEntryValues && ArgNo) {
- if (auto *PD = dyn_cast<ParmVarDecl>(VD))
- ParamCache[PD].reset(D);
- }
-
return D;
}
@@ -4709,29 +4694,6 @@ void CGDebugInfo::setDwoId(uint64_t Signature) {
TheCU->setDWOId(Signature);
}
-/// Analyzes each function parameter to determine whether it is constant
-/// throughout the function body.
-static void analyzeParametersModification(
- ASTContext &Ctx,
- llvm::DenseMap<const FunctionDecl *, llvm::TrackingMDRef> &SPDefCache,
- llvm::DenseMap<const ParmVarDecl *, llvm::TrackingMDRef> &ParamCache) {
- for (auto &SP : SPDefCache) {
- auto *FD = SP.first;
- assert(FD->hasBody() && "Functions must have body here");
- const Stmt *FuncBody = (*FD).getBody();
- for (auto Parm : FD->parameters()) {
- ExprMutationAnalyzer FuncAnalyzer(*FuncBody, Ctx);
- if (FuncAnalyzer.isMutated(Parm))
- continue;
-
- auto I = ParamCache.find(Parm);
- assert(I != ParamCache.end() && "Parameters should be already cached");
- auto *DIParm = cast<llvm::DILocalVariable>(I->second);
- DIParm->setIsNotModified();
- }
- }
-}
-
void CGDebugInfo::finalize() {
// Creating types might create further types - invalidating the current
// element and the size(), so don't cache/reference them.
@@ -4804,10 +4766,6 @@ void CGDebugInfo::finalize() {
if (auto MD = TypeCache[RT])
DBuilder.retainType(cast<llvm::DIType>(MD));
- if (CGM.getCodeGenOpts().EnableDebugEntryValues)
- // This will be used to emit debug entry values.
- analyzeParametersModification(CGM.getContext(), SPDefCache, ParamCache);
-
DBuilder.finalize();
}
OpenPOWER on IntegriCloud