llvm-6502/test/Bitcode
David Blaikie 32b845d223 [opaque pointer type] Add textual IR support for explicit type parameter to the call instruction
See r230786 and r230794 for similar changes to gep and load
respectively.

Call is a bit different because it often doesn't have a single explicit
type - usually the type is deduced from the arguments, and just the
return type is explicit. In those cases there's no need to change the
IR.

When that's not the case, the IR usually contains the pointer type of
the first operand - but since typed pointers are going away, that
representation is insufficient so I'm just stripping the "pointerness"
of the explicit type away.

This does make the IR a bit weird - it /sort of/ reads like the type of
the first operand: "call void () %x(" but %x is actually of type "void
()*" and will eventually be just of type "ptr". But this seems not too
bad and I don't think it would benefit from repeating the type
("void (), void () * %x(" and then eventually "void (), ptr %x(") as has
been done with gep and load.

This also has a side benefit: since the explicit type is no longer a
pointer, there's no ambiguity between an explicit type and a function
that returns a function pointer. Previously this case needed an explicit
type (eg: a function returning a void() function was written as
"call void () () * @x(" rather than "call void () * @x(" because of the
ambiguity between a function returning a pointer to a void() function
and a function returning void).

No ambiguity means even function pointer return types can just be
written alone, without writing the whole function's type.

This leaves /only/ the varargs case where the explicit type is required.

Given the special type syntax in call instructions, the regex-fu used
for migration was a bit more involved in its own unique way (as every
one of these is) so here it is. Use it in conjunction with the apply.sh
script and associated find/xargs commands I've provided in rr230786 to
migrate your out of tree tests. Do let me know if any of this doesn't
cover your cases & we can iterate on a more general script/regexes to
help others with out of tree tests.

About 9 test cases couldn't be automatically migrated - half of those
were functions returning function pointers, where I just had to manually
delete the function argument types now that we didn't need an explicit
function type there. The other half were typedefs of function types used
in calls - just had to manually drop the * from those.

import fileinput
import sys
import re

pat = re.compile(r'((?:=|:|^|\s)call\s(?:[^@]*?))(\s*$|\s*(?:(?:\[\[[a-zA-Z0-9_]+\]\]|[@%](?:(")?[\\\?@a-zA-Z0-9_.]*?(?(3)"|)|{{.*}}))(?:\(|$)|undef|inttoptr|bitcast|null|asm).*$)')
addrspace_end = re.compile(r"addrspace\(\d+\)\s*\*$")
func_end = re.compile("(?:void.*|\)\s*)\*$")

def conv(match, line):
  if not match or re.search(addrspace_end, match.group(1)) or not re.search(func_end, match.group(1)):
    return line
  return line[:match.start()] + match.group(1)[:match.group(1).rfind('*')].rstrip() + match.group(2) + line[match.end():]

for line in sys.stdin:
  sys.stdout.write(conv(re.search(pat, line), line))

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235145 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-16 23:24:18 +00:00
..
Inputs Revert "Verify sizes when trying to read a VBR" 2015-04-15 11:10:17 +00:00
2006-12-11-Cast-ConstExpr.ll verify-uselistorder: Force -preserve-bc-use-list-order 2014-08-19 21:08:27 +00:00
2009-06-11-FirstClassAggregateConstant.ll verify-uselistorder: Force -preserve-bc-use-list-order 2014-08-19 21:08:27 +00:00
aggregateInstructions.3.2.ll verify-uselistorder: Force -preserve-bc-use-list-order 2014-08-19 21:08:27 +00:00
aggregateInstructions.3.2.ll.bc Ensure bitcode encoding of instructions and their operands stays stable. 2014-02-26 12:06:36 +00:00
arm32_neon_vcnt_upgrade.ll [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
atomic.ll verify-uselistorder: Force -preserve-bc-use-list-order 2014-08-19 21:08:27 +00:00
attributes-3.3.ll verify-uselistorder: Force -preserve-bc-use-list-order 2014-08-19 21:08:27 +00:00
attributes-3.3.ll.bc
attributes.ll [IR] Introduce a dereferenceable_or_null(N) attribute. 2015-04-16 20:29:50 +00:00
binaryFloatInstructions.3.2.ll verify-uselistorder: Force -preserve-bc-use-list-order 2014-08-19 21:08:27 +00:00
binaryFloatInstructions.3.2.ll.bc Ensure bitcode encoding of instructions and their operands stays stable. 2014-02-26 12:06:36 +00:00
binaryIntInstructions.3.2.ll verify-uselistorder: Force -preserve-bc-use-list-order 2014-08-19 21:08:27 +00:00
binaryIntInstructions.3.2.ll.bc Ensure bitcode encoding of instructions and their operands stays stable. 2014-02-26 12:06:36 +00:00
bitwiseInstructions.3.2.ll verify-uselistorder: Force -preserve-bc-use-list-order 2014-08-19 21:08:27 +00:00
bitwiseInstructions.3.2.ll.bc Ensure bitcode encoding of instructions and their operands stays stable. 2014-02-26 12:06:36 +00:00
blockaddress.ll verify-uselistorder: Force -preserve-bc-use-list-order 2014-08-19 21:08:27 +00:00
calling-conventions.3.2.ll Parse 'ghccc' in .ll files as the GHC convention (cc 10) 2014-12-01 21:04:44 +00:00
calling-conventions.3.2.ll.bc Ensure bitcode encoding of calling conventions stays stable. Patch by Boaz Ouriel. 2013-12-22 07:51:53 +00:00
case-ranges-3.3.ll [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
case-ranges-3.3.ll.bc Revert patches to add case-range support for PR1255. 2013-09-09 19:14:35 +00:00
cmpxchg-upgrade.ll verify-uselistorder: Force -preserve-bc-use-list-order 2014-08-19 21:08:27 +00:00
cmpxchg-upgrade.ll.bc IR: add a second ordering operand to cmpxhg for failure 2014-03-11 10:48:52 +00:00
constantsTest.3.2.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
constantsTest.3.2.ll.bc Ensure bitcode encoding stays stable. 2014-09-23 08:48:01 +00:00
conversionInstructions.3.2.ll Ensure bitcode encoding stays stable. 2014-09-23 08:48:01 +00:00
conversionInstructions.3.2.ll.bc Ensure bitcode encoding stays stable. 2014-09-23 08:48:01 +00:00
drop-debug-info.3.5.ll llvm-dis: Stop crashing when dropping debug info 2015-02-25 01:10:03 +00:00
drop-debug-info.3.5.ll.bc llvm-dis: Stop crashing when dropping debug info 2015-02-25 01:10:03 +00:00
extractelement.ll verify-uselistorder: Force -preserve-bc-use-list-order 2014-08-19 21:08:27 +00:00
flags.ll verify-uselistorder: Force -preserve-bc-use-list-order 2014-08-19 21:08:27 +00:00
function-encoding-rel-operands.ll [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
function-local-metadata.3.5.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
function-local-metadata.3.5.ll.bc IR: Fix bitcode compatability filenames 2014-12-08 00:41:39 +00:00
global-variables.3.2.ll verify-uselistorder: Force -preserve-bc-use-list-order 2014-08-19 21:08:27 +00:00
global-variables.3.2.ll.bc Ensure bitcode encoding of global variable attributes stays stable. Patch by Boaz Ouriel. 2013-12-15 11:50:45 +00:00
highLevelStructure.3.2.ll Make DataLayout Non-Optional in the Module 2015-03-04 18:43:29 +00:00
highLevelStructure.3.2.ll.bc Ensure bitcode encoding stays stable. 2014-09-23 08:48:01 +00:00
inalloca.ll verify-uselistorder: Force -preserve-bc-use-list-order 2014-08-19 21:08:27 +00:00
invalid.ll llvm-dis: Stop crashing when dropping debug info 2015-02-25 01:10:03 +00:00
invalid.ll.bc Use a larger invalid attribute bitcode number 2013-10-31 19:12:36 +00:00
invalid.test Revert "Verify sizes when trying to read a VBR" 2015-04-15 11:10:17 +00:00
linkage-types-3.2.ll Bring r226038 back. 2015-01-19 15:16:06 +00:00
linkage-types-3.2.ll.bc Ensure bitcode encoding of linkage types stays stable. Patch by Boaz Ouriel 2013-12-01 10:16:35 +00:00
local-linkage-default-visibility.3.4.ll verify-uselistorder: Force -preserve-bc-use-list-order 2014-08-19 21:08:27 +00:00
local-linkage-default-visibility.3.4.ll.bc IR: Don't allow non-default visibility on local linkage 2014-05-07 22:57:20 +00:00
mdstring-high-bits.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
memInstructions.3.2.ll [opaque pointer type] Add textual IR support for explicit type parameter to gep operator 2015-03-13 18:20:45 +00:00
memInstructions.3.2.ll.bc Ensure bitcode encoding of instructions and their operands stays stable. 2014-03-02 15:26:36 +00:00
metadata-2.ll [opaque pointer type] Add textual IR support for explicit type parameter to gep operator 2015-03-13 18:20:45 +00:00
metadata.3.5.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
metadata.3.5.ll.bc Bitcode: Add METADATA_NODE and METADATA_VALUE 2014-12-11 23:02:24 +00:00
metadata.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
miscInstructions.3.2.ll [opaque pointer type] Add textual IR support for explicit type parameter to the call instruction 2015-04-16 23:24:18 +00:00
miscInstructions.3.2.ll.bc Ensure bitcode encoding stays stable. 2014-09-23 08:48:01 +00:00
null-type.ll Change BitcodeReader to use error_code instead of bool + string. 2013-11-04 16:16:24 +00:00
null-type.ll.bc
old-aliases.ll [opaque pointer type] Add textual IR support for explicit type parameter to gep operator 2015-03-13 18:20:45 +00:00
old-aliases.ll.bc Fix most of PR10367. 2014-05-16 19:35:39 +00:00
pr18704.ll llvm-dis: Stop crashing when dropping debug info 2015-02-25 01:10:03 +00:00
pr18704.ll.bc All new elements except the last one initialized to NULL. Ideally, once parsing is complete, all elements should be non-NULL. 2014-03-27 12:08:23 +00:00
ptest-new.ll verify-uselistorder: Force -preserve-bc-use-list-order 2014-08-19 21:08:27 +00:00
ptest-old.ll verify-uselistorder: Force -preserve-bc-use-list-order 2014-08-19 21:08:27 +00:00
select.ll verify-uselistorder: Force -preserve-bc-use-list-order 2014-08-19 21:08:27 +00:00
shuffle.ll verify-uselistorder: Force -preserve-bc-use-list-order 2014-08-19 21:08:27 +00:00
ssse3_palignr.ll verify-uselistorder: Force -preserve-bc-use-list-order 2014-08-19 21:08:27 +00:00
standardCIntrinsic.3.2.ll Ensure bitcode encoding stays stable. 2014-09-23 08:48:01 +00:00
standardCIntrinsic.3.2.ll.bc Ensure bitcode encoding stays stable. 2014-09-23 08:48:01 +00:00
tailcall.ll verify-uselistorder: Force -preserve-bc-use-list-order 2014-08-19 21:08:27 +00:00
terminatorInstructions.3.2.ll Ensure bitcode encoding stays stable. 2014-09-23 08:48:01 +00:00
terminatorInstructions.3.2.ll.bc Ensure bitcode encoding stays stable. 2014-09-23 08:48:01 +00:00
upgrade-global-ctors.ll verify-uselistorder: Force -preserve-bc-use-list-order 2014-08-19 21:08:27 +00:00
upgrade-global-ctors.ll.bc Handle ConstantAggregateZero when upgrading global_ctors. 2014-05-17 21:00:22 +00:00
upgrade-loop-metadata.ll [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
upgrade-loop-metadata.ll.bc Add some test files for r211710. 2014-06-25 15:41:39 +00:00
upgrade-tbaa.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
use-list-order.ll [opaque pointer type] Add textual IR support for explicit type parameter to gep operator 2015-03-13 18:20:45 +00:00
variableArgumentIntrinsic.3.2.ll verify-uselistorder: Force -preserve-bc-use-list-order 2014-08-19 21:08:27 +00:00
variableArgumentIntrinsic.3.2.ll.bc Ensure bitcode encoding of instructions and their operands stays stable. 2014-03-02 15:26:36 +00:00
vectorInstructions.3.2.ll verify-uselistorder: Force -preserve-bc-use-list-order 2014-08-19 21:08:27 +00:00
vectorInstructions.3.2.ll.bc Ensure bitcode encoding of instructions and their operands stays stable. 2014-02-26 12:06:36 +00:00
visibility-styles.3.2.ll verify-uselistorder: Force -preserve-bc-use-list-order 2014-08-19 21:08:27 +00:00
visibility-styles.3.2.ll.bc Ensure bitcode encoding of visibility styles stays stable. Patch by Boaz Ouriel. 2013-12-08 11:35:09 +00:00
weak-cmpxchg-upgrade.ll verify-uselistorder: Force -preserve-bc-use-list-order 2014-08-19 21:08:27 +00:00
weak-cmpxchg-upgrade.ll.bc IR: add "cmpxchg weak" variant to support permitted failure. 2014-06-13 14:24:07 +00:00
weak-macho-3.5.ll Bitcode: Don't create comdats when autoupgrading macho bitcode 2015-01-20 05:58:07 +00:00
weak-macho-3.5.ll.bc Bitcode: Don't create comdats when autoupgrading macho bitcode 2015-01-20 05:58:07 +00:00