aboutsummaryrefslogtreecommitdiff
path: root/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'CodeGen/CodeGenModule.cpp')
-rw-r--r--CodeGen/CodeGenModule.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/CodeGen/CodeGenModule.cpp b/CodeGen/CodeGenModule.cpp
index d091dd73eb..262469e34b 100644
--- a/CodeGen/CodeGenModule.cpp
+++ b/CodeGen/CodeGenModule.cpp
@@ -26,7 +26,7 @@ using namespace CodeGen;
CodeGenModule::CodeGenModule(ASTContext &C, llvm::Module &M)
- : Context(C), TheModule(M), Types(C.Target) {}
+ : Context(C), TheModule(M), Types(C) {}
llvm::Constant *CodeGenModule::GetAddrOfGlobalDecl(const Decl *D) {
// See if it is already in the map.
@@ -68,7 +68,8 @@ void CodeGenModule::EmitGlobalVar(const FileVarDecl *D) {
if (D->getInit() == 0) {
Init = llvm::Constant::getNullValue(GV->getType()->getElementType());
} else if (D->getType()->isIntegerType()) {
- llvm::APSInt Value(getContext().getTypeSize(D->getInit()->getType()));
+ llvm::APSInt Value(getContext().getTypeSize(D->getInit()->getType(),
+ SourceLocation()));
if (D->getInit()->isIntegerConstantExpr(Value))
Init = llvm::ConstantInt::get(Value);
}
@@ -103,7 +104,9 @@ void CodeGenModule::EmitGlobalVarDeclarator(const FileVarDecl *D) {
llvm::Function *CodeGenModule::getMemCpyFn() {
if (MemCpyFn) return MemCpyFn;
llvm::Intrinsic::ID IID;
- switch (Context.Target.getPointerWidth(SourceLocation())) {
+ uint64_t Size; unsigned Align;
+ Context.Target.getPointerInfo(Size, Align, SourceLocation());
+ switch (Size) {
default: assert(0 && "Unknown ptr width");
case 32: IID = llvm::Intrinsic::memcpy_i32; break;
case 64: IID = llvm::Intrinsic::memcpy_i64; break;