diff options
author | Alexey Samsonov <samsonov@google.com> | 2012-04-27 07:24:20 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2012-04-27 07:24:20 +0000 |
commit | 3a70cd6e1cc414856e41ce5509aa61c89bf472dc (patch) | |
tree | 0da206d1543c71379d1af4a232aa0057b79318f3 /lib/CodeGen | |
parent | 577f14a34457032523e59dbbbacb88ca2cd4db57 (diff) |
Use enum to set debug info size generated by Clang
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155697 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/BackendUtil.cpp | 2 | ||||
-rw-r--r-- | lib/CodeGen/CGClass.cpp | 3 | ||||
-rw-r--r-- | lib/CodeGen/CGDebugInfo.cpp | 4 | ||||
-rw-r--r-- | lib/CodeGen/CGExprCXX.cpp | 2 | ||||
-rw-r--r-- | lib/CodeGen/CGExprScalar.cpp | 7 | ||||
-rw-r--r-- | lib/CodeGen/CodeGenModule.cpp | 3 |
6 files changed, 12 insertions, 9 deletions
diff --git a/lib/CodeGen/BackendUtil.cpp b/lib/CodeGen/BackendUtil.cpp index 2f44711b60..9633dec1fe 100644 --- a/lib/CodeGen/BackendUtil.cpp +++ b/lib/CodeGen/BackendUtil.cpp @@ -219,7 +219,7 @@ void EmitAssemblyHelper::CreatePasses() { CodeGenOpts.EmitGcovArcs, TargetTriple.isMacOSX())); - if (!CodeGenOpts.DebugInfo) + if (CodeGenOpts.DebugInfo == CodeGenOptions::NoDebugInfo) MPM->add(createStripSymbolsPass(true)); } diff --git a/lib/CodeGen/CGClass.cpp b/lib/CodeGen/CGClass.cpp index a01cdc0783..7062b9c621 100644 --- a/lib/CodeGen/CGClass.cpp +++ b/lib/CodeGen/CGClass.cpp @@ -1227,7 +1227,8 @@ CodeGenFunction::EmitCXXConstructorCall(const CXXConstructorDecl *D, CallExpr::const_arg_iterator ArgEnd) { CGDebugInfo *DI = getDebugInfo(); - if (DI && CGM.getCodeGenOpts().LimitDebugInfo) { + if (DI && + CGM.getCodeGenOpts().DebugInfo == CodeGenOptions::LimitedDebugInfo) { // If debug info for this class has not been emitted then this is the // right time to do so. const CXXRecordDecl *Parent = D->getParent(); diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index 36fb22b1fe..81cc15ebc6 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -546,7 +546,7 @@ llvm::DIDescriptor CGDebugInfo::createContextChain(const Decl *Context) { /// then emit record's fwd if debug info size reduction is enabled. llvm::DIType CGDebugInfo::CreatePointeeType(QualType PointeeTy, llvm::DIFile Unit) { - if (!CGM.getCodeGenOpts().LimitDebugInfo) + if (CGM.getCodeGenOpts().DebugInfo != CodeGenOptions::LimitedDebugInfo) return getOrCreateType(PointeeTy, Unit); // Limit debug info for the pointee type. @@ -1823,7 +1823,7 @@ llvm::DIType CGDebugInfo::CreateLimitedType(const RecordType *Ty) { StringRef RDName = RD->getName(); llvm::DIDescriptor RDContext; - if (CGM.getCodeGenOpts().LimitDebugInfo) + if (CGM.getCodeGenOpts().DebugInfo == CodeGenOptions::LimitedDebugInfo) RDContext = createContextChain(cast<Decl>(RD->getDeclContext())); else RDContext = getContextDescriptor(cast<Decl>(RD->getDeclContext())); diff --git a/lib/CodeGen/CGExprCXX.cpp b/lib/CodeGen/CGExprCXX.cpp index c69c8830c1..f20617973a 100644 --- a/lib/CodeGen/CGExprCXX.cpp +++ b/lib/CodeGen/CGExprCXX.cpp @@ -179,7 +179,7 @@ RValue CodeGenFunction::EmitCXXMemberCallExpr(const CXXMemberCallExpr *CE, const CXXMethodDecl *MD = cast<CXXMethodDecl>(ME->getMemberDecl()); CGDebugInfo *DI = getDebugInfo(); - if (DI && CGM.getCodeGenOpts().LimitDebugInfo + if (DI && CGM.getCodeGenOpts().DebugInfo == CodeGenOptions::LimitedDebugInfo && !isa<CallExpr>(ME->getBase())) { QualType PQTy = ME->getBase()->IgnoreParenImpCasts()->getType(); if (const PointerType * PTy = dyn_cast<PointerType>(PQTy)) { diff --git a/lib/CodeGen/CGExprScalar.cpp b/lib/CodeGen/CGExprScalar.cpp index 734531f724..db4349b8e1 100644 --- a/lib/CodeGen/CGExprScalar.cpp +++ b/lib/CodeGen/CGExprScalar.cpp @@ -798,14 +798,15 @@ Value *ScalarExprEmitter::VisitMemberExpr(MemberExpr *E) { return Builder.getInt(Value); } - // Emit debug info for aggregate now, if it was delayed to reduce + // Emit debug info for aggregate now, if it was delayed to reduce // debug info size. CGDebugInfo *DI = CGF.getDebugInfo(); - if (DI && CGF.CGM.getCodeGenOpts().LimitDebugInfo) { + if (DI && + CGF.CGM.getCodeGenOpts().DebugInfo == CodeGenOptions::LimitedDebugInfo) { QualType PQTy = E->getBase()->IgnoreParenImpCasts()->getType(); if (const PointerType * PTy = dyn_cast<PointerType>(PQTy)) if (FieldDecl *M = dyn_cast<FieldDecl>(E->getMemberDecl())) - DI->getOrCreateRecordType(PTy->getPointeeType(), + DI->getOrCreateRecordType(PTy->getPointeeType(), M->getParent()->getLocation()); } return EmitLoadOfLValue(E); diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index 0b1ddc15be..85f404d510 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -110,7 +110,8 @@ CodeGenModule::CodeGenModule(ASTContext &C, const CodeGenOptions &CGO, // If debug info or coverage generation is enabled, create the CGDebugInfo // object. - if (CodeGenOpts.DebugInfo || CodeGenOpts.EmitGcovArcs || + if (CodeGenOpts.DebugInfo != CodeGenOptions::NoDebugInfo || + CodeGenOpts.EmitGcovArcs || CodeGenOpts.EmitGcovNotes) DebugInfo = new CGDebugInfo(*this); |