Skip to content

Commit d4a5947

Browse files
authored
Merge branch 'main' into ConstExprFlatCast
2 parents eff333a + d3caae1 commit d4a5947

File tree

7 files changed

+66
-55
lines changed

7 files changed

+66
-55
lines changed

clang/include/clang/Basic/IdentifierTable.h

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,57 @@ class LangOptions;
4646
class MultiKeywordSelector;
4747
class SourceLocation;
4848

49+
/// Constants for TokenKinds.def
50+
enum TokenKey : unsigned {
51+
KEYC99 = 0x1,
52+
KEYCXX = 0x2,
53+
KEYCXX11 = 0x4,
54+
KEYGNU = 0x8,
55+
KEYMS = 0x10,
56+
BOOLSUPPORT = 0x20,
57+
KEYALTIVEC = 0x40,
58+
KEYNOCXX = 0x80,
59+
KEYBORLAND = 0x100,
60+
KEYOPENCLC = 0x200,
61+
KEYC23 = 0x400,
62+
KEYNOMS18 = 0x800,
63+
KEYNOOPENCL = 0x1000,
64+
WCHARSUPPORT = 0x2000,
65+
HALFSUPPORT = 0x4000,
66+
CHAR8SUPPORT = 0x8000,
67+
KEYOBJC = 0x10000,
68+
KEYZVECTOR = 0x20000,
69+
KEYCOROUTINES = 0x40000,
70+
KEYMODULES = 0x80000,
71+
KEYCXX20 = 0x100000,
72+
KEYOPENCLCXX = 0x200000,
73+
KEYMSCOMPAT = 0x400000,
74+
KEYSYCL = 0x800000,
75+
KEYCUDA = 0x1000000,
76+
KEYZOS = 0x2000000,
77+
KEYNOZOS = 0x4000000,
78+
KEYHLSL = 0x8000000,
79+
KEYFIXEDPOINT = 0x10000000,
80+
KEYMAX = KEYFIXEDPOINT, // The maximum key
81+
KEYALLCXX = KEYCXX | KEYCXX11 | KEYCXX20,
82+
KEYALL = (KEYMAX | (KEYMAX - 1)) & ~KEYNOMS18 & ~KEYNOOPENCL &
83+
~KEYNOZOS // KEYNOMS18, KEYNOOPENCL, KEYNOZOS are excluded.
84+
};
85+
86+
/// How a keyword is treated in the selected standard. This enum is ordered
87+
/// intentionally so that the value that 'wins' is the most 'permissive'.
88+
enum KeywordStatus {
89+
KS_Unknown, // Not yet calculated. Used when figuring out the status.
90+
KS_Disabled, // Disabled
91+
KS_Future, // Is a keyword in future standard
92+
KS_Extension, // Is an extension
93+
KS_Enabled, // Enabled
94+
};
95+
96+
/// Translates flags as specified in TokenKinds.def into keyword status
97+
/// in the given language standard.
98+
KeywordStatus getKeywordStatus(const LangOptions &LangOpts, unsigned Flags);
99+
49100
enum class ReservedIdentifierStatus {
50101
NotReserved = 0,
51102
StartsWithUnderscoreAtGlobalScope,

clang/lib/Basic/IdentifierTable.cpp

Lines changed: 1 addition & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -77,57 +77,6 @@ IdentifierTable::IdentifierTable(const LangOptions &LangOpts,
7777
// Language Keyword Implementation
7878
//===----------------------------------------------------------------------===//
7979

80-
// Constants for TokenKinds.def
81-
namespace {
82-
83-
enum TokenKey : unsigned {
84-
KEYC99 = 0x1,
85-
KEYCXX = 0x2,
86-
KEYCXX11 = 0x4,
87-
KEYGNU = 0x8,
88-
KEYMS = 0x10,
89-
BOOLSUPPORT = 0x20,
90-
KEYALTIVEC = 0x40,
91-
KEYNOCXX = 0x80,
92-
KEYBORLAND = 0x100,
93-
KEYOPENCLC = 0x200,
94-
KEYC23 = 0x400,
95-
KEYNOMS18 = 0x800,
96-
KEYNOOPENCL = 0x1000,
97-
WCHARSUPPORT = 0x2000,
98-
HALFSUPPORT = 0x4000,
99-
CHAR8SUPPORT = 0x8000,
100-
KEYOBJC = 0x10000,
101-
KEYZVECTOR = 0x20000,
102-
KEYCOROUTINES = 0x40000,
103-
KEYMODULES = 0x80000,
104-
KEYCXX20 = 0x100000,
105-
KEYOPENCLCXX = 0x200000,
106-
KEYMSCOMPAT = 0x400000,
107-
KEYSYCL = 0x800000,
108-
KEYCUDA = 0x1000000,
109-
KEYZOS = 0x2000000,
110-
KEYNOZOS = 0x4000000,
111-
KEYHLSL = 0x8000000,
112-
KEYFIXEDPOINT = 0x10000000,
113-
KEYMAX = KEYFIXEDPOINT, // The maximum key
114-
KEYALLCXX = KEYCXX | KEYCXX11 | KEYCXX20,
115-
KEYALL = (KEYMAX | (KEYMAX - 1)) & ~KEYNOMS18 & ~KEYNOOPENCL &
116-
~KEYNOZOS // KEYNOMS18, KEYNOOPENCL, KEYNOZOS are excluded.
117-
};
118-
119-
/// How a keyword is treated in the selected standard. This enum is ordered
120-
/// intentionally so that the value that 'wins' is the most 'permissive'.
121-
enum KeywordStatus {
122-
KS_Unknown, // Not yet calculated. Used when figuring out the status.
123-
KS_Disabled, // Disabled
124-
KS_Future, // Is a keyword in future standard
125-
KS_Extension, // Is an extension
126-
KS_Enabled, // Enabled
127-
};
128-
129-
} // namespace
130-
13180
// This works on a single TokenKey flag and checks the LangOpts to get the
13281
// KeywordStatus based exclusively on this flag, so that it can be merged in
13382
// getKeywordStatus. Most should be enabled/disabled, but some might imply
@@ -220,9 +169,7 @@ static KeywordStatus getKeywordStatusHelper(const LangOptions &LangOpts,
220169
}
221170
}
222171

223-
/// Translates flags as specified in TokenKinds.def into keyword status
224-
/// in the given language standard.
225-
static KeywordStatus getKeywordStatus(const LangOptions &LangOpts,
172+
KeywordStatus clang::getKeywordStatus(const LangOptions &LangOpts,
226173
unsigned Flags) {
227174
// KEYALL means always enabled, so special case this one.
228175
if (Flags == KEYALL) return KS_Enabled;

llvm/lib/CodeGen/AtomicExpandPass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1691,7 +1691,7 @@ Value *AtomicExpandImpl::insertRMWCmpXchgLoop(
16911691
// Atomic RMW expands to a cmpxchg loop, Since precise branch weights
16921692
// cannot be easily determined here, we mark the branch as "unknown" (50/50)
16931693
// to prevent misleading optimizations.
1694-
setExplicitlyUnknownBranchWeightsIfProfiled(*CondBr, *F, DEBUG_TYPE);
1694+
setExplicitlyUnknownBranchWeightsIfProfiled(*CondBr, DEBUG_TYPE);
16951695

16961696
Builder.SetInsertPoint(ExitBB, ExitBB->begin());
16971697
return NewLoaded;

llvm/lib/Target/PowerPC/PPCInstrFuture.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,9 @@ let Predicates = [HasVSX, IsISAFuture] in {
420420
: VXForm_VRTAB5<323, (outs vrrc:$VRT), (ins vrrc:$VRA, vrrc:$VRB),
421421
"vucmprlh $VRT, $VRA, $VRB", []>;
422422

423+
def XVRLW: XX3Form_XTAB6<60, 184, (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB),
424+
"xvrlw $XT, $XA, $XB", []>;
425+
423426
// AES Acceleration Instructions
424427
def XXAESENCP : XX3Form_XTABp5_M2<194, (outs vsrprc:$XTp),
425428
(ins vsrprc:$XAp, vsrprc:$XBp, u2imm:$M),

llvm/test/MC/Disassembler/PowerPC/ppc-encoding-ISAFuture.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,9 @@
250250
#CHECK: vucmprhh 1, 3, 6
251251
0x10,0x23,0x31,0x03
252252

253+
#CHECK: xvrlw 34, 15, 16
254+
0xf0,0x4f,0x85,0xc1
255+
253256
#CHECK: xxaes192encp 8, 10, 14
254257
0xf1,0x0b,0x76,0x10
255258

llvm/test/MC/Disassembler/PowerPC/ppc64le-encoding-ISAFuture.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,9 @@
244244
#CHECK: vucmprhh 1, 3, 6
245245
0x03,0x31,0x23,0x10
246246

247+
#CHECK: xvrlw 34, 15, 16
248+
0xc1,0x85,0x4f,0xf0
249+
247250
#CHECK: xxaes192encp 8, 10, 14
248251
0x10,0x76,0x0b,0xf1
249252

llvm/test/MC/PowerPC/ppc-encoding-ISAFuture.s

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,10 @@
355355
#CHECK-BE: vucmprhh 1, 3, 6 # encoding: [0x10,0x23,0x31,0x03]
356356
#CHECK-LE: vucmprhh 1, 3, 6 # encoding: [0x03,0x31,0x23,0x10]
357357

358+
xvrlw 34, 15, 16
359+
#CHECK-BE: xvrlw 34, 15, 16 # encoding: [0xf0,0x4f,0x85,0xc1]
360+
#CHECK-LE: xvrlw 34, 15, 16 # encoding: [0xc1,0x85,0x4f,0xf0]
361+
358362
xxaes192encp 8, 10, 14
359363
#CHECK-BE: xxaes192encp 8, 10, 14 # encoding: [0xf1,0x0b,0x76,0x10]
360364
#CHECK-LE: xxaes192encp 8, 10, 14 # encoding: [0x10,0x76,0x0b,0xf1]

0 commit comments

Comments
 (0)