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:
Adrian Prantl
2013-07-31 18:08:38 +00:00
parent 5295671f3b
commit aecfb851cd
5 changed files with 57 additions and 35 deletions

View File

@@ -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() {