summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorSanjiv Gupta <sanjiv.gupta@microchip.com>2008-05-08 08:54:20 +0000
committerSanjiv Gupta <sanjiv.gupta@microchip.com>2008-05-08 08:54:20 +0000
commit15cb669039cf26cf018460c8a18901f023bcc7dd (patch)
tree983415416e056a3e9da736291994758db590d55f /clang/lib/CodeGen/CodeGenModule.cpp
parentcd13ef01a21e83d7ee0660bf4994c2c453368d05 (diff)
downloadbcm5719-llvm-15cb669039cf26cf018460c8a18901f023bcc7dd.tar.gz
bcm5719-llvm-15cb669039cf26cf018460c8a18901f023bcc7dd.zip
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.
llvm-svn: 50848
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index d8b1fc327a9..b234788a08f 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/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));
}
OpenPOWER on IntegriCloud