From: Matt Arsenault Date: Fri, 27 Sep 2013 22:26:25 +0000 (+0000) Subject: Use right pointer type in DebugIR X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b99f6e14af3752c356b6acc887e1a3dcd961e19f;p=oota-llvm.git Use right pointer type in DebugIR git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191576 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Instrumentation/DebugIR.cpp b/lib/Transforms/Instrumentation/DebugIR.cpp index 9489bb2556f..f50a044073f 100644 --- a/lib/Transforms/Instrumentation/DebugIR.cpp +++ b/lib/Transforms/Instrumentation/DebugIR.cpp @@ -402,7 +402,7 @@ private: Type *PointeeTy = T->getPointerElementType(); if (!(N = getType(PointeeTy))) N = Builder.createPointerType( - getOrCreateType(PointeeTy), Layout.getPointerSizeInBits(), + getOrCreateType(PointeeTy), Layout.getPointerTypeSizeInBits(T), Layout.getPrefTypeAlignment(T), getTypeName(T)); } else if (T->isArrayTy()) { SmallVector Subrange; diff --git a/test/Transforms/DebugIR/simple-addrspace.ll b/test/Transforms/DebugIR/simple-addrspace.ll new file mode 100644 index 00000000000..6bea9b269f5 --- /dev/null +++ b/test/Transforms/DebugIR/simple-addrspace.ll @@ -0,0 +1,13 @@ +; RUN: opt -debug-ir -S %s -o - | FileCheck %s + +target datalayout = "e-p:64:64:64-p1:16:16:16" + +define void @foo(i32 addrspace(1)*) nounwind { + ret void +} + +; Make sure the pointer size is 16 + +; CHECK: metadata !"i32 addrspace(1)*", i32 0, i64 16, i64 2, i64 0, i32 0 + +