Update clang TargetInfo AddressSpace API usage

The TargetInfo pointer APIs updated to taking an "AddressSpace" type
instead of a raw integer. This goes through and updates the call
locations where this change caused build failures. In all cases, the
value passed was `0`, corresponding with the Default AddressSpace.
This commit is contained in:
Evan Wilde
2023-07-24 12:56:27 -07:00
parent f4946e9718
commit ecbccb9310
2 changed files with 19 additions and 18 deletions

View File

@@ -19,6 +19,7 @@
#include "swift/AST/Type.h"
#include "swift/IRGen/IRABIDetailsProvider.h"
#include "swift/IRGen/Linking.h"
#include "clang/Basic/AddressSpaces.h"
#include "clang/Basic/TargetInfo.h"
#include "llvm/ADT/STLExtras.h"
@@ -178,7 +179,7 @@ void printPrimitiveGenericTypeTraits(raw_ostream &os, ASTContext &astContext,
auto &clangTI =
astContext.getClangModuleLoader()->getClangASTContext().getTargetInfo();
bool isSwiftIntLong =
clangTI.getPtrDiffType(0) == clang::TransferrableTargetInfo::SignedLong;
clangTI.getPtrDiffType(clang::LangAS::Default) == clang::TransferrableTargetInfo::SignedLong;
bool isInt64Long =
clangTI.getInt64Type() == clang::TransferrableTargetInfo::SignedLong;
if (!(isSwiftIntLong && !isInt64Long))