Commit Graph

4 Commits

Author SHA1 Message Date
Arnold Schwaighofer
597f8d9e99 Move swift-llvm-opt over to use the new pass manager
rdar://112424659
2023-08-04 07:50:38 -07:00
Arnold Schwaighofer
9ee12db2a9 Fix tests for LLVM change that added anonymous parameter labeling
Fix for r367755.
2019-08-15 14:57:24 -07:00
Michael Gottesman
32805cbd23 [llvm-arc-opts] When RAUWing of bridgeRetain->bridgeRetainN, cast the result of the bridgeRetainN to the type of bridgeRetain.
Since we introduce the declaration for bridgeRetainN, its result type may be out
of sync with bridgeRetain's. This means that when we perform a RAUW of one for
the other, the types do not match and we get an LLVM error. Instead, just cast
the bridgeRetainN's type to bridgeRetain's result type.

rdar://40507281
2018-06-04 13:15:28 -07:00
Michael Gottesman
9d35e973f7 [llvm-arc-opts] If we are missing "swift.{refcounted,bridge}", create it as an opaque structure and don't assert.
Sometimes when running ARCContract on LLVM-IR certain required declarations will
be deleted. This triggers an assert that makes it difficult to work on running
test cases through the pass.

Instead, if we can not find by name the runtime function we are looking for,
recreate the named type as an opaque struct. Since we can not find the function
by name, we can assume that either this is a runtime function that we are the
only passes that create them or that the declarations were dead. Thus, there is
no earlier data, so we can just create a new opaque struct type and use pointers
to that struct_type. If we later need to merge this with another module that did
not delete that type definition, LLVM IR will set the type's body. Since we are
just using pointers to the type, there will be no codegen differences.

rdar://40491584
2018-06-04 13:15:07 -07:00