mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Wire clang::TargetInfo into swift::IRGenDebugInfo so we have access to
the target size of types, which may be different from the LLVM storage size. Swift SVN r6774
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
#include "swift/AST/ASTContext.h"
|
||||
#include "swift/AST/Module.h"
|
||||
#include "swift/AST/Diagnostics.h"
|
||||
#include "swift/ClangImporter/ClangImporter.h"
|
||||
#include "swift/IRGen/Options.h"
|
||||
#include "llvm/IR/Constants.h"
|
||||
#include "llvm/IR/DataLayout.h"
|
||||
@@ -178,8 +179,12 @@ IRGenModule::IRGenModule(ASTContext &Context,
|
||||
// TODO: use "tinycc" on platforms that support it
|
||||
RuntimeCC = llvm::CallingConv::C;
|
||||
|
||||
if (Opts.DebugInfo)
|
||||
DebugInfo = new IRGenDebugInfo(Opts, Types, Context.SourceMgr, Module);
|
||||
if (Opts.DebugInfo) {
|
||||
auto CI = static_cast<ClangImporter*>(&*Context.getClangModuleLoader());
|
||||
assert(CI && "no clang module loader");
|
||||
DebugInfo = new IRGenDebugInfo(Opts, CI->getTargetInfo(), Types,
|
||||
Context.SourceMgr, Module);
|
||||
}
|
||||
}
|
||||
|
||||
IRGenModule::~IRGenModule() {
|
||||
|
||||
Reference in New Issue
Block a user