mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-22 10:24:26 +00:00
[opaque pointer type] Add textual IR support for explicit type parameter to gep operator
Similar to gep (r230786) and load (r230794) changes. Similar migration script can be used to update test cases, which successfully migrated all of LLVM and Polly, but about 4 test cases needed manually changes in Clang. (this script will read the contents of stdin and massage it into stdout - wrap it in the 'apply.sh' script shown in previous commits + xargs to apply it over a large set of test cases) import fileinput import sys import re rep = re.compile(r"(getelementptr(?:\s+inbounds)?\s*\()((<\d*\s+x\s+)?([^@]*?)(|\s*addrspace\(\d+\))\s*\*(?(3)>)\s*)(?=$|%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|zeroinitializer|<|\[\[[a-zA-Z]|\{\{)", re.MULTILINE | re.DOTALL) def conv(match): line = match.group(1) line += match.group(4) line += ", " line += match.group(2) return line line = sys.stdin.read() off = 0 for match in re.finditer(rep, line): sys.stdout.write(line[off:match.start()]) sys.stdout.write(conv(match)) off = match.end() sys.stdout.write(line[off:]) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232184 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -311,7 +311,7 @@ entry:
|
||||
ret void
|
||||
}
|
||||
|
||||
define void @getelementptr({i8, i8}* %s, <4 x i8*> %ptrs, <4 x i64> %offsets ){
|
||||
define void @getelementptr({i8, i8}, {i8, i8}* %s, <4 x i8*> %ptrs, <4 x i64> %offsets ){
|
||||
entry:
|
||||
; CHECK: %res1 = getelementptr { i8, i8 }, { i8, i8 }* %s, i32 1, i32 1
|
||||
%res1 = getelementptr {i8, i8}, {i8, i8}* %s, i32 1, i32 1
|
||||
|
@ -21,7 +21,7 @@
|
||||
%"void*[]" = type { i64, i8** }
|
||||
@_D10ModuleInfo6__vtblZ = external constant %object.ModuleInfo.__vtbl ; <%object.ModuleInfo.__vtbl*> [#uses=1]
|
||||
@.str = internal constant [20 x i8] c"tango.core.BitManip\00" ; <[20 x i8]*> [#uses=1]
|
||||
@_D5tango4core8BitManip8__ModuleZ = global %0 { %object.ModuleInfo.__vtbl* @_D10ModuleInfo6__vtblZ, i8* null, %"byte[]" { i64 19, i8* getelementptr ([20 x i8]* @.str, i32 0, i32 0) }, %1 zeroinitializer, %"ClassInfo[]" zeroinitializer, i32 4, void ()* null, void ()* null, void ()* null, i8* null, void ()* null } ; <%0*> [#uses=1]
|
||||
@_D5tango4core8BitManip8__ModuleZ = global %0 { %object.ModuleInfo.__vtbl* @_D10ModuleInfo6__vtblZ, i8* null, %"byte[]" { i64 19, i8* getelementptr ([20 x i8], [20 x i8]* @.str, i32 0, i32 0) }, %1 zeroinitializer, %"ClassInfo[]" zeroinitializer, i32 4, void ()* null, void ()* null, void ()* null, i8* null, void ()* null } ; <%0*> [#uses=1]
|
||||
@_D5tango4core8BitManip11__moduleRefZ = internal global %ModuleReference { %ModuleReference* null, %object.ModuleInfo* bitcast (%0* @_D5tango4core8BitManip8__ModuleZ to %object.ModuleInfo*) } ; <%ModuleReference*> [#uses=2]
|
||||
@_Dmodule_ref = external global %ModuleReference* ; <%ModuleReference**> [#uses=2]
|
||||
@llvm.global_ctors = appending constant [1 x %2] [%2 { i32 65535, void ()* @_D5tango4core8BitManip16__moduleinfoCtorZ }] ; <[1 x %2]*> [#uses=0]
|
||||
@ -78,7 +78,7 @@ entry:
|
||||
define internal void @_D5tango4core8BitManip16__moduleinfoCtorZ() nounwind {
|
||||
moduleinfoCtorEntry:
|
||||
%current = load %ModuleReference*, %ModuleReference** @_Dmodule_ref ; <%ModuleReference*> [#uses=1]
|
||||
store %ModuleReference* %current, %ModuleReference** getelementptr (%ModuleReference* @_D5tango4core8BitManip11__moduleRefZ, i32 0, i32 0)
|
||||
store %ModuleReference* %current, %ModuleReference** getelementptr (%ModuleReference, %ModuleReference* @_D5tango4core8BitManip11__moduleRefZ, i32 0, i32 0)
|
||||
store %ModuleReference* @_D5tango4core8BitManip11__moduleRefZ, %ModuleReference** @_Dmodule_ref
|
||||
ret void
|
||||
}
|
||||
|
@ -13,8 +13,8 @@
|
||||
@v3 = alias bitcast (i32* @v1 to i16*)
|
||||
; CHECK: @v3 = alias bitcast (i32* @v1 to i16*)
|
||||
|
||||
@v4 = alias getelementptr ([1 x i32]* @v2, i32 0, i32 0)
|
||||
; CHECK: @v4 = alias getelementptr inbounds ([1 x i32]* @v2, i32 0, i32 0)
|
||||
@v4 = alias getelementptr ([1 x i32], [1 x i32]* @v2, i32 0, i32 0)
|
||||
; CHECK: @v4 = alias getelementptr inbounds ([1 x i32], [1 x i32]* @v2, i32 0, i32 0)
|
||||
|
||||
@v5 = alias i32 addrspace(2)* addrspacecast (i32 addrspace(0)* @v1 to i32 addrspace(2)*)
|
||||
; CHECK: @v5 = alias addrspacecast (i32* @v1 to i32 addrspace(2)*)
|
||||
|
@ -1,7 +1,7 @@
|
||||
; RUN: verify-uselistorder < %s
|
||||
|
||||
@a = global [4 x i1] [i1 0, i1 1, i1 0, i1 1]
|
||||
@b = alias i1* getelementptr ([4 x i1]* @a, i64 0, i64 2)
|
||||
@b = alias i1* getelementptr ([4 x i1], [4 x i1]* @a, i64 0, i64 2)
|
||||
|
||||
; Check use-list order of constants used by globals.
|
||||
@glob1 = global i5 7
|
||||
@ -85,7 +85,7 @@ entry:
|
||||
|
||||
define i1 @loada() {
|
||||
entry:
|
||||
%a = load i1, i1* getelementptr ([4 x i1]* @a, i64 0, i64 2)
|
||||
%a = load i1, i1* getelementptr ([4 x i1], [4 x i1]* @a, i64 0, i64 2)
|
||||
ret i1 %a
|
||||
}
|
||||
|
||||
@ -134,11 +134,11 @@ loop2:
|
||||
|
||||
; Check that block addresses work.
|
||||
@ba1 = constant i8* blockaddress (@bafunc1, %bb)
|
||||
@ba2 = constant i8* getelementptr (i8* blockaddress (@bafunc2, %bb), i61 0)
|
||||
@ba3 = constant i8* getelementptr (i8* blockaddress (@bafunc2, %bb), i61 0)
|
||||
@ba2 = constant i8* getelementptr (i8, i8* blockaddress (@bafunc2, %bb), i61 0)
|
||||
@ba3 = constant i8* getelementptr (i8, i8* blockaddress (@bafunc2, %bb), i61 0)
|
||||
|
||||
define i8* @babefore() {
|
||||
ret i8* getelementptr (i8* blockaddress (@bafunc2, %bb), i61 0)
|
||||
ret i8* getelementptr (i8, i8* blockaddress (@bafunc2, %bb), i61 0)
|
||||
bb1:
|
||||
ret i8* blockaddress (@bafunc1, %bb)
|
||||
bb2:
|
||||
|
Reference in New Issue
Block a user