[llvm] r191576 - Use right pointer type in DebugIR
Matt Arsenault
Matthew.Arsenault at amd.com
Fri Sep 27 15:26:25 PDT 2013
Author: arsenm
Date: Fri Sep 27 17:26:25 2013
New Revision: 191576
URL: http://llvm.org/viewvc/llvm-project?rev=191576&view=rev
Log:
Use right pointer type in DebugIR
Added:
llvm/trunk/test/Transforms/DebugIR/simple-addrspace.ll
Modified:
llvm/trunk/lib/Transforms/Instrumentation/DebugIR.cpp
Modified: llvm/trunk/lib/Transforms/Instrumentation/DebugIR.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/DebugIR.cpp?rev=191576&r1=191575&r2=191576&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/DebugIR.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/DebugIR.cpp Fri Sep 27 17:26:25 2013
@@ -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<Value *, 1> Subrange;
Added: llvm/trunk/test/Transforms/DebugIR/simple-addrspace.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/DebugIR/simple-addrspace.ll?rev=191576&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/DebugIR/simple-addrspace.ll (added)
+++ llvm/trunk/test/Transforms/DebugIR/simple-addrspace.ll Fri Sep 27 17:26:25 2013
@@ -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
+
+
More information about the llvm-commits
mailing list