-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[cxx-interop][stdlib] windows - use new hash inline functions like ot…
…her platforms The PR #77857 added windows-specific workaround for #77856, that happened after #77843. Unfortunately this caused a new issue on windows - #78119. It looks like windows is suffering from a similar serialization issue as libstdc++, although its even more complex as the callAsFunction is not only a derived function from a base class, the base class although has a static call operator. In any case, the libstdc++ callAsFunction deserialization fix should align with the static operator () deserialization too, so for now make windows use the same workaround as other platforms to avoid the deserialization crash (77856). This change was tested on i686 windows too, ensuring that IR verifier crash no longer happens
- Loading branch information
Showing
5 changed files
with
40 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#include <string> | ||
#include <vector> | ||
|
||
struct Item { | ||
std::vector<std::string> keys; | ||
std::vector<std::string> values; | ||
}; | ||
|
||
inline Item get_item() { | ||
return {}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// RUN: %target-run-simple-swift(-I %S/Inputs -cxx-interoperability-mode=default -Xcc -std=c++20 -O) | ||
// | ||
// REQUIRES: executable_test | ||
|
||
// Tests optimizations related to CxxStdlib. | ||
|
||
import StdlibUnittest | ||
import CxxStdlib | ||
import StdStringAndVector | ||
|
||
var StdStringOptTestSuite = TestSuite("StdStringWithOpts") | ||
|
||
StdStringOptTestSuite.test("std::string with Hashable conformance optimized") { | ||
let item = get_item() | ||
let dict = Dictionary(uniqueKeysWithValues: zip(item.keys, item.values).lazy) | ||
|
||
expectEqual(dict.count, 0) | ||
} | ||
|
||
runAllTests() |