Skip to content

Commit fc7eac0

Browse files
SC llvm teamSC llvm team
authored andcommitted
Merge llvm/main into amd-debug
2 parents 2d225ae + 3c4bad0 commit fc7eac0

File tree

196 files changed

+18527
-33
lines changed

Some content is hidden

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

196 files changed

+18527
-33
lines changed

clang-tools-extra/clangd/ModulesBuilder.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,21 @@
1414
#include "clang/Serialization/ASTReader.h"
1515
#include "clang/Serialization/ModuleCache.h"
1616
#include "llvm/ADT/ScopeExit.h"
17+
#include "llvm/Support/CommandLine.h"
18+
1719
#include <queue>
1820

1921
namespace clang {
2022
namespace clangd {
2123

2224
namespace {
2325

26+
llvm::cl::opt<bool> DebugModulesBuilder(
27+
"debug-modules-builder",
28+
llvm::cl::desc("Don't remove clangd's built module files for debugging. "
29+
"Remember to remove them later after debugging."),
30+
llvm::cl::init(false));
31+
2432
// Create a path to store module files. Generally it should be:
2533
//
2634
// {TEMP_DIRS}/clangd/module_files/{hashed-file-name}-%%-%%-%%-%%-%%-%%/.
@@ -122,7 +130,7 @@ struct ModuleFile {
122130
}
123131

124132
~ModuleFile() {
125-
if (!ModuleFilePath.empty())
133+
if (!ModuleFilePath.empty() && !DebugModulesBuilder)
126134
llvm::sys::fs::remove(ModuleFilePath);
127135
}
128136

@@ -315,7 +323,7 @@ buildModuleFile(llvm::StringRef ModuleName, PathRef ModuleUnitFileName,
315323
Cmds += Arg;
316324
}
317325

318-
clangd::vlog("Failed to compile {0} with command: {1}.", ModuleUnitFileName,
326+
clangd::vlog("Failed to compile {0} with command: {1}", ModuleUnitFileName,
319327
Cmds);
320328

321329
std::string BuiltModuleFilesStr = BuiltModuleFiles.getAsString();

clang/lib/AST/ByteCode/Interp.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2117,8 +2117,8 @@ bool DiagTypeid(InterpState &S, CodePtr OpPC) {
21172117

21182118
bool arePotentiallyOverlappingStringLiterals(const Pointer &LHS,
21192119
const Pointer &RHS) {
2120-
unsigned LHSOffset = LHS.getIndex();
2121-
unsigned RHSOffset = RHS.getIndex();
2120+
unsigned LHSOffset = LHS.isOnePastEnd() ? LHS.getNumElems() : LHS.getIndex();
2121+
unsigned RHSOffset = RHS.isOnePastEnd() ? RHS.getNumElems() : RHS.getIndex();
21222122
unsigned LHSLength = (LHS.getNumElems() - 1) * LHS.elemSize();
21232123
unsigned RHSLength = (RHS.getNumElems() - 1) * RHS.elemSize();
21242124

clang/test/AST/ByteCode/cxx11.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,8 @@ namespace OverlappingStrings {
287287
constexpr bool may_overlap_4 = &"xfoo"[1] == &"xfoo"[1]; // both-error {{}} both-note {{addresses of potentially overlapping literals}}
288288

289289

290+
/// Used to crash.
291+
const bool x = &"ab"[0] == &"ba"[3];
290292

291293
}
292294

libcxx/docs/DesignDocs/VisibilityMacros.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ Visibility Macros
3131
Mark a symbol as being part of our ABI. This includes functions that are part
3232
of the libc++ library, type information and other symbols. On Windows,
3333
this macro applies `dllimport`/`dllexport` to the symbol, and on other
34-
platforms it gives the symbol default visibility.
34+
platforms it gives the symbol default visibility. This macro should never be
35+
used on class templates. On classes it should only be used if the vtable
36+
lives in the built library.
3537

3638
**_LIBCPP_OVERRIDABLE_FUNC_VIS**
3739
Mark a symbol as being exported by the libc++ library, but allow it to be

libcxx/docs/ReleaseNotes/22.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ Deprecations and Removals
6262
Potentially breaking changes
6363
----------------------------
6464

65+
- The algorithm for ``multi{map,set}::find`` has been modified such that it doesn't necessarily return an iterator to the first equal element in the container. This was never guaranteed by the Standard, but libc++ previously happened to always return the first equal element, like other implementations do. Starting with this release, code relying on the first element being returned from ``find`` will be broken, and ``lower_bound`` or ``equal_range`` should be used instead.
66+
6567
Announcements About Future Releases
6668
-----------------------------------
6769

libcxx/include/__charconv/from_chars_result.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2121

2222
#if _LIBCPP_STD_VER >= 17
2323

24-
struct _LIBCPP_EXPORTED_FROM_ABI from_chars_result {
24+
struct from_chars_result {
2525
const char* ptr;
2626
errc ec;
2727
# if _LIBCPP_STD_VER >= 20

libcxx/include/__charconv/to_chars_result.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2121

2222
#if _LIBCPP_STD_VER >= 17
2323

24-
struct _LIBCPP_EXPORTED_FROM_ABI to_chars_result {
24+
struct to_chars_result {
2525
char* ptr;
2626
errc ec;
2727
# if _LIBCPP_STD_VER >= 20

libcxx/include/__filesystem/file_status.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
2424

25-
class _LIBCPP_EXPORTED_FROM_ABI file_status {
25+
class file_status {
2626
public:
2727
// constructors
2828
_LIBCPP_HIDE_FROM_ABI file_status() noexcept : file_status(file_type::none) {}

libcxx/include/__filesystem/path.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -861,7 +861,7 @@ class _LIBCPP_EXPORTED_FROM_ABI path {
861861
}
862862

863863
// iterators
864-
class _LIBCPP_EXPORTED_FROM_ABI iterator;
864+
class iterator;
865865
typedef iterator const_iterator;
866866

867867
iterator begin() const;

libcxx/include/__filesystem/space_info.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
2323

24-
struct _LIBCPP_EXPORTED_FROM_ABI space_info {
24+
struct space_info {
2525
uintmax_t capacity;
2626
uintmax_t free;
2727
uintmax_t available;

0 commit comments

Comments
 (0)