Skip to content

Commit 920616f

Browse files
author
z1_cciauto
authored
merge main into amd-staging (llvm#2343)
2 parents 4b4a00d + 84b66f1 commit 920616f

File tree

11 files changed

+174
-86
lines changed

11 files changed

+174
-86
lines changed

.github/workflows/containers/github-action-ci-windows/Dockerfile

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -39,33 +39,15 @@ RUN regsvr32 /S "C:\BuildTools\DIA SDK\bin\amd64\msdia140.dll" & \
3939

4040
# install tools as described in https://llvm.org/docs/GettingStartedVS.html
4141
# and a few more that were not documented...
42-
RUN choco install -y ninja git
42+
RUN choco install -y ninja git sccache
4343
# Pin an older version of Python; the current Python 3.10 fails when
4444
# doing "pip install" for the other dependencies, as it fails to find libxml
4545
# while compiling some package.
4646
RUN choco install -y python3 --version 3.9.7
4747

48-
# ActivePerl is currently not installable via Chocolatey, see
49-
# http://disq.us/p/2ipditb. Install StrawberryPerl instead. Unfortunately,
50-
# StrawberryPerl not only installs Perl, but also a redundant C/C++ compiler
51-
# toolchain, and a copy of pkg-config which can cause misdetections for other
52-
# built products, see
53-
# https://github.com/StrawberryPerl/Perl-Dist-Strawberry/issues/11 for further
54-
# details. Remove the redundant and unnecessary parts of the StrawberryPerl
55-
# install.
56-
RUN choco install -y strawberryperl && \
57-
rmdir /q /s c:\strawberry\c && \
58-
del /q c:\strawberry\perl\bin\pkg-config*
59-
60-
# libcxx requires clang(-cl) to be available
61-
RUN choco install -y sccache llvm
48+
# Testing requires psutil
6249
RUN pip install psutil
6350

64-
RUN curl -LO https://github.com/mstorsjo/llvm-mingw/releases/download/20230320/llvm-mingw-20230320-ucrt-x86_64.zip && \
65-
powershell Expand-Archive llvm-mingw-*-ucrt-x86_64.zip -DestinationPath . && \
66-
del llvm-mingw-*-ucrt-x86_64.zip && \
67-
ren llvm-mingw-20230320-ucrt-x86_64 llvm-mingw
68-
6951
# configure Python encoding
7052
ENV PYTHONIOENCODING=UTF-8
7153

@@ -103,11 +85,6 @@ RUN powershell -Command \
10385
RUN git config --system core.longpaths true & \
10486
git config --global core.autocrlf false
10587
106-
# handle for debugging of files beeing locked by some processes.
107-
RUN choco install -y handle
108-
109-
RUN pip3 install pywin32 buildbot-worker==2.8.4
110-
11188
ARG RUNNER_VERSION=2.324.0
11289
ENV RUNNER_VERSION=$RUNNER_VERSION
11390

clang/include/clang/Driver/Options.td

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5671,9 +5671,9 @@ def mlamcas : Flag<["-"], "mlamcas">, Group<m_loongarch_Features_Group>,
56715671
def mno_lamcas : Flag<["-"], "mno-lamcas">, Group<m_loongarch_Features_Group>,
56725672
HelpText<"Disable amcas[_db].{b/h/w/d}">;
56735673
def mld_seq_sa : Flag<["-"], "mld-seq-sa">, Group<m_loongarch_Features_Group>,
5674-
HelpText<"Do not generate load-load barrier instructions (dbar 0x700)">;
5674+
HelpText<"Do not generate same-address load-load barrier instructions (dbar 0x700)">;
56755675
def mno_ld_seq_sa : Flag<["-"], "mno-ld-seq-sa">, Group<m_loongarch_Features_Group>,
5676-
HelpText<"Generate load-load barrier instructions (dbar 0x700)">;
5676+
HelpText<"Generate same-address load-load barrier instructions (dbar 0x700)">;
56775677
def mdiv32 : Flag<["-"], "mdiv32">, Group<m_loongarch_Features_Group>,
56785678
HelpText<"Use div.w[u] and mod.w[u] instructions with input not sign-extended.">;
56795679
def mno_div32 : Flag<["-"], "mno-div32">, Group<m_loongarch_Features_Group>,
@@ -6831,8 +6831,12 @@ def mapx_features_EQ : CommaJoined<["-"], "mapx-features=">, Group<m_x86_Feature
68316831
HelpText<"Enable features of APX">, Values<"egpr,push2pop2,ppx,ndd,ccmp,nf,cf,zu">, Visibility<[ClangOption, CLOption, FlangOption]>;
68326832
def mno_apx_features_EQ : CommaJoined<["-"], "mno-apx-features=">, Group<m_x86_Features_Group>,
68336833
HelpText<"Disable features of APX">, Values<"egpr,push2pop2,ppx,ndd,ccmp,nf,cf,zu">, Visibility<[ClangOption, CLOption, FlangOption]>;
6834-
def mapxf : Flag<["-"], "mapxf">, Alias<mapx_features_EQ>, AliasArgs<["egpr","push2pop2","ppx","ndd","ccmp","nf","cf","zu"]>;
6835-
def mno_apxf : Flag<["-"], "mno-apxf">, Alias<mno_apx_features_EQ>, AliasArgs<["egpr","push2pop2","ppx","ndd","ccmp","nf","cf","zu"]>;
6834+
def mapxf : Flag<["-"], "mapxf">, Alias<mapx_features_EQ>,
6835+
AliasArgs<["egpr","push2pop2","ppx","ndd","ccmp","nf","cf","zu"]>,
6836+
Group<m_x86_Features_Group>;
6837+
def mno_apxf : Flag<["-"], "mno-apxf">, Alias<mno_apx_features_EQ>,
6838+
AliasArgs<["egpr","push2pop2","ppx","ndd","ccmp","nf","cf","zu"]>,
6839+
Group<m_x86_Features_Group>;
68366840
def mapx_inline_asm_use_gpr32 : Flag<["-"], "mapx-inline-asm-use-gpr32">, Group<m_Group>,
68376841
HelpText<"Enable use of GPR32 in inline assembly for APX">;
68386842
} // let Flags = [TargetSpecific]

clang/lib/Format/FormatTokenLexer.cpp

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,36 @@ bool FormatTokenLexer::canPrecedeRegexLiteral(FormatToken *Prev) {
694694
return true;
695695
}
696696

697+
void FormatTokenLexer::tryParseJavaTextBlock() {
698+
if (FormatTok->TokenText != "\"\"")
699+
return;
700+
701+
const auto *S = Lex->getBufferLocation();
702+
const auto *End = Lex->getBuffer().end();
703+
704+
if (S == End || *S != '\"')
705+
return;
706+
707+
++S; // Skip the `"""` that begins a text block.
708+
709+
// Find the `"""` that ends the text block.
710+
for (int Count = 0; Count < 3 && S < End; ++S) {
711+
switch (*S) {
712+
case '\\':
713+
Count = -1;
714+
break;
715+
case '\"':
716+
++Count;
717+
break;
718+
default:
719+
Count = 0;
720+
}
721+
}
722+
723+
// Ignore the possibly invalid text block.
724+
resetLexer(SourceMgr.getFileOffset(Lex->getSourceLocation(S)));
725+
}
726+
697727
// Tries to parse a JavaScript Regex literal starting at the current token,
698728
// if that begins with a slash and is in a location where JavaScript allows
699729
// regex literals. Changes the current token to a regex literal and updates
@@ -1374,6 +1404,8 @@ FormatToken *FormatTokenLexer::getNextToken() {
13741404
FormatTok->TokenText = FormatTok->TokenText.substr(0, 1);
13751405
++Column;
13761406
StateStack.push(LexerState::TOKEN_STASHED);
1407+
} else if (Style.isJava() && FormatTok->is(tok::string_literal)) {
1408+
tryParseJavaTextBlock();
13771409
}
13781410

13791411
if (Style.isVerilog() && Tokens.size() > 0 &&

clang/lib/Format/FormatTokenLexer.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ class FormatTokenLexer {
7272

7373
bool canPrecedeRegexLiteral(FormatToken *Prev);
7474

75+
void tryParseJavaTextBlock();
76+
7577
// Tries to parse a JavaScript Regex literal starting at the current token,
7678
// if that begins with a slash and is in a location where JavaScript allows
7779
// regex literals. Changes the current token to a regex literal and updates

clang/lib/Sema/SemaTypeTraits.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,7 @@ static bool EvaluateUnaryTypeTrait(Sema &Self, TypeTrait UTT,
836836
// GCC[1] and the Embarcadero C++ compiler[2], and Clang implements those
837837
// specifications.
838838
//
839-
// 1: http://gcc.gnu/.org/onlinedocs/gcc/Type-Traits.html
839+
// 1: http://gcc.gnu.org/onlinedocs/gcc/Type-Traits.html
840840
// 2:
841841
// http://docwiki.embarcadero.com/RADStudio/XE/en/Type_Trait_Functions_(C%2B%2B0x)_Index
842842
//

clang/test/Driver/cl-x86-flags.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,3 +135,16 @@
135135

136136
void f(void) {
137137
}
138+
139+
140+
// RUN: not %clang_cl -### --target=i386 -mapx-features=ndd %s 2>&1 | FileCheck --check-prefix=NON-APX %s
141+
// RUN: not %clang_cl -### --target=i386 -mapxf %s 2>&1 | FileCheck --check-prefix=NON-APX %s
142+
// RUN: %clang_cl -### --target=i386 -mno-apxf %s 2>&1 > /dev/null
143+
// NON-APX: error: unsupported option '-mapx-features=|-mapxf' for target 'i386'
144+
// NON-APX-NOT: error: {{.*}} -mapx-features=
145+
146+
// RUN: %clang_cl --target=x86_64-pc-windows -mapxf %s -### 2>&1 | FileCheck -check-prefix=APXF %s
147+
// RUN: %clang_cl --target=x86_64-pc-windows -mapxf -mno-apxf %s -### 2>&1 | FileCheck -check-prefix=NO-APXF %s
148+
// RUN: %clang_cl --target=x86_64-pc-windows -mapx-features=egpr,push2pop2,ppx,ndd,ccmp,nf,cf,zu %s -### 2>&1 | FileCheck -check-prefix=APXF %s
149+
// APXF: "-target-feature" "+egpr" "-target-feature" "+push2pop2" "-target-feature" "+ppx" "-target-feature" "+ndd" "-target-feature" "+ccmp" "-target-feature" "+nf" "-target-feature" "+cf" "-target-feature" "+zu"
150+
// NO-APXF: "-target-feature" "-egpr" "-target-feature" "-push2pop2" "-target-feature" "-ppx" "-target-feature" "-ndd" "-target-feature" "-ccmp" "-target-feature" "-nf" "-target-feature" "-cf" "-target-feature" "-zu"

0 commit comments

Comments
 (0)