mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Debug Info! Add basic support for line tables, compilation units, files,
and lexical scopes, which can be enabled through the new -g option. When -g is enabled, line tables and scopes compile all the way down to DWARF. Changes to SIL: - In addition to a SILLocation, every instruction now also has a pointer to a SILDebugScope (its containing lexical scope). - Added LexicalScope, which is to be used for all Scopes we want to show up in the debug info. Swift SVN r5772
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
|
||||
#include "GenType.h"
|
||||
#include "IRGenModule.h"
|
||||
#include "IRGenDebugInfo.h"
|
||||
#include "Linking.h"
|
||||
|
||||
#include <initializer_list>
|
||||
@@ -61,7 +62,7 @@ IRGenModule::IRGenModule(ASTContext &Context,
|
||||
Options &Opts, llvm::Module &Module,
|
||||
const llvm::DataLayout &DataLayout,
|
||||
SILModule *SILMod)
|
||||
: Context(Context), Opts(Opts),
|
||||
: Context(Context), Opts(Opts), DebugInfo(0),
|
||||
Module(Module), LLVMContext(Module.getContext()),
|
||||
DataLayout(DataLayout), SILMod(SILMod),
|
||||
Types(*new TypeConverter(*this)) {
|
||||
@@ -173,10 +174,15 @@ IRGenModule::IRGenModule(ASTContext &Context,
|
||||
|
||||
// TODO: use "tinycc" on platforms that support it
|
||||
RuntimeCC = llvm::CallingConv::C;
|
||||
|
||||
if (Opts.DebugInfo)
|
||||
DebugInfo = new IRGenDebugInfo(Context.SourceMgr, Module);
|
||||
}
|
||||
|
||||
IRGenModule::~IRGenModule() {
|
||||
delete &Types;
|
||||
if (DebugInfo)
|
||||
delete DebugInfo;
|
||||
}
|
||||
|
||||
static llvm::Constant *getRuntimeFn(IRGenModule &IGM,
|
||||
|
||||
Reference in New Issue
Block a user