%struct.rtx_def = type { i16, i16 }
-define void @bar(%struct.rtx_def* %a, i8 %b, i32 %c) {
- call void @llvm.memset.p0struct.rtx_def.i32(%struct.rtx_def* align 4 %a, i8 %b, i32 %c, i1 true)
+define void @bar(ptr %a, i8 %b, i32 %c) {
+ call void @llvm.memset.p0.rtx_def.i32(ptr align 4 %a, i8 %b, i32 %c, i1 true)
ret void
}
-declare void @llvm.memset.p0struct.rtx_def.i32(%struct.rtx_def*, i8, i32, i1)
+declare void @llvm.memset.p0.rtx_def.i32(ptr, i8, i32, i1)
%struct.rtx_def = type { i16, i16 }
-define void @bar(%struct.rtx_def* %a, i8 %b, i32 %c) {
- call void @llvm.memset.p0struct.rtx_def.i32(%struct.rtx_def* align 4 %a, i8 %b, i32 %c, i1 true)
+define void @bar(ptr %a, i8 %b, i32 %c) {
+ call void @llvm.memset.p0.rtx_def.i32(ptr align 4 %a, i8 %b, i32 %c, i1 true)
ret void
}
-declare void @llvm.memset.p0struct.rtx_def.i32(%struct.rtx_def*, i8, i32, i1)
+declare void @llvm.memset.p0.rtx_def.i32(ptr, i8, i32, i1)
; T2 is the non-opaque struct required to trigger the uniqued T2.0 and T3.0 to
; respectively T2 and T3 in the destination module.
-%"T2" = type { %"T3"* }
+%"T2" = type { ptr }
%"T3" = type opaque
; Use/refer to T2 so it gets added as an IdentifiedStructType. The debug
%CommonStruct = type opaque
@x = external global %SrcType
-@bar = internal global %CommonStruct* null, !dbg !0
+@bar = internal global ptr null, !dbg !0
!llvm.dbg.cu = !{!2}
!llvm.module.flags = !{!8}
; Without -exported-symbol, main should be eliminated by LTO.
; With -exported-symbol=main, main should be preserved by LTO.
-define i32 @main(i32 %argc, i8** %argv) {
+define i32 @main(i32 %argc, ptr %argv) {
; NOEXPORT-NOT: main
; EXPORT: main
call void @PR14512()
; RUN: llvm-nm %t | FileCheck %s -check-prefix=ZED1_AND_ZED2
; ZED1_AND_ZED2: V zed1
@zed1 = linkonce_odr global i32 42
-define i32* @get_zed1() {
- ret i32* @zed1
+define ptr @get_zed1() {
+ ret ptr @zed1
}
; ZED1_AND_ZED2: r zed2
@zed2 = linkonce_odr unnamed_addr constant i32 42
define i32 @useZed2() {
- %x = load i32, i32* @zed2
+ %x = load i32, ptr @zed2
ret i32 %x
}
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
-@f = internal global [4 x void ()*] [void ()* @a, void ()* @b, void ()* @c, void ()* null], align 16
+@f = internal global [4 x ptr] [ptr @a, ptr @b, ptr @c, ptr null], align 16
define dso_local void @a() !type !5 !type !6 { ret void }
define dso_local void @b() !type !5 !type !6 { ret void }
define dso_local void @d() !type !5 !type !6 {
entry:
%i = alloca i32, align 4
- store i32 0, i32* %i, align 4
+ store i32 0, ptr %i, align 4
br label %for.cond
for.cond: ; preds = %for.inc, %entry
- %0 = load i32, i32* %i, align 4
+ %0 = load i32, ptr %i, align 4
%idxprom = sext i32 %0 to i64
- %arrayidx = getelementptr inbounds [4 x void ()*], [4 x void ()*]* @f, i64 0, i64 %idxprom
- %1 = load void ()*, void ()** %arrayidx, align 8
- %tobool = icmp ne void ()* %1, null
+ %arrayidx = getelementptr inbounds [4 x ptr], ptr @f, i64 0, i64 %idxprom
+ %1 = load ptr, ptr %arrayidx, align 8
+ %tobool = icmp ne ptr %1, null
br i1 %tobool, label %for.body, label %for.end
for.body: ; preds = %for.cond
- %2 = load i32, i32* %i, align 4
+ %2 = load i32, ptr %i, align 4
%idxprom1 = sext i32 %2 to i64
- %arrayidx2 = getelementptr inbounds [4 x void ()*], [4 x void ()*]* @f, i64 0, i64 %idxprom1
- %3 = load void ()*, void ()** %arrayidx2, align 8
- %4 = bitcast void ()* %3 to i8*, !nosanitize !7
- %5 = call i1 @llvm.type.test(i8* %4, metadata !"_ZTSFvvE"), !nosanitize !7
- br i1 %5, label %cont, label %trap, !nosanitize !7
+ %arrayidx2 = getelementptr inbounds [4 x ptr], ptr @f, i64 0, i64 %idxprom1
+ %3 = load ptr, ptr %arrayidx2, align 8
+ %4 = call i1 @llvm.type.test(ptr %3, metadata !"_ZTSFvvE"), !nosanitize !7
+ br i1 %4, label %cont, label %trap, !nosanitize !7
trap: ; preds = %for.body
call void @llvm.ubsantrap(i8 2), !nosanitize !7
br label %for.inc
for.inc: ; preds = %cont
- %6 = load i32, i32* %i, align 4
- %inc = add nsw i32 %6, 1
- store i32 %inc, i32* %i, align 4
+ %5 = load i32, ptr %i, align 4
+ %inc = add nsw i32 %5, 1
+ store i32 %inc, ptr %i, align 4
br label %for.cond
for.end: ; preds = %for.cond
ret void
}
-declare i1 @llvm.type.test(i8*, metadata)
+declare i1 @llvm.type.test(ptr, metadata)
declare void @llvm.ubsantrap(i8 immarg)
!llvm.module.flags = !{!0, !1, !2, !3}
@data = internal constant [0 x i32] []
-define i32* @_start() nounwind readonly {
+define ptr @_start() nounwind readonly {
entry:
; CHECK-SMALL-LABEL: <_start>:
; CHECK-SMALL: leaq (%rip), %rax
- ret i32* getelementptr ([0 x i32], [0 x i32]* @data, i64 0, i64 0)
+ ret ptr @data
}
@data = internal constant [0 x i32] []
-define i32* @_start() nounwind readonly {
+define ptr @_start() nounwind readonly {
entry:
; CHECK-LARGE-LABEL: <_start>:
; CHECK-LARGE: movabsq $0, %rax
- ret i32* getelementptr ([0 x i32], [0 x i32]* @data, i64 0, i64 0)
+ ret ptr @data
}
@data = internal constant [0 x i32] []
-define i32* @_start() nounwind readonly {
+define ptr @_start() nounwind readonly {
entry:
- ret i32* getelementptr ([0 x i32], [0 x i32]* @data, i64 0, i64 0)
+ ret ptr @data
}
; CHECK: 'Code Model': IDs have conflicting values
ret i32 %i
}
-define i32 @func2(i32* %out, i32* %out2, i32* %A, i32* %B, i32* %C, i32* %D, i32* %E, i32* %F) {
+define i32 @func2(ptr %out, ptr %out2, ptr %A, ptr %B, ptr %C, ptr %D, ptr %E, ptr %F) {
entry:
br label %for.body
for.body: ; preds = %for.body, %entry
%i.037 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
- %arrayidx = getelementptr inbounds i32, i32* %A, i64 %i.037
- %0 = load i32, i32* %arrayidx, align 4
- %arrayidx1 = getelementptr inbounds i32, i32* %B, i64 %i.037
- %1 = load i32, i32* %arrayidx1, align 4
+ %arrayidx = getelementptr inbounds i32, ptr %A, i64 %i.037
+ %0 = load i32, ptr %arrayidx, align 4
+ %arrayidx1 = getelementptr inbounds i32, ptr %B, i64 %i.037
+ %1 = load i32, ptr %arrayidx1, align 4
%add = add nsw i32 %1, %0
- %arrayidx2 = getelementptr inbounds i32, i32* %C, i64 %i.037
- %2 = load i32, i32* %arrayidx2, align 4
+ %arrayidx2 = getelementptr inbounds i32, ptr %C, i64 %i.037
+ %2 = load i32, ptr %arrayidx2, align 4
%add3 = add nsw i32 %add, %2
- %arrayidx4 = getelementptr inbounds i32, i32* %E, i64 %i.037
- %3 = load i32, i32* %arrayidx4, align 4
+ %arrayidx4 = getelementptr inbounds i32, ptr %E, i64 %i.037
+ %3 = load i32, ptr %arrayidx4, align 4
%add5 = add nsw i32 %add3, %3
- %arrayidx6 = getelementptr inbounds i32, i32* %F, i64 %i.037
- %4 = load i32, i32* %arrayidx6, align 4
+ %arrayidx6 = getelementptr inbounds i32, ptr %F, i64 %i.037
+ %4 = load i32, ptr %arrayidx6, align 4
%add7 = add nsw i32 %add5, %4
- %arrayidx8 = getelementptr inbounds i32, i32* %out, i64 %i.037
- store i32 %add7, i32* %arrayidx8, align 4
- %5 = load i32, i32* %arrayidx, align 4
- %6 = load i32, i32* %arrayidx1, align 4
+ %arrayidx8 = getelementptr inbounds i32, ptr %out, i64 %i.037
+ store i32 %add7, ptr %arrayidx8, align 4
+ %5 = load i32, ptr %arrayidx, align 4
+ %6 = load i32, ptr %arrayidx1, align 4
%add11 = add nsw i32 %6, %5
- %7 = load i32, i32* %arrayidx2, align 4
+ %7 = load i32, ptr %arrayidx2, align 4
%add13 = add nsw i32 %add11, %7
- %8 = load i32, i32* %arrayidx4, align 4
+ %8 = load i32, ptr %arrayidx4, align 4
%add15 = add nsw i32 %add13, %8
- %9 = load i32, i32* %arrayidx6, align 4
+ %9 = load i32, ptr %arrayidx6, align 4
%add17 = add nsw i32 %add15, %9
- %arrayidx18 = getelementptr inbounds i32, i32* %out2, i64 %i.037
- store i32 %add17, i32* %arrayidx18, align 4
+ %arrayidx18 = getelementptr inbounds i32, ptr %out2, i64 %i.037
+ store i32 %add17, ptr %arrayidx18, align 4
%inc = add i64 %i.037, 1
%exitcond = icmp eq i64 %inc, 256
br i1 %exitcond, label %for.end, label %for.body
module asm ".weak foo"
module asm ".equ foo,bar"
-@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 (i32)* @bar to i8*)], section "llvm.metadata"
+@llvm.compiler.used = appending global [1 x ptr] [ptr @bar], section "llvm.metadata"
define internal i32 @bar(i32 %0) {
%2 = add nsw i32 %0, 1
target triple = "x86_64-apple-darwin11"
-@llvm.compiler.used = appending global [1 x i8*] [
- i8* bitcast (i32(i8*)* @puts to i8*)
+@llvm.compiler.used = appending global [1 x ptr] [
+ ptr @puts
], section "llvm.metadata"
-@llvm.used = appending global [1 x i8*] [
- i8* bitcast (i32(i32)* @uses_printf to i8*)
+@llvm.used = appending global [1 x ptr] [
+ ptr @uses_printf
], section "llvm.metadata"
@str = private unnamed_addr constant [13 x i8] c"hello world\0A\00"
define i32 @uses_printf(i32 %i) {
entry:
- %s = getelementptr [13 x i8], [13 x i8]* @str, i64 0, i64 0
- call i32 (i8*, ...) @printf(i8* %s)
+ call i32 (ptr, ...) @printf(ptr @str)
ret i32 0
}
-define internal i32 @printf(i8* readonly nocapture %fmt, ...) {
+define internal i32 @printf(ptr readonly nocapture %fmt, ...) {
entry:
- %ret = call i32 @bar(i8* %fmt)
+ %ret = call i32 @bar(ptr %fmt)
ret i32 %ret
}
; CHECK: define {{.*}} @puts(
-define internal i32 @puts(i8* %s) {
+define internal i32 @puts(ptr %s) {
entry:
- %ret = call i32 @bar(i8* %s)
+ %ret = call i32 @bar(ptr %s)
ret i32 %ret
}
-declare i32 @bar(i8*)
+declare i32 @bar(ptr)
@src = global float 0x40091EB860000000, align 4
@dst = common global float 0.000000e+00, align 4
-@logf = alias float (float), float (float)* @fname
+@logf = alias float (float), ptr @fname
define i32 @main() local_unnamed_addr {
entry:
- %0 = load volatile float, float* @src, align 4
+ %0 = load volatile float, ptr @src, align 4
%1 = tail call float @llvm.log.f32(float %0)
- store volatile float %1, float* @dst, align 4
+ store volatile float %1, ptr @dst, align 4
ret i32 0
}
call void @foo1()
call void @foo2()
call void @foo3()
- %x1 = load i32, i32* @v1
- %x2 = load i32, i32* @v2
- %x3 = load i32, i32* @v3
- %x4 = load i32, i32* @v4
- %x5 = load i32, i32* @v5
- %x6 = load i32, i32* @v6
+ %x1 = load i32, ptr @v1
+ %x2 = load i32, ptr @v2
+ %x3 = load i32, ptr @v3
+ %x4 = load i32, ptr @v4
+ %x5 = load i32, ptr @v5
+ %x6 = load i32, ptr @v6
ret void
}
; CHECK: T _uses_puts
define i32 @uses_puts(i32 %i) {
entry:
- %s = call i8* @foo(i32 %i)
- %ret = call i32 @puts(i8* %s)
+ %s = call ptr @foo(i32 %i)
+ %ret = call i32 @puts(ptr %s)
ret i32 %ret
}
define i32 @uses_printf(i32 %i) {
entry:
- %s = getelementptr [13 x i8], [13 x i8]* @str, i64 0, i64 0
- call i32 (i8*, ...) @printf(i8* %s)
+ call i32 (ptr, ...) @printf(ptr @str)
ret i32 0
}
-define hidden i32 @printf(i8* readonly nocapture %fmt, ...) {
+define hidden i32 @printf(ptr readonly nocapture %fmt, ...) {
entry:
- %ret = call i32 @bar(i8* %fmt)
+ %ret = call i32 @bar(ptr %fmt)
ret i32 %ret
}
-define hidden i32 @puts(i8* %s) {
+define hidden i32 @puts(ptr %s) {
entry:
- %ret = call i32 @bar(i8* %s)
+ %ret = call i32 @bar(ptr %s)
ret i32 %ret
}
-declare i8* @foo(i32)
-declare i32 @bar(i8*)
+declare ptr @foo(i32)
+declare i32 @bar(ptr)
module asm "\09.globl .objc_category_name_A_foo"
%0 = type opaque
-%struct._objc_method = type { i8*, i8*, i8* }
-%struct._objc_category = type { i8*, i8*, %struct._objc_method_list*, %struct._objc_method_list*, %struct._objc_protocol_list*, i32, %struct._prop_list_t*, %struct._prop_list_t* }
+%struct._objc_method = type { ptr, ptr, ptr }
+%struct._objc_category = type { ptr, ptr, ptr, ptr, ptr, i32, ptr, ptr }
%struct._objc_method_list = type opaque
-%struct._objc_protocol_list = type { %struct._objc_protocol_list*, i32, [0 x %struct._objc_protocol] }
-%struct._objc_protocol = type { %struct._objc_protocol_extension*, i8*, %struct._objc_protocol_list*, %struct._objc_method_description_list*, %struct._objc_method_description_list* }
-%struct._objc_protocol_extension = type { i32, %struct._objc_method_description_list*, %struct._objc_method_description_list*, %struct._prop_list_t*, i8**, %struct._prop_list_t* }
+%struct._objc_protocol_list = type { ptr, i32, [0 x %struct._objc_protocol] }
+%struct._objc_protocol = type { ptr, ptr, ptr, ptr, ptr }
+%struct._objc_protocol_extension = type { i32, ptr, ptr, ptr, ptr, ptr }
%struct._objc_method_description_list = type { i32, [0 x %struct._objc_method_description] }
-%struct._objc_method_description = type { i8*, i8* }
+%struct._objc_method_description = type { ptr, ptr }
%struct._prop_list_t = type { i32, i32, [0 x %struct._prop_t] }
-%struct._prop_t = type { i8*, i8* }
-%struct._objc_module = type { i32, i32, i8*, %struct._objc_symtab* }
-%struct._objc_symtab = type { i32, i8*, i16, i16, [0 x i8*] }
+%struct._prop_t = type { ptr, ptr }
+%struct._objc_module = type { i32, i32, ptr, ptr }
+%struct._objc_symtab = type { i32, ptr, i16, i16, [0 x ptr] }
@OBJC_METH_VAR_NAME_ = private global [12 x i8] c"foo_myStuff\00", section "__TEXT,__cstring,cstring_literals", align 1
@OBJC_METH_VAR_TYPE_ = private global [7 x i8] c"v8@0:4\00", section "__TEXT,__cstring,cstring_literals", align 1
@OBJC_CLASS_NAME_ = private global [4 x i8] c"foo\00", section "__TEXT,__cstring,cstring_literals", align 1
@OBJC_CLASS_NAME_.1 = private global [2 x i8] c"A\00", section "__TEXT,__cstring,cstring_literals", align 1
-@OBJC_CATEGORY_INSTANCE_METHODS_A_foo = private global { i8*, i32, [1 x %struct._objc_method] } { i8* null, i32 1, [1 x %struct._objc_method] [%struct._objc_method { i8* getelementptr inbounds ([12 x i8], [12 x i8]* @OBJC_METH_VAR_NAME_, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @OBJC_METH_VAR_TYPE_, i32 0, i32 0), i8* bitcast (void (%0*, i8*)* @"\01-[A(foo) foo_myStuff]" to i8*) }] }, section "__OBJC,__cat_inst_meth,regular,no_dead_strip", align 4
-@OBJC_CATEGORY_A_foo = private global %struct._objc_category { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @OBJC_CLASS_NAME_, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @OBJC_CLASS_NAME_.1, i32 0, i32 0), %struct._objc_method_list* bitcast ({ i8*, i32, [1 x %struct._objc_method] }* @OBJC_CATEGORY_INSTANCE_METHODS_A_foo to %struct._objc_method_list*), %struct._objc_method_list* null, %struct._objc_protocol_list* null, i32 32, %struct._prop_list_t* null, %struct._prop_list_t* null }, section "__OBJC,__category,regular,no_dead_strip", align 4
+@OBJC_CATEGORY_INSTANCE_METHODS_A_foo = private global { ptr, i32, [1 x %struct._objc_method] } { ptr null, i32 1, [1 x %struct._objc_method] [%struct._objc_method { ptr @OBJC_METH_VAR_NAME_, ptr @OBJC_METH_VAR_TYPE_, ptr @"\01-[A(foo) foo_myStuff]" }] }, section "__OBJC,__cat_inst_meth,regular,no_dead_strip", align 4
+@OBJC_CATEGORY_A_foo = private global %struct._objc_category { ptr @OBJC_CLASS_NAME_, ptr @OBJC_CLASS_NAME_.1, ptr @OBJC_CATEGORY_INSTANCE_METHODS_A_foo, ptr null, ptr null, i32 32, ptr null, ptr null }, section "__OBJC,__category,regular,no_dead_strip", align 4
@OBJC_CLASS_NAME_.2 = private global [1 x i8] zeroinitializer, section "__TEXT,__cstring,cstring_literals", align 1
-@OBJC_SYMBOLS = private global { i32, i8*, i16, i16, [1 x i8*] } { i32 0, i8* null, i16 0, i16 1, [1 x i8*] [i8* bitcast (%struct._objc_category* @OBJC_CATEGORY_A_foo to i8*)] }, section "__OBJC,__symbols,regular,no_dead_strip", align 4
-@OBJC_MODULES = private global %struct._objc_module { i32 7, i32 16, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @OBJC_CLASS_NAME_.2, i32 0, i32 0), %struct._objc_symtab* bitcast ({ i32, i8*, i16, i16, [1 x i8*] }* @OBJC_SYMBOLS to %struct._objc_symtab*) }, section "__OBJC,__module_info,regular,no_dead_strip", align 4
-@llvm.compiler.used = appending global [9 x i8*] [i8* getelementptr inbounds ([12 x i8], [12 x i8]* @OBJC_METH_VAR_NAME_, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @OBJC_METH_VAR_TYPE_, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @OBJC_CLASS_NAME_, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @OBJC_CLASS_NAME_.1, i32 0, i32 0), i8* bitcast ({ i8*, i32, [1 x %struct._objc_method] }* @OBJC_CATEGORY_INSTANCE_METHODS_A_foo to i8*), i8* bitcast (%struct._objc_category* @OBJC_CATEGORY_A_foo to i8*), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @OBJC_CLASS_NAME_.2, i32 0, i32 0), i8* bitcast ({ i32, i8*, i16, i16, [1 x i8*] }* @OBJC_SYMBOLS to i8*), i8* bitcast (%struct._objc_module* @OBJC_MODULES to i8*)], section "llvm.metadata"
+@OBJC_SYMBOLS = private global { i32, ptr, i16, i16, [1 x ptr] } { i32 0, ptr null, i16 0, i16 1, [1 x ptr] [ptr @OBJC_CATEGORY_A_foo] }, section "__OBJC,__symbols,regular,no_dead_strip", align 4
+@OBJC_MODULES = private global %struct._objc_module { i32 7, i32 16, ptr @OBJC_CLASS_NAME_.2, ptr @OBJC_SYMBOLS }, section "__OBJC,__module_info,regular,no_dead_strip", align 4
+@llvm.compiler.used = appending global [9 x ptr] [ptr @OBJC_METH_VAR_NAME_, ptr @OBJC_METH_VAR_TYPE_, ptr @OBJC_CLASS_NAME_, ptr @OBJC_CLASS_NAME_.1, ptr @OBJC_CATEGORY_INSTANCE_METHODS_A_foo, ptr @OBJC_CATEGORY_A_foo, ptr @OBJC_CLASS_NAME_.2, ptr @OBJC_SYMBOLS, ptr @OBJC_MODULES], section "llvm.metadata"
; Function Attrs: nounwind ssp
-define internal void @"\01-[A(foo) foo_myStuff]"(%0*, i8*) #0 {
- %3 = alloca %0*, align 4
- %4 = alloca i8*, align 4
- store %0* %0, %0** %3, align 4
- store i8* %1, i8** %4, align 4
+define internal void @"\01-[A(foo) foo_myStuff]"(ptr, ptr) #0 {
+ %3 = alloca ptr, align 4
+ %4 = alloca ptr, align 4
+ store ptr %0, ptr %3, align 4
+ store ptr %1, ptr %4, align 4
ret void
}
target triple = "x86_64-apple-macosx10.12.0"
%0 = type opaque
-%struct._class_t = type { %struct._class_t*, %struct._class_t*, %struct._objc_cache*, i8* (i8*, i8*)**, %struct._class_ro_t* }
+%struct._class_t = type { ptr, ptr, ptr, ptr, ptr }
%struct._objc_cache = type opaque
-%struct._class_ro_t = type { i32, i32, i32, i8*, i8*, %struct.__method_list_t*, %struct._objc_protocol_list*, %struct._ivar_list_t*, i8*, %struct._prop_list_t* }
+%struct._class_ro_t = type { i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.__method_list_t = type { i32, i32, [0 x %struct._objc_method] }
-%struct._objc_method = type { i8*, i8*, i8* }
-%struct._objc_protocol_list = type { i64, [0 x %struct._protocol_t*] }
-%struct._protocol_t = type { i8*, i8*, %struct._objc_protocol_list*, %struct.__method_list_t*, %struct.__method_list_t*, %struct.__method_list_t*, %struct.__method_list_t*, %struct._prop_list_t*, i32, i32, i8**, i8*, %struct._prop_list_t* }
+%struct._objc_method = type { ptr, ptr, ptr }
+%struct._objc_protocol_list = type { i64, [0 x ptr] }
+%struct._protocol_t = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, ptr, ptr, ptr }
%struct._ivar_list_t = type { i32, i32, [0 x %struct._ivar_t] }
-%struct._ivar_t = type { i64*, i8*, i8*, i32, i32 }
+%struct._ivar_t = type { ptr, ptr, ptr, i32, i32 }
%struct._prop_list_t = type { i32, i32, [0 x %struct._prop_t] }
-%struct._prop_t = type { i8*, i8* }
-%struct._category_t = type { i8*, %struct._class_t*, %struct.__method_list_t*, %struct.__method_list_t*, %struct._objc_protocol_list*, %struct._prop_list_t*, %struct._prop_list_t*, i32 }
+%struct._prop_t = type { ptr, ptr }
+%struct._category_t = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32 }
@OBJC_CLASS_NAME_ = private global [4 x i8] c"foo\00", section "__TEXT,__objc_classname,cstring_literals", align 1
@"OBJC_CLASS_$_A" = external global %struct._class_t
@OBJC_METH_VAR_NAME_ = private global [12 x i8] c"foo_myStuff\00", section "__TEXT,__objc_methname,cstring_literals", align 1
@OBJC_METH_VAR_TYPE_ = private global [8 x i8] c"v16@0:8\00", section "__TEXT,__objc_methtype,cstring_literals", align 1
-@"\01l_OBJC_$_CATEGORY_INSTANCE_METHODS_A_$_foo" = private global { i32, i32, [1 x %struct._objc_method] } { i32 24, i32 1, [1 x %struct._objc_method] [%struct._objc_method { i8* getelementptr inbounds ([12 x i8], [12 x i8]* @OBJC_METH_VAR_NAME_, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @OBJC_METH_VAR_TYPE_, i32 0, i32 0), i8* bitcast (void (%0*, i8*)* @"\01-[A(foo) foo_myStuff]" to i8*) }] }, section "__DATA, __objc_const", align 8
-@"\01l_OBJC_$_CATEGORY_A_$_foo" = private global %struct._category_t { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @OBJC_CLASS_NAME_, i32 0, i32 0), %struct._class_t* @"OBJC_CLASS_$_A", %struct.__method_list_t* bitcast ({ i32, i32, [1 x %struct._objc_method] }* @"\01l_OBJC_$_CATEGORY_INSTANCE_METHODS_A_$_foo" to %struct.__method_list_t*), %struct.__method_list_t* null, %struct._objc_protocol_list* null, %struct._prop_list_t* null, %struct._prop_list_t* null, i32 64 }, section "__DATA, __objc_const", align 8
-@"OBJC_LABEL_CATEGORY_$" = private global [1 x i8*] [i8* bitcast (%struct._category_t* @"\01l_OBJC_$_CATEGORY_A_$_foo" to i8*)], section "__DATA, __objc_catlist, regular, no_dead_strip", align 8
-@llvm.compiler.used = appending global [6 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @OBJC_CLASS_NAME_, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @OBJC_METH_VAR_NAME_, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @OBJC_METH_VAR_TYPE_, i32 0, i32 0), i8* bitcast ({ i32, i32, [1 x %struct._objc_method] }* @"\01l_OBJC_$_CATEGORY_INSTANCE_METHODS_A_$_foo" to i8*), i8* bitcast (%struct._category_t* @"\01l_OBJC_$_CATEGORY_A_$_foo" to i8*), i8* bitcast ([1 x i8*]* @"OBJC_LABEL_CATEGORY_$" to i8*)], section "llvm.metadata"
+@"\01l_OBJC_$_CATEGORY_INSTANCE_METHODS_A_$_foo" = private global { i32, i32, [1 x %struct._objc_method] } { i32 24, i32 1, [1 x %struct._objc_method] [%struct._objc_method { ptr @OBJC_METH_VAR_NAME_, ptr @OBJC_METH_VAR_TYPE_, ptr @"\01-[A(foo) foo_myStuff]" }] }, section "__DATA, __objc_const", align 8
+@"\01l_OBJC_$_CATEGORY_A_$_foo" = private global %struct._category_t { ptr @OBJC_CLASS_NAME_, ptr @"OBJC_CLASS_$_A", ptr @"\01l_OBJC_$_CATEGORY_INSTANCE_METHODS_A_$_foo", ptr null, ptr null, ptr null, ptr null, i32 64 }, section "__DATA, __objc_const", align 8
+@"OBJC_LABEL_CATEGORY_$" = private global [1 x ptr] [ptr @"\01l_OBJC_$_CATEGORY_A_$_foo"], section "__DATA, __objc_catlist, regular, no_dead_strip", align 8
+@llvm.compiler.used = appending global [6 x ptr] [ptr @OBJC_CLASS_NAME_, ptr @OBJC_METH_VAR_NAME_, ptr @OBJC_METH_VAR_TYPE_, ptr @"\01l_OBJC_$_CATEGORY_INSTANCE_METHODS_A_$_foo", ptr @"\01l_OBJC_$_CATEGORY_A_$_foo", ptr @"OBJC_LABEL_CATEGORY_$"], section "llvm.metadata"
; Function Attrs: ssp uwtable
-define internal void @"\01-[A(foo) foo_myStuff]"(%0*, i8*) #0 {
- %3 = alloca %0*, align 8
- %4 = alloca i8*, align 8
- store %0* %0, %0** %3, align 8
- store i8* %1, i8** %4, align 8
+define internal void @"\01-[A(foo) foo_myStuff]"(ptr, ptr) #0 {
+ %3 = alloca ptr, align 8
+ %4 = alloca ptr, align 8
+ store ptr %0, ptr %3, align 8
+ store ptr %1, ptr %4, align 8
ret void
}
target triple = "x86_64-unknown-linux-gnu"
define i32 @foo() {
- call void @llvm.dbg.value(metadata i32 ()* @get, metadata !7, metadata !DIExpression()), !dbg !DILocation(scope: !6)
+ call void @llvm.dbg.value(metadata ptr @get, metadata !7, metadata !DIExpression()), !dbg !DILocation(scope: !6)
ret i32 0
}
%struct.rtx_def = type { i16 }
-define void @foo(%struct.rtx_def* %a, i8 %b, i32 %c) {
- call void @llvm.memset.p0struct.rtx_def.i32(%struct.rtx_def* align 4 %a, i8 %b, i32 %c, i1 true)
+define void @foo(ptr %a, i8 %b, i32 %c) {
+ call void @llvm.memset.p0.rtx_def.i32(ptr align 4 %a, i8 %b, i32 %c, i1 true)
ret void
}
-declare void @llvm.memset.p0struct.rtx_def.i32(%struct.rtx_def*, i8, i32, i1)
+declare void @llvm.memset.p0.rtx_def.i32(ptr, i8, i32, i1)
define i32 @_Z3fooi(i32 %a) {
entry:
%a.addr = alloca i32, align 4
- store i32 %a, i32* %a.addr, align 4
- %0 = load i32, i32* %a.addr, align 4
- %1 = load i32, i32* %a.addr, align 4
+ store i32 %a, ptr %a.addr, align 4
+ %0 = load i32, ptr %a.addr, align 4
+ %1 = load i32, ptr %a.addr, align 4
%call = call i32 @_Z4bar2i(i32 %1)
%add = add nsw i32 %0, %call
ret i32 %add
define i32 @_Z4bar2i(i32 %a) {
entry:
%a.addr = alloca i32, align 4
- store i32 %a, i32* %a.addr, align 4
- %0 = load i32, i32* %a.addr, align 4
+ store i32 %a, ptr %a.addr, align 4
+ %0 = load i32, ptr %a.addr, align 4
%mul = mul nsw i32 2, %0
ret i32 %mul
}
define i32 @main() {
entry:
%retval = alloca i32, align 4
- store i32 0, i32* %retval
+ store i32 0, ptr %retval
%call = call i32 @_Z3fooi(i32 44)
ret i32 %call
}
target triple = "i386-pc-windows-msvc19.0.23918"
; CHECK: .globl _DllMain@12
-define x86_stdcallcc i32 @DllMain(i8* %module, i32 %reason, i8* %reserved) {
+define x86_stdcallcc i32 @DllMain(ptr %module, i32 %reason, ptr %reserved) {
ret i32 1
}
; Local values used in inline assembly must be specified on the
; llvm.compiler.used so they aren't incorrectly DCE'd during module linking.
-@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 ()* @io_cancel_local_0_4 to i8*)], section "llvm.metadata"
+@llvm.compiler.used = appending global [1 x ptr] [ptr @io_cancel_local_0_4], section "llvm.metadata"
define i32 @io_cancel_0_4() {
; CHECK-DAG: T io_cancel@@LIBAIO_0.4
target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.11.0"
-declare i32 @fprintf(%FILE*, i8*, ...)
+declare i32 @fprintf(ptr, ptr, ...)
%FILE = type { }
; Check fprintf(fp, "%s", str) -> fwrite(str, fp) only when builtins are enabled
-define void @foo(%FILE* %fp) {
- %fmt = getelementptr [3 x i8], [3 x i8]* @percent_s, i32 0, i32 0
- %str = getelementptr [13 x i8], [13 x i8]* @hello_world, i32 0, i32 0
- call i32 (%FILE*, i8*, ...) @fprintf(%FILE* %fp, i8* %fmt, i8* %str)
+define void @foo(ptr %fp) {
+ call i32 (ptr, ptr, ...) @fprintf(ptr %fp, ptr @percent_s, ptr @hello_world)
ret void
}
target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-windows-msvc19.11.0"
-define dso_local i32 @main(i32 %argc, i8** nocapture readnone %argv) local_unnamed_addr {
+define dso_local i32 @main(i32 %argc, ptr nocapture readnone %argv) local_unnamed_addr {
entry:
%conv = sitofp i32 %argc to float
%exp2 = tail call float @llvm.exp2.f32(float %conv)
%CommonStruct = type { i32 }
; The Src module will re-use our DINode for this type.
%Tricky = type opaque
-%Tricky.1 = type { %DstType* }
+%Tricky.1 = type { ptr }
@x = global %DstType zeroinitializer
@foo = internal global %CommonStruct zeroinitializer, !dbg !0
-; That DINode will refer to this value, casted to %Tricky.1* (!11),
+; That DINode will refer to this value, casted to ptr (!11),
; which will then show up in Src's getIdentifiedStructTypes().
@templateValueParam = global i8 0
; Because of the names, we would try to map %Tricky.1 to %Tricky --
; a destination type. Since these types are not in the source module,
; there should be no attempt to create a mapping involving them;
; both types should be left as they are.
-@use = global %Tricky* null
+@use = global ptr null
; Mark %Tricky used.
!llvm.dbg.cu = !{!2}
!8 = !DIDerivedType(tag: DW_TAG_inheritance, scope: !6, baseType: !9)
!9 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "Template<&x>", file: !3, line: 3, size: 8, elements: !4, templateParams: !10, identifier: ".?AU?$Template@$1?x@@3UX@@A@@")
!10 = !{!11}
-!11 = !DITemplateValueParameter(type: !12, value: %Tricky.1* bitcast (i8* @templateValueParam to %Tricky.1*))
+!11 = !DITemplateValueParameter(type: !12, value: ptr @templateValueParam)
!12 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !13, size: 64)
!13 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "X", file: !3, line: 1, size: 8, elements: !4, identifier: ".?AUX@@")
!14 = !{i32 2, !"Debug Info Version", i32 3}
unreachable
}
-define i1 @b(%"T2"*) {
+define i1 @b(ptr) {
unreachable
}
; The reference to @b and T2 that will be loaded in %t0.o
-!7 = !DITemplateValueParameter(value: i1 (%"T2"*)* @b)
+!7 = !DITemplateValueParameter(value: ptr @b)
!8 = distinct !DISubprogram(unit: !2)
; This DICompositeType is uniqued against !5 in Inputs/type-mapping-bug2.ll,
; T2 is the non-opaque struct required to trigger the uniqued T2.0 and T3.0 to
; respectively T2 and T3 in the destination module.
-%"T2" = type { %"T3"* }
+%"T2" = type { ptr }
%"T3" = type opaque
; Use/refer to T2 so it gets added as an IdentifiedStructType.
; The global declaration that causes the assertion when its type is mapped to
; itself incorrectly.
-declare void @d(%"T3"*)
+declare void @d(ptr)
define void @b() {
entry:
- %f.addr = alloca %"T3"*load %"T3"*, %"T3"** %f.addr
+ %f.addr = alloca ptr load ptr, ptr %f.addr
; The call with the getCalledOperand() vs getCalledFunction() mismatch.
- call void @d(%"T3"* %0)
+ call void @d(ptr %0)
unreachable
}
!6 = !{!7}
; The reference to d and T3 that gets loaded into %t0.o
-!7 = !DITemplateValueParameter(value: void (%"T3"*)* @d)
+!7 = !DITemplateValueParameter(value: ptr @d)
target triple = "x86_64-unknown-linux-gnu"
@0 = private global i32 42
-@foo = constant i32* @0
+@foo = constant ptr @0