mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
This allows the usage of the whole remark infrastructure developed in LLVM, which includes a new binary format, metadata in object files, etc. This gets rid of the YAMLTraits-based remark serialization and does the plumbing for hooking to LLVM's main remark streamer. For more about the idea behind LLVM's main remark streamer, see the docs/Remarks.rst changes in https://reviews.llvm.org/D73676. The flags are now: * -save-optimization-record: enable remarks, defaults to YAML * -save-optimization-record=<format>: enable remarks, use <format> for serialization * -save-optimization-record-passes <regex>: only serialize passes that match <regex>. The YAMLTraits in swift had a different `flow` setting for the debug location, resulting in some test changes.
21 lines
1.3 KiB
Swift
21 lines
1.3 KiB
Swift
// RUN: not %target-swiftc_driver -wmo -save-optimization-record=unknown %s -module-name optrecordmod -o /dev/null 2>&1 | %FileCheck --check-prefix=ERROR-FORMAT %s
|
|
// ERROR-FORMAT: error while creating remark serializer: 'Unknown remark format: 'unknown''
|
|
|
|
// RUN: %target-swiftc_driver -wmo -save-optimization-record %s -module-name optrecordmod -o /dev/null 2>&1 -### | %FileCheck --check-prefix=YAML-PATH %s
|
|
// RUN: %target-swiftc_driver -wmo -save-optimization-record=yaml %s -module-name optrecordmod -o /dev/null 2>&1 -### | %FileCheck --check-prefix=YAML-PATH %s
|
|
// YAML-PATH: -save-optimization-record-path {{.*}}optrecordmod.opt.yaml
|
|
|
|
// RUN: %target-swiftc_driver -wmo -save-optimization-record=bitstream %s -module-name optrecordmod -o /dev/null 2>&1 -### | %FileCheck --check-prefix=BITSTREAM-PATH %s
|
|
// BITSTREAM-PATH: -save-optimization-record=bitstream
|
|
// BITSTREAM-PATH: -save-optimization-record-path {{.*}}optrecordmod.opt.bitstream
|
|
|
|
// RUN: %target-swiftc_driver -wmo -save-optimization-record -save-optimization-record-passes sil-inliner %s -module-name optrecordmod -o /dev/null 2>&1 -### | %FileCheck --check-prefix=FILTER-PASS %s
|
|
// FILTER-PASS: -save-optimization-record-passes sil-inliner
|
|
|
|
var a: Int = 1
|
|
#sourceLocation(file: "custom.swift", line: 2000)
|
|
func foo() {
|
|
a = 2
|
|
}
|
|
#sourceLocation() // reset
|