aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Basic/IdentifierTable.cpp
diff options
context:
space:
mode:
authorAbhina Sree <Abhina.Sreeskantharajan@ibm.com>2024-08-08 08:35:22 -0400
committerGitHub <noreply@github.com>2024-08-08 08:35:22 -0400
commit135fecd4441068667ef23f56098befd0c42f89f2 (patch)
treea1d7265fc12e84bab39a8e46bfa7dbc71fc3d172 /clang/lib/Basic/IdentifierTable.cpp
parent7e7a439705f4926a798785579aeb9bfff07049c7 (diff)
downloadllvm-135fecd4441068667ef23f56098befd0c42f89f2.zip
llvm-135fecd4441068667ef23f56098befd0c42f89f2.tar.gz
llvm-135fecd4441068667ef23f56098befd0c42f89f2.tar.bz2
[SystemZ][z/OS] __ptr32 support for z/OS (#101696)
Enabling __ptr32 keyword to support in Clang for z/OS. It is represented by addrspace(1) in LLVM IR. Unlike existing implementation, __ptr32 is not mangled into symbol names for z/OS.
Diffstat (limited to 'clang/lib/Basic/IdentifierTable.cpp')
-rw-r--r--clang/lib/Basic/IdentifierTable.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/clang/lib/Basic/IdentifierTable.cpp b/clang/lib/Basic/IdentifierTable.cpp
index 9cf081e..c9c9d92 100644
--- a/clang/lib/Basic/IdentifierTable.cpp
+++ b/clang/lib/Basic/IdentifierTable.cpp
@@ -107,12 +107,14 @@ enum TokenKey : unsigned {
KEYMSCOMPAT = 0x400000,
KEYSYCL = 0x800000,
KEYCUDA = 0x1000000,
- KEYHLSL = 0x2000000,
- KEYFIXEDPOINT = 0x4000000,
+ KEYZOS = 0x2000000,
+ KEYNOZOS = 0x4000000,
+ KEYHLSL = 0x8000000,
+ KEYFIXEDPOINT = 0x10000000,
KEYMAX = KEYFIXEDPOINT, // The maximum key
KEYALLCXX = KEYCXX | KEYCXX11 | KEYCXX20,
- KEYALL = (KEYMAX | (KEYMAX - 1)) & ~KEYNOMS18 &
- ~KEYNOOPENCL // KEYNOMS18 and KEYNOOPENCL are used to exclude.
+ KEYALL = (KEYMAX | (KEYMAX - 1)) & ~KEYNOMS18 & ~KEYNOOPENCL &
+ ~KEYNOZOS // KEYNOMS18, KEYNOOPENCL, KEYNOZOS are excluded.
};
/// How a keyword is treated in the selected standard. This enum is ordered
@@ -199,6 +201,8 @@ static KeywordStatus getKeywordStatusHelper(const LangOptions &LangOpts,
return LangOpts.isSYCL() ? KS_Enabled : KS_Unknown;
case KEYCUDA:
return LangOpts.CUDA ? KS_Enabled : KS_Unknown;
+ case KEYZOS:
+ return LangOpts.ZOSExt ? KS_Enabled : KS_Unknown;
case KEYHLSL:
return LangOpts.HLSL ? KS_Enabled : KS_Unknown;
case KEYNOCXX:
@@ -206,9 +210,8 @@ static KeywordStatus getKeywordStatusHelper(const LangOptions &LangOpts,
// reasons as well.
return LangOpts.CPlusPlus ? KS_Unknown : KS_Enabled;
case KEYNOOPENCL:
- // The disable behavior for this is handled in getKeywordStatus.
- return KS_Unknown;
case KEYNOMS18:
+ case KEYNOZOS:
// The disable behavior for this is handled in getKeywordStatus.
return KS_Unknown;
case KEYFIXEDPOINT:
@@ -230,7 +233,8 @@ static KeywordStatus getKeywordStatus(const LangOptions &LangOpts,
if (LangOpts.MSVCCompat && (Flags & KEYNOMS18) &&
!LangOpts.isCompatibleWithMSVC(LangOptions::MSVC2015))
return KS_Disabled;
-
+ if (LangOpts.ZOSExt && (Flags & KEYNOZOS))
+ return KS_Disabled;
KeywordStatus CurStatus = KS_Unknown;
while (Flags != 0) {