diff options
| author | David Blaikie <dblaikie@gmail.com> | 2015-09-11 03:22:04 +0000 |
|---|---|---|
| committer | David Blaikie <dblaikie@gmail.com> | 2015-09-11 03:22:04 +0000 |
| commit | 2f40830ddebea58a5b6dcf31fae32651e4bddc8f (patch) | |
| tree | 75b71c6711893e70d9dbaf83762083db89badb0e /llvm/test/DebugInfo | |
| parent | 33b4675b4419da760df111a3eea41af1de36384f (diff) | |
| download | bcm5719-llvm-2f40830ddebea58a5b6dcf31fae32651e4bddc8f.tar.gz bcm5719-llvm-2f40830ddebea58a5b6dcf31fae32651e4bddc8f.zip | |
[opaque pointer type] Add textual IR support for explicit type parameter for global aliases
update.py:
import fileinput
import sys
import re
alias_match_prefix = r"(.*(?:=|:|^)\s*(?:external |)(?:(?:private|internal|linkonce|linkonce_odr|weak|weak_odr|common|appending|extern_weak|available_externally) )?(?:default |hidden |protected )?(?:dllimport |dllexport )?(?:unnamed_addr |)(?:thread_local(?:\([a-z]*\))? )?alias"
plain = re.compile(alias_match_prefix + r" (.*?))(| addrspace\(\d+\) *)\*($| *(?:%|@|null|undef|blockaddress|addrspacecast|\[\[[a-zA-Z]|\{\{).*$)")
cast = re.compile(alias_match_prefix + r") ((?:bitcast|inttoptr|addrspacecast)\s*\(.* to (.*?)(| addrspace\(\d+\) *)\*\)\s*(?:;.*)?$)")
gep = re.compile(alias_match_prefix + r") ((?:getelementptr)\s*(?:inbounds)?\s*\((?P<type>.*), (?P=type)(?:\s*addrspace\(\d+\)\s*)?\* .*\)\s*(?:;.*)?$)")
def conv(line):
m = re.match(cast, line)
if m:
return m.group(1) + " " + m.group(3) + ", " + m.group(2)
m = re.match(gep, line)
if m:
return m.group(1) + " " + m.group(3) + ", " + m.group(2)
m = re.match(plain, line)
if m:
return m.group(1) + ", " + m.group(2) + m.group(3) + "*" + m.group(4) + "\n"
return line
for line in sys.stdin:
sys.stdout.write(conv(line))
apply.sh:
for name in "$@"
do
python3 `dirname "$0"`/update.py < "$name" > "$name.tmp" && mv "$name.tmp" "$name"
rm -f "$name.tmp"
done
The actual commands:
From llvm/src:
find test/ -name *.ll | xargs ./apply.sh
From llvm/src/tools/clang:
find test/ -name *.mm -o -name *.m -o -name *.cpp -o -name *.c | xargs -I '{}' ../../apply.sh "{}"
From llvm/src/tools/polly:
find test/ -name *.ll | xargs ./apply.sh
llvm-svn: 247378
Diffstat (limited to 'llvm/test/DebugInfo')
| -rw-r--r-- | llvm/test/DebugInfo/X86/elf-names.ll | 4 | ||||
| -rw-r--r-- | llvm/test/DebugInfo/X86/pr12831.ll | 4 | ||||
| -rw-r--r-- | llvm/test/DebugInfo/X86/sret.ll | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/llvm/test/DebugInfo/X86/elf-names.ll b/llvm/test/DebugInfo/X86/elf-names.ll index 9010c4f1540..649e3447cf7 100644 --- a/llvm/test/DebugInfo/X86/elf-names.ll +++ b/llvm/test/DebugInfo/X86/elf-names.ll @@ -17,8 +17,8 @@ %class.D = type { i32, i32, i32, i32 } -@_ZN1DC1Ev = alias void (%class.D*)* @_ZN1DC2Ev -@_ZN1DC1ERKS_ = alias void (%class.D*, %class.D*)* @_ZN1DC2ERKS_ +@_ZN1DC1Ev = alias void (%class.D*), void (%class.D*)* @_ZN1DC2Ev +@_ZN1DC1ERKS_ = alias void (%class.D*, %class.D*), void (%class.D*, %class.D*)* @_ZN1DC2ERKS_ define void @_ZN1DC2Ev(%class.D* nocapture %this) unnamed_addr nounwind uwtable align 2 { entry: diff --git a/llvm/test/DebugInfo/X86/pr12831.ll b/llvm/test/DebugInfo/X86/pr12831.ll index 1a1229b0dab..082bb59e294 100644 --- a/llvm/test/DebugInfo/X86/pr12831.ll +++ b/llvm/test/DebugInfo/X86/pr12831.ll @@ -9,8 +9,8 @@ target triple = "x86_64-unknown-linux-gnu" %class.anon = type { i8 } %class.anon.0 = type { i8 } -@"_ZN8functionIFvvEEC1IZN17BPLFunctionWriter9writeExprEvE3$_1_0EET_" = internal alias void (%class.function*)* @"_ZN8functionIFvvEEC2IZN17BPLFunctionWriter9writeExprEvE3$_1_0EET_" -@"_ZN8functionIFvvEEC1IZN17BPLFunctionWriter9writeExprEvE3$_0EET_" = internal alias void (%class.function*)* @"_ZN8functionIFvvEEC2IZN17BPLFunctionWriter9writeExprEvE3$_0EET_" +@"_ZN8functionIFvvEEC1IZN17BPLFunctionWriter9writeExprEvE3$_1_0EET_" = internal alias void (%class.function*), void (%class.function*)* @"_ZN8functionIFvvEEC2IZN17BPLFunctionWriter9writeExprEvE3$_1_0EET_" +@"_ZN8functionIFvvEEC1IZN17BPLFunctionWriter9writeExprEvE3$_0EET_" = internal alias void (%class.function*), void (%class.function*)* @"_ZN8functionIFvvEEC2IZN17BPLFunctionWriter9writeExprEvE3$_0EET_" define void @_ZN17BPLFunctionWriter9writeExprEv(%class.BPLFunctionWriter* %this) nounwind uwtable align 2 { entry: diff --git a/llvm/test/DebugInfo/X86/sret.ll b/llvm/test/DebugInfo/X86/sret.ll index 305fbebd307..da73eb8ddc2 100644 --- a/llvm/test/DebugInfo/X86/sret.ll +++ b/llvm/test/DebugInfo/X86/sret.ll @@ -14,8 +14,8 @@ @_ZTS1A = linkonce_odr constant [3 x i8] c"1A\00" @_ZTI1A = linkonce_odr constant { i8*, i8* } { i8* bitcast (i8** getelementptr inbounds (i8*, i8** @_ZTVN10__cxxabiv117__class_type_infoE, i64 2) to i8*), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @_ZTS1A, i32 0, i32 0) } -@_ZN1AC1Ei = alias void (%class.A*, i32)* @_ZN1AC2Ei -@_ZN1AC1ERKS_ = alias void (%class.A*, %class.A*)* @_ZN1AC2ERKS_ +@_ZN1AC1Ei = alias void (%class.A*, i32), void (%class.A*, i32)* @_ZN1AC2Ei +@_ZN1AC1ERKS_ = alias void (%class.A*, %class.A*), void (%class.A*, %class.A*)* @_ZN1AC2ERKS_ ; Function Attrs: nounwind uwtable define void @_ZN1AC2Ei(%class.A* %this, i32 %i) unnamed_addr #0 align 2 { |

