Skip to content

Commit 8ef76c7

Browse files
committed
merge main into amd-staging
2 parents 6952645 + 3b90597 commit 8ef76c7

File tree

18 files changed

+1052
-404
lines changed

18 files changed

+1052
-404
lines changed

bolt/include/bolt/Core/BinarySection.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -523,11 +523,6 @@ inline uint8_t *copyByteArray(const uint8_t *Data, uint64_t Size) {
523523
return Array;
524524
}
525525

526-
inline uint8_t *copyByteArray(StringRef Buffer) {
527-
return copyByteArray(reinterpret_cast<const uint8_t *>(Buffer.data()),
528-
Buffer.size());
529-
}
530-
531526
inline uint8_t *copyByteArray(ArrayRef<char> Buffer) {
532527
return copyByteArray(reinterpret_cast<const uint8_t *>(Buffer.data()),
533528
Buffer.size());

clang/lib/CodeGen/CGDebugInfo.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -891,8 +891,8 @@ llvm::DIType *CGDebugInfo::CreateType(const BuiltinType *BT) {
891891
auto *ISATy = DBuilder.createPointerType(ClassTy, Size);
892892

893893
ObjTy = DBuilder.createStructType(TheCU, "objc_object", TheCU->getFile(), 0,
894-
0, 0, llvm::DINode::FlagZero, nullptr,
895-
llvm::DINodeArray());
894+
(uint64_t)0, 0, llvm::DINode::FlagZero,
895+
nullptr, llvm::DINodeArray());
896896

897897
DBuilder.replaceArrays(
898898
ObjTy, DBuilder.getOrCreateArray(&*DBuilder.createMemberType(

lldb/include/lldb/Utility/XcodeSDK.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -93,19 +93,6 @@ class XcodeSDK {
9393
static bool SDKSupportsModules(Type type, llvm::VersionTuple version);
9494
static bool SDKSupportsModules(Type desired_type, const FileSpec &sdk_path);
9595

96-
/// Returns true if the SDK for the specified triple supports
97-
/// builtin modules in system headers.
98-
///
99-
/// NOTE: should be kept in sync with sdkSupportsBuiltinModules in
100-
/// Toolchains/Darwin.cpp
101-
///
102-
/// FIXME: this function will be removed once LLDB's ClangExpressionParser
103-
/// constructs the compiler instance through the driver/toolchain. See \ref
104-
/// SetupImportStdModuleLangOpts
105-
///
106-
static bool SDKSupportsBuiltinModules(const llvm::Triple &target_triple,
107-
llvm::VersionTuple sdk_version);
108-
10996
/// Return the canonical SDK name, such as "macosx" for the macOS SDK.
11097
static std::string GetCanonicalName(Info info);
11198
/// Return the best-matching SDK type for a specific triple.

lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp

Lines changed: 1 addition & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -319,49 +319,6 @@ class ClangDiagnosticManagerAdapter : public clang::DiagnosticConsumer {
319319
StringRef m_filename;
320320
};
321321

322-
/// Returns true if the SDK for the specified triple supports
323-
/// builtin modules in system headers. This is used to decide
324-
/// whether to pass -fbuiltin-headers-in-system-modules to
325-
/// the compiler instance when compiling the `std` module.
326-
static llvm::Expected<bool>
327-
sdkSupportsBuiltinModules(lldb_private::Target &target) {
328-
auto arch_spec = target.GetArchitecture();
329-
auto const &triple = arch_spec.GetTriple();
330-
auto module_sp = target.GetExecutableModule();
331-
if (!module_sp)
332-
return llvm::createStringError("Executable module not found.");
333-
334-
// Get SDK path that the target was compiled against.
335-
auto platform_sp = target.GetPlatform();
336-
if (!platform_sp)
337-
return llvm::createStringError("No Platform plugin found on target.");
338-
339-
auto sdk_or_err = platform_sp->GetSDKPathFromDebugInfo(*module_sp);
340-
if (!sdk_or_err)
341-
return sdk_or_err.takeError();
342-
343-
// Use the SDK path from debug-info to find a local matching SDK directory.
344-
auto sdk_path_or_err =
345-
HostInfo::GetSDKRoot(HostInfo::SDKOptions{std::move(sdk_or_err->first)});
346-
if (!sdk_path_or_err)
347-
return sdk_path_or_err.takeError();
348-
349-
auto VFS = FileSystem::Instance().GetVirtualFileSystem();
350-
if (!VFS)
351-
return llvm::createStringError("No virtual filesystem available.");
352-
353-
// Extract SDK version from the /path/to/some.sdk/SDKSettings.json
354-
auto parsed_or_err = clang::parseDarwinSDKInfo(*VFS, *sdk_path_or_err);
355-
if (!parsed_or_err)
356-
return parsed_or_err.takeError();
357-
358-
auto maybe_sdk = *parsed_or_err;
359-
if (!maybe_sdk)
360-
return llvm::createStringError("Couldn't find Darwin SDK info.");
361-
362-
return XcodeSDK::SDKSupportsBuiltinModules(triple, maybe_sdk->getVersion());
363-
}
364-
365322
static void SetupModuleHeaderPaths(CompilerInstance *compiler,
366323
std::vector<std::string> include_directories,
367324
lldb::TargetSP target_sp) {
@@ -705,7 +662,6 @@ static void SetupLangOpts(CompilerInstance &compiler,
705662

706663
static void SetupImportStdModuleLangOpts(CompilerInstance &compiler,
707664
lldb_private::Target &target) {
708-
Log *log = GetLog(LLDBLog::Expressions);
709665
LangOptions &lang_opts = compiler.getLangOpts();
710666
lang_opts.Modules = true;
711667
// We want to implicitly build modules.
@@ -723,12 +679,7 @@ static void SetupImportStdModuleLangOpts(CompilerInstance &compiler,
723679
lang_opts.GNUKeywords = true;
724680
lang_opts.CPlusPlus11 = true;
725681

726-
if (auto supported_or_err = sdkSupportsBuiltinModules(target))
727-
lang_opts.BuiltinHeadersInSystemModules = !*supported_or_err;
728-
else
729-
LLDB_LOG_ERROR(log, supported_or_err.takeError(),
730-
"Failed to determine BuiltinHeadersInSystemModules when "
731-
"setting up import-std-module: {0}");
682+
lang_opts.BuiltinHeadersInSystemModules = false;
732683

733684
// The Darwin libc expects this macro to be set.
734685
lang_opts.GNUCVersion = 40201;

lldb/source/Utility/XcodeSDK.cpp

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -266,27 +266,6 @@ bool XcodeSDK::SupportsSwift() const {
266266
}
267267
}
268268

269-
bool XcodeSDK::SDKSupportsBuiltinModules(const llvm::Triple &target_triple,
270-
llvm::VersionTuple sdk_version) {
271-
using namespace llvm;
272-
273-
switch (target_triple.getOS()) {
274-
case Triple::OSType::MacOSX:
275-
return sdk_version >= VersionTuple(15U);
276-
case Triple::OSType::IOS:
277-
return sdk_version >= VersionTuple(18U);
278-
case Triple::OSType::TvOS:
279-
return sdk_version >= VersionTuple(18U);
280-
case Triple::OSType::WatchOS:
281-
return sdk_version >= VersionTuple(11U);
282-
case Triple::OSType::XROS:
283-
return sdk_version >= VersionTuple(2U);
284-
default:
285-
// New SDKs support builtin modules from the start.
286-
return true;
287-
}
288-
}
289-
290269
bool XcodeSDK::SDKSupportsModules(XcodeSDK::Type desired_type,
291270
const FileSpec &sdk_path) {
292271
ConstString last_path_component = sdk_path.GetFilename();

llvm/include/llvm/IR/DIBuilder.h

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,22 @@ namespace llvm {
376376
uint32_t VBPtrOffset,
377377
DINode::DIFlags Flags);
378378

379+
/// Create debugging information entry for a member.
380+
/// \param Scope Member scope.
381+
/// \param Name Member name.
382+
/// \param File File where this member is defined.
383+
/// \param LineNo Line number.
384+
/// \param SizeInBits Member size.
385+
/// \param AlignInBits Member alignment.
386+
/// \param OffsetInBits Member offset.
387+
/// \param Flags Flags to encode member attribute, e.g. private
388+
/// \param Ty Parent type.
389+
/// \param Annotations Member annotations.
390+
LLVM_ABI DIDerivedType *createMemberType(
391+
DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNo,
392+
Metadata *SizeInBits, uint32_t AlignInBits, Metadata *OffsetInBits,
393+
DINode::DIFlags Flags, DIType *Ty, DINodeArray Annotations = nullptr);
394+
379395
/// Create debugging information entry for a member.
380396
/// \param Scope Member scope.
381397
/// \param Name Member name.
@@ -428,6 +444,23 @@ namespace llvm {
428444
Constant *Discriminant,
429445
DIType *Ty);
430446

447+
/// Create debugging information entry for a bit field member.
448+
/// \param Scope Member scope.
449+
/// \param Name Member name.
450+
/// \param File File where this member is defined.
451+
/// \param LineNo Line number.
452+
/// \param SizeInBits Member size.
453+
/// \param OffsetInBits Member offset.
454+
/// \param StorageOffsetInBits Member storage offset.
455+
/// \param Flags Flags to encode member attribute.
456+
/// \param Ty Parent type.
457+
/// \param Annotations Member annotations.
458+
LLVM_ABI DIDerivedType *createBitFieldMemberType(
459+
DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNo,
460+
Metadata *SizeInBits, Metadata *OffsetInBits,
461+
uint64_t StorageOffsetInBits, DINode::DIFlags Flags, DIType *Ty,
462+
DINodeArray Annotations = nullptr);
463+
431464
/// Create debugging information entry for a bit field member.
432465
/// \param Scope Member scope.
433466
/// \param Name Member name.
@@ -519,6 +552,29 @@ namespace llvm {
519552
unsigned RunTimeLang = 0, DIType *VTableHolder = nullptr,
520553
MDNode *TemplateParms = nullptr, StringRef UniqueIdentifier = "");
521554

555+
/// Create debugging information entry for a struct.
556+
/// \param Scope Scope in which this struct is defined.
557+
/// \param Name Struct name.
558+
/// \param File File where this member is defined.
559+
/// \param LineNumber Line number.
560+
/// \param SizeInBits Member size.
561+
/// \param AlignInBits Member alignment.
562+
/// \param Flags Flags to encode member attribute, e.g. private
563+
/// \param Elements Struct elements.
564+
/// \param RunTimeLang Optional parameter, Objective-C runtime version.
565+
/// \param UniqueIdentifier A unique identifier for the struct.
566+
/// \param Specification The type that this type completes. This is used by
567+
/// Swift to represent generic types.
568+
/// \param NumExtraInhabitants The number of extra inhabitants of the type.
569+
/// An extra inhabitant is a bit pattern that does not represent a valid
570+
/// value for instances of a given type. This is used by the Swift language.
571+
LLVM_ABI DICompositeType *createStructType(
572+
DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNumber,
573+
Metadata *SizeInBits, uint32_t AlignInBits, DINode::DIFlags Flags,
574+
DIType *DerivedFrom, DINodeArray Elements, unsigned RunTimeLang = 0,
575+
DIType *VTableHolder = nullptr, StringRef UniqueIdentifier = "",
576+
DIType *Specification = nullptr, uint32_t NumExtraInhabitants = 0);
577+
522578
/// Create debugging information entry for a struct.
523579
/// \param Scope Scope in which this struct is defined.
524580
/// \param Name Struct name.

0 commit comments

Comments
 (0)