diff options
author | Sanjiv Gupta <sanjiv.gupta@microchip.com> | 2008-05-08 08:54:20 +0000 |
---|---|---|
committer | Sanjiv Gupta <sanjiv.gupta@microchip.com> | 2008-05-08 08:54:20 +0000 |
commit | e8b9f5b8ea60983c4a74cb8b63879616b914b65a (patch) | |
tree | 12fefe9c0746176f5f7dae2f26a3a6c9aa4bbfe8 /lib/CodeGen/CodeGenModule.cpp | |
parent | 56cf96b3ea9a0027b29e11c47b90719525c13bc6 (diff) |
Added -g command line options to clang for generating source level debug information. This patch currently enables generation of line number debug information (stoppoints) and region begin/end debug information. The new files CGDebugInfo.h and CGDebugInfo.cpp implements the debug info manager class CGDebugInfo.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50848 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | lib/CodeGen/CodeGenModule.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index d8b1fc327a..b234788a08 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -11,6 +11,7 @@ // //===----------------------------------------------------------------------===// +#include "CGDebugInfo.h" #include "CodeGenModule.h" #include "CodeGenFunction.h" #include "clang/AST/ASTContext.h" @@ -32,13 +33,19 @@ using namespace CodeGen; CodeGenModule::CodeGenModule(ASTContext &C, const LangOptions &LO, llvm::Module &M, const llvm::TargetData &TD, - Diagnostic &diags) + Diagnostic &diags, bool GenerateDebugInfo) : Context(C), Features(LO), TheModule(M), TheTargetData(TD), Diags(diags), Types(C, M, TD), MemCpyFn(0), MemSetFn(0), CFConstantStringClassRef(0) { //TODO: Make this selectable at runtime Runtime = CreateObjCRuntime(M, getTypes().ConvertType(getContext().IntTy), getTypes().ConvertType(getContext().LongTy)); + + // If debug info generation is enabled, create the CGDebugInfo object. + if (GenerateDebugInfo) + DebugInfo = new CGDebugInfo(this); + else + DebugInfo = NULL; } CodeGenModule::~CodeGenModule() { @@ -49,7 +56,7 @@ CodeGenModule::~CodeGenModule() { EmitGlobalCtors(); EmitAnnotations(); delete Runtime; - + delete DebugInfo; // Run the verifier to check that the generated code is consistent. assert(!verifyModule(TheModule)); } |