Skip to content

Commit b7dbc44

Browse files
authored
merge main into amd-staging (llvm#1965)
2 parents 810f4f7 + dba74a5 commit b7dbc44

35 files changed

+184
-346
lines changed

clang/lib/CIR/CodeGen/CIRGenExprConstant.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,10 @@ class ConstExprEmitter
9090
}
9191

9292
mlir::Attribute VisitCastExpr(CastExpr *e, QualType destType) {
93-
if (const auto *ece = dyn_cast<ExplicitCastExpr>(e))
93+
if (isa<ExplicitCastExpr>(e))
9494
cgm.errorNYI(e->getBeginLoc(),
9595
"ConstExprEmitter::VisitCastExpr explicit cast");
96+
9697
Expr *subExpr = e->getSubExpr();
9798

9899
switch (e->getCastKind()) {

clang/lib/Format/TokenAnnotator.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3103,10 +3103,14 @@ class AnnotatingParser {
31033103
// Or expressions like:
31043104
// width * height * length
31053105
if (NextToken->Tok.isAnyIdentifier()) {
3106-
const FormatToken *NextNextToken = NextToken->getNextNonComment();
3107-
if (NextNextToken && (NextNextToken->is(tok::arrow) ||
3108-
NextNextToken->isPointerOrReference())) {
3109-
return TT_BinaryOperator;
3106+
auto *NextNextToken = NextToken->getNextNonComment();
3107+
if (NextNextToken) {
3108+
if (NextNextToken->is(tok::arrow))
3109+
return TT_BinaryOperator;
3110+
if (NextNextToken->isPointerOrReference()) {
3111+
NextNextToken->setFinalizedType(TT_BinaryOperator);
3112+
return TT_BinaryOperator;
3113+
}
31103114
}
31113115
}
31123116

clang/tools/clang-shlib/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ endif()
5757

5858
# Optimize function calls for default visibility definitions to avoid PLT and
5959
# reduce dynamic relocations.
60-
if (NOT APPLE AND NOT MINGW AND NOT LLVM_LINKER_IS_SOLARISLD_ILLUMOS)
60+
if (NOT APPLE AND NOT MINGW AND NOT CYGWIN AND NOT LLVM_LINKER_IS_SOLARISLD_ILLUMOS)
6161
target_link_options(clang-cpp PRIVATE LINKER:-Bsymbolic-functions)
6262
endif()
6363
if (MINGW OR CYGWIN)

clang/unittests/Format/TokenAnnotatorTest.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,11 @@ TEST_F(TokenAnnotatorTest, UnderstandsUsesOfStarAndAmp) {
406406
ASSERT_EQ(Tokens.size(), 16u) << Tokens;
407407
EXPECT_TOKEN(Tokens[9], tok::star, TT_BinaryOperator);
408408
EXPECT_TOKEN(Tokens[11], tok::star, TT_BinaryOperator);
409+
410+
Tokens = annotate("float foo[3] = {M * H * H, H * M * H, H * H * M};");
411+
ASSERT_EQ(Tokens.size(), 27u) << Tokens;
412+
EXPECT_TOKEN(Tokens[16], tok::star, TT_BinaryOperator);
413+
EXPECT_TOKEN(Tokens[22], tok::star, TT_BinaryOperator);
409414
}
410415

411416
TEST_F(TokenAnnotatorTest, UnderstandsUsesOfPlusAndMinus) {

libc/cmake/modules/LLVMLibCTestRules.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ function(create_libc_unittest fq_target_name)
321321
${fq_target_name}
322322
COMMAND ${LIBC_UNITTEST_ENV} ${CMAKE_CROSSCOMPILING_EMULATOR} ${fq_build_target_name}
323323
COMMENT "Running unit test ${fq_target_name}"
324+
DEPENDS ${fq_build_target_name}
324325
)
325326
endif()
326327

lld/test/ELF/sparcv9-reloc.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# REQUIRES: sparc
22
# RUN: llvm-mc -filetype=obj -triple=sparcv9 %s -o %t.o
33
# RUN: ld.lld %t.o --defsym=a=0x0123456789ABCDEF --defsym=b=0x0123456789A --defsym=c=0x01234567 -o %t
4-
# RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s
4+
# RUN: llvm-objdump -d --no-show-raw-insn --no-print-imm-hex %t | FileCheck %s
55
# RUN: llvm-objdump -s %t | FileCheck --check-prefix=HEX %s
66

77
## R_SPARC_HH22, R_SPARC_HM10

lld/test/ELF/sparcv9-tls-le.s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
## %hix(@tpoff(a)) = ~(st_value(a) - 1026) >> 10 = 1
77
## %lo(@tpoff(a)) = (st_value(a) - 1026) & 0x3ff | 0x1c00 = -2 (0x1ffe)
8-
# LE: sethi 1, %o0
9-
# LE-NEXT: xor %o0, -2, %o0
8+
# LE: sethi 0x1, %o0
9+
# LE-NEXT: xor %o0, -0x2, %o0
1010
sethi %tle_hix22(a), %o0
1111
xor %o0, %tle_lox10(a), %o0
1212

llvm/CMakeLists.txt

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,7 @@ endif()
9292

9393
set(CMAKE_CXX_STANDARD ${LLVM_REQUIRED_CXX_STANDARD} CACHE STRING "C++ standard to conform to")
9494
set(CMAKE_CXX_STANDARD_REQUIRED YES)
95-
96-
if (CYGWIN)
97-
# Cygwin is a bit stricter and lack things like 'strdup', 'stricmp', etc in
98-
# c++xx mode.
99-
set(CMAKE_CXX_EXTENSIONS YES)
100-
else()
101-
set(CMAKE_CXX_EXTENSIONS NO)
102-
endif()
95+
set(CMAKE_CXX_EXTENSIONS NO)
10396

10497
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
10598
message(FATAL_ERROR "

llvm/cmake/config-ix.cmake

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,15 @@ endif()
8686
# Keep this at the top to make sure we don't add _GNU_SOURCE dependent checks
8787
# before adding it.
8888
check_symbol_exists(__GLIBC__ stdio.h LLVM_USING_GLIBC)
89-
if(LLVM_USING_GLIBC)
89+
if(LLVM_USING_GLIBC OR CYGWIN)
9090
add_compile_definitions(_GNU_SOURCE)
9191
list(APPEND CMAKE_REQUIRED_DEFINITIONS "-D_GNU_SOURCE")
92+
endif()
9293

93-
# enable 64bit off_t on 32bit systems using glibc
94-
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
95-
add_compile_definitions(_FILE_OFFSET_BITS=64)
96-
list(APPEND CMAKE_REQUIRED_DEFINITIONS "-D_FILE_OFFSET_BITS=64")
97-
endif()
94+
# enable 64bit off_t on 32bit systems using glibc
95+
if(LLVM_USING_GLIBC AND CMAKE_SIZEOF_VOID_P EQUAL 4)
96+
add_compile_definitions(_FILE_OFFSET_BITS=64)
97+
list(APPEND CMAKE_REQUIRED_DEFINITIONS "-D_FILE_OFFSET_BITS=64")
9898
endif()
9999

100100
# include checks

llvm/include/llvm/Transforms/Scalar/Reassociate.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,14 @@ struct Factor {
6565
};
6666

6767
struct OverflowTracking {
68-
bool HasNUW;
69-
bool HasNSW;
70-
bool AllKnownNonNegative;
71-
bool AllKnownNonZero;
68+
bool HasNUW = true;
69+
bool HasNSW = true;
70+
bool AllKnownNonNegative = true;
71+
bool AllKnownNonZero = true;
7272
// Note: AllKnownNonNegative can be true in a case where one of the operands
7373
// is negative, but one the operators is not NSW. AllKnownNonNegative should
7474
// not be used independently of HasNSW
75-
OverflowTracking()
76-
: HasNUW(true), HasNSW(true), AllKnownNonNegative(true),
77-
AllKnownNonZero(true) {}
75+
OverflowTracking() = default;
7876
};
7977

8078
class XorOpnd;

0 commit comments

Comments
 (0)