diff options
author | Devang Patel <dpatel@apple.com> | 2011-03-07 18:45:56 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2011-03-07 18:45:56 +0000 |
commit | d6ffebb077db73705565a71e86d54c044cbcb9dd (patch) | |
tree | da2c50e0fe1c5e5b6664f4e04c3f4bf9098f6945 /clang/lib/CodeGen/CodeGenFunction.cpp | |
parent | e65982c8c88c1a591ca87083f5cb572c0da8b042 (diff) | |
download | bcm5719-llvm-d6ffebb077db73705565a71e86d54c044cbcb9dd.tar.gz bcm5719-llvm-d6ffebb077db73705565a71e86d54c044cbcb9dd.zip |
DebugInfo can be enabled or disabled at function level (e.g. using an attribute). However, at module level it is determined by command line option and the state of command line option does not change during compilation. Make this layering explicit and fix accidental cases where the code generator was checking whether module has debug info enabled instead of checking whether debug info is enabled for this function or not.
llvm-svn: 127165
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index 958eca75402..50e03cd0c7a 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -33,7 +33,7 @@ CodeGenFunction::CodeGenFunction(CodeGenModule &cgm) Target(CGM.getContext().Target), Builder(cgm.getModule().getContext()), BlockInfo(0), BlockPointer(0), NormalCleanupDest(0), EHCleanupDest(0), NextCleanupDestIndex(1), - ExceptionSlot(0), DebugInfo(0), IndirectBranch(0), + ExceptionSlot(0), DebugInfo(0), DisableDebugInfo(false), IndirectBranch(0), SwitchInsn(0), CaseRangeBlock(0), DidCallStackSave(false), UnreachableBlock(0), CXXThisDecl(0), CXXThisValue(0), CXXVTTDecl(0), CXXVTTValue(0), @@ -336,8 +336,8 @@ void CodeGenFunction::GenerateCode(GlobalDecl GD, llvm::Function *Fn) { const FunctionDecl *FD = cast<FunctionDecl>(GD.getDecl()); // Check if we should generate debug info for this function. - if (CGM.getDebugInfo() && !FD->hasAttr<NoDebugAttr>()) - DebugInfo = CGM.getDebugInfo(); + if (CGM.getModuleDebugInfo() && !FD->hasAttr<NoDebugAttr>()) + DebugInfo = CGM.getModuleDebugInfo(); FunctionArgList Args; QualType ResTy = FD->getResultType(); |