Skip to content

Commit e684ec8

Browse files
authored
Merge branch 'main' into uefi_predefines
2 parents 2bdba34 + dce2245 commit e684ec8

Some content is hidden

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

49 files changed

+219
-138
lines changed

clang/lib/Basic/Targets/X86.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -832,11 +832,6 @@ class LLVM_LIBRARY_VISIBILITY UEFIX86_64TargetInfo
832832
"i64:64-i128:128-f80:128-n8:16:32:64-S128");
833833
}
834834

835-
void getTargetDefines(const LangOptions &Opts,
836-
MacroBuilder &Builder) const override {
837-
getOSDefines(Opts, X86TargetInfo::getTriple(), Builder);
838-
}
839-
840835
BuiltinVaListKind getBuiltinVaListKind() const override {
841836
return TargetInfo::CharPtrBuiltinVaList;
842837
}

clang/lib/Driver/ToolChains/UEFI.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,24 @@ UEFI::UEFI(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
3535

3636
Tool *UEFI::buildLinker() const { return new tools::uefi::Linker(*this); }
3737

38+
void UEFI::AddClangSystemIncludeArgs(const ArgList &DriverArgs,
39+
ArgStringList &CC1Args) const {
40+
if (DriverArgs.hasArg(options::OPT_nostdinc))
41+
return;
42+
43+
if (!DriverArgs.hasArg(options::OPT_nobuiltininc)) {
44+
SmallString<128> Dir(getDriver().ResourceDir);
45+
llvm::sys::path::append(Dir, "include");
46+
addSystemInclude(DriverArgs, CC1Args, Dir.str());
47+
}
48+
49+
if (DriverArgs.hasArg(options::OPT_nostdlibinc))
50+
return;
51+
52+
if (std::optional<std::string> Path = getStdlibIncludePath())
53+
addSystemInclude(DriverArgs, CC1Args, *Path);
54+
}
55+
3856
void tools::uefi::Linker::ConstructJob(Compilation &C, const JobAction &JA,
3957
const InputInfo &Output,
4058
const InputInfoList &Inputs,

clang/lib/Driver/ToolChains/UEFI.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ class LLVM_LIBRARY_VISIBILITY UEFI : public ToolChain {
5151
return false;
5252
}
5353
bool isPICDefaultForced() const override { return true; }
54+
55+
void
56+
AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
57+
llvm::opt::ArgStringList &CC1Args) const override;
5458
};
5559

5660
} // namespace toolchains

clang/lib/Format/QualifierAlignmentFixer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ const FormatToken *LeftRightQualifierAlignmentFixer::analyzeRight(
348348
}
349349
}
350350

351-
if (Next->is(tok::kw_auto))
351+
if (Next && Next->is(tok::kw_auto))
352352
TypeToken = Next;
353353

354354
// Place the Qualifier at the end of the list of qualifiers.

clang/lib/Lex/InitHeaderSearch.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ bool InitHeaderSearch::ShouldAddDefaultIncludePaths(
301301
case llvm::Triple::PS5:
302302
case llvm::Triple::RTEMS:
303303
case llvm::Triple::Solaris:
304+
case llvm::Triple::UEFI:
304305
case llvm::Triple::WASI:
305306
case llvm::Triple::ZOS:
306307
return false;

clang/lib/Serialization/MultiOnDiskHashTable.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ template<typename Info> class MultiOnDiskHashTable {
9393
using result_type = OnDiskTable *;
9494

9595
result_type operator()(void *P) const {
96-
return Table::getFromOpaqueValue(P).template get<OnDiskTable *>();
96+
return llvm::cast<OnDiskTable *>(Table::getFromOpaqueValue(P));
9797
}
9898
};
9999

@@ -130,7 +130,7 @@ template<typename Info> class MultiOnDiskHashTable {
130130
Files.insert(PendingOverrides.begin(), PendingOverrides.end());
131131
// Explicitly capture Files to work around an MSVC 2015 rejects-valid bug.
132132
auto ShouldRemove = [&Files](void *T) -> bool {
133-
auto *ODT = Table::getFromOpaqueValue(T).template get<OnDiskTable *>();
133+
auto *ODT = llvm::cast<OnDiskTable *>(Table::getFromOpaqueValue(T));
134134
bool Remove = Files.count(ODT->File);
135135
if (Remove)
136136
delete ODT;

clang/unittests/Format/QualifierFixerTest.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,11 @@ TEST_F(QualifierFixerTest, RightQualifier) {
531531
verifyFormat("float (C::*const p)(int);", Style);
532532
verifyFormat("float (C::*p)(int) const;", Style);
533533
verifyFormat("float const (C::*p)(int);", "const float (C::*p)(int);", Style);
534+
535+
Style.BreakBeforeBraces = FormatStyle::BS_Custom;
536+
Style.BraceWrapping.AfterFunction = true;
537+
verifyFormat("auto foo() -> T const { return bar; }",
538+
"auto foo() -> const T { return bar; }", Style);
534539
}
535540

536541
TEST_F(QualifierFixerTest, LeftQualifier) {

libcxx/include/__config

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,11 +1170,7 @@ typedef __char32_t char32_t;
11701170
# define _LIBCPP_NOESCAPE
11711171
# endif
11721172

1173-
# if __has_attribute(__nodebug__)
1174-
# define _LIBCPP_NODEBUG __attribute__((__nodebug__))
1175-
# else
1176-
# define _LIBCPP_NODEBUG
1177-
# endif
1173+
# define _LIBCPP_NODEBUG [[__gnu__::__nodebug__]]
11781174

11791175
# if __has_attribute(__standalone_debug__)
11801176
# define _LIBCPP_STANDALONE_DEBUG __attribute__((__standalone_debug__))

libcxx/include/__functional/function.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ class __alloc_func<_Fp, _Ap, _Rp(_ArgTypes...)> {
146146
_LIBCPP_COMPRESSED_PAIR(_Fp, __func_, _Ap, __alloc_);
147147

148148
public:
149-
typedef _LIBCPP_NODEBUG _Fp _Target;
150-
typedef _LIBCPP_NODEBUG _Ap _Alloc;
149+
using _Target _LIBCPP_NODEBUG = _Fp;
150+
using _Alloc _LIBCPP_NODEBUG = _Ap;
151151

152152
_LIBCPP_HIDE_FROM_ABI const _Target& __target() const { return __func_; }
153153

@@ -198,7 +198,7 @@ class __default_alloc_func<_Fp, _Rp(_ArgTypes...)> {
198198
_Fp __f_;
199199

200200
public:
201-
typedef _LIBCPP_NODEBUG _Fp _Target;
201+
using _Target _LIBCPP_NODEBUG = _Fp;
202202

203203
_LIBCPP_HIDE_FROM_ABI const _Target& __target() const { return __f_; }
204204

libcxx/include/__fwd/memory_resource.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
# pragma GCC system_header
1616
#endif
1717

18+
#if _LIBCPP_STD_VER >= 17
19+
1820
_LIBCPP_BEGIN_NAMESPACE_STD
1921

2022
namespace pmr {
@@ -24,4 +26,6 @@ class _LIBCPP_AVAILABILITY_PMR _LIBCPP_TEMPLATE_VIS polymorphic_allocator;
2426

2527
_LIBCPP_END_NAMESPACE_STD
2628

29+
#endif // _LIBCPP_STD_VER >= 17
30+
2731
#endif // _LIBCPP___FWD_MEMORY_RESOURCE_H

0 commit comments

Comments
 (0)