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 | 15cb669039cf26cf018460c8a18901f023bcc7dd (patch) | |
| tree | 983415416e056a3e9da736291994758db590d55f /clang/Driver/clang.cpp | |
| parent | cd13ef01a21e83d7ee0660bf4994c2c453368d05 (diff) | |
| download | bcm5719-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/Driver/clang.cpp')
| -rw-r--r-- | clang/Driver/clang.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/clang/Driver/clang.cpp b/clang/Driver/clang.cpp index d3c40dcd25d..c6ace84ea19 100644 --- a/clang/Driver/clang.cpp +++ b/clang/Driver/clang.cpp @@ -149,6 +149,13 @@ OutputFile("o", llvm::cl::desc("Specify output file (for --serialize, this is a directory)")); //===----------------------------------------------------------------------===// +// Code Generator Options +//===----------------------------------------------------------------------===// +static llvm::cl::opt<bool> +GenerateDebugInfo("g", + llvm::cl::desc("Generate source level debug information")); + +//===----------------------------------------------------------------------===// // Diagnostic Options //===----------------------------------------------------------------------===// @@ -1161,7 +1168,7 @@ static ASTConsumer* CreateASTConsumer(const std::string& InFile, case EmitLLVM: case EmitBC: DestModule = new llvm::Module(InFile); - return CreateLLVMCodeGen(Diag, LangOpts, DestModule); + return CreateLLVMCodeGen(Diag, LangOpts, DestModule, GenerateDebugInfo); case SerializeAST: // FIXME: Allow user to tailor where the file is written. |

