forked from OSchip/llvm-project
2f40830dde
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 |
||
---|---|---|
.. | ||
apple-version | ||
2003-01-30-LinkerRename.ll | ||
2003-05-31-LinkerRename.ll | ||
ConstantGlobals.ll | ||
PR8300.a.ll | ||
PR8300.b.ll | ||
PR11464.a.ll | ||
PR11464.b.ll | ||
alias.ll | ||
alignment.ll | ||
basiclink.a.ll | ||
basiclink.b.ll | ||
comdat.ll | ||
comdat2.ll | ||
comdat3.ll | ||
comdat4.ll | ||
comdat5.ll | ||
comdat8.ll | ||
constructor-comdat.ll | ||
ctors.ll | ||
datalayout-a.ll | ||
datalayout-b.ll | ||
distinct.ll | ||
drop-debug.bc | ||
ident.a.ll | ||
ident.b.ll | ||
linkage.a.ll | ||
linkage.b.ll | ||
linkage.c.ll | ||
linkage2.ll | ||
mdlocation.ll | ||
metadata-function.ll | ||
module-flags-dont-change-others.ll | ||
module-flags-pic-1-b.ll | ||
module-flags-pic-2-b.ll | ||
old_global_ctors.3.4.bc | ||
opaque.ll | ||
override-different-linkage.ll | ||
override-with-internal-linkage-2.ll | ||
override-with-internal-linkage.ll | ||
override.ll | ||
pr21374.ll | ||
pr22807-1.ll | ||
pr22807-2.ll | ||
redefinition.ll | ||
replaced-function-matches-first-subprogram.ll | ||
subprogram-linkonce-weak.ll | ||
targettriple-a.ll | ||
targettriple-b.ll | ||
targettriple-c.ll | ||
testlink.ll | ||
type-unique-alias.ll | ||
type-unique-dst-types2.ll | ||
type-unique-dst-types3.ll | ||
type-unique-inheritance-a.ll | ||
type-unique-inheritance-b.ll | ||
type-unique-name.ll | ||
type-unique-opaque.ll | ||
type-unique-simple2-a.ll | ||
type-unique-simple2-b.ll | ||
type-unique-unrelated2.ll | ||
type-unique-unrelated3.ll | ||
unique-fwd-decl-b.ll | ||
unique-fwd-decl-order.ll | ||
visibility.ll |