Skip to content

Commit 279787e

Browse files
[IRGen] Remove a static variable that caches pointer value
Remove a static variable that caches pointer value from ASTContext that will become invalid if the same process is re-used for compilation using a second ASTContext. This configuration is used under `-enable-deterministic-check` option for output detertiminism checking. rdar://147438789
1 parent 922a01d commit 279787e

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

lib/IRGen/IRGenModule.cpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1428,14 +1428,9 @@ llvm::Module *IRGenModule::getModule() const {
14281428
}
14291429

14301430
bool IRGenModule::IsWellKnownBuiltinOrStructralType(CanType T) const {
1431-
static const CanType kStructural[] = {
1432-
Context.TheEmptyTupleType, Context.TheNativeObjectType,
1433-
Context.TheBridgeObjectType, Context.TheRawPointerType,
1434-
Context.getAnyObjectType()
1435-
};
1436-
1437-
if (std::any_of(std::begin(kStructural), std::end(kStructural),
1438-
[T](const CanType &ST) { return T == ST; }))
1431+
if (T == Context.TheEmptyTupleType || T == Context.TheNativeObjectType ||
1432+
T == Context.TheBridgeObjectType || T == Context.TheRawPointerType ||
1433+
T == Context.getAnyObjectType())
14391434
return true;
14401435

14411436
if (auto IntTy = dyn_cast<BuiltinIntegerType>(T)) {

0 commit comments

Comments
 (0)