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
This commit is contained in:
@@ -944,6 +944,7 @@ public:
|
||||
const VarDecl *V);
|
||||
private:
|
||||
CGDebugInfo *DebugInfo;
|
||||
bool DisableDebugInfo;
|
||||
|
||||
/// IndirectBranch - The first time an indirect goto is seen we create a block
|
||||
/// with an indirect branch. Every time we see the address of a label taken,
|
||||
@@ -1030,7 +1031,14 @@ public:
|
||||
|
||||
CodeGenTypes &getTypes() const { return CGM.getTypes(); }
|
||||
ASTContext &getContext() const;
|
||||
CGDebugInfo *getDebugInfo() { return DebugInfo; }
|
||||
CGDebugInfo *getDebugInfo() {
|
||||
if (DisableDebugInfo)
|
||||
return NULL;
|
||||
return DebugInfo;
|
||||
}
|
||||
void disableDebugInfo() { DisableDebugInfo = true; }
|
||||
void enableDebugInfo() { DisableDebugInfo = false; }
|
||||
|
||||
|
||||
const LangOptions &getLangOptions() const { return CGM.getLangOptions(); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user