mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[rbi] Add the ability to test in SIL RegionAnalysisValueMap::getTrackableValue().
I also added some basic tests of its functionality. I am doing this in
preparation for making some more invasive changes to getTrackableValue and I
want to be able to test it out very specifically in SIL.
(cherry picked from commit 8f458cd029)
This commit is contained in:
@@ -3887,3 +3887,24 @@ void RegionAnalysis::initialize(SILPassManager *pm) {
|
||||
SILAnalysis *swift::createRegionAnalysis(SILModule *) {
|
||||
return new RegionAnalysis();
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// MARK: Tests
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
namespace swift::test {
|
||||
|
||||
// Arguments:
|
||||
// - SILValue: value to look up isolation for.
|
||||
// Dumps:
|
||||
// - The inferred isolation.
|
||||
static FunctionTest
|
||||
UnderlyingTrackedValue("sil_regionanalysis_underlying_tracked_value",
|
||||
[](auto &function, auto &arguments, auto &test) {
|
||||
RegionAnalysisValueMap valueMap(&function);
|
||||
auto value = arguments.takeValue();
|
||||
auto trackableValue = valueMap.getTrackableValue(value);
|
||||
trackableValue.print(llvm::outs());
|
||||
});
|
||||
|
||||
} // namespace swift::test
|
||||
|
||||
Reference in New Issue
Block a user