swift
swift copied to clipboard
Enable usage of LLVM's opaque pointer
This PR enables usage of LLVM's opaque pointer type ptr
during LLVM IR code generation (instead of usage of typed pointers e.g. i64 *
).
I have added a %use_no_opaque_pointers
substitution for tests which will expand to the clang frontend flag (-Xcc -Xclang -Xcc -no-opaque-pointers
) which disables opaque pointers.
Example usage:
%target-swift-frontend %use_no_opaque_pointers -emit-ir %s | %FileCheck %s
This substitution can be used to run tests under the -no-opaque-pointers option.
All LLVM IR checking tests are moved to use this option to keep them passing. An invocation without the %FileCheck
command was added to verify that the test does not crash.
-// RUN: %target-swift-frontend -parse-stdlib %s -emit-ir | %FileCheck %s
+// RUN: %target-swift-frontend %use_no_opaque_pointers -parse-stdlib %s -emit-ir | %FileCheck %s
+// RUN: %target-swift-frontend -parse-stdlib %s -emit-ir
This approach should facilitate incrementally moving the test to use opaque pointers.
rdar://108891584
@swift-ci test
We will need a newer version of Xcode, the version installed on the build has a libtool/ar binary that does not support opaque pointers in bitcode.
@swift-ci test linux
An invocation without the %FileCheck command was added to verify that the test does not crash.
Just to double check, as the tests are ported, should we also remove this line?
An invocation without the %FileCheck command was added to verify that the test does not crash.
Just to double check, as the tests are ported, should we also remove this line?
@felipepiovezan Yes please.
This PR will require Xcode 14.3 to pass all tests on macOS. This is due to the usage of bitcode files containing opaque pointers and tools in Xcode prior to 14.3 did not support opaque pointers.
@swift-ci test windows
@swift-ci test
@swift-ci test windows
@swift-ci test windows
@swift-ci test windows
@swift-ci test windows
@swift-ci test windows
@swift-ci test windows
@swift-ci test macos
@swift-ci test linux
@swift-ci test
@swift-ci test
@swift-ci test
Please test with following PR: https://github.com/apple/llvm-project/pull/6923 @swift-ci test
Please test with following PR: https://github.com/apple/llvm-project/pull/6923 @swift-ci test
@swift-ci test