Skip to content

Commit 49cc472

Browse files
author
iclsrc
committed
Merge from 'main' to 'sycl-web'
2 parents 1bfa08f + 485c18c commit 49cc472

File tree

134 files changed

+7561
-5531
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+7561
-5531
lines changed

clang-tools-extra/clangd/ConfigCompile.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ struct FragmentCompiler {
197197
compile(std::move(F.Completion));
198198
compile(std::move(F.Hover));
199199
compile(std::move(F.InlayHints));
200+
compile(std::move(F.Style));
200201
}
201202

202203
void compile(Fragment::IfBlock &&F) {

clang-tools-extra/clangd/unittests/ConfigCompileTests.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,14 @@ TEST_F(ConfigCompileTests, AllScopes) {
536536
EXPECT_TRUE(compileAndApply());
537537
EXPECT_TRUE(Conf.Completion.AllScopes);
538538
}
539+
540+
TEST_F(ConfigCompileTests, Style) {
541+
Frag = {};
542+
Frag.Style.FullyQualifiedNamespaces.push_back(std::string("foo"));
543+
Frag.Style.FullyQualifiedNamespaces.push_back(std::string("bar"));
544+
EXPECT_TRUE(compileAndApply());
545+
EXPECT_THAT(Conf.Style.FullyQualifiedNamespaces, ElementsAre("foo", "bar"));
546+
}
539547
} // namespace
540548
} // namespace config
541549
} // namespace clangd

clang-tools-extra/clangd/unittests/ConfigYAMLTests.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,19 @@ TEST(ParseYAML, IncludesIgnoreHeader) {
261261
EXPECT_THAT(Results[0].Diagnostics.Includes.IgnoreHeader,
262262
ElementsAre(val("foo"), val("bar")));
263263
}
264+
265+
TEST(ParseYAML, Style) {
266+
CapturedDiags Diags;
267+
Annotations YAML(R"yaml(
268+
Style:
269+
FullyQualifiedNamespaces: [foo, bar])yaml");
270+
auto Results =
271+
Fragment::parseYAML(YAML.code(), "config.yaml", Diags.callback());
272+
ASSERT_THAT(Diags.Diagnostics, IsEmpty());
273+
ASSERT_EQ(Results.size(), 1u);
274+
EXPECT_THAT(Results[0].Style.FullyQualifiedNamespaces,
275+
ElementsAre(val("foo"), val("bar")));
276+
}
264277
} // namespace
265278
} // namespace config
266279
} // namespace clangd

clang/include/clang/Analysis/FlowSensitive/Value.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,17 +170,17 @@ class IntegerValue : public Value {
170170
/// in C.
171171
class ReferenceValue final : public Value {
172172
public:
173-
explicit ReferenceValue(StorageLocation &PointeeLoc)
174-
: Value(Kind::Reference), PointeeLoc(PointeeLoc) {}
173+
explicit ReferenceValue(StorageLocation &ReferentLoc)
174+
: Value(Kind::Reference), ReferentLoc(ReferentLoc) {}
175175

176176
static bool classof(const Value *Val) {
177177
return Val->getKind() == Kind::Reference;
178178
}
179179

180-
StorageLocation &getPointeeLoc() const { return PointeeLoc; }
180+
StorageLocation &getReferentLoc() const { return ReferentLoc; }
181181

182182
private:
183-
StorageLocation &PointeeLoc;
183+
StorageLocation &ReferentLoc;
184184
};
185185

186186
/// Models a symbolic pointer. Specifically, any value of type `T*`.

clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ llvm::DenseMap<K, V> intersectDenseMaps(const llvm::DenseMap<K, V> &Map1,
5353
static bool areEquivalentIndirectionValues(Value *Val1, Value *Val2) {
5454
if (auto *IndVal1 = dyn_cast<ReferenceValue>(Val1)) {
5555
auto *IndVal2 = cast<ReferenceValue>(Val2);
56-
return &IndVal1->getPointeeLoc() == &IndVal2->getPointeeLoc();
56+
return &IndVal1->getReferentLoc() == &IndVal2->getReferentLoc();
5757
}
5858
if (auto *IndVal1 = dyn_cast<PointerValue>(Val1)) {
5959
auto *IndVal2 = cast<PointerValue>(Val2);
@@ -522,7 +522,7 @@ StorageLocation &Environment::skip(StorageLocation &Loc, SkipPast SP) const {
522522
// References cannot be chained so we only need to skip past one level of
523523
// indirection.
524524
if (auto *Val = dyn_cast_or_null<ReferenceValue>(getValue(Loc)))
525-
return Val->getPointeeLoc();
525+
return Val->getReferentLoc();
526526
return Loc;
527527
case SkipPast::ReferenceThenPointer:
528528
StorageLocation &LocPastRef = skip(Loc, SkipPast::Reference);

clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ StorageLocation *maybeInitializeOptionalValueMember(QualType Q,
236236
// `Value` representing the optional (here, `OptionalVal`).
237237
if (auto *ValueProp = OptionalVal.getProperty("value")) {
238238
auto *ValueRef = clang::cast<ReferenceValue>(ValueProp);
239-
auto &ValueLoc = ValueRef->getPointeeLoc();
239+
auto &ValueLoc = ValueRef->getReferentLoc();
240240
if (Env.getValue(ValueLoc) == nullptr) {
241241
// The property was previously set, but the value has been lost. This can
242242
// happen, for example, because of an environment merge (where the two

clang/lib/Basic/Targets/AMDGPU.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,9 +462,13 @@ void AMDGPUTargetInfo::setAuxTarget(const TargetInfo *Aux) {
462462
// supported by AMDGPU. Therefore keep its own format for these two types.
463463
auto SaveLongDoubleFormat = LongDoubleFormat;
464464
auto SaveFloat128Format = Float128Format;
465+
auto SaveLongDoubleWidth = LongDoubleWidth;
466+
auto SaveLongDoubleAlign = LongDoubleAlign;
465467
copyAuxTarget(Aux);
466468
LongDoubleFormat = SaveLongDoubleFormat;
467469
Float128Format = SaveFloat128Format;
470+
LongDoubleWidth = SaveLongDoubleWidth;
471+
LongDoubleAlign = SaveLongDoubleAlign;
468472
// For certain builtin types support on the host target, claim they are
469473
// support to pass the compilation of the host code during the device-side
470474
// compilation.

clang/lib/Driver/ToolChains/AVR.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,9 @@ void AVR::Linker::ConstructJob(Compilation &C, const JobAction &JA,
432432
llvm::Optional<unsigned> SectionAddressData = GetMCUSectionAddressData(CPU);
433433

434434
// Compute the linker program path, and use GNU "avr-ld" as default.
435-
std::string Linker = getToolChain().GetLinkerPath(nullptr);
435+
const Arg *A = Args.getLastArg(options::OPT_fuse_ld_EQ);
436+
std::string Linker = A ? getToolChain().GetLinkerPath(nullptr)
437+
: getToolChain().GetProgramPath(getShortName());
436438

437439
ArgStringList CmdArgs;
438440
AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs, JA);

clang/lib/Format/Format.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1833,7 +1833,9 @@ namespace {
18331833
class BracesInserter : public TokenAnalyzer {
18341834
public:
18351835
BracesInserter(const Environment &Env, const FormatStyle &Style)
1836-
: TokenAnalyzer(Env, Style) {}
1836+
: TokenAnalyzer(Env, Style) {
1837+
this->Style.RemoveBracesLLVM = false;
1838+
}
18371839

18381840
std::pair<tooling::Replacements, unsigned>
18391841
analyze(TokenAnnotator &Annotator,
@@ -1875,7 +1877,9 @@ class BracesInserter : public TokenAnalyzer {
18751877
class BracesRemover : public TokenAnalyzer {
18761878
public:
18771879
BracesRemover(const Environment &Env, const FormatStyle &Style)
1878-
: TokenAnalyzer(Env, Style) {}
1880+
: TokenAnalyzer(Env, Style) {
1881+
this->Style.InsertBraces = false;
1882+
}
18791883

18801884
std::pair<tooling::Replacements, unsigned>
18811885
analyze(TokenAnnotator &Annotator,

clang/test/CodeGenCUDA/long-double.cu

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -target-cpu gfx906 \
2+
// RUN: -aux-triple x86_64-unknown-gnu-linux -fcuda-is-device \
3+
// RUN: -emit-llvm -o - -x hip %s 2>&1 | FileCheck %s
4+
5+
// RUN: %clang_cc1 -triple nvptx \
6+
// RUN: -aux-triple x86_64-unknown-gnu-linux -fcuda-is-device \
7+
// RUN: -emit-llvm -o - %s 2>&1 | FileCheck %s
8+
9+
// CHECK: @_ZN15infinity_helperIeE5valueE = {{.*}} double 0x47EFFFFFD586B834, align 8
10+
// CHECK: @size = {{.*}} i32 8
11+
12+
#include "Inputs/cuda.h"
13+
14+
template <class> struct infinity_helper {};
15+
template <> struct infinity_helper<long double> { static constexpr long double value = 3.4028234e38L; };
16+
constexpr long double infinity_helper<long double>::value;
17+
__device__ int size = sizeof(long double);

0 commit comments

Comments
 (0)