[Lldb-commits] [lldb] r334745 - Add remaining fixed-point types and saturated equivalents to fix -Wswitch of r334718
Author: maskray Date: Thu Jun 14 11:19:40 2018 New Revision: 334745 URL: http://llvm.org/viewvc/llvm-project?rev=334745=rev Log: Add remaining fixed-point types and saturated equivalents to fix -Wswitch of r334718 Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=334745=334744=334745=diff == --- lldb/trunk/source/Symbol/ClangASTContext.cpp (original) +++ lldb/trunk/source/Symbol/ClangASTContext.cpp Thu Jun 14 11:19:40 2018 @@ -4941,6 +4941,25 @@ lldb::Encoding ClangASTContext::GetEncod case clang::BuiltinType::UShortAccum: case clang::BuiltinType::UAccum: case clang::BuiltinType::ULongAccum: +case clang::BuiltinType::ShortFract: +case clang::BuiltinType::ShortFract: +case clang::BuiltinType::Fract: +case clang::BuiltinType::LongFract: +case clang::BuiltinType::UShortFract: +case clang::BuiltinType::UFract: +case clang::BuiltinType::ULongFract: +case clang::BuiltinType::SatShortAccum: +case clang::BuiltinType::SatAccum: +case clang::BuiltinType::SatLongAccum: +case clang::BuiltinType::SatUShortAccum: +case clang::BuiltinType::SatUAccum: +case clang::BuiltinType::SatULongAccum: +case clang::BuiltinType::SatShortFract: +case clang::BuiltinType::SatFract: +case clang::BuiltinType::SatLongFract: +case clang::BuiltinType::SatUShortFract: +case clang::BuiltinType::SatUFract: +case clang::BuiltinType::SatULongFract: break; case clang::BuiltinType::Half: ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r319869 - Do not use default arguments of DataLayout::getPointer*. NFC
Author: maskray Date: Tue Dec 5 17:32:06 2017 New Revision: 319869 URL: http://llvm.org/viewvc/llvm-project?rev=319869=rev Log: Do not use default arguments of DataLayout::getPointer*. NFC Summary: There are "FIXME"s in include/llvm/IR/DataLayout.h to remove the default arguments. Reviewers: zturner, clayborg Reviewed By: zturner Subscribers: bjope Differential Revision: https://reviews.llvm.org/D40064 Modified: lldb/trunk/source/Expression/IRInterpreter.cpp Modified: lldb/trunk/source/Expression/IRInterpreter.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/IRInterpreter.cpp?rev=319869=319868=319869=diff == --- lldb/trunk/source/Expression/IRInterpreter.cpp (original) +++ lldb/trunk/source/Expression/IRInterpreter.cpp Tue Dec 5 17:32:06 2017 @@ -385,11 +385,6 @@ public: return ret; } - lldb::addr_t MallocPointer() { -return Malloc(m_target_data.getPointerSize(), - m_target_data.getPointerPrefAlignment()); - } - lldb::addr_t Malloc(llvm::Type *type) { lldb_private::Status alloc_error; ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r337063 - Fix -Wswitch after introduction of clang; :Type::DependentVector in r337036
Author: maskray Date: Fri Jul 13 15:40:40 2018 New Revision: 337063 URL: http://llvm.org/viewvc/llvm-project?rev=337063=rev Log: Fix -Wswitch after introduction of clang;:Type::DependentVector in r337036 Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=337063=337062=337063=diff == --- lldb/trunk/source/Symbol/ClangASTContext.cpp (original) +++ lldb/trunk/source/Symbol/ClangASTContext.cpp Fri Jul 13 15:40:40 2018 @@ -4166,6 +4166,8 @@ ClangASTContext::GetTypeClass(lldb::opaq return lldb::eTypeClassArray; case clang::Type::DependentSizedExtVector: return lldb::eTypeClassVector; + case clang::Type::DependentVector: +return lldb::eTypeClassVector; case clang::Type::ExtVector: return lldb::eTypeClassVector; case clang::Type::Vector: @@ -4900,6 +4902,7 @@ lldb::Encoding ClangASTContext::GetEncod case clang::Type::ConstantArray: break; + case clang::Type::DependentVector: case clang::Type::ExtVector: case clang::Type::Vector: // TODO: Set this to more than one??? @@ -5154,6 +5157,7 @@ lldb::Format ClangASTContext::GetFormat( case clang::Type::ConstantArray: return lldb::eFormatVoid; // no value + case clang::Type::DependentVector: case clang::Type::ExtVector: case clang::Type::Vector: break; ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r343164 - llvm::sort(C.begin(), C.end(), ...) -> llvm::sort(C, ...)
Author: maskray Date: Wed Sep 26 20:35:05 2018 New Revision: 343164 URL: http://llvm.org/viewvc/llvm-project?rev=343164=rev Log: llvm::sort(C.begin(), C.end(), ...) -> llvm::sort(C, ...) The convenience wrapper in STLExtras is available since rL342102. Modified: lldb/trunk/source/Breakpoint/Breakpoint.cpp Modified: lldb/trunk/source/Breakpoint/Breakpoint.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Breakpoint/Breakpoint.cpp?rev=343164=343163=343164=diff == --- lldb/trunk/source/Breakpoint/Breakpoint.cpp (original) +++ lldb/trunk/source/Breakpoint/Breakpoint.cpp Wed Sep 26 20:35:05 2018 @@ -785,8 +785,8 @@ void Breakpoint::ModuleReplaced(ModuleSP // we go. if (old_id_vec.size() == new_id_vec.size()) { -llvm::sort(old_id_vec.begin(), old_id_vec.end()); -llvm::sort(new_id_vec.begin(), new_id_vec.end()); +llvm::sort(old_id_vec); +llvm::sort(new_id_vec); size_t num_elements = old_id_vec.size(); for (size_t idx = 0; idx < num_elements; idx++) { BreakpointLocationSP old_loc_sp = ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r358249 - [IRMemoryMap] Fix -Wimplicit-fallthrough in -DLLVM_ENABLE_ASSERTIONS=off build
Author: maskray Date: Thu Apr 11 19:38:17 2019 New Revision: 358249 URL: http://llvm.org/viewvc/llvm-project?rev=358249=rev Log: [IRMemoryMap] Fix -Wimplicit-fallthrough in -DLLVM_ENABLE_ASSERTIONS=off build Modified: lldb/trunk/source/Expression/IRMemoryMap.cpp Modified: lldb/trunk/source/Expression/IRMemoryMap.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/IRMemoryMap.cpp?rev=358249=358248=358249=diff == --- lldb/trunk/source/Expression/IRMemoryMap.cpp (original) +++ lldb/trunk/source/Expression/IRMemoryMap.cpp Thu Apr 11 19:38:17 2019 @@ -275,7 +275,7 @@ IRMemoryMap::Allocation::Allocation(lldb m_alignment(alignment) { switch (policy) { default: -assert(0 && "We cannot reach this!"); +llvm_unreachable("Invalid AllocationPolicy"); case eAllocationPolicyHostOnly: case eAllocationPolicyMirror: m_data.SetByteSize(size); ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r360557 - [CMake] Add lli to LLDB_TEST_DEPS
Author: maskray Date: Sun May 12 22:05:46 2019 New Revision: 360557 URL: http://llvm.org/viewvc/llvm-project?rev=360557=rev Log: [CMake] Add lli to LLDB_TEST_DEPS lli is used by lit/Breakpoint/jitbp_elf.test I had a test failure when running check-lldb-lit because my lli was stale. Modified: lldb/trunk/lit/CMakeLists.txt Modified: lldb/trunk/lit/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/CMakeLists.txt?rev=360557=360556=360557=diff == --- lldb/trunk/lit/CMakeLists.txt (original) +++ lldb/trunk/lit/CMakeLists.txt Sun May 12 22:05:46 2019 @@ -24,6 +24,7 @@ list(APPEND LLDB_TEST_DEPS llc lldb lldb-test + lli llvm-config llvm-mc llvm-objcopy ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r360562 - Remove declaratons of deleted structs/classes
Author: maskray Date: Mon May 13 01:25:53 2019 New Revision: 360562 URL: http://llvm.org/viewvc/llvm-project?rev=360562=rev Log: Remove declaratons of deleted structs/classes Modified: lldb/trunk/include/lldb/lldb-forward.h Modified: lldb/trunk/include/lldb/lldb-forward.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-forward.h?rev=360562=360561=360562=diff == --- lldb/trunk/include/lldb/lldb-forward.h (original) +++ lldb/trunk/include/lldb/lldb-forward.h Mon May 13 01:25:53 2019 @@ -18,7 +18,6 @@ namespace lldb_private { class ABI; class Address; -class AddressImpl; class AddressRange; class AddressResolver; class ArchSpec; @@ -52,7 +51,6 @@ class ClangASTSource; class ClangExpressionDeclMap; class ClangExpressionParser; class ClangExpressionVariable; -class ClangExpressionVariables; class ClangModulesDeclVendor; class ClangPersistentVariables; class CommandInterpreter; @@ -67,7 +65,6 @@ class CompilerDecl; class CompilerDeclContext; class CompilerType; class CompileUnit; -class Condition; class Connection; class ConnectionFileDescriptor; class ConstString; @@ -94,7 +91,6 @@ class EventData; class EventDataStructuredData; class ExecutionContext; class ExecutionContextRef; -class ExecutionContextRefLocker; class ExecutionContextScope; class Expression; class ExpressionVariable; @@ -134,10 +130,8 @@ class Module; class ModuleList; class ModuleSpec; class ModuleSpecList; -class Mutex; struct NameSearchContext; class ObjCLanguageRuntime; -class ObjCRuntimeSyntheticProvider; class ObjectContainer; class OptionGroup; class OptionGroupOptions; @@ -166,7 +160,6 @@ class OptionValueSInt64; class OptionValueString; class OptionValueUInt64; class OptionValueUUID; -class NamedOption; class PathMappingList; class FunctionCaller; class PersistentExpressionState; @@ -184,8 +177,6 @@ struct PropertyDefinition; class RecognizedStackFrame; class RegisterCheckpoint; class RegisterContext; -class RegisterLocation; -class RegisterLocationList; class RegisterValue; class RegularExpression; class REPL; @@ -196,7 +187,6 @@ class ScriptInterpreterLocker; struct ScriptSummaryFormat; class SearchFilter; class Section; -class SectionImpl; class SectionList; class SectionLoadHistory; class SectionLoadList; @@ -204,7 +194,6 @@ class Settings; class SourceManager; class SourceManagerImpl; class StackFrame; -class StackFrameImpl; class StackFrameList; class StackFrameRecognizer; class StackFrameRecognizerManager; ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r360554 - Fix file names in file headers. NFC
Author: maskray Date: Sun May 12 21:42:32 2019 New Revision: 360554 URL: http://llvm.org/viewvc/llvm-project?rev=360554=rev Log: Fix file names in file headers. NFC Modified: lldb/trunk/include/lldb/API/SBExpressionOptions.h lldb/trunk/include/lldb/API/SBThreadPlan.h lldb/trunk/include/lldb/Core/ValueObjectCast.h lldb/trunk/include/lldb/Expression/IRMemoryMap.h lldb/trunk/include/lldb/Host/HostGetOpt.h lldb/trunk/include/lldb/Host/HostInfo.h lldb/trunk/include/lldb/Host/windows/PipeWindows.h lldb/trunk/include/lldb/Host/windows/editlinewin.h lldb/trunk/include/lldb/Host/windows/windows.h lldb/trunk/include/lldb/Interpreter/OptionValueChar.h lldb/trunk/include/lldb/Symbol/LocateSymbolFile.h lldb/trunk/include/lldb/Symbol/UnwindTable.h lldb/trunk/include/lldb/lldb-public.h lldb/trunk/lit/ExecControl/StopHook/Inputs/stop-hook-threads.cpp lldb/trunk/source/API/SBBreakpointOptionCommon.cpp lldb/trunk/source/Breakpoint/BreakpointName.cpp lldb/trunk/source/Host/posix/ProcessLauncherPosixFork.cpp lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.h lldb/trunk/source/Plugins/Instruction/ARM/EmulationStateARM.h lldb/trunk/source/Plugins/InstrumentationRuntime/ASan/ASanRuntime.h lldb/trunk/source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.h lldb/trunk/source/Plugins/InstrumentationRuntime/UBSan/UBSanRuntime.h lldb/trunk/source/Plugins/Process/Utility/ARMDefines.h lldb/trunk/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.h lldb/trunk/source/Plugins/SymbolFile/NativePDB/PdbFPOProgramToDWARFExpression.cpp lldb/trunk/source/Plugins/SymbolFile/NativePDB/PdbFPOProgramToDWARFExpression.h lldb/trunk/source/Plugins/SymbolFile/NativePDB/UdtRecordCompleter.h lldb/trunk/source/Symbol/LocateSymbolFile.cpp lldb/trunk/source/Symbol/LocateSymbolFileMacOSX.cpp lldb/trunk/source/Utility/ProcessInfo.cpp lldb/trunk/source/Utility/VASprintf.cpp lldb/trunk/tools/darwin-debug/darwin-debug.cpp lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/ActivityStreamSPI.h lldb/trunk/tools/debugserver/source/MacOSX/Genealogy.cpp lldb/trunk/tools/debugserver/source/MacOSX/Genealogy.h lldb/trunk/tools/debugserver/source/MacOSX/GenealogySPI.h lldb/trunk/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp lldb/trunk/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.h lldb/trunk/tools/lldb-mi/MICmdCmdSupportInfo.cpp lldb/trunk/tools/lldb-mi/MICmnMIValueResult.h lldb/trunk/unittests/TestingSupport/MockTildeExpressionResolver.h Modified: lldb/trunk/include/lldb/API/SBExpressionOptions.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBExpressionOptions.h?rev=360554=360553=360554=diff == --- lldb/trunk/include/lldb/API/SBExpressionOptions.h (original) +++ lldb/trunk/include/lldb/API/SBExpressionOptions.h Sun May 12 21:42:32 2019 @@ -1,4 +1,4 @@ -//===-- SBEvent.h ---*- C++ -*-===// +//===-- SBExpressionOptions.h ---*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -89,10 +89,10 @@ public: bool GetTopLevel(); void SetTopLevel(bool b = true); - + // Gets whether we will JIT an expression if it cannot be interpreted bool GetAllowJIT(); - + // Sets whether we will JIT an expression if it cannot be interpreted void SetAllowJIT(bool allow); Modified: lldb/trunk/include/lldb/API/SBThreadPlan.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBThreadPlan.h?rev=360554=360553=360554=diff == --- lldb/trunk/include/lldb/API/SBThreadPlan.h (original) +++ lldb/trunk/include/lldb/API/SBThreadPlan.h Sun May 12 21:42:32 2019 @@ -1,4 +1,4 @@ -//===-- SBThread.h --*- C++ -*-===// +//===-- SBThreadPlan.h --*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. Modified: lldb/trunk/include/lldb/Core/ValueObjectCast.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectCast.h?rev=360554=360553=360554=diff == --- lldb/trunk/include/lldb/Core/ValueObjectCast.h (original) +++ lldb/trunk/include/lldb/Core/ValueObjectCast.h Sun May 12 21:42:32 2019 @@ -1,4 +1,4 @@ -//===-- ValueObjectDynamicValue.h ---*- C++ -*-===// +//===-- ValueObjectCast.h ---*- C++ -*-===// // // Part of the LLVM Project, under the
[Lldb-commits] [lldb] r362570 - Fix -Wsign-compare by explicit cast after r362557
Author: maskray Date: Tue Jun 4 18:49:06 2019 New Revision: 362570 URL: http://llvm.org/viewvc/llvm-project?rev=362570=rev Log: Fix -Wsign-compare by explicit cast after r362557 Modified: lldb/trunk/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp Modified: lldb/trunk/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp?rev=362570=362569=362570=diff == --- lldb/trunk/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp (original) +++ lldb/trunk/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp Tue Jun 4 18:49:06 2019 @@ -819,7 +819,7 @@ bool x86AssemblyInspectionEngine::local_ int offset; if (pc_rel_branch_or_jump_p (instruction_length, offset) && offset != 0) { addr_t next_pc_value = current_func_text_offset + instruction_length; -if (offset < 0 && abs (offset) > current_func_text_offset) { +if (offset < 0 && addr_t(-offset) > current_func_text_offset) { // Branch target is before the start of this function return false; } ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r362049 - DWARFDebugInfoEntry: delete unused Extract() and rename FastExtract() to Extract()
Author: maskray Date: Wed May 29 18:51:16 2019 New Revision: 362049 URL: http://llvm.org/viewvc/llvm-project?rev=362049=rev Log: DWARFDebugInfoEntry: delete unused Extract() and rename FastExtract() to Extract() The function Extract() is almost a duplicate of FastExtract() but is not used. Delete it and rename FastExtract() to Extract(). Reviewed By: JDevlieghere Differential Revision: https://reviews.llvm.org/D62593 Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp?rev=362049=362048=362049=diff == --- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp (original) +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp Wed May 29 18:51:16 2019 @@ -31,9 +31,12 @@ using namespace lldb_private; using namespace std; extern int g_verbose; -bool DWARFDebugInfoEntry::FastExtract( -const DWARFDataExtractor _info_data, const DWARFUnit *cu, -lldb::offset_t *offset_ptr) { +// Extract a debug info entry for a given compile unit from the .debug_info and +// .debug_abbrev data within the SymbolFileDWARF class starting at the given +// offset +bool DWARFDebugInfoEntry::Extract(const DWARFDataExtractor _info_data, + const DWARFUnit *cu, + lldb::offset_t *offset_ptr) { m_offset = *offset_ptr; m_parent_idx = 0; m_sibling_idx = 0; @@ -196,168 +199,6 @@ bool DWARFDebugInfoEntry::FastExtract( } return false; -} - -// Extract -// -// Extract a debug info entry for a given compile unit from the .debug_info and -// .debug_abbrev data within the SymbolFileDWARF class starting at the given -// offset -bool DWARFDebugInfoEntry::Extract(const DWARFUnit *cu, - lldb::offset_t *offset_ptr) { - const DWARFDataExtractor _info_data = cu->GetData(); - //const DWARFDataExtractor& debug_str_data = - //dwarf2Data->get_debug_str_data(); - const uint32_t cu_end_offset = cu->GetNextUnitOffset(); - lldb::offset_t offset = *offset_ptr; - // if (offset >= cu_end_offset) - // Log::Status("DIE at offset 0x%8.8x is beyond the end of the current - // compile unit (0x%8.8x)", m_offset, cu_end_offset); - if ((offset < cu_end_offset) && debug_info_data.ValidOffset(offset)) { -m_offset = offset; - -const uint64_t abbr_idx = debug_info_data.GetULEB128(); -lldbassert(abbr_idx <= UINT16_MAX); -m_abbr_idx = abbr_idx; -if (abbr_idx) { - const DWARFAbbreviationDeclaration *abbrevDecl = - cu->GetAbbreviations()->GetAbbreviationDeclaration(abbr_idx); - - if (abbrevDecl) { -m_tag = abbrevDecl->Tag(); -m_has_children = abbrevDecl->HasChildren(); - -bool isCompileUnitTag = (m_tag == DW_TAG_compile_unit || - m_tag == DW_TAG_partial_unit); -if (cu && isCompileUnitTag) - const_cast(cu)->SetBaseAddress(0); - -// Skip all data in the .debug_info for the attributes -const uint32_t numAttributes = abbrevDecl->NumAttributes(); -for (uint32_t i = 0; i < numAttributes; ++i) { - DWARFFormValue form_value(cu); - dw_attr_t attr; - abbrevDecl->GetAttrAndFormValueByIndex(i, attr, form_value); - dw_form_t form = form_value.Form(); - - if (isCompileUnitTag && - ((attr == DW_AT_entry_pc) || (attr == DW_AT_low_pc))) { -if (form_value.ExtractValue(debug_info_data, )) { - if (attr == DW_AT_low_pc || attr == DW_AT_entry_pc) -const_cast(cu)->SetBaseAddress( -form_value.Address()); -} - } else { -bool form_is_indirect = false; -do { - form_is_indirect = false; - uint32_t form_size = 0; - switch (form) { - // Blocks if inlined data that have a length field and the data - // bytes inlined in the .debug_info - case DW_FORM_exprloc: - case DW_FORM_block: -form_size = debug_info_data.GetULEB128(); -break; - case DW_FORM_block1: -form_size = debug_info_data.GetU8(); -break; - case DW_FORM_block2: -form_size = debug_info_data.GetU16(); -break; - case DW_FORM_block4: -form_size = debug_info_data.GetU32(); -break; - - // Inlined NULL terminated C-strings - case DW_FORM_string: -debug_info_data.GetCStr();
[Lldb-commits] [lldb] r361962 - Clean up DWARFDebugInfoEntry
Author: maskray Date: Wed May 29 07:36:11 2019 New Revision: 361962 URL: http://llvm.org/viewvc/llvm-project?rev=361962=rev Log: Clean up DWARFDebugInfoEntry Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp?rev=361962=361961=361962=diff == --- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp (original) +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp Wed May 29 07:36:11 2019 @@ -1074,13 +1074,6 @@ void DWARFDebugInfoEntry::BuildFunctionA } } -std::vector -DWARFDebugInfoEntry::GetDeclContextDIEs(DWARFUnit *cu) const { - - DWARFDIE die(cu, const_cast(this)); - return die.GetDeclContextDIEs(); -} - void DWARFDebugInfoEntry::GetDWARFDeclContext( DWARFUnit *cu, DWARFDeclContext _decl_ctx) const { const dw_tag_t tag = Tag(); @@ -1096,14 +1089,6 @@ void DWARFDebugInfoEntry::GetDWARFDeclCo } } -bool DWARFDebugInfoEntry::MatchesDWARFDeclContext( -DWARFUnit *cu, const DWARFDeclContext _decl_ctx) const { - - DWARFDeclContext this_dwarf_decl_ctx; - GetDWARFDeclContext(cu, this_dwarf_decl_ctx); - return this_dwarf_decl_ctx == dwarf_decl_ctx; -} - DWARFDIE DWARFDebugInfoEntry::GetParentDeclContextDIE(DWARFUnit *cu) const { DWARFAttributes attributes; @@ -1214,7 +1199,6 @@ DWARFDebugInfoEntry::GetQualifiedName(DW return storage.c_str(); } -// LookupAddress bool DWARFDebugInfoEntry::LookupAddress(const dw_addr_t address, const DWARFUnit *cu, DWARFDebugInfoEntry **function_die, @@ -1232,13 +1216,9 @@ bool DWARFDebugInfoEntry::LookupAddress( check_children = true; break; case DW_TAG_entry_point: - break; case DW_TAG_enumeration_type: - break; case DW_TAG_formal_parameter: - break; case DW_TAG_imported_declaration: - break; case DW_TAG_label: break; case DW_TAG_lexical_block: @@ -1246,9 +1226,7 @@ bool DWARFDebugInfoEntry::LookupAddress( match_addr_range = true; break; case DW_TAG_member: - break; case DW_TAG_pointer_type: - break; case DW_TAG_reference_type: break; case DW_TAG_compile_unit: @@ -1260,20 +1238,15 @@ bool DWARFDebugInfoEntry::LookupAddress( check_children = true; break; case DW_TAG_subroutine_type: - break; case DW_TAG_typedef: - break; case DW_TAG_union_type: - break; case DW_TAG_unspecified_parameters: - break; case DW_TAG_variant: break; case DW_TAG_common_block: check_children = true; break; case DW_TAG_common_inclusion: - break; case DW_TAG_inheritance: break; case DW_TAG_inlined_subroutine: @@ -1284,76 +1257,53 @@ bool DWARFDebugInfoEntry::LookupAddress( match_addr_range = true; break; case DW_TAG_ptr_to_member_type: - break; case DW_TAG_set_type: - break; case DW_TAG_subrange_type: - break; case DW_TAG_with_stmt: - break; case DW_TAG_access_declaration: - break; case DW_TAG_base_type: break; case DW_TAG_catch_block: match_addr_range = true; break; case DW_TAG_const_type: - break; case DW_TAG_constant: - break; case DW_TAG_enumerator: - break; case DW_TAG_file_type: - break; case DW_TAG_friend: - break; case DW_TAG_namelist: - break; case DW_TAG_namelist_item: - break; case DW_TAG_packed_type: break; case DW_TAG_subprogram: match_addr_range = true; break; case DW_TAG_template_type_parameter: - break; case DW_TAG_template_value_parameter: - break; case DW_TAG_GNU_template_parameter_pack: - break; case DW_TAG_thrown_type: break; case DW_TAG_try_block: match_addr_range = true; break; case DW_TAG_variant_part: - break; case DW_TAG_variable: - break; case DW_TAG_volatile_type: - break; case DW_TAG_dwarf_procedure: - break; case DW_TAG_restrict_type: - break; case DW_TAG_interface_type: break; case DW_TAG_namespace: check_children = true; break; case DW_TAG_imported_module: - break; case DW_TAG_unspecified_type: break; case DW_TAG_partial_unit: match_addr_range = true; break; case DW_TAG_imported_unit: - break; case DW_TAG_shared_type: - break; default: break; } @@ -1485,11 +1435,6 @@ DWARFDebugInfoEntry::GetAbbreviationDecl return nullptr; }
[Lldb-commits] [lldb] r360646 - ARMDefines.h: fix -Wimplicit-fallthrough in -DLLVM_ENABLE_ASSERTIONS=OFF builds
Author: maskray Date: Mon May 13 21:09:52 2019 New Revision: 360646 URL: http://llvm.org/viewvc/llvm-project?rev=360646=rev Log: ARMDefines.h: fix -Wimplicit-fallthrough in -DLLVM_ENABLE_ASSERTIONS=OFF builds Reviewed By: JDevlieghere Differential Revision: https://reviews.llvm.org/D61844 Modified: lldb/trunk/source/Plugins/Process/Utility/ARMDefines.h Modified: lldb/trunk/source/Plugins/Process/Utility/ARMDefines.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/ARMDefines.h?rev=360646=360645=360646=diff == --- lldb/trunk/source/Plugins/Process/Utility/ARMDefines.h (original) +++ lldb/trunk/source/Plugins/Process/Utility/ARMDefines.h Mon May 13 21:09:52 2019 @@ -9,6 +9,8 @@ #ifndef lldb_ARMDefines_h_ #define lldb_ARMDefines_h_ +#include "llvm/Support/ErrorHandling.h" + #include #include @@ -68,8 +70,6 @@ typedef enum { static inline const char *ARMCondCodeToString(uint32_t CC) { switch (CC) { - default: -assert(0 && "Unknown condition code"); case COND_EQ: return "eq"; case COND_NE: @@ -101,6 +101,7 @@ static inline const char *ARMCondCodeToS case COND_AL: return "al"; } + llvm_unreachable("Unknown condition code"); } static inline bool ARMConditionPassed(const uint32_t condition, ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r360654 - typedef enum -> enum
Author: maskray Date: Tue May 14 01:55:50 2019 New Revision: 360654 URL: http://llvm.org/viewvc/llvm-project?rev=360654=rev Log: typedef enum -> enum Reviewed By: labath Differential Revision: https://reviews.llvm.org/D61883 Modified: lldb/trunk/include/lldb/Breakpoint/Breakpoint.h lldb/trunk/include/lldb/Core/Address.h lldb/trunk/include/lldb/Core/AddressResolver.h lldb/trunk/include/lldb/Core/SearchFilter.h lldb/trunk/include/lldb/Host/Socket.h lldb/trunk/include/lldb/Interpreter/CommandCompletions.h lldb/trunk/include/lldb/Interpreter/OptionGroupWatchpoint.h lldb/trunk/include/lldb/Interpreter/OptionValue.h lldb/trunk/include/lldb/Interpreter/ScriptInterpreter.h lldb/trunk/include/lldb/Symbol/ObjectFile.h lldb/trunk/include/lldb/Symbol/SymbolContext.h lldb/trunk/include/lldb/Symbol/Symtab.h lldb/trunk/include/lldb/Symbol/Type.h lldb/trunk/include/lldb/Target/Process.h lldb/trunk/include/lldb/Target/Target.h lldb/trunk/include/lldb/Target/ThreadPlan.h lldb/trunk/include/lldb/Target/ThreadPlanTracer.h lldb/trunk/include/lldb/Utility/DataExtractor.h lldb/trunk/include/lldb/Utility/IOObject.h lldb/trunk/include/lldb/Utility/Predicate.h lldb/trunk/include/lldb/lldb-private-enumerations.h lldb/trunk/packages/Python/lldbsuite/test/expression_command/cast_int_to_anonymous_enum/main.cpp lldb/trunk/packages/Python/lldbsuite/test/python_api/lldbutil/iter/main.cpp lldb/trunk/packages/Python/lldbsuite/test/python_api/module_section/main.cpp lldb/trunk/source/Commands/CommandObjectBreakpoint.cpp lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.h lldb/trunk/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.h lldb/trunk/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.h lldb/trunk/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h lldb/trunk/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.h lldb/trunk/source/Plugins/Process/Utility/ARMDefines.h lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.h lldb/trunk/source/Target/Target.cpp lldb/trunk/tools/debugserver/source/DNBDataRef.h lldb/trunk/tools/debugserver/source/DNBDefs.h lldb/trunk/tools/debugserver/source/DNBError.h lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.h lldb/trunk/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.h lldb/trunk/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.h lldb/trunk/tools/debugserver/source/MacOSX/ppc/DNBArchImpl.h lldb/trunk/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.h lldb/trunk/tools/debugserver/source/RNBDefs.h lldb/trunk/tools/debugserver/source/RNBRemote.h lldb/trunk/tools/debugserver/source/debugserver.cpp lldb/trunk/tools/debugserver/source/libdebugserver.cpp lldb/trunk/tools/driver/Driver.h Modified: lldb/trunk/include/lldb/Breakpoint/Breakpoint.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Breakpoint/Breakpoint.h?rev=360654=360653=360654=diff == --- lldb/trunk/include/lldb/Breakpoint/Breakpoint.h (original) +++ lldb/trunk/include/lldb/Breakpoint/Breakpoint.h Tue May 14 01:55:50 2019 @@ -82,7 +82,7 @@ public: /// An enum specifying the match style for breakpoint settings. At present /// only used for function name style breakpoints. - typedef enum { Exact, Regexp, Glob } MatchType; + enum MatchType { Exact, Regexp, Glob }; private: enum class OptionNames : uint32_t { Names = 0, Hardware, LastOptionName }; Modified: lldb/trunk/include/lldb/Core/Address.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Address.h?rev=360654=360653=360654=diff == --- lldb/trunk/include/lldb/Core/Address.h (original) +++ lldb/trunk/include/lldb/Core/Address.h Tue May 14 01:55:50 2019 @@ -81,7 +81,7 @@ class Address { public: /// Dump styles allow the Address::Dump(Stream *,DumpStyle) const function /// to display Address contents in a variety of ways. - typedef enum { + enum DumpStyle { DumpStyleInvalid, ///< Invalid dump style DumpStyleSectionNameOffset, ///< Display as the section name + offset. ///< \code @@ -97,7 +97,7 @@ public: /// // address for printf in libSystem.B.dylib as a file address /// 0x0005dcff \endcode DumpStyleModuleWithFileAddress, ///< Display as the file address with the -///module name prepended (if any). +/// module name prepended (if any). ///< \code /// // address for printf in
[Lldb-commits] [lldb] r360757 - Group forward declarations in one namespace lldb_private {}
Author: maskray Date: Wed May 15 02:15:13 2019 New Revision: 360757 URL: http://llvm.org/viewvc/llvm-project?rev=360757=rev Log: Group forward declarations in one namespace lldb_private {} Modified: lldb/trunk/include/lldb/Core/Address.h lldb/trunk/include/lldb/Core/AddressRange.h lldb/trunk/include/lldb/Core/AddressResolver.h lldb/trunk/include/lldb/Core/AddressResolverFileLine.h lldb/trunk/include/lldb/Core/AddressResolverName.h lldb/trunk/include/lldb/Core/Communication.h lldb/trunk/include/lldb/Core/Debugger.h lldb/trunk/include/lldb/Core/Disassembler.h lldb/trunk/include/lldb/Core/EmulateInstruction.h lldb/trunk/include/lldb/Core/FileLineResolver.h lldb/trunk/include/lldb/Core/FileSpecList.h lldb/trunk/include/lldb/Core/FormatEntity.h lldb/trunk/include/lldb/Core/Module.h lldb/trunk/include/lldb/Core/ModuleList.h lldb/trunk/include/lldb/Core/Opcode.h lldb/trunk/include/lldb/Core/PluginManager.h lldb/trunk/include/lldb/Core/SearchFilter.h lldb/trunk/include/lldb/Core/Section.h lldb/trunk/include/lldb/Core/SourceManager.h lldb/trunk/include/lldb/Core/StreamAsynchronousIO.h lldb/trunk/include/lldb/Core/UserSettingsController.h lldb/trunk/include/lldb/Core/Value.h lldb/trunk/include/lldb/Core/ValueObject.h lldb/trunk/include/lldb/Core/ValueObjectCast.h lldb/trunk/include/lldb/Core/ValueObjectConstResult.h lldb/trunk/include/lldb/Core/ValueObjectConstResultCast.h lldb/trunk/include/lldb/Core/ValueObjectConstResultChild.h lldb/trunk/include/lldb/Core/ValueObjectConstResultImpl.h lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h lldb/trunk/include/lldb/Core/ValueObjectList.h lldb/trunk/include/lldb/Core/ValueObjectMemory.h lldb/trunk/include/lldb/Core/ValueObjectRegister.h lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h lldb/trunk/include/lldb/Core/ValueObjectVariable.h lldb/trunk/include/lldb/Target/DynamicLoader.h lldb/trunk/include/lldb/Utility/Broadcaster.h lldb/trunk/include/lldb/Utility/Connection.h lldb/trunk/include/lldb/Utility/DataExtractor.h lldb/trunk/include/lldb/Utility/Event.h lldb/trunk/include/lldb/Utility/JSON.h lldb/trunk/include/lldb/Utility/Listener.h lldb/trunk/include/lldb/Utility/StringList.h lldb/trunk/include/lldb/Utility/StructuredData.h lldb/trunk/include/lldb/Utility/UserID.h Modified: lldb/trunk/include/lldb/Core/Address.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Address.h?rev=360757=360756=360757=diff == --- lldb/trunk/include/lldb/Core/Address.h (original) +++ lldb/trunk/include/lldb/Core/Address.h Wed May 15 02:15:13 2019 @@ -19,36 +19,15 @@ namespace lldb_private { class Block; -} -namespace lldb_private { class CompileUnit; -} -namespace lldb_private { class ExecutionContextScope; -} -namespace lldb_private { class Function; -} -namespace lldb_private { class SectionList; -} -namespace lldb_private { class Stream; -} -namespace lldb_private { class Symbol; -} -namespace lldb_private { class SymbolContext; -} -namespace lldb_private { class Target; -} -namespace lldb_private { struct LineEntry; -} - -namespace lldb_private { /// \class Address Address.h "lldb/Core/Address.h" /// A section + offset based address class. Modified: lldb/trunk/include/lldb/Core/AddressRange.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/AddressRange.h?rev=360757=360756=360757=diff == --- lldb/trunk/include/lldb/Core/AddressRange.h (original) +++ lldb/trunk/include/lldb/Core/AddressRange.h Wed May 15 02:15:13 2019 @@ -17,15 +17,8 @@ namespace lldb_private { class SectionList; -} -namespace lldb_private { class Stream; -} -namespace lldb_private { class Target; -} - -namespace lldb_private { /// \class AddressRange AddressRange.h "lldb/Core/AddressRange.h" /// A section + offset based address range class. Modified: lldb/trunk/include/lldb/Core/AddressResolver.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/AddressResolver.h?rev=360757=360756=360757=diff == --- lldb/trunk/include/lldb/Core/AddressResolver.h (original) +++ lldb/trunk/include/lldb/Core/AddressResolver.h Wed May 15 02:15:13 2019 @@ -18,11 +18,7 @@ namespace lldb_private { class ModuleList; -} -namespace lldb_private { class Stream; -} -namespace lldb_private { /// \class AddressResolver AddressResolver.h "lldb/Core/AddressResolver.h" /// This class works with SearchFilter to resolve function names and source Modified: lldb/trunk/include/lldb/Core/AddressResolverFileLine.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/AddressResolverFileLine.h?rev=360757=360756=360757=diff
[Lldb-commits] [lldb] r361358 - Delete unnecessary copy ctors
Author: maskray Date: Wed May 22 01:38:23 2019 New Revision: 361358 URL: http://llvm.org/viewvc/llvm-project?rev=361358=rev Log: Delete unnecessary copy ctors Modified: lldb/trunk/include/lldb/Core/SearchFilter.h lldb/trunk/include/lldb/Utility/FileSpec.h lldb/trunk/include/lldb/Utility/Scalar.h lldb/trunk/source/Core/SearchFilter.cpp lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h lldb/trunk/source/Utility/FileSpec.cpp lldb/trunk/source/Utility/Scalar.cpp lldb/trunk/tools/debugserver/source/StdStringExtractor.cpp lldb/trunk/tools/debugserver/source/StdStringExtractor.h lldb/trunk/tools/intel-features/intel-pt/PTDecoder.cpp lldb/trunk/tools/intel-features/intel-pt/PTDecoder.h Modified: lldb/trunk/include/lldb/Core/SearchFilter.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/SearchFilter.h?rev=361358=361357=361358=diff == --- lldb/trunk/include/lldb/Core/SearchFilter.h (original) +++ lldb/trunk/include/lldb/Core/SearchFilter.h Wed May 22 01:38:23 2019 @@ -364,8 +364,6 @@ public: const FileSpecList _list, enum FilterTy filter_ty); - SearchFilterByModuleList(const SearchFilterByModuleList ); - ~SearchFilterByModuleList() override; SearchFilterByModuleList =(const SearchFilterByModuleList ); Modified: lldb/trunk/include/lldb/Utility/FileSpec.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Utility/FileSpec.h?rev=361358=361357=361358=diff == --- lldb/trunk/include/lldb/Utility/FileSpec.h (original) +++ lldb/trunk/include/lldb/Utility/FileSpec.h Wed May 22 01:38:23 2019 @@ -77,14 +77,6 @@ public: /// Copy constructor /// - /// Makes a copy of the uniqued directory and filename strings from \a rhs. - /// - /// \param[in] rhs - /// A const FileSpec object reference to copy. - FileSpec(const FileSpec ); - - /// Copy constructor - /// /// Makes a copy of the uniqued directory and filename strings from \a rhs /// if it is not nullptr. /// Modified: lldb/trunk/include/lldb/Utility/Scalar.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Utility/Scalar.h?rev=361358=361357=361358=diff == --- lldb/trunk/include/lldb/Utility/Scalar.h (original) +++ lldb/trunk/include/lldb/Utility/Scalar.h Wed May 22 01:38:23 2019 @@ -115,7 +115,6 @@ public: } lldbassert(false && "unsupported bitwidth"); } - Scalar(const Scalar ); // Scalar(const RegisterValue& reg_value); virtual ~Scalar(); Modified: lldb/trunk/source/Core/SearchFilter.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/SearchFilter.cpp?rev=361358=361357=361358=diff == --- lldb/trunk/source/Core/SearchFilter.cpp (original) +++ lldb/trunk/source/Core/SearchFilter.cpp Wed May 22 01:38:23 2019 @@ -524,9 +524,6 @@ SearchFilterByModuleList::SearchFilterBy enum FilterTy filter_ty) : SearchFilter(target_sp, filter_ty), m_module_spec_list(module_list) {} -SearchFilterByModuleList::SearchFilterByModuleList( -const SearchFilterByModuleList ) = default; - SearchFilterByModuleList :: operator=(const SearchFilterByModuleList ) { m_target_sp = rhs.m_target_sp; Modified: lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp?rev=361358=361357=361358=diff == --- lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp (original) +++ lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp Wed May 22 01:38:23 2019 @@ -215,8 +215,6 @@ PythonBytes::PythonBytes(PyRefType type, Reset(type, py_obj); // Use "Reset()" to ensure that py_obj is a string } -PythonBytes::PythonBytes(const PythonBytes ) : PythonObject(object) {} - PythonBytes::~PythonBytes() {} bool PythonBytes::Check(PyObject *py_obj) { @@ -340,8 +338,6 @@ PythonString::PythonString(PyRefType typ Reset(type, py_obj); // Use "Reset()" to ensure that py_obj is a string } -PythonString::PythonString(const PythonString ) : PythonObject(object) {} - PythonString::PythonString(llvm::StringRef string) : PythonObject() { SetString(string); } @@ -441,9 +437,6 @@ PythonInteger::PythonInteger(PyRefType t Reset(type, py_obj); // Use "Reset()" to ensure that py_obj is a integer type } -PythonInteger::PythonInteger(const PythonInteger ) -: PythonObject(object) {} - PythonInteger::PythonInteger(int64_t value) :
[Lldb-commits] [lldb] r360865 - Simplify ArchSpec::IsMIPS()
Author: maskray Date: Thu May 16 01:37:32 2019 New Revision: 360865 URL: http://llvm.org/viewvc/llvm-project?rev=360865=rev Log: Simplify ArchSpec::IsMIPS() Modified: lldb/trunk/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp lldb/trunk/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp lldb/trunk/source/Utility/ArchSpec.cpp Modified: lldb/trunk/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp?rev=360865=360864=360865=diff == --- lldb/trunk/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp (original) +++ lldb/trunk/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp Thu May 16 01:37:32 2019 @@ -553,11 +553,8 @@ size_t ABISysV_mips64::GetRedZoneSize() ABISP ABISysV_mips64::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec ) { - const llvm::Triple::ArchType arch_type = arch.GetTriple().getArch(); - if ((arch_type == llvm::Triple::mips64) || - (arch_type == llvm::Triple::mips64el)) { + if (arch.GetTriple().isMIPS64()) return ABISP(new ABISysV_mips64(process_sp)); - } return ABISP(); } Modified: lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp?rev=360865=360864=360865=diff == --- lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp (original) +++ lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp Thu May 16 01:37:32 2019 @@ -1178,10 +1178,7 @@ DisassemblerLLVMC::DisassemblerLLVMC(con break; } - if (triple.getArch() == llvm::Triple::mips || - triple.getArch() == llvm::Triple::mipsel || - triple.getArch() == llvm::Triple::mips64 || - triple.getArch() == llvm::Triple::mips64el) { + if (arch.IsMIPS()) { uint32_t arch_flags = arch.GetFlags(); if (arch_flags & ArchSpec::eMIPSAse_msa) features_str += "+msa,"; @@ -1219,10 +1216,7 @@ DisassemblerLLVMC::DisassemblerLLVMC(con if (!m_alternate_disasm_up) m_disasm_up.reset(); - } else if (llvm_arch == llvm::Triple::mips || - llvm_arch == llvm::Triple::mipsel || - llvm_arch == llvm::Triple::mips64 || - llvm_arch == llvm::Triple::mips64el) { + } else if (arch.IsMIPS()) { /* Create alternate disassembler for MIPS16 and microMIPS */ uint32_t arch_flags = arch.GetFlags(); if (arch_flags & ArchSpec::eMIPSAse_mips16) Modified: lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp?rev=360865=360864=360865=diff == --- lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp (original) +++ lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp Thu May 16 01:37:32 2019 @@ -488,10 +488,7 @@ bool DYLDRendezvous::ReadSOEntryFromMemo const ArchSpec = m_process->GetTarget().GetArchitecture(); if ((arch.GetTriple().getOS() == llvm::Triple::FreeBSD || arch.GetTriple().getOS() == llvm::Triple::NetBSD) && - (arch.GetMachine() == llvm::Triple::mips || - arch.GetMachine() == llvm::Triple::mipsel || - arch.GetMachine() == llvm::Triple::mips64 || - arch.GetMachine() == llvm::Triple::mips64el)) { + arch.IsMIPS()) { addr_t mips_l_offs; if (!(addr = ReadPointer(addr, _l_offs))) return false; Modified: lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp?rev=360865=360864=360865=diff == --- lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp (original) +++ lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp Thu May 16 01:37:32 2019 @@ -2185,11 +2185,7 @@ unsigned ObjectFileELF::ParseSymbols(Sym * class * accordingly. */ - const llvm::Triple::ArchType llvm_arch = arch.GetMachine(); - if (llvm_arch == llvm::Triple::mips || - llvm_arch == llvm::Triple::mipsel || - llvm_arch == llvm::Triple::mips64 || -
[Lldb-commits] [lldb] r360868 - Simplify Triple::ppc64{, le} checks with Triple::isPPC64()
Author: maskray Date: Thu May 16 02:07:33 2019 New Revision: 360868 URL: http://llvm.org/viewvc/llvm-project?rev=360868=rev Log: Simplify Triple::ppc64{,le} checks with Triple::isPPC64() While here, update some ppc64le specific check to isPPC64(), if it applies to big-endian as well, in the hope that it will ease the support of big-endian if people are interested in this area. The big-endian variant is used by at least FreeBSD, Gentoo Linux, Adélie Linux, and Void Linux. Modified: lldb/trunk/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp lldb/trunk/source/Plugins/Architecture/PPC64/ArchitecturePPC64.cpp lldb/trunk/source/Plugins/Instruction/PPC64/EmulateInstructionPPC64.cpp lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp Modified: lldb/trunk/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp?rev=360868=360867=360868=diff == --- lldb/trunk/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp (original) +++ lldb/trunk/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp Thu May 16 02:07:33 2019 @@ -69,10 +69,8 @@ lldb::ByteOrder ABISysV_ppc64::GetByteOr ABISP ABISysV_ppc64::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec ) { - if (arch.GetTriple().getArch() == llvm::Triple::ppc64 || - arch.GetTriple().getArch() == llvm::Triple::ppc64le) { + if (arch.GetTriple().isPPC64()) return ABISP(new ABISysV_ppc64(process_sp)); - } return ABISP(); } Modified: lldb/trunk/source/Plugins/Architecture/PPC64/ArchitecturePPC64.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Architecture/PPC64/ArchitecturePPC64.cpp?rev=360868=360867=360868=diff == --- lldb/trunk/source/Plugins/Architecture/PPC64/ArchitecturePPC64.cpp (original) +++ lldb/trunk/source/Plugins/Architecture/PPC64/ArchitecturePPC64.cpp Thu May 16 02:07:33 2019 @@ -35,11 +35,10 @@ void ArchitecturePPC64::Terminate() { } std::unique_ptr ArchitecturePPC64::Create(const ArchSpec ) { - if ((arch.GetMachine() != llvm::Triple::ppc64 && - arch.GetMachine() != llvm::Triple::ppc64le) || - arch.GetTriple().getObjectFormat() != llvm::Triple::ObjectFormatType::ELF) -return nullptr; - return std::unique_ptr(new ArchitecturePPC64()); + if (arch.GetTriple().isPPC64() && + arch.GetTriple().getObjectFormat() == llvm::Triple::ObjectFormatType::ELF) +return std::unique_ptr(new ArchitecturePPC64()); + return nullptr; } ConstString ArchitecturePPC64::GetPluginName() { return GetPluginNameStatic(); } Modified: lldb/trunk/source/Plugins/Instruction/PPC64/EmulateInstructionPPC64.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Instruction/PPC64/EmulateInstructionPPC64.cpp?rev=360868=360867=360868=diff == --- lldb/trunk/source/Plugins/Instruction/PPC64/EmulateInstructionPPC64.cpp (original) +++ lldb/trunk/source/Plugins/Instruction/PPC64/EmulateInstructionPPC64.cpp Thu May 16 02:07:33 2019 @@ -55,23 +55,15 @@ EmulateInstruction * EmulateInstructionPPC64::CreateInstance(const ArchSpec , InstructionType inst_type) { if (EmulateInstructionPPC64::SupportsEmulatingInstructionsOfTypeStatic( - inst_type)) { -if (arch.GetTriple().getArch() == llvm::Triple::ppc64 || -arch.GetTriple().getArch() == llvm::Triple::ppc64le) { + inst_type)) +if (arch.GetTriple().isPPC64()) return new EmulateInstructionPPC64(arch); -} - } return nullptr; } bool EmulateInstructionPPC64::SetTargetTriple(const ArchSpec ) { - if (arch.GetTriple().getArch() == llvm::Triple::ppc64) -return true; - else if (arch.GetTriple().getArch() == llvm::Triple::ppc64le) -return true; - - return false; + return arch.GetTriple().isPPC64(); } static bool LLDBTableGetRegisterInfo(uint32_t reg_num, RegisterInfo _info) { Modified: lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp?rev=360868=360867=360868=diff == --- lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp (original) +++ lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp Thu May 16 02:07:33 2019 @@ -1007,7 +1007,7 @@ NativeProcessLinux::SetupSoftwareSingleS // Arm mode error = SetSoftwareBreakpoint(next_pc, 4); } - } else if (m_arch.IsMIPS() || m_arch.GetMachine() == llvm::Triple::ppc64le) + } else if (m_arch.IsMIPS() || m_arch.GetTriple().isPPC64())
[Lldb-commits] [lldb] r360762 - Delete unnecessary copy ctors/copy assignment operators
Author: maskray Date: Wed May 15 04:23:54 2019 New Revision: 360762 URL: http://llvm.org/viewvc/llvm-project?rev=360762=rev Log: Delete unnecessary copy ctors/copy assignment operators It's the simplest and gives the cleanest semantics. Modified: lldb/trunk/include/lldb/Core/ModuleChild.h lldb/trunk/include/lldb/Core/SearchFilter.h lldb/trunk/include/lldb/Core/ValueObjectList.h lldb/trunk/include/lldb/DataFormatters/TypeSummary.h lldb/trunk/include/lldb/Expression/DWARFExpression.h lldb/trunk/include/lldb/Host/SocketAddress.h lldb/trunk/include/lldb/Symbol/SymbolContext.h lldb/trunk/include/lldb/Symbol/Type.h lldb/trunk/include/lldb/Target/ThreadSpec.h lldb/trunk/include/lldb/Utility/Broadcaster.h lldb/trunk/include/lldb/Utility/Status.h lldb/trunk/include/lldb/Utility/StringExtractor.h lldb/trunk/include/lldb/Utility/StringLexer.h lldb/trunk/source/Core/ModuleChild.cpp lldb/trunk/source/Core/SearchFilter.cpp lldb/trunk/source/Core/ValueObjectList.cpp lldb/trunk/source/DataFormatters/TypeSummary.cpp lldb/trunk/source/Expression/DWARFExpression.cpp lldb/trunk/source/Host/common/SocketAddress.cpp lldb/trunk/source/Symbol/SymbolContext.cpp lldb/trunk/source/Symbol/Type.cpp lldb/trunk/source/Target/ThreadSpec.cpp lldb/trunk/source/Utility/Broadcaster.cpp lldb/trunk/source/Utility/Status.cpp lldb/trunk/source/Utility/StringExtractor.cpp lldb/trunk/source/Utility/StringLexer.cpp lldb/trunk/tools/intel-features/intel-pt/PTDecoder.cpp lldb/trunk/tools/intel-features/intel-pt/PTDecoder.h lldb/trunk/tools/lldb-perf/lib/MemoryGauge.cpp lldb/trunk/tools/lldb-perf/lib/MemoryGauge.h Modified: lldb/trunk/include/lldb/Core/ModuleChild.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ModuleChild.h?rev=360762=360761=360762=diff == --- lldb/trunk/include/lldb/Core/ModuleChild.h (original) +++ lldb/trunk/include/lldb/Core/ModuleChild.h Wed May 15 04:23:54 2019 @@ -25,12 +25,6 @@ public: /// class. ModuleChild(const lldb::ModuleSP _sp); - /// Copy constructor. - /// - /// \param[in] rhs - /// A const ModuleChild class reference to copy. - ModuleChild(const ModuleChild ); - /// Destructor. ~ModuleChild(); Modified: lldb/trunk/include/lldb/Core/SearchFilter.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/SearchFilter.h?rev=360762=360761=360762=diff == --- lldb/trunk/include/lldb/Core/SearchFilter.h (original) +++ lldb/trunk/include/lldb/Core/SearchFilter.h Wed May 15 04:23:54 2019 @@ -88,14 +88,10 @@ public: ///The Target that provides the module list to search. SearchFilter(const lldb::TargetSP _sp); - SearchFilter(const SearchFilter ); - SearchFilter(const lldb::TargetSP _sp, unsigned char filterType); virtual ~SearchFilter(); - SearchFilter =(const SearchFilter ); - /// Call this method with a file spec to see if that spec passes the filter. /// /// \param[in] spec @@ -317,12 +313,8 @@ public: ///The Module that limits the search. SearchFilterByModule(const lldb::TargetSP , const FileSpec ); - SearchFilterByModule(const SearchFilterByModule ); - ~SearchFilterByModule() override; - SearchFilterByModule =(const SearchFilterByModule ); - bool ModulePasses(const lldb::ModuleSP _sp) override; bool ModulePasses(const FileSpec ) override; Modified: lldb/trunk/include/lldb/Core/ValueObjectList.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectList.h?rev=360762=360761=360762=diff == --- lldb/trunk/include/lldb/Core/ValueObjectList.h (original) +++ lldb/trunk/include/lldb/Core/ValueObjectList.h Wed May 15 04:23:54 2019 @@ -22,13 +22,6 @@ class ValueObject; // A collection of ValueObject values that class ValueObjectList { public: - // Constructors and Destructors - ValueObjectList(); - - ValueObjectList(const ValueObjectList ); - - ~ValueObjectList(); - const ValueObjectList =(const ValueObjectList ); void Append(const lldb::ValueObjectSP _obj_sp); Modified: lldb/trunk/include/lldb/DataFormatters/TypeSummary.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/TypeSummary.h?rev=360762=360761=360762=diff == --- lldb/trunk/include/lldb/DataFormatters/TypeSummary.h (original) +++ lldb/trunk/include/lldb/DataFormatters/TypeSummary.h Wed May 15 04:23:54 2019 @@ -26,12 +26,9 @@ namespace lldb_private { class TypeSummaryOptions { public: TypeSummaryOptions(); - TypeSummaryOptions(const TypeSummaryOptions ); ~TypeSummaryOptions() = default; - TypeSummaryOptions =(const TypeSummaryOptions ); -
[Lldb-commits] [lldb] r365295 - Change LaunchThread interface to return an Expected for non-Apple-non-Windows
Author: maskray Date: Mon Jul 8 00:07:05 2019 New Revision: 365295 URL: http://llvm.org/viewvc/llvm-project?rev=365295=rev Log: Change LaunchThread interface to return an Expected for non-Apple-non-Windows Fixes Linux build errors after D64163/r365226 Modified: lldb/trunk/include/lldb/Host/Host.h lldb/trunk/include/lldb/Host/HostNativeProcessBase.h lldb/trunk/include/lldb/Host/HostProcess.h lldb/trunk/include/lldb/Host/posix/HostProcessPosix.h lldb/trunk/source/Host/common/Host.cpp lldb/trunk/source/Host/common/HostProcess.cpp lldb/trunk/source/Host/common/MonitoringProcessLauncher.cpp lldb/trunk/source/Host/common/ProcessLaunchInfo.cpp lldb/trunk/source/Host/posix/HostProcessPosix.cpp Modified: lldb/trunk/include/lldb/Host/Host.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/Host.h?rev=365295=365294=365295=diff == --- lldb/trunk/include/lldb/Host/Host.h (original) +++ lldb/trunk/include/lldb/Host/Host.h Mon Jul 8 00:07:05 2019 @@ -99,7 +99,7 @@ public: /// was spawned to monitor \a pid. /// /// \see static void Host::StopMonitoringChildProcess (uint32_t) - static HostThread + static llvm::Expected StartMonitoringChildProcess(const MonitorChildProcessCallback , lldb::pid_t pid, bool monitor_signals); Modified: lldb/trunk/include/lldb/Host/HostNativeProcessBase.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/HostNativeProcessBase.h?rev=365295=365294=365295=diff == --- lldb/trunk/include/lldb/Host/HostNativeProcessBase.h (original) +++ lldb/trunk/include/lldb/Host/HostNativeProcessBase.h Mon Jul 8 00:07:05 2019 @@ -35,7 +35,7 @@ public: lldb::process_t GetSystemHandle() const { return m_process; } - virtual HostThread + virtual llvm::Expected StartMonitoring(const Host::MonitorChildProcessCallback , bool monitor_signals) = 0; Modified: lldb/trunk/include/lldb/Host/HostProcess.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/HostProcess.h?rev=365295=365294=365295=diff == --- lldb/trunk/include/lldb/Host/HostProcess.h (original) +++ lldb/trunk/include/lldb/Host/HostProcess.h Mon Jul 8 00:07:05 2019 @@ -43,8 +43,9 @@ public: lldb::pid_t GetProcessId() const; bool IsRunning() const; - HostThread StartMonitoring(const Host::MonitorChildProcessCallback , - bool monitor_signals); + llvm::Expected + StartMonitoring(const Host::MonitorChildProcessCallback , + bool monitor_signals); HostNativeProcessBase (); const HostNativeProcessBase () const; Modified: lldb/trunk/include/lldb/Host/posix/HostProcessPosix.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/posix/HostProcessPosix.h?rev=365295=365294=365295=diff == --- lldb/trunk/include/lldb/Host/posix/HostProcessPosix.h (original) +++ lldb/trunk/include/lldb/Host/posix/HostProcessPosix.h Mon Jul 8 00:07:05 2019 @@ -32,8 +32,9 @@ public: lldb::pid_t GetProcessId() const override; bool IsRunning() const override; - HostThread StartMonitoring(const Host::MonitorChildProcessCallback , - bool monitor_signals) override; + llvm::Expected + StartMonitoring(const Host::MonitorChildProcessCallback , + bool monitor_signals) override; }; } // namespace lldb_private Modified: lldb/trunk/source/Host/common/Host.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Host.cpp?rev=365295=365294=365295=diff == --- lldb/trunk/source/Host/common/Host.cpp (original) +++ lldb/trunk/source/Host/common/Host.cpp Mon Jul 8 00:07:05 2019 @@ -99,7 +99,7 @@ struct MonitorInfo { static thread_result_t MonitorChildProcessThreadFunction(void *arg); -HostThread Host::StartMonitoringChildProcess( +llvm::Expected Host::StartMonitoringChildProcess( const Host::MonitorChildProcessCallback , lldb::pid_t pid, bool monitor_signals) { MonitorInfo *info_ptr = new MonitorInfo(); @@ -112,7 +112,7 @@ HostThread Host::StartMonitoringChildPro ::snprintf(thread_name, sizeof(thread_name), "", pid); return ThreadLauncher::LaunchThread( - thread_name, MonitorChildProcessThreadFunction, info_ptr, nullptr); + thread_name, MonitorChildProcessThreadFunction, info_ptr, 0); } #ifndef __linux__ Modified: lldb/trunk/source/Host/common/HostProcess.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/HostProcess.cpp?rev=365295=365294=365295=diff
[Lldb-commits] [lldb] r364702 - Use const auto *
Author: maskray Date: Fri Jun 28 17:55:13 2019 New Revision: 364702 URL: http://llvm.org/viewvc/llvm-project?rev=364702=rev Log: Use const auto * Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp lldb/trunk/source/Symbol/Block.cpp Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp?rev=364702=364701=364702=diff == --- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp (original) +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp Fri Jun 28 17:55:13 2019 @@ -51,7 +51,7 @@ bool DWARFDebugInfoEntry::Extract(const if (m_abbr_idx) { lldb::offset_t offset = *offset_ptr; -auto *abbrevDecl = GetAbbreviationDeclarationPtr(cu); +const auto *abbrevDecl = GetAbbreviationDeclarationPtr(cu); if (abbrevDecl == nullptr) { cu->GetSymbolFileDWARF().GetObjectFile()->GetModule()->ReportError( "{0x%8.8x}: invalid abbreviation code %u, please file a bug and " @@ -232,7 +232,7 @@ bool DWARFDebugInfoEntry::GetDIENamesAnd std::vector dies; bool set_frame_base_loclist_addr = false; - auto abbrevDecl = GetAbbreviationDeclarationPtr(cu); + const auto *abbrevDecl = GetAbbreviationDeclarationPtr(cu); SymbolFileDWARF = cu->GetSymbolFileDWARF(); lldb::ModuleSP module = dwarf.GetObjectFile()->GetModule(); @@ -415,7 +415,7 @@ void DWARFDebugInfoEntry::Dump(const DWA if (abbrCode != m_abbr_idx) { s.Printf("error: DWARF has been modified\n"); } else if (abbrCode) { - auto *abbrevDecl = GetAbbreviationDeclarationPtr(cu); + const auto *abbrevDecl = GetAbbreviationDeclarationPtr(cu); if (abbrevDecl) { s.PutCString(DW_TAG_value_to_name(abbrevDecl->Tag())); s.Printf(" [%u] %c\n", abbrCode, abbrevDecl->HasChildren() ? '*' : ' '); @@ -546,7 +546,7 @@ void DWARFDebugInfoEntry::DumpAttribute( size_t DWARFDebugInfoEntry::GetAttributes( const DWARFUnit *cu, DWARFAttributes , uint32_t curr_depth) const { - auto abbrevDecl = GetAbbreviationDeclarationPtr(cu); + const auto *abbrevDecl = GetAbbreviationDeclarationPtr(cu); if (abbrevDecl) { const DWARFDataExtractor = cu->GetData(); lldb::offset_t offset = GetFirstAttributeOffset(); @@ -606,7 +606,7 @@ dw_offset_t DWARFDebugInfoEntry::GetAttr const DWARFUnit *cu, const dw_attr_t attr, DWARFFormValue _value, dw_offset_t *end_attr_offset_ptr, bool check_specification_or_abstract_origin) const { - if (auto *abbrevDecl = GetAbbreviationDeclarationPtr(cu)) { + if (const auto *abbrevDecl = GetAbbreviationDeclarationPtr(cu)) { uint32_t attr_idx = abbrevDecl->FindAttributeIndex(attr); if (attr_idx != DW_INVALID_INDEX) { Modified: lldb/trunk/source/Symbol/Block.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Block.cpp?rev=364702=364701=364702=diff == --- lldb/trunk/source/Symbol/Block.cpp (original) +++ lldb/trunk/source/Symbol/Block.cpp Fri Jun 28 17:55:13 2019 @@ -214,10 +214,10 @@ Block *Block::GetInlinedParent() { Block *Block::GetContainingInlinedBlockWithCallSite( const Declaration _call_site) { - auto inlined_block = GetContainingInlinedBlock(); + Block *inlined_block = GetContainingInlinedBlock(); while (inlined_block) { -auto function_info = inlined_block->GetInlinedFunctionInfo(); +const auto *function_info = inlined_block->GetInlinedFunctionInfo(); if (function_info && function_info->GetCallSite().FileAndLineEqual(find_call_site)) ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r371962 - [test] Add -z separate-code to fix tests that ae sensitive to exact addresses after r371958
Author: maskray Date: Mon Sep 16 00:52:30 2019 New Revision: 371962 URL: http://llvm.org/viewvc/llvm-project?rev=371962=rev Log: [test] Add -z separate-code to fix tests that ae sensitive to exact addresses after r371958 Modified: lldb/trunk/lit/SymbolFile/DWARF/debug-types-address-ranges.s lldb/trunk/lit/SymbolFile/DWARF/dir-separator-no-comp-dir-relative-name.s lldb/trunk/lit/SymbolFile/DWARF/dir-separator-no-comp-dir.s lldb/trunk/lit/SymbolFile/DWARF/dir-separator-posix.s lldb/trunk/lit/SymbolFile/DWARF/dir-separator-windows.s lldb/trunk/lit/SymbolFile/DWARF/find-inline-method.s Modified: lldb/trunk/lit/SymbolFile/DWARF/debug-types-address-ranges.s URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/DWARF/debug-types-address-ranges.s?rev=371962=371961=371962=diff == --- lldb/trunk/lit/SymbolFile/DWARF/debug-types-address-ranges.s (original) +++ lldb/trunk/lit/SymbolFile/DWARF/debug-types-address-ranges.s Mon Sep 16 00:52:30 2019 @@ -7,7 +7,7 @@ # REQUIRES: lld, x86 # RUN: llvm-mc -dwarf-version=5 -triple x86_64-pc-linux %s -filetype=obj >%t.o -# RUN: ld.lld %t.o -o %t -image-base=0x47000 +# RUN: ld.lld %t.o -o %t -image-base=0x47000 -z separate-code # RUN: %lldb %t -o "image lookup -a 0x48000 -v" -o exit | FileCheck %s # CHECK: CompileUnit: id = {0x0001}, file = "/tmp/a.cc", language = "c++" Modified: lldb/trunk/lit/SymbolFile/DWARF/dir-separator-no-comp-dir-relative-name.s URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/DWARF/dir-separator-no-comp-dir-relative-name.s?rev=371962=371961=371962=diff == --- lldb/trunk/lit/SymbolFile/DWARF/dir-separator-no-comp-dir-relative-name.s (original) +++ lldb/trunk/lit/SymbolFile/DWARF/dir-separator-no-comp-dir-relative-name.s Mon Sep 16 00:52:30 2019 @@ -5,7 +5,7 @@ # REQUIRES: lld, x86 # RUN: llvm-mc -triple x86_64-pc-linux %s -filetype=obj > %t.o -# RUN: ld.lld %t.o -o %t +# RUN: ld.lld %t.o -o %t -z separate-code # RUN: %lldb %t -s %S/Inputs/dir-separator-no-comp-dir-relative-name.lldbinit -o exit | FileCheck %s # CHECK-LABEL: image dump line-table a.c Modified: lldb/trunk/lit/SymbolFile/DWARF/dir-separator-no-comp-dir.s URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/DWARF/dir-separator-no-comp-dir.s?rev=371962=371961=371962=diff == --- lldb/trunk/lit/SymbolFile/DWARF/dir-separator-no-comp-dir.s (original) +++ lldb/trunk/lit/SymbolFile/DWARF/dir-separator-no-comp-dir.s Mon Sep 16 00:52:30 2019 @@ -4,7 +4,7 @@ # REQUIRES: lld, x86 # RUN: llvm-mc -triple x86_64-pc-linux %s -filetype=obj > %t.o -# RUN: ld.lld %t.o -o %t +# RUN: ld.lld %t.o -o %t -z separate-code # RUN: %lldb %t -s %S/Inputs/dir-separator-windows.lldbinit -o exit | FileCheck %s # CHECK-LABEL: image dump line-table a.c Modified: lldb/trunk/lit/SymbolFile/DWARF/dir-separator-posix.s URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/DWARF/dir-separator-posix.s?rev=371962=371961=371962=diff == --- lldb/trunk/lit/SymbolFile/DWARF/dir-separator-posix.s (original) +++ lldb/trunk/lit/SymbolFile/DWARF/dir-separator-posix.s Mon Sep 16 00:52:30 2019 @@ -4,7 +4,7 @@ # REQUIRES: lld, x86 # RUN: llvm-mc -triple x86_64-pc-linux %s -filetype=obj > %t.o -# RUN: ld.lld %t.o -o %t +# RUN: ld.lld %t.o -o %t -z separate-code # RUN: %lldb %t -s %S/Inputs/dir-separator-posix.lldbinit -o exit | FileCheck %s # CHECK-LABEL: image dump line-table a.c Modified: lldb/trunk/lit/SymbolFile/DWARF/dir-separator-windows.s URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/DWARF/dir-separator-windows.s?rev=371962=371961=371962=diff == --- lldb/trunk/lit/SymbolFile/DWARF/dir-separator-windows.s (original) +++ lldb/trunk/lit/SymbolFile/DWARF/dir-separator-windows.s Mon Sep 16 00:52:30 2019 @@ -4,7 +4,7 @@ # REQUIRES: lld, x86 # RUN: llvm-mc -triple x86_64-pc-linux %s -filetype=obj > %t.o -# RUN: ld.lld %t.o -o %t +# RUN: ld.lld %t.o -o %t -z separate-code # RUN: %lldb %t -s %S/Inputs/dir-separator-windows.lldbinit -o exit | FileCheck %s # CHECK-LABEL: image dump line-table a.c Modified: lldb/trunk/lit/SymbolFile/DWARF/find-inline-method.s URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/DWARF/find-inline-method.s?rev=371962=371961=371962=diff == --- lldb/trunk/lit/SymbolFile/DWARF/find-inline-method.s (original) +++ lldb/trunk/lit/SymbolFile/DWARF/find-inline-method.s Mon Sep 16 00:52:30 2019 @@ -1,7 +1,7 @@ # REQUIRES: lld, x86 # RUN: llvm-mc -triple x86_64-pc-linux %s -filetype=obj >
[Lldb-commits] [lldb] r367800 - Rename F_{None, Text, Append} to OF_{None, Text, Append}. NFC
Author: maskray Date: Sun Aug 4 22:43:48 2019 New Revision: 367800 URL: http://llvm.org/viewvc/llvm-project?rev=367800=rev Log: Rename F_{None,Text,Append} to OF_{None,Text,Append}. NFC F_{None,Text,Append} are kept for compatibility since r334221. Modified: lldb/trunk/include/lldb/Utility/Reproducer.h lldb/trunk/source/API/SBReproducerPrivate.h lldb/trunk/source/Core/Debugger.cpp lldb/trunk/source/Plugins/Platform/Android/AdbClient.cpp lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp lldb/trunk/source/Target/Platform.cpp lldb/trunk/source/Utility/Reproducer.cpp lldb/trunk/tools/lldb-server/LLDBServerUtilities.cpp Modified: lldb/trunk/include/lldb/Utility/Reproducer.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Utility/Reproducer.h?rev=367800=367799=367800=diff == --- lldb/trunk/include/lldb/Utility/Reproducer.h (original) +++ lldb/trunk/include/lldb/Utility/Reproducer.h Sun Aug 4 22:43:48 2019 @@ -137,7 +137,7 @@ class DataRecorder { public: DataRecorder(const FileSpec , std::error_code ) : m_filename(filename.GetFilename().GetStringRef()), -m_os(filename.GetPath(), ec, llvm::sys::fs::F_Text), m_record(true) {} +m_os(filename.GetPath(), ec, llvm::sys::fs::OF_Text), m_record(true) {} static llvm::Expected> Create(const FileSpec ); Modified: lldb/trunk/source/API/SBReproducerPrivate.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBReproducerPrivate.h?rev=367800=367799=367800=diff == --- lldb/trunk/source/API/SBReproducerPrivate.h (original) +++ lldb/trunk/source/API/SBReproducerPrivate.h Sun Aug 4 22:43:48 2019 @@ -40,7 +40,7 @@ public: SBProvider(const FileSpec ) : Provider(directory), m_stream(directory.CopyByAppendingPathComponent("sbapi.bin").GetPath(), - m_ec, llvm::sys::fs::OpenFlags::F_None), + m_ec, llvm::sys::fs::OpenFlags::OF_None), m_serializer(m_stream) {} Serializer () { return m_serializer; } Modified: lldb/trunk/source/Core/Debugger.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Debugger.cpp?rev=367800=367799=367800=diff == --- lldb/trunk/source/Core/Debugger.cpp (original) +++ lldb/trunk/source/Core/Debugger.cpp Sun Aug 4 22:43:48 2019 @@ -1200,9 +1200,9 @@ bool Debugger::EnableLog(llvm::StringRef if (pos != m_log_streams.end()) log_stream_sp = pos->second.lock(); if (!log_stream_sp) { - llvm::sys::fs::OpenFlags flags = llvm::sys::fs::F_Text; + llvm::sys::fs::OpenFlags flags = llvm::sys::fs::OF_Text; if (log_options & LLDB_LOG_OPTION_APPEND) -flags |= llvm::sys::fs::F_Append; +flags |= llvm::sys::fs::OF_Append; int FD; if (std::error_code ec = llvm::sys::fs::openFileForWrite( log_file, FD, llvm::sys::fs::CD_CreateAlways, flags)) { Modified: lldb/trunk/source/Plugins/Platform/Android/AdbClient.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/Android/AdbClient.cpp?rev=367800=367799=367800=diff == --- lldb/trunk/source/Plugins/Platform/Android/AdbClient.cpp (original) +++ lldb/trunk/source/Plugins/Platform/Android/AdbClient.cpp Sun Aug 4 22:43:48 2019 @@ -405,7 +405,7 @@ Status AdbClient::ShellToFile(const char const auto output_filename = output_file_spec.GetPath(); std::error_code EC; - llvm::raw_fd_ostream dst(output_filename, EC, llvm::sys::fs::F_None); + llvm::raw_fd_ostream dst(output_filename, EC, llvm::sys::fs::OF_None); if (EC) return Status("Unable to open local file %s", output_filename.c_str()); @@ -432,7 +432,7 @@ Status AdbClient::SyncService::internalP llvm::FileRemover local_file_remover(local_file_path); std::error_code EC; - llvm::raw_fd_ostream dst(local_file_path, EC, llvm::sys::fs::F_None); + llvm::raw_fd_ostream dst(local_file_path, EC, llvm::sys::fs::OF_None); if (EC) return Status("Unable to open local file %s", local_file_path.c_str()); Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp?rev=367800=367799=367800=diff == --- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (original) +++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Sun Aug 4 22:43:48 2019 @@ -179,8 +179,8 @@ public: FileSpec history_file = GetRoot().CopyByAppendingPathComponent(Info::file); std::error_code EC; -m_stream_up = llvm::make_unique(history_file.GetPath(), EC, -
[Lldb-commits] [lldb] r367549 - [lit] Use ld.lld -z separate-code to work around a debug_line parsing bug
Author: maskray Date: Thu Aug 1 05:34:43 2019 New Revision: 367549 URL: http://llvm.org/viewvc/llvm-project?rev=367549=rev Log: [lit] Use ld.lld -z separate-code to work around a debug_line parsing bug The issue was exposed by D64903/r367537. http://lab.llvm.org:8011/builders/lldb-x64-windows-ninja/builds/7321/ In these tests, .debug_str immediately follows .text. The last section of last RX PT_LOAD was originally padded with trap instructions and .debug_str started at a new page (actually common-page-size). Now, .debug_str immediately follows .test. Add -z separate-code to use the old layout. Modified: lldb/trunk/lit/SymbolFile/DWARF/debug-line-basic.s lldb/trunk/lit/SymbolFile/DWARF/dir-separator-no-comp-dir-relative-name.s lldb/trunk/lit/SymbolFile/DWARF/dir-separator-no-comp-dir.s lldb/trunk/lit/SymbolFile/DWARF/dir-separator-posix.s lldb/trunk/lit/SymbolFile/DWARF/dir-separator-windows.s Modified: lldb/trunk/lit/SymbolFile/DWARF/debug-line-basic.s URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/DWARF/debug-line-basic.s?rev=367549=367548=367549=diff == --- lldb/trunk/lit/SymbolFile/DWARF/debug-line-basic.s (original) +++ lldb/trunk/lit/SymbolFile/DWARF/debug-line-basic.s Thu Aug 1 05:34:43 2019 @@ -1,7 +1,7 @@ # REQUIRES: lld, x86 # RUN: llvm-mc -triple x86_64-pc-linux %s -filetype=obj > %t.o -# RUN: ld.lld %t.o -o %t +# RUN: ld.lld -z separate-code %t.o -o %t # RUN: %lldb %t -o "image dump line-table -v a.c" -o exit | FileCheck %s Modified: lldb/trunk/lit/SymbolFile/DWARF/dir-separator-no-comp-dir-relative-name.s URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/DWARF/dir-separator-no-comp-dir-relative-name.s?rev=367549=367548=367549=diff == --- lldb/trunk/lit/SymbolFile/DWARF/dir-separator-no-comp-dir-relative-name.s (original) +++ lldb/trunk/lit/SymbolFile/DWARF/dir-separator-no-comp-dir-relative-name.s Thu Aug 1 05:34:43 2019 @@ -5,7 +5,7 @@ # REQUIRES: lld, x86 # RUN: llvm-mc -triple x86_64-pc-linux %s -filetype=obj > %t.o -# RUN: ld.lld %t.o -o %t +# RUN: ld.lld -z separate-code %t.o -o %t # RUN: %lldb %t -s %S/Inputs/dir-separator-no-comp-dir-relative-name.lldbinit -o exit | FileCheck %s # CHECK-LABEL: image dump line-table a.c Modified: lldb/trunk/lit/SymbolFile/DWARF/dir-separator-no-comp-dir.s URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/DWARF/dir-separator-no-comp-dir.s?rev=367549=367548=367549=diff == --- lldb/trunk/lit/SymbolFile/DWARF/dir-separator-no-comp-dir.s (original) +++ lldb/trunk/lit/SymbolFile/DWARF/dir-separator-no-comp-dir.s Thu Aug 1 05:34:43 2019 @@ -4,7 +4,7 @@ # REQUIRES: lld, x86 # RUN: llvm-mc -triple x86_64-pc-linux %s -filetype=obj > %t.o -# RUN: ld.lld %t.o -o %t +# RUN: ld.lld -z separate-code %t.o -o %t # RUN: %lldb %t -s %S/Inputs/dir-separator-windows.lldbinit -o exit | FileCheck %s # CHECK-LABEL: image dump line-table a.c Modified: lldb/trunk/lit/SymbolFile/DWARF/dir-separator-posix.s URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/DWARF/dir-separator-posix.s?rev=367549=367548=367549=diff == --- lldb/trunk/lit/SymbolFile/DWARF/dir-separator-posix.s (original) +++ lldb/trunk/lit/SymbolFile/DWARF/dir-separator-posix.s Thu Aug 1 05:34:43 2019 @@ -4,7 +4,7 @@ # REQUIRES: lld, x86 # RUN: llvm-mc -triple x86_64-pc-linux %s -filetype=obj > %t.o -# RUN: ld.lld %t.o -o %t +# RUN: ld.lld -z separate-code %t.o -o %t # RUN: %lldb %t -s %S/Inputs/dir-separator-posix.lldbinit -o exit | FileCheck %s # CHECK-LABEL: image dump line-table a.c Modified: lldb/trunk/lit/SymbolFile/DWARF/dir-separator-windows.s URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/DWARF/dir-separator-windows.s?rev=367549=367548=367549=diff == --- lldb/trunk/lit/SymbolFile/DWARF/dir-separator-windows.s (original) +++ lldb/trunk/lit/SymbolFile/DWARF/dir-separator-windows.s Thu Aug 1 05:34:43 2019 @@ -4,7 +4,7 @@ # REQUIRES: lld, x86 # RUN: llvm-mc -triple x86_64-pc-linux %s -filetype=obj > %t.o -# RUN: ld.lld %t.o -o %t +# RUN: ld.lld -z separate-code %t.o -o %t # RUN: %lldb %t -s %S/Inputs/dir-separator-windows.lldbinit -o exit | FileCheck %s # CHECK-LABEL: image dump line-table a.c ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r366983 - cli-wrapper-mpxtable.cpp: fix file header
Author: maskray Date: Wed Jul 24 22:15:50 2019 New Revision: 366983 URL: http://llvm.org/viewvc/llvm-project?rev=366983=rev Log: cli-wrapper-mpxtable.cpp: fix file header Modified: lldb/trunk/tools/intel-features/intel-mpx/cli-wrapper-mpxtable.cpp Modified: lldb/trunk/tools/intel-features/intel-mpx/cli-wrapper-mpxtable.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/intel-features/intel-mpx/cli-wrapper-mpxtable.cpp?rev=366983=366982=366983=diff == --- lldb/trunk/tools/intel-features/intel-mpx/cli-wrapper-mpxtable.cpp (original) +++ lldb/trunk/tools/intel-features/intel-mpx/cli-wrapper-mpxtable.cpp Wed Jul 24 22:15:50 2019 @@ -1,5 +1,4 @@ -//===-- cli-wrapper-mpxtable.cpp--*- C++ -//-*-===// +//===-- cli-wrapper-mpxtable.cpp *- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r367001 - SymbolFile: Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=off builds after D65089/r366791
Author: maskray Date: Thu Jul 25 02:56:45 2019 New Revision: 367001 URL: http://llvm.org/viewvc/llvm-project?rev=367001=rev Log: SymbolFile: Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=off builds after D65089/r366791 Modified: lldb/trunk/source/Symbol/SymbolFile.cpp Modified: lldb/trunk/source/Symbol/SymbolFile.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/SymbolFile.cpp?rev=367001=367000=367001=diff == --- lldb/trunk/source/Symbol/SymbolFile.cpp (original) +++ lldb/trunk/source/Symbol/SymbolFile.cpp Thu Jul 25 02:56:45 2019 @@ -189,6 +189,7 @@ void SymbolFile::SetCompileUnitAtIndex(u std::lock_guard guard(GetModuleMutex()); const size_t num_compile_units = GetNumCompileUnits(); assert(idx < num_compile_units); + (void)num_compile_units; // Fire off an assertion if this compile unit already exists for now. The // partial parsing should take care of only setting the compile unit ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r367090 - ObjectFileELF: Use llvm::JamCRC to refactor CRC32 computation
Author: maskray Date: Fri Jul 26 01:33:36 2019 New Revision: 367090 URL: http://llvm.org/viewvc/llvm-project?rev=367090=rev Log: ObjectFileELF: Use llvm::JamCRC to refactor CRC32 computation Reviewed By: labath Differential Revision: https://reviews.llvm.org/D65318 Modified: lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp Modified: lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp?rev=367090=367089=367090=diff == --- lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp (original) +++ lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp Fri Jul 26 01:33:36 2019 @@ -35,6 +35,7 @@ #include "llvm/ADT/StringRef.h" #include "llvm/Object/Decompressor.h" #include "llvm/Support/ARMBuildAttributes.h" +#include "llvm/Support/JamCRC.h" #include "llvm/Support/MathExtras.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/MipsABIFlags.h" @@ -428,67 +429,11 @@ bool ObjectFileELF::MagicBytesMatch(Data return false; } -/* - * crc function from http://svnweb.freebsd.org/base/head/sys/libkern/crc32.c - * - * COPYRIGHT (C) 1986 Gary S. Brown. You may use this program, or - * code or tables extracted from it, as desired without restriction. - */ -static uint32_t calc_crc32(uint32_t crc, const void *buf, size_t size) { - static const uint32_t g_crc32_tab[] = { - 0x, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, - 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, - 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, - 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, - 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, - 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, - 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c, - 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, - 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, - 0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, - 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106, - 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, - 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, - 0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, - 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, - 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, - 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, - 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, - 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, - 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, - 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, - 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, - 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84, - 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, - 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, - 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, - 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e, - 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, - 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, - 0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, - 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28, - 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, - 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, - 0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, - 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, - 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, - 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, - 0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, - 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, - 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, - 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, - 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, - 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d}; - const uint8_t *p = (const uint8_t *)buf; - - crc = crc ^ ~0U; - while (size--) -crc = g_crc32_tab[(crc ^
[Lldb-commits] [lldb] r375072 - SBCommandReturnObject: change LLDB_RECORD_METHOD(..., FILE *, ...) to use LLDB_RECORD_DUMMY
Author: maskray Date: Wed Oct 16 18:28:07 2019 New Revision: 375072 URL: http://llvm.org/viewvc/llvm-project?rev=375072=rev Log: SBCommandReturnObject: change LLDB_RECORD_METHOD(..., FILE *, ...) to use LLDB_RECORD_DUMMY POSIX says FILE is a typedef to a structure containing information about a file. The structure is unspecified, i.e. it may be an incomplete type, as is the case on musl (`struct _IO_FILE` is an implementation detail that is not exposed). `LLDB_RECORD_METHOD(..., (FILE *), ...)` transitively uses sizeof(FILE) and requires the structure to be complete. Change it to LLDB_RECORD_DUMMY to fix the build failure on musl (regression of D57475). Reviewed By: JDevlieghere, labath, lawrence_danna Differential Revision: https://reviews.llvm.org/D68872 Modified: lldb/trunk/source/API/SBCommandReturnObject.cpp Modified: lldb/trunk/source/API/SBCommandReturnObject.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBCommandReturnObject.cpp?rev=375072=375071=375072=diff == --- lldb/trunk/source/API/SBCommandReturnObject.cpp (original) +++ lldb/trunk/source/API/SBCommandReturnObject.cpp Wed Oct 16 18:28:07 2019 @@ -116,7 +116,7 @@ size_t SBCommandReturnObject::GetErrorSi } size_t SBCommandReturnObject::PutOutput(FILE *fh) { - LLDB_RECORD_METHOD(size_t, SBCommandReturnObject, PutOutput, (FILE *), fh); + LLDB_RECORD_DUMMY(size_t, SBCommandReturnObject, PutOutput, (FILE *), fh); if (fh) { size_t num_bytes = GetOutputSize(); if (num_bytes) @@ -141,8 +141,7 @@ size_t SBCommandReturnObject::PutOutput( } size_t SBCommandReturnObject::PutError(FILE *fh) { - LLDB_RECORD_METHOD(size_t, SBCommandReturnObject, PutError, (FILE *), fh); - + LLDB_RECORD_DUMMY(size_t, SBCommandReturnObject, PutError, (FILE *), fh); if (fh) { size_t num_bytes = GetErrorSize(); if (num_bytes) @@ -255,31 +254,31 @@ bool SBCommandReturnObject::GetDescripti } void SBCommandReturnObject::SetImmediateOutputFile(FILE *fh) { - LLDB_RECORD_METHOD(void, SBCommandReturnObject, SetImmediateOutputFile, - (FILE *), fh); + LLDB_RECORD_DUMMY(void, SBCommandReturnObject, SetImmediateOutputFile, +(FILE *), fh); SetImmediateOutputFile(fh, false); } void SBCommandReturnObject::SetImmediateErrorFile(FILE *fh) { - LLDB_RECORD_METHOD(void, SBCommandReturnObject, SetImmediateErrorFile, - (FILE *), fh); + LLDB_RECORD_DUMMY(void, SBCommandReturnObject, SetImmediateErrorFile, +(FILE *), fh); SetImmediateErrorFile(fh, false); } void SBCommandReturnObject::SetImmediateOutputFile(FILE *fh, bool transfer_ownership) { - LLDB_RECORD_METHOD(void, SBCommandReturnObject, SetImmediateOutputFile, - (FILE *, bool), fh, transfer_ownership); + LLDB_RECORD_DUMMY(void, SBCommandReturnObject, SetImmediateOutputFile, +(FILE *, bool), fh, transfer_ownership); FileSP file = std::make_shared(fh, transfer_ownership); ref().SetImmediateOutputFile(file); } void SBCommandReturnObject::SetImmediateErrorFile(FILE *fh, bool transfer_ownership) { - LLDB_RECORD_METHOD(void, SBCommandReturnObject, SetImmediateErrorFile, - (FILE *, bool), fh, transfer_ownership); + LLDB_RECORD_DUMMY(void, SBCommandReturnObject, SetImmediateErrorFile, +(FILE *, bool), fh, transfer_ownership); FileSP file = std::make_shared(fh, transfer_ownership); ref().SetImmediateErrorFile(file); } ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] 041fa5a - [lldb] Fix file header of Host/posix/FileSystemPosix.cpp
Author: Fangrui Song Date: 2020-01-24T00:29:53-08:00 New Revision: 041fa5ad7c3c61b2253efaa049326ea7e98752ab URL: https://github.com/llvm/llvm-project/commit/041fa5ad7c3c61b2253efaa049326ea7e98752ab DIFF: https://github.com/llvm/llvm-project/commit/041fa5ad7c3c61b2253efaa049326ea7e98752ab.diff LOG: [lldb] Fix file header of Host/posix/FileSystemPosix.cpp Added: Modified: lldb/source/Host/posix/FileSystemPosix.cpp Removed: diff --git a/lldb/source/Host/posix/FileSystemPosix.cpp b/lldb/source/Host/posix/FileSystemPosix.cpp index 4c7158b42feb..3660f67895a4 100644 --- a/lldb/source/Host/posix/FileSystemPosix.cpp +++ b/lldb/source/Host/posix/FileSystemPosix.cpp @@ -1,4 +1,4 @@ -//===-- FileSystem.cpp ===// +//===-- FileSystemPosix.cpp ---===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] 77519b6 - [test] yaml2obj -docnum => --docnum=
Author: Fangrui Song Date: 2020-02-05T10:25:04-08:00 New Revision: 77519b60d99233ccea2622ea3e40b30018d2f228 URL: https://github.com/llvm/llvm-project/commit/77519b60d99233ccea2622ea3e40b30018d2f228 DIFF: https://github.com/llvm/llvm-project/commit/77519b60d99233ccea2622ea3e40b30018d2f228.diff LOG: [test] yaml2obj -docnum => --docnum= Added: Modified: lld/test/ELF/compressed-input-alignment.test lld/test/ELF/invalid/bad-reloc-target.test lld/test/ELF/invalid/common-symbol-alignment.test lld/test/ELF/invalid/dynamic-section-broken.test lld/test/ELF/invalid/symtab-sh-info.s lld/test/ELF/mips-elf-flags-err.test lld/test/ELF/mips-fp-flags-err.test lldb/test/Shell/ObjectFile/wasm/unified-debug-sections.yaml Removed: diff --git a/lld/test/ELF/compressed-input-alignment.test b/lld/test/ELF/compressed-input-alignment.test index fd71bf361e25..57dd677c988b 100644 --- a/lld/test/ELF/compressed-input-alignment.test +++ b/lld/test/ELF/compressed-input-alignment.test @@ -1,10 +1,10 @@ # REQUIRES: zlib, x86 -# RUN: yaml2obj -docnum=1 %s -o %t.o +# RUN: yaml2obj --docnum=1 %s -o %t.o # RUN: ld.lld %t.o %t.o -o %t2 # RUN: llvm-readobj --sections --section-data %t2 | FileCheck %s -# RUN: yaml2obj -docnum=2 %s -o %t.o +# RUN: yaml2obj --docnum=2 %s -o %t.o # RUN: ld.lld %t.o %t.o -o %t2 # RUN: llvm-readobj --sections --section-data %t2 | FileCheck %s diff --git a/lld/test/ELF/invalid/bad-reloc-target.test b/lld/test/ELF/invalid/bad-reloc-target.test index 9ab5d9c22580..7fafe5e70773 100644 --- a/lld/test/ELF/invalid/bad-reloc-target.test +++ b/lld/test/ELF/invalid/bad-reloc-target.test @@ -1,4 +1,4 @@ -# RUN: yaml2obj -docnum=1 %s -o %t1.o +# RUN: yaml2obj --docnum=1 %s -o %t1.o # RUN: not ld.lld %t1.o -o %t1 2>&1 | FileCheck %s # CHECK: error: {{.*}}.o: unsupported relocation reference @@ -24,7 +24,7 @@ Symbols: - Name:foo Binding: STB_GLOBAL -# RUN: yaml2obj -docnum=2 %s -o %t2.o +# RUN: yaml2obj --docnum=2 %s -o %t2.o # RUN: not ld.lld %t2.o -o %t2 2>&1 | FileCheck %s --check-prefix=ERR2 # ERR2: error: {{.*}}.o: invalid relocated section index: 99 @@ -52,7 +52,7 @@ Symbols: ## Relocation refers to a symbol with index larger than ## symbol table size. Check we report it. -# RUN: yaml2obj -docnum=3 %s -o %t2.o +# RUN: yaml2obj --docnum=3 %s -o %t2.o # RUN: not ld.lld %t2.o -o %t2 2>&1 | FileCheck %s --check-prefix=ERR3 # ERR3: error: {{.*}}.o: invalid symbol index diff --git a/lld/test/ELF/invalid/common-symbol-alignment.test b/lld/test/ELF/invalid/common-symbol-alignment.test index 7b79441aa110..cb8a35a956c2 100644 --- a/lld/test/ELF/invalid/common-symbol-alignment.test +++ b/lld/test/ELF/invalid/common-symbol-alignment.test @@ -1,6 +1,6 @@ ## If an object contains a common symbol with zero alignment, ## check we report it. -# RUN: yaml2obj -docnum=1 %s -o %t1.o +# RUN: yaml2obj --docnum=1 %s -o %t1.o # RUN: not ld.lld %t1.o -o %t 2>&1 | FileCheck %s # CHECK: common symbol 'bar' has invalid alignment: 0 @@ -18,7 +18,7 @@ Symbols: ## If an object contains a common symbol with alignment greater ## than UINT32_MAX, check we report it. -# RUN: yaml2obj -docnum=2 %s -o %t2.o +# RUN: yaml2obj --docnum=2 %s -o %t2.o # RUN: not ld.lld %t2.o -o %t 2>&1 | FileCheck %s --check-prefix=BIG # BIG: common symbol 'bar' has invalid alignment: 271644049215 diff --git a/lld/test/ELF/invalid/dynamic-section-broken.test b/lld/test/ELF/invalid/dynamic-section-broken.test index ecc7834300ec..31317f632487 100644 --- a/lld/test/ELF/invalid/dynamic-section-broken.test +++ b/lld/test/ELF/invalid/dynamic-section-broken.test @@ -1,5 +1,5 @@ ## .dynamic section has invalid sh_entsize, check we report it. -# RUN: yaml2obj -docnum=1 %s -o %t.so +# RUN: yaml2obj --docnum=1 %s -o %t.so # RUN: not ld.lld %t.so -o /dev/null 2>&1 | FileCheck %s --check-prefix=ERR1 # ERR1: error: {{.*}}.so: section [index 1] has an invalid sh_entsize: 291 @@ -18,7 +18,7 @@ Sections: ## The .dynamic section has invalid sh_size, which is too short and ## even less than entry size. Check we report it. -# RUN: yaml2obj -docnum=2 %s -o %t.so +# RUN: yaml2obj --docnum=2 %s -o %t.so # RUN: not ld.lld %t.so -o /dev/null 2>&1 | FileCheck %s --check-prefix=ERR2 # ERR2: error: {{.*}}.so: section [index 1] has an invalid sh_size (1) which is not a multiple of its sh_entsize (16) diff --git a/lld/test/ELF/invalid/symtab-sh-info.s b/lld/test/ELF/invalid/symtab-sh-info.s index 9e694dcc4982..9b9cd4e9964b 100644 --- a/lld/test/ELF/invalid/symtab-sh-info.s +++ b/lld/test/ELF/invalid/symtab-sh-info.s @@ -1,7 +1,7 @@ ## .symtab's sh_info contains zero value. First entry in a .symtab is a ## zero entry that must exist in a valid object, so sh_info can't be null. ## Check we report a proper error for that case. -# RUN: yaml2obj -docnum=1 %s -o %t.o +# RUN: yaml2obj
[Lldb-commits] [lldb] 512c03b - [DebugInfo] Add a DWARFDataExtractor constructor that takes ArrayRef
Author: Fangrui Song Date: 2020-02-09T17:45:32-08:00 New Revision: 512c03bac449d8d40c5fc8d0ff1719f887c7fdc3 URL: https://github.com/llvm/llvm-project/commit/512c03bac449d8d40c5fc8d0ff1719f887c7fdc3 DIFF: https://github.com/llvm/llvm-project/commit/512c03bac449d8d40c5fc8d0ff1719f887c7fdc3.diff LOG: [DebugInfo] Add a DWARFDataExtractor constructor that takes ArrayRef Similar to D67797 (DataExtractor). Added: Modified: lldb/source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.cpp lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp llvm/include/llvm/DebugInfo/DWARF/DWARFDataExtractor.h llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp llvm/tools/llvm-readobj/DwarfCFIEHPrinter.h Removed: diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.cpp index 4eea18e0f237..cf483286a66d 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.cpp @@ -23,8 +23,7 @@ DWARFDataExtractor::GetDWARFOffset(lldb::offset_t *offset_ptr) const { llvm::DWARFDataExtractor DWARFDataExtractor::GetAsLLVM() const { return llvm::DWARFDataExtractor( - llvm::StringRef(reinterpret_cast(GetDataStart()), - GetByteSize()), + llvm::makeArrayRef(GetDataStart(), GetByteSize()), GetByteOrder() == lldb::eByteOrderLittle, GetAddressByteSize()); } } // namespace lldb_private diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp index 8944078d7fff..e4a89160969e 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp @@ -468,8 +468,8 @@ void DWARFUnit::SetLoclistsBase(dw_addr_t loclists_base) { std::unique_ptr DWARFUnit::GetLocationTable(const DataExtractor ) const { llvm::DWARFDataExtractor llvm_data( - toStringRef(data.GetData()), - data.GetByteOrder() == lldb::eByteOrderLittle, data.GetAddressByteSize()); + data.GetData(), data.GetByteOrder() == lldb::eByteOrderLittle, + data.GetAddressByteSize()); if (m_is_dwo || GetVersion() >= 5) return std::make_unique(llvm_data, GetVersion()); diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFDataExtractor.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFDataExtractor.h index 6f7ddb2ef421..c4ba982ce808 100644 --- a/llvm/include/llvm/DebugInfo/DWARF/DWARFDataExtractor.h +++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFDataExtractor.h @@ -32,6 +32,11 @@ class DWARFDataExtractor : public DataExtractor { /// Constructor for cases when there are no relocations. DWARFDataExtractor(StringRef Data, bool IsLittleEndian, uint8_t AddressSize) : DataExtractor(Data, IsLittleEndian, AddressSize) {} + DWARFDataExtractor(ArrayRef Data, bool IsLittleEndian, + uint8_t AddressSize) + : DataExtractor( +StringRef(reinterpret_cast(Data.data()), Data.size()), +IsLittleEndian, AddressSize) {} /// Extracts a value and applies a relocation to the result if /// one exists for the given offset. diff --git a/llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp b/llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp index 131017e749d6..8f047bb872e5 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp @@ -109,7 +109,7 @@ DWARFLocationInterpreter::Interpret(const DWARFLocationEntry ) { static void dumpExpression(raw_ostream , ArrayRef Data, bool IsLittleEndian, unsigned AddressSize, const MCRegisterInfo *MRI, DWARFUnit *U) { - DWARFDataExtractor Extractor(toStringRef(Data), IsLittleEndian, AddressSize); + DWARFDataExtractor Extractor(Data, IsLittleEndian, AddressSize); DWARFExpression(Extractor, AddressSize).print(OS, MRI, U); } diff --git a/llvm/tools/llvm-readobj/DwarfCFIEHPrinter.h b/llvm/tools/llvm-readobj/DwarfCFIEHPrinter.h index 0a365d4fe72a..3d0b75f93771 100644 --- a/llvm/tools/llvm-readobj/DwarfCFIEHPrinter.h +++ b/llvm/tools/llvm-readobj/DwarfCFIEHPrinter.h @@ -186,12 +186,9 @@ void PrinterContext::printEHFrame( if (Error E = Result.takeError()) reportError(std::move(E), ObjF->getFileName()); - auto Contents = Result.get(); - DWARFDataExtractor DE( - StringRef(reinterpret_cast(Contents.data()), -Contents.size()), - ELFT::TargetEndianness == support::endianness::little, - ELFT::Is64Bits ? 8 : 4); + DWARFDataExtractor DE(*Result, +ELFT::TargetEndianness == support::endianness::little, +ELFT::Is64Bits ? 8 : 4); DWARFDebugFrame EHFrame(Triple::ArchType(ObjF->getArch()), /*IsEH=*/true, /*EHFrameAddress=*/Address); EHFrame.parse(DE);
[Lldb-commits] [lldb] ebee131 - [lldb][test] Fix sh_type of .debug_cu_index and .debug_tu_index
Author: Fangrui Song Date: 2020-02-21T17:38:39-08:00 New Revision: ebee131259719fa9c06cd346e21ace3fa8ac0888 URL: https://github.com/llvm/llvm-project/commit/ebee131259719fa9c06cd346e21ace3fa8ac0888 DIFF: https://github.com/llvm/llvm-project/commit/ebee131259719fa9c06cd346e21ace3fa8ac0888.diff LOG: [lldb][test] Fix sh_type of .debug_cu_index and .debug_tu_index They do not have the SHF_EXCLUDE flag. After D73999, MC errors `changed section type for .debug_cu_index, expected: 0x0` Added: Modified: lldb/test/Shell/SymbolFile/DWARF/dwp-debug-types.s lldb/test/Shell/SymbolFile/DWARF/dwp.s Removed: diff --git a/lldb/test/Shell/SymbolFile/DWARF/dwp-debug-types.s b/lldb/test/Shell/SymbolFile/DWARF/dwp-debug-types.s index fd009381b452..8680d27a3b42 100644 --- a/lldb/test/Shell/SymbolFile/DWARF/dwp-debug-types.s +++ b/lldb/test/Shell/SymbolFile/DWARF/dwp-debug-types.s @@ -203,9 +203,9 @@ A\I: .endr .endmacro -.section.debug_cu_index,"e",@progbits +.section.debug_cu_index,"",@progbits index 1, .debug_info.dwo, .Lcu_begin, .Ldebug_info_end -.section.debug_tu_index,"e",@progbits +.section.debug_tu_index,"",@progbits index 2, .debug_types.dwo, .Ltu_begin, .Ltype_info_end .endif diff --git a/lldb/test/Shell/SymbolFile/DWARF/dwp.s b/lldb/test/Shell/SymbolFile/DWARF/dwp.s index 730609412c36..659d7703daa9 100644 --- a/lldb/test/Shell/SymbolFile/DWARF/dwp.s +++ b/lldb/test/Shell/SymbolFile/DWARF/dwp.s @@ -232,7 +232,7 @@ F\I: .Ldebug_info_end\I: .endr -.section.debug_cu_index,"e",@progbits +.section.debug_cu_index,"",@progbits .short 2 # DWARF version number .short 0 # Reserved .long 4 # Section count ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] e29065a - [lldb][test] Fix sh_flags and sh_entsize of .debug_str.dwo
Author: Fangrui Song Date: 2020-02-21T18:51:05-08:00 New Revision: e29065a105342a904871437d18a4e6fab09e5bc1 URL: https://github.com/llvm/llvm-project/commit/e29065a105342a904871437d18a4e6fab09e5bc1 DIFF: https://github.com/llvm/llvm-project/commit/e29065a105342a904871437d18a4e6fab09e5bc1.diff LOG: [lldb][test] Fix sh_flags and sh_entsize of .debug_str.dwo sh_flags: SHF_MERGE | SHF_STRINGS | SHF_EXCLUDE sh_entsize: 1 Incorrect sh_flags or sh_entsize is an error after the assembler change made by D73999. Added: Modified: lldb/test/Shell/SymbolFile/DWARF/dwp.s Removed: diff --git a/lldb/test/Shell/SymbolFile/DWARF/dwp.s b/lldb/test/Shell/SymbolFile/DWARF/dwp.s index 659d7703daa9..7987299197d9 100644 --- a/lldb/test/Shell/SymbolFile/DWARF/dwp.s +++ b/lldb/test/Shell/SymbolFile/DWARF/dwp.s @@ -105,7 +105,7 @@ F\I: # This deliberately excludes compile unit 4 to check test the case of a missing # split unit. .irpc I,0123 -.section.debug_str.dwo,"e",@progbits +.section.debug_str.dwo,"MSe",@progbits,1 .Lstr\I: .byte 'I', 'N', 'T', '0'+\I, 0 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] 6fdd6a7 - [Disassembler] Delete the VStream parameter of MCDisassembler::getInstruction()
Author: Fangrui Song Date: 2020-01-11T13:34:52-08:00 New Revision: 6fdd6a7b3f696972edc244488f59532d05136a27 URL: https://github.com/llvm/llvm-project/commit/6fdd6a7b3f696972edc244488f59532d05136a27 DIFF: https://github.com/llvm/llvm-project/commit/6fdd6a7b3f696972edc244488f59532d05136a27.diff LOG: [Disassembler] Delete the VStream parameter of MCDisassembler::getInstruction() The argument is llvm::null() everywhere except llvm::errs() in llvm-objdump in -DLLVM_ENABLE_ASSERTIONS=On builds. It is used by no target but X86 in -DLLVM_ENABLE_ASSERTIONS=On builds. If we ever have the needs to add verbose log to disassemblers, we can record log with a member function, instead of passing it around as an argument. Added: Modified: lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp lldb/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp llvm/include/llvm/MC/MCDisassembler/MCDisassembler.h llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp llvm/lib/MC/MCDisassembler/Disassembler.cpp llvm/lib/MC/MCDisassembler/MCDisassembler.cpp llvm/lib/Target/AArch64/Disassembler/AArch64Disassembler.cpp llvm/lib/Target/AArch64/Disassembler/AArch64Disassembler.h llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.h llvm/lib/Target/ARC/Disassembler/ARCDisassembler.cpp llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp llvm/lib/Target/AVR/Disassembler/AVRDisassembler.cpp llvm/lib/Target/BPF/Disassembler/BPFDisassembler.cpp llvm/lib/Target/Hexagon/Disassembler/HexagonDisassembler.cpp llvm/lib/Target/Lanai/Disassembler/LanaiDisassembler.cpp llvm/lib/Target/Lanai/Disassembler/LanaiDisassembler.h llvm/lib/Target/MSP430/Disassembler/MSP430Disassembler.cpp llvm/lib/Target/Mips/Disassembler/MipsDisassembler.cpp llvm/lib/Target/PowerPC/Disassembler/PPCDisassembler.cpp llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp llvm/lib/Target/Sparc/Disassembler/SparcDisassembler.cpp llvm/lib/Target/SystemZ/Disassembler/SystemZDisassembler.cpp llvm/lib/Target/WebAssembly/Disassembler/WebAssemblyDisassembler.cpp llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp llvm/lib/Target/XCore/Disassembler/XCoreDisassembler.cpp llvm/tools/llvm-cfi-verify/lib/FileAnalysis.cpp llvm/tools/llvm-exegesis/lib/Analysis.cpp llvm/tools/llvm-mc/Disassembler.cpp llvm/tools/llvm-objdump/MachODump.cpp llvm/tools/llvm-objdump/llvm-objdump.cpp llvm/tools/sancov/sancov.cpp Removed: diff --git a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp index 399f8031bfe9..dbdb3520087e 100644 --- a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp +++ b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp @@ -1020,7 +1020,7 @@ uint64_t DisassemblerLLVMC::MCDisasmInstance::GetMCInst( uint64_t new_inst_size; status = m_disasm_up->getInstruction(mc_inst, new_inst_size, data, pc, - llvm::nulls(), llvm::nulls()); + llvm::nulls()); if (status == llvm::MCDisassembler::Success) return new_inst_size; else diff --git a/lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp b/lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp index b92804788268..b55eeb0eaf46 100644 --- a/lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp +++ b/lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp @@ -981,13 +981,11 @@ EmulateInstructionMIPS::GetSizeOfInstruction(lldb_private::DataExtractor , llvm::ArrayRef raw_insn(data.GetDataStart(), data.GetByteSize()); if (m_use_alt_disaasm) -decode_status = -m_alt_disasm->getInstruction(mc_insn, next_inst_size, raw_insn, - inst_addr, llvm::nulls(), llvm::nulls()); +decode_status = m_alt_disasm->getInstruction( +mc_insn, next_inst_size, raw_insn, inst_addr, llvm::nulls()); else -decode_status = -m_disasm->getInstruction(mc_insn, next_inst_size, raw_insn, inst_addr, - llvm::nulls(), llvm::nulls()); +decode_status = m_disasm->getInstruction(mc_insn, next_inst_size, raw_insn, + inst_addr, llvm::nulls()); if (decode_status != llvm::MCDisassembler::Success) return false; @@ -1070,11 +1068,11 @@ bool EmulateInstructionMIPS::EvaluateInstruction(uint32_t evaluate_options) { llvm::MCDisassembler::DecodeStatus decode_status; llvm::ArrayRef raw_insn(data.GetDataStart(), data.GetByteSize()); if (m_use_alt_disaasm) - decode_status = m_alt_disasm->getInstruction( -
[Lldb-commits] [lldb] bbfebd7 - [CMake] Add $ORIGIN/../../../../lib to rpath if BUILD_SHARED_LIBS or LLVM_LINK_LLVM_DYLIB on *nix
Author: Fangrui Song Date: 2020-01-06T10:01:55-08:00 New Revision: bbfebd7b8a671c9649305b8a5f72e93dd1ef60e1 URL: https://github.com/llvm/llvm-project/commit/bbfebd7b8a671c9649305b8a5f72e93dd1ef60e1 DIFF: https://github.com/llvm/llvm-project/commit/bbfebd7b8a671c9649305b8a5f72e93dd1ef60e1.diff LOG: [CMake] Add $ORIGIN/../../../../lib to rpath if BUILD_SHARED_LIBS or LLVM_LINK_LLVM_DYLIB on *nix Summary: lib/python2.7/dist-packages/lldb/_lldb.so is a symlink to lib/liblldb.so, which depends on lib/libLLVM*.so (-DBUILD_SHARED_LIBS=ON) or lib/libLLVM-10git.so (-DLLVM_LINK_LLVM_DYLIB=ON). Add an additional rpath `$ORIGIN/../../../../lib` so that _lldb.so can be loaded from Python. This fixes an import error from lib/python2.7/dist-packages/lldb/__init__.py from . import _lldb ImportError: libLLVMAArch64CodeGen.so.10git: cannot open shared object file: No such file or directory The following configurations will work: * -DBUILD_SHARED_LIBS=ON * -DBUILD_SHARED_LIBS=OFF -DLLVM_LINK_LLVM_DYLIB=ON * -DBUILD_SHARED_LIBS=OFF -DLLVM_LINK_LLVM_DYLIB=ON -DCLANG_LINK_CLANG_DYLIB=ON (-DCLANG_LINK_CLANG_DYLIB=ON depends on -DLLVM_LINK_LLVM_DYLIB=ON) Reviewed By: labath Differential Revision: https://reviews.llvm.org/D71800 Added: Modified: lldb/source/API/CMakeLists.txt Removed: diff --git a/lldb/source/API/CMakeLists.txt b/lldb/source/API/CMakeLists.txt index d036caf2f434..eea409bed185 100644 --- a/lldb/source/API/CMakeLists.txt +++ b/lldb/source/API/CMakeLists.txt @@ -111,6 +111,14 @@ add_lldb_library(liblldb SHARED ${option_framework} ${option_install_prefix} ) +# lib/pythonX.Y/dist-packages/lldb/_lldb.so is a symlink to lib/liblldb.so, +# which depends on lib/libLLVM*.so (BUILD_SHARED_LIBS) or lib/libLLVM-10git.so +# (LLVM_LINK_LLVM_DYLIB). Add an additional rpath $ORIGIN/../../../../lib so +# that _lldb.so can be loaded from Python. +if(LLDB_ENABLE_PYTHON AND (BUILD_SHARED_LIBS OR LLVM_LINK_LLVM_DYLIB) AND UNIX AND NOT APPLE) + set_property(TARGET liblldb APPEND PROPERTY INSTALL_RPATH "\$ORIGIN/../../../../lib${LLVM_LIBDIR_SUFFIX}") +endif() + if (MSVC) set_source_files_properties(SBReproducer.cpp PROPERTIES COMPILE_FLAGS /bigobj) endif() ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] 71269a1 - [lldb] Add .clang-tidy with customization to disable readability-identifier-naming
Author: Fangrui Song Date: 2020-03-09T12:50:28-07:00 New Revision: 71269a1f172cdad1cc0d7e2e6c94a7ece11ddb27 URL: https://github.com/llvm/llvm-project/commit/71269a1f172cdad1cc0d7e2e6c94a7ece11ddb27 DIFF: https://github.com/llvm/llvm-project/commit/71269a1f172cdad1cc0d7e2e6c94a7ece11ddb27.diff LOG: [lldb] Add .clang-tidy with customization to disable readability-identifier-naming Reviewed By: JDevlieghere Differential Revision: https://reviews.llvm.org/D75810 Added: lldb/.clang-tidy Modified: Removed: diff --git a/lldb/.clang-tidy b/lldb/.clang-tidy new file mode 100644 index ..e949902171e7 --- /dev/null +++ b/lldb/.clang-tidy @@ -0,0 +1,2 @@ +# Checks enabled in the top-level .clang-tidy minus readability-identifier-naming +Checks: '-*,clang-diagnostic-*,llvm-*,misc-*,-misc-unused-parameters,-misc-non-private-member-variables-in-classes' ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] 95bfeb5 - [lldb] Delete two unneeded
Author: Fangrui Song Date: 2020-09-21T18:11:26-07:00 New Revision: 95bfeb5903c7b75a0a9ddf5c4b53e4308bb05486 URL: https://github.com/llvm/llvm-project/commit/95bfeb5903c7b75a0a9ddf5c4b53e4308bb05486 DIFF: https://github.com/llvm/llvm-project/commit/95bfeb5903c7b75a0a9ddf5c4b53e4308bb05486.diff LOG: [lldb] Delete two unneeded Added: Modified: lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp lldb/source/Target/Trace.cpp Removed: diff --git a/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp b/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp index 1001514edede..aaf839407134 100644 --- a/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp +++ b/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp @@ -52,8 +52,6 @@ #include "Plugins/Language/CPlusPlus/MSVCUndecoratedNameParser.h" #include "Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h" -#include - using namespace lldb; using namespace lldb_private; using namespace llvm::pdb; diff --git a/lldb/source/Target/Trace.cpp b/lldb/source/Target/Trace.cpp index 6a1f8eadee1b..afe4ee20be48 100644 --- a/lldb/source/Target/Trace.cpp +++ b/lldb/source/Target/Trace.cpp @@ -8,7 +8,6 @@ #include "lldb/Target/Trace.h" -#include #include #include "llvm/Support/Format.h" ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] 0b9f9ec - Include sstream after D85705
Author: Fangrui Song Date: 2020-09-21T17:41:59-07:00 New Revision: 0b9f9eced9c532ee9bbf320216a2e85b314eb5f0 URL: https://github.com/llvm/llvm-project/commit/0b9f9eced9c532ee9bbf320216a2e85b314eb5f0 DIFF: https://github.com/llvm/llvm-project/commit/0b9f9eced9c532ee9bbf320216a2e85b314eb5f0.diff LOG: Include sstream after D85705 Added: Modified: lldb/source/Target/TraceSettingsParser.cpp Removed: diff --git a/lldb/source/Target/TraceSettingsParser.cpp b/lldb/source/Target/TraceSettingsParser.cpp index 09e60bb35a4a..2c0f337ee9a1 100644 --- a/lldb/source/Target/TraceSettingsParser.cpp +++ b/lldb/source/Target/TraceSettingsParser.cpp @@ -9,6 +9,7 @@ #include "lldb/Target/TraceSettingsParser.h" #include +#include #include "Plugins/Process/Utility/HistoryThread.h" #include "lldb/Core/Debugger.h" ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] f212122 - [lldb][test] Remove accidental import pdb in 783dc7dc7ed7487d0782c2feb8854df949b98e69
Author: Fangrui Song Date: 2020-09-22T13:08:12-07:00 New Revision: f21212215031e5871c38daf3b06b1a6250fd URL: https://github.com/llvm/llvm-project/commit/f21212215031e5871c38daf3b06b1a6250fd DIFF: https://github.com/llvm/llvm-project/commit/f21212215031e5871c38daf3b06b1a6250fd.diff LOG: [lldb][test] Remove accidental import pdb in 783dc7dc7ed7487d0782c2feb8854df949b98e69 Added: Modified: lldb/test/API/functionalities/postmortem/minidump-new/TestMiniDumpUUID.py Removed: diff --git a/lldb/test/API/functionalities/postmortem/minidump-new/TestMiniDumpUUID.py b/lldb/test/API/functionalities/postmortem/minidump-new/TestMiniDumpUUID.py index 052fcaebfdd0..1dc2c81485d0 100644 --- a/lldb/test/API/functionalities/postmortem/minidump-new/TestMiniDumpUUID.py +++ b/lldb/test/API/functionalities/postmortem/minidump-new/TestMiniDumpUUID.py @@ -214,7 +214,6 @@ def test_breakpad_overflow_hash_match(self): cmd = 'settings set target.exec-search-paths "%s"' % (os.path.dirname(so_path)) self.dbg.HandleCommand(cmd) modules = self.get_minidump_modules("linux-arm-breakpad-uuid-match.yaml") -import pdb; pdb.set_trace() self.assertEqual(1, len(modules)) # LLDB makes up it own UUID as well when there is no build ID so we # will check that this matches. ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] 67782a0 - [lldb/bindings] Fix -Wformat after D88123
Author: Fangrui Song Date: 2020-09-25T17:33:12-07:00 New Revision: 67782a0f99c6a792c9d60267d42b21f7335814ba URL: https://github.com/llvm/llvm-project/commit/67782a0f99c6a792c9d60267d42b21f7335814ba DIFF: https://github.com/llvm/llvm-project/commit/67782a0f99c6a792c9d60267d42b21f7335814ba.diff LOG: [lldb/bindings] Fix -Wformat after D88123 Added: Modified: lldb/bindings/python/python-wrapper.swig Removed: diff --git a/lldb/bindings/python/python-wrapper.swig b/lldb/bindings/python/python-wrapper.swig index 9e84b341d1a6..cd326046b421 100644 --- a/lldb/bindings/python/python-wrapper.swig +++ b/lldb/bindings/python/python-wrapper.swig @@ -532,7 +532,8 @@ LLDBSwigPythonCreateScriptedStopHook } else { error.SetErrorStringWithFormat("Class \"%s\" is missing the required " - "handle_stop callback."); + "handle_stop callback.", + python_class_name); result.release(); } } ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] a6db64e - [ELF] Allow sections after a non-SHF_ALLOC section to be covered by PT_LOAD
Author: Fangrui Song Date: 2020-08-06T08:27:15-07:00 New Revision: a6db64ef4a9906c96ef5652739ac15aefaa7827c URL: https://github.com/llvm/llvm-project/commit/a6db64ef4a9906c96ef5652739ac15aefaa7827c DIFF: https://github.com/llvm/llvm-project/commit/a6db64ef4a9906c96ef5652739ac15aefaa7827c.diff LOG: [ELF] Allow sections after a non-SHF_ALLOC section to be covered by PT_LOAD GNU ld allows sections after a non-SHF_ALLOC section to be covered by PT_LOAD (PR37607) and assigns addresses to non-SHF_ALLOC output sections (similar to SHF_ALLOC NOBITS sections. The location counter is not advanced). This patch tries to fix PR37607 (remove a special case in `Writer::createPhdrs`). To make the created PT_LOAD meaningful, we cannot reset dot to 0 for a middle non-SHF_ALLOC output section. This results in removal of two special cases in LinkerScript::assignOffsets. Non-SHF_ALLOC non-orphan sections can have non-zero addresses like in GNU ld. The zero address rule for non-SHF_ALLOC sections is weakened to apply to orphan only. This results in a special case in createSection and findOrphanPos, respectively. Reviewed By: jhenderson Differential Revision: https://reviews.llvm.org/D85100 Added: Modified: lld/ELF/LinkerScript.cpp lld/ELF/Writer.cpp lld/test/ELF/linkerscript/compress-debug-sections-custom.s lld/test/ELF/linkerscript/sections.s lld/test/ELF/linkerscript/symbols-non-alloc.test lldb/test/Shell/SymbolFile/DWARF/Inputs/debug-line-basic.script Removed: diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp index 72e2ebff9b8c..a187aa1eb05a 100644 --- a/lld/ELF/LinkerScript.cpp +++ b/lld/ELF/LinkerScript.cpp @@ -586,6 +586,8 @@ static OutputSection *findByName(ArrayRef vec, static OutputSection *createSection(InputSectionBase *isec, StringRef outsecName) { OutputSection *sec = script->createOutputSection(outsecName, ""); + if (!(isec->flags & SHF_ALLOC)) +sec->addrExpr = [] { return 0; }; sec->recordSection(isec); return sec; } @@ -848,9 +850,6 @@ static OutputSection *findFirstSection(PhdrEntry *load) { // This function assigns offsets to input sections and an output section // for a single sections command (e.g. ".text { *(.text); }"). void LinkerScript::assignOffsets(OutputSection *sec) { - if (!(sec->flags & SHF_ALLOC)) -dot = 0; - const bool sameMemRegion = ctx->memRegion == sec->memRegion; const bool prevLMARegionIsDefault = ctx->lmaRegion == nullptr; ctx->memRegion = sec->memRegion; @@ -858,7 +857,7 @@ void LinkerScript::assignOffsets(OutputSection *sec) { if (ctx->memRegion) dot = ctx->memRegion->curPos; - if ((sec->flags & SHF_ALLOC) && sec->addrExpr) + if (sec->addrExpr) setDot(sec->addrExpr, sec->location, false); // If the address of the section has been moved forward by an explicit diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp index c1469e123336..1bd6fb61e2e4 100644 --- a/lld/ELF/Writer.cpp +++ b/lld/ELF/Writer.cpp @@ -1234,7 +1234,13 @@ static bool shouldSkip(BaseCommand *cmd) { static std::vector::iterator findOrphanPos(std::vector::iterator b, std::vector::iterator e) { + // OutputSections without the SHF_ALLOC flag are not part of the memory image + // and their addresses usually don't matter. Place any orphan sections without + // the SHF_ALLOC flag at the end so that these do not affect the address + // assignment of OutputSections with the SHF_ALLOC flag. OutputSection *sec = cast(*e); + if (!(sec->flags & SHF_ALLOC)) +return e; // Find the first element that has as close a rank as possible. auto i = std::max_element(b, e, [=](BaseCommand *a, BaseCommand *b) { @@ -2329,8 +2335,6 @@ std::vector Writer::createPhdrs(Partition ) { } for (OutputSection *sec : outputSections) { -if (!(sec->flags & SHF_ALLOC)) - break; if (!needsPtLoad(sec)) continue; diff --git a/lld/test/ELF/linkerscript/compress-debug-sections-custom.s b/lld/test/ELF/linkerscript/compress-debug-sections-custom.s index f61d6398b1f0..7b9a8d091bf5 100644 --- a/lld/test/ELF/linkerscript/compress-debug-sections-custom.s +++ b/lld/test/ELF/linkerscript/compress-debug-sections-custom.s @@ -1,9 +1,10 @@ # REQUIRES: x86, zlib +## NOTE GNU ld makes .debug_str and .debug_info SHF_ALLOC due to `. += 10`. # RUN: echo "SECTIONS { \ # RUN: .text : { . += 0x10; *(.text) } \ -# RUN: .debug_str : { . += 0x10; *(.debug_str) } \ -# RUN: .debug_info : { . += 0x10; *(.debug_info) } \ +# RUN: .debug_str 0 : { . += 0x10; *(.debug_str) } \ +# RUN: .debug_info 0 : { . += 0x10; *(.debug_info) } \ # RUN: }" > %t.script # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o diff --git a/lld/test/ELF/linkerscript/sections.s b/lld/test/ELF/linkerscript/sections.s index
[Lldb-commits] [lldb] 53880b8 - [CMake] Make `intrinsics_gen` dependency unconditional.
Author: Michele Scandale Date: 2020-07-17T16:43:17-07:00 New Revision: 53880b8cb9c61e81457d13c0adefe51ff41664fa URL: https://github.com/llvm/llvm-project/commit/53880b8cb9c61e81457d13c0adefe51ff41664fa DIFF: https://github.com/llvm/llvm-project/commit/53880b8cb9c61e81457d13c0adefe51ff41664fa.diff LOG: [CMake] Make `intrinsics_gen` dependency unconditional. The `intrinsics_gen` target exists in the CMake exports since r309389 (see LLVMConfig.cmake.in), hence projects can depend on `intrinsics_gen` even it they are built separately from LLVM. Reviewed By: MaskRay, JDevlieghere Differential Revision: https://reviews.llvm.org/D83454 Added: Modified: clang/CMakeLists.txt clang/lib/CodeGen/CMakeLists.txt clang/lib/Frontend/CMakeLists.txt clang/tools/clang-fuzzer/handle-llvm/CMakeLists.txt clang/tools/clang-import-test/CMakeLists.txt clang/tools/clang-offload-bundler/CMakeLists.txt clang/tools/clang-offload-wrapper/CMakeLists.txt clang/tools/driver/CMakeLists.txt lld/COFF/CMakeLists.txt lld/Common/CMakeLists.txt lld/ELF/CMakeLists.txt lld/MinGW/CMakeLists.txt lld/lib/Core/CMakeLists.txt lld/wasm/CMakeLists.txt lldb/CMakeLists.txt lldb/source/Expression/CMakeLists.txt lldb/source/Plugins/ExpressionParser/Clang/CMakeLists.txt lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/CMakeLists.txt Removed: diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt index 7f8e0718c2eb..948452661a32 100644 --- a/clang/CMakeLists.txt +++ b/clang/CMakeLists.txt @@ -531,7 +531,7 @@ list(APPEND LLVM_COMMON_DEPENDS clang-tablegen-targets) # Force target to be built as soon as possible. Clang modules builds depend # header-wise on it as they ship all headers from the umbrella folders. Building # an entire module might include header, which depends on intrinsics_gen. -if(LLVM_ENABLE_MODULES AND NOT CLANG_BUILT_STANDALONE) +if(LLVM_ENABLE_MODULES) list(APPEND LLVM_COMMON_DEPENDS intrinsics_gen) endif() diff --git a/clang/lib/CodeGen/CMakeLists.txt b/clang/lib/CodeGen/CMakeLists.txt index c4bedf34921c..8afd7219fbe1 100644 --- a/clang/lib/CodeGen/CMakeLists.txt +++ b/clang/lib/CodeGen/CMakeLists.txt @@ -26,15 +26,6 @@ set(LLVM_LINK_COMPONENTS TransformUtils ) -# In a standard Clang+LLVM build, we need to generate intrinsics before -# building codegen. In a standalone build, LLVM is already built and we don't -# need this dependency. Furthermore, LLVM doesn't export it so we can't have -# this dependency. -set(codegen_deps intrinsics_gen) -if (CLANG_BUILT_STANDALONE) - set(codegen_deps) -endif() - if (MSVC) set_source_files_properties(CodeGenModule.cpp PROPERTIES COMPILE_FLAGS /bigobj) endif() @@ -99,7 +90,7 @@ add_clang_library(clangCodeGen VarBypassDetector.cpp DEPENDS - ${codegen_deps} + intrinsics_gen LINK_LIBS clangAnalysis diff --git a/clang/lib/Frontend/CMakeLists.txt b/clang/lib/Frontend/CMakeLists.txt index 0e23b92e2dea..af5446618b03 100644 --- a/clang/lib/Frontend/CMakeLists.txt +++ b/clang/lib/Frontend/CMakeLists.txt @@ -8,11 +8,6 @@ set(LLVM_LINK_COMPONENTS Support ) -set(optional_deps intrinsics_gen) -if (CLANG_BUILT_STANDALONE) - set(optional_deps) -endif() - add_clang_library(clangFrontend ASTConsumers.cpp ASTMerge.cpp @@ -49,7 +44,7 @@ add_clang_library(clangFrontend DEPENDS ClangDriverOptions - ${optional_deps} + intrinsics_gen LINK_LIBS clangAST diff --git a/clang/tools/clang-fuzzer/handle-llvm/CMakeLists.txt b/clang/tools/clang-fuzzer/handle-llvm/CMakeLists.txt index 47f9fdf68f40..9ceb1d331828 100644 --- a/clang/tools/clang-fuzzer/handle-llvm/CMakeLists.txt +++ b/clang/tools/clang-fuzzer/handle-llvm/CMakeLists.txt @@ -16,15 +16,9 @@ set(LLVM_LINK_COMPONENTS native ) -# Depend on LLVM IR intrinsic generation. -set(handle_llvm_deps intrinsics_gen) -if (CLANG_BUILT_STANDALONE) - set(handle_llvm_deps) -endif() - add_clang_library(clangHandleLLVM handle_llvm.cpp DEPENDS - ${handle_llvm_deps} + intrinsics_gen ) diff --git a/clang/tools/clang-import-test/CMakeLists.txt b/clang/tools/clang-import-test/CMakeLists.txt index 4ccc2d752aac..e459de8f635f 100644 --- a/clang/tools/clang-import-test/CMakeLists.txt +++ b/clang/tools/clang-import-test/CMakeLists.txt @@ -3,14 +3,10 @@ set(LLVM_LINK_COMPONENTS Support ) -if(NOT CLANG_BUILT_STANDALONE) - set(tablegen_deps intrinsics_gen) -endif() - add_clang_executable(clang-import-test clang-import-test.cpp DEPENDS - ${tablegen_deps} + intrinsics_gen ) set(CLANG_IMPORT_TEST_LIB_DEPS diff --git a/clang/tools/clang-offload-bundler/CMakeLists.txt b/clang/tools/clang-offload-bundler/CMakeLists.txt index 4ef099493364..2738bf02e729 100644 --- a/clang/tools/clang-offload-bundler/CMakeLists.txt +++ b/clang/tools/clang-offload-bundler/CMakeLists.txt @@ -1,14 +1,10 @@
[Lldb-commits] [lldb] ce5e218 - [lldb] Fix build after found_decls was removed by 1f40d60a3b7f310ff3f77bb8643a27d979a703cb
Author: Fangrui Song Date: 2020-12-01T19:14:35-08:00 New Revision: ce5e21868c22479df62ebd8884adc1bd7c964433 URL: https://github.com/llvm/llvm-project/commit/ce5e21868c22479df62ebd8884adc1bd7c964433 DIFF: https://github.com/llvm/llvm-project/commit/ce5e21868c22479df62ebd8884adc1bd7c964433.diff LOG: [lldb] Fix build after found_decls was removed by 1f40d60a3b7f310ff3f77bb8643a27d979a703cb Added: Modified: lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp Removed: diff --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp index bab50a3b068c..ca109ef9c2fc 100644 --- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp +++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp @@ -148,10 +148,11 @@ void addOverridesForMethod(clang::CXXMethodDecl *decl) { return; clang::CXXBasePaths paths; + llvm::SmallVector decls; auto find_overridden_methods = - [decl](const clang::CXXBaseSpecifier *specifier, - clang::CXXBasePath ) { + [, decl](const clang::CXXBaseSpecifier *specifier, + clang::CXXBasePath ) { if (auto *base_record = llvm::dyn_cast( specifier->getType()->getAs()->getDecl())) { @@ -163,6 +164,7 @@ void addOverridesForMethod(clang::CXXMethodDecl *decl) { if (auto *baseDtorDecl = base_record->getDestructor()) { if (baseDtorDecl->isVirtual()) { path.Decls = baseDtorDecl; +decls.push_back(baseDtorDecl); return true; } else return false; @@ -175,6 +177,7 @@ void addOverridesForMethod(clang::CXXMethodDecl *decl) { llvm::dyn_cast(path.Decls.front())) if (method_decl->isVirtual() && !isOverload(decl, method_decl)) { path.Decls = method_decl; +decls.push_back(method_decl); return true; } } @@ -184,7 +187,7 @@ void addOverridesForMethod(clang::CXXMethodDecl *decl) { }; if (decl->getParent()->lookupInBases(find_overridden_methods, paths)) { -for (auto *overridden_decl : paths.found_decls()) +for (auto *overridden_decl : decls) decl->addOverriddenMethod( llvm::cast(overridden_decl)); } ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] 9bb9b73 - Remove HAVE_VCS_VERSION_INC, not needed
Author: Marcel Hlopko Date: 2020-10-29T13:09:05-07:00 New Revision: 9bb9b737c5573cf3850230bc4db8dac7be0e1e85 URL: https://github.com/llvm/llvm-project/commit/9bb9b737c5573cf3850230bc4db8dac7be0e1e85 DIFF: https://github.com/llvm/llvm-project/commit/9bb9b737c5573cf3850230bc4db8dac7be0e1e85.diff LOG: Remove HAVE_VCS_VERSION_INC, not needed This preprocessor define was meant to be used to conditionally include VCSVersion.inc. However, the define was always set, and it was the content of the header that was conditionally generated. Therefore HAVE_VCS_VERSION_INC should be cleaned up. Reviewed By: gribozavr2, MaskRay Differential Revision: https://reviews.llvm.org/D84623 Added: Modified: clang/lib/Basic/CMakeLists.txt clang/lib/Basic/Version.cpp lld/Common/CMakeLists.txt lld/Common/Version.cpp lldb/source/CMakeLists.txt lldb/source/lldb.cpp llvm/utils/gn/secondary/clang/lib/Basic/BUILD.gn llvm/utils/gn/secondary/lld/Common/BUILD.gn Removed: diff --git a/clang/lib/Basic/CMakeLists.txt b/clang/lib/Basic/CMakeLists.txt index dfbe74a3f9f1..d259b951f2c2 100644 --- a/clang/lib/Basic/CMakeLists.txt +++ b/clang/lib/Basic/CMakeLists.txt @@ -33,9 +33,6 @@ set_source_files_properties("${version_inc}" PROPERTIES GENERATED TRUE HEADER_FILE_ONLY TRUE) -set_property(SOURCE Version.cpp APPEND PROPERTY - COMPILE_DEFINITIONS "HAVE_VCS_VERSION_INC") - add_clang_library(clangBasic Attributes.cpp Builtins.cpp diff --git a/clang/lib/Basic/Version.cpp b/clang/lib/Basic/Version.cpp index 286107cab9d7..af3118b0f6da 100644 --- a/clang/lib/Basic/Version.cpp +++ b/clang/lib/Basic/Version.cpp @@ -17,9 +17,7 @@ #include #include -#ifdef HAVE_VCS_VERSION_INC #include "VCSVersion.inc" -#endif namespace clang { diff --git a/lld/Common/CMakeLists.txt b/lld/Common/CMakeLists.txt index bfa4f7b8ee58..0437d5afb8eb 100644 --- a/lld/Common/CMakeLists.txt +++ b/lld/Common/CMakeLists.txt @@ -26,9 +26,6 @@ set_source_files_properties("${version_inc}" PROPERTIES GENERATED TRUE HEADER_FILE_ONLY TRUE) -set_property(SOURCE Version.cpp APPEND PROPERTY - COMPILE_DEFINITIONS "HAVE_VCS_VERSION_INC") - add_lld_library(lldCommon Args.cpp DWARF.cpp diff --git a/lld/Common/Version.cpp b/lld/Common/Version.cpp index cd9fcd4f4059..f3768091cd0e 100644 --- a/lld/Common/Version.cpp +++ b/lld/Common/Version.cpp @@ -12,9 +12,7 @@ #include "lld/Common/Version.h" -#ifdef HAVE_VCS_VERSION_INC #include "VCSVersion.inc" -#endif // Returns a version string, e.g.: // lld 9.0.0 (https://github.com/llvm/llvm-project.git 9efdd7ac5e914d3c9fa1ef) diff --git a/lldb/source/CMakeLists.txt b/lldb/source/CMakeLists.txt index 6dbdec5ec008..56ea8342be4e 100644 --- a/lldb/source/CMakeLists.txt +++ b/lldb/source/CMakeLists.txt @@ -26,9 +26,6 @@ set_source_files_properties("${version_inc}" PROPERTIES GENERATED TRUE HEADER_FILE_ONLY TRUE) -set_property(SOURCE lldb.cpp APPEND PROPERTY - COMPILE_DEFINITIONS "HAVE_VCS_VERSION_INC") - list(APPEND lldbBase_SOURCES ${version_inc}) if(LLDB_VERSION_STRING) diff --git a/lldb/source/lldb.cpp b/lldb/source/lldb.cpp index 4d4c636a4f9c..10fc2d7cf556 100644 --- a/lldb/source/lldb.cpp +++ b/lldb/source/lldb.cpp @@ -13,9 +13,7 @@ using namespace lldb_private; #include "clang/Basic/Version.h" -#ifdef HAVE_VCS_VERSION_INC #include "VCSVersion.inc" -#endif static const char *GetLLDBRevision() { #ifdef LLDB_REVISION diff --git a/llvm/utils/gn/secondary/clang/lib/Basic/BUILD.gn b/llvm/utils/gn/secondary/clang/lib/Basic/BUILD.gn index 43767f15e1a1..2fe572ada231 100644 --- a/llvm/utils/gn/secondary/clang/lib/Basic/BUILD.gn +++ b/llvm/utils/gn/secondary/clang/lib/Basic/BUILD.gn @@ -103,5 +103,4 @@ static_library("Basic") { "XRayInstr.cpp", "XRayLists.cpp", ] - defines = [ "HAVE_VCS_VERSION_INC" ] # For Version.cpp } diff --git a/llvm/utils/gn/secondary/lld/Common/BUILD.gn b/llvm/utils/gn/secondary/lld/Common/BUILD.gn index 125cad30a32e..d02d950e88d2 100644 --- a/llvm/utils/gn/secondary/lld/Common/BUILD.gn +++ b/llvm/utils/gn/secondary/lld/Common/BUILD.gn @@ -42,5 +42,4 @@ static_library("Common") { "Timer.cpp", "Version.cpp", ] - defines = [ "HAVE_VCS_VERSION_INC" ] # For Version.cpp } ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] 6afdf13 - Makefile.rules: Avoid redundant .d generation (make restart) and inline archive rule to the only test
Author: Fangrui Song Date: 2021-01-20T14:22:33-08:00 New Revision: 6afdf13ae4ccf00296065960a0b311c87e6f8dd5 URL: https://github.com/llvm/llvm-project/commit/6afdf13ae4ccf00296065960a0b311c87e6f8dd5 DIFF: https://github.com/llvm/llvm-project/commit/6afdf13ae4ccf00296065960a0b311c87e6f8dd5.diff LOG: Makefile.rules: Avoid redundant .d generation (make restart) and inline archive rule to the only test Take an example when `CXX_SOURCES` is main.cpp. main.d is an included file. make will rebuild main.d, re-executes itself [1] to read in the new main.d file, then rebuild main.o, finally link main.o into a.out. main.cpp is parsed twice in this process. This patch merges .d generation into .o generation [2], writes explicit rules for .c/.m and deletes suffix rules for %.m and %.o. Since a target can be satisfied by either of .c/.cpp/.m/.mm, we use multiple pattern rules. The rule with the prerequisite (with VPATH considered) satisfied is used [3]. Since suffix rules are disabled, the implicit rule for archive member targets is no long available [4]. Rewrite, simplify the archive rule and inline it into the only test `test/API/functionalities/archives/Makefile`. [1]: https://www.gnu.org/software/make/manual/html_node/Remaking-Makefiles.html [2]: http://make.mad-scientist.net/papers/advanced-auto-dependency-generation/ [3]: https://www.gnu.org/software/make/manual/html_node/Pattern-Match.html [4]: https://www.gnu.org/software/make/manual/html_node/Archive-Update.html ObjC/ObjCXX tests only run on macOS. I don't have testing environment. Hope someone can do it for me. Reviewed By: JDevlieghere Differential Revision: https://reviews.llvm.org/D94890 Added: Modified: lldb/packages/Python/lldbsuite/test/make/Makefile.rules lldb/test/API/functionalities/archives/Makefile Removed: diff --git a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules index d715f1ca24e4..374dd6865d88 100644 --- a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules +++ b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules @@ -26,15 +26,13 @@ # SPLIT_DEBUG_SYMBOLS := YES # CROSS_COMPILE := # USE_PRIVATE_MODULE_CACHE := YES -# -# And test/functionalities/archives/Makefile: -# MAKE_DSYM := NO -# ARCHIVE_NAME := libfoo.a -# ARCHIVE_C_SOURCES := a.c b.c # Uncomment line below for debugging shell commands # SHELL = /bin/sh -x +# Suppress built-in suffix rules. We explicitly define rules for %.o. +.SUFFIXES: + SRCDIR := $(shell dirname $(firstword $(MAKEFILE_LIST))) BUILDDIR := $(shell pwd) MAKEFILE_RULES := $(lastword $(MAKEFILE_LIST)) @@ -477,42 +475,6 @@ ifneq "$(strip $(OBJCXX_SOURCES))" "" endif endif -#-- -# Check if we have any C source files for archive -#-- -ifneq "$(strip $(ARCHIVE_C_SOURCES))" "" - ARCHIVE_OBJECTS +=$(strip $(ARCHIVE_C_SOURCES:.c=.o)) -endif - -#-- -# Check if we have any C++ source files for archive -#-- -ifneq "$(strip $(ARCHIVE_CXX_SOURCES))" "" - ARCHIVE_OBJECTS +=$(strip $(ARCHIVE_CXX_SOURCES:.cpp=.o)) - CXX = $(call cxx_compiler,$(CC)) - LD = $(call cxx_linker,$(CC)) -endif - -#-- -# Check if we have any ObjC source files for archive -#-- -ifneq "$(strip $(ARCHIVE_OBJC_SOURCES))" "" - ARCHIVE_OBJECTS +=$(strip $(ARCHIVE_OBJC_SOURCES:.m=.o)) - LDFLAGS +=-lobjc -endif - -#-- -# Check if we have any ObjC++ source files for archive -#-- -ifneq "$(strip $(ARCHIVE_OBJCXX_SOURCES))" "" - ARCHIVE_OBJECTS +=$(strip $(ARCHIVE_OBJCXX_SOURCES:.mm=.o)) - CXX = $(call cxx_compiler,$(CC)) - LD = $(call cxx_linker,$(CC)) - ifeq "$(findstring lobjc,$(LDFLAGS))" "" - LDFLAGS +=-lobjc - endif -endif - ifeq ($(findstring clang, $(CXX)), clang) CXXFLAGS += --driver-mode=g++ endif @@ -534,8 +496,8 @@ endif #-- ifneq "$(DYLIB_NAME)" "" ifeq "$(DYLIB_ONLY)" "" -$(EXE) : $(OBJECTS) $(ARCHIVE_NAME) $(DYLIB_FILENAME) - $(LD) $(OBJECTS) $(ARCHIVE_NAME) -L. -l$(DYLIB_NAME) $(LDFLAGS) -o "$(EXE)" +$(EXE) : $(OBJECTS) $(DYLIB_FILENAME) + $(LD) $(OBJECTS) -L. -l$(DYLIB_NAME) $(LDFLAGS) -o "$(EXE)" ifneq "$(CODESIGN)" "" $(CODESIGN) -s - "$(EXE)" endif @@ -543,8 +505,8 @@ else EXE = $(DYLIB_FILENAME) endif else -$(EXE) :
[Lldb-commits] [lldb] 95d1461 - Makefile.rules: Delete GCC 4.6 workaround
Author: Fangrui Song Date: 2021-01-17T13:16:38-08:00 New Revision: 95d146182fdf2315e74943b93fb3bb0cbafc5d89 URL: https://github.com/llvm/llvm-project/commit/95d146182fdf2315e74943b93fb3bb0cbafc5d89 DIFF: https://github.com/llvm/llvm-project/commit/95d146182fdf2315e74943b93fb3bb0cbafc5d89.diff LOG: Makefile.rules: Delete GCC 4.6 workaround 5.1 is the minimum supported version. Added: Modified: lldb/packages/Python/lldbsuite/test/make/Makefile.rules Removed: diff --git a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules index 5f6218db4d6d..a7efa15e09df 100644 --- a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules +++ b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules @@ -513,20 +513,6 @@ ifneq "$(strip $(ARCHIVE_OBJCXX_SOURCES))" "" endif endif -#-- -# Check if we are compiling with gcc 4.6 -#-- -ifneq "$(strip $(CXX_SOURCES) $(OBJCXX_SOURCES))" "" -ifneq "$(filter g++,$(CXX))" "" - CXXVERSION = $(shell $(CXX) -dumpversion | cut -b 1-3) - ifeq "$(CXXVERSION)" "4.6" - # GCC 4.6 cannot handle -std=c++11, so replace it with -std=c++0x - # instead. FIXME: remove once GCC version is upgraded. - override CXXFLAGS := $(subst -std=c++11,-std=c++0x,$(CXXFLAGS)) - endif -endif -endif - ifeq ($(findstring clang, $(CXX)), clang) CXXFLAGS += --driver-mode=g++ endif ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] b74ae43 - Makefile.rules: Make HOST_OS/OS simply expanded variable to avoid excess uname -s invocations
Author: Fangrui Song Date: 2021-01-17T17:19:29-08:00 New Revision: b74ae43c44b1c954508149409d3cfe6477be4079 URL: https://github.com/llvm/llvm-project/commit/b74ae43c44b1c954508149409d3cfe6477be4079 DIFF: https://github.com/llvm/llvm-project/commit/b74ae43c44b1c954508149409d3cfe6477be4079.diff LOG: Makefile.rules: Make HOST_OS/OS simply expanded variable to avoid excess uname -s invocations This decreases the number of runs from 18 to 1. Added: Modified: lldb/packages/Python/lldbsuite/test/make/Makefile.rules Removed: diff --git a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules index a7efa15e09df..d715f1ca24e4 100644 --- a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules +++ b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules @@ -56,12 +56,12 @@ LLDB_BASE_DIR := $(THIS_FILE_DIR)/../../../../../ # When running tests from Visual Studio, the environment variable isn't # inherited all the way down to the process spawned for make. #-- -HOST_OS = $(shell uname -s) +HOST_OS := $(shell uname -s) ifneq (,$(findstring windows32,$(HOST_OS))) - HOST_OS = Windows_NT + HOST_OS := Windows_NT endif ifeq "$(OS)" "" - OS = $(HOST_OS) + OS := $(HOST_OS) endif #-- ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] 45db9d4 - [test] Fix unused FileCheck prefixes in lldb
Author: Fangrui Song Date: 2021-02-01T21:45:51-08:00 New Revision: 45db9d4594bdbb4a304c16f6ad61b87c60eeb300 URL: https://github.com/llvm/llvm-project/commit/45db9d4594bdbb4a304c16f6ad61b87c60eeb300 DIFF: https://github.com/llvm/llvm-project/commit/45db9d4594bdbb4a304c16f6ad61b87c60eeb300.diff LOG: [test] Fix unused FileCheck prefixes in lldb Added: Modified: lldb/test/Shell/Reproducer/TestMultipleTargets.test Removed: diff --git a/lldb/test/Shell/Reproducer/TestMultipleTargets.test b/lldb/test/Shell/Reproducer/TestMultipleTargets.test index 7859480e2d04..cb2f766034fd 100644 --- a/lldb/test/Shell/Reproducer/TestMultipleTargets.test +++ b/lldb/test/Shell/Reproducer/TestMultipleTargets.test @@ -21,3 +21,5 @@ # CAPTURE: Reproducer is in capture mode. # CAPTURE: Reproducer written + +# REPLAY: Reproducer is in replay mode. ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] f1e2d58 - [OptTable] Rename PrintHelp to printHelp
Author: Fangrui Song Date: 2021-06-24T14:47:03-07:00 New Revision: f1e2d5851bf869685971d5acb894b39a89ea2d49 URL: https://github.com/llvm/llvm-project/commit/f1e2d5851bf869685971d5acb894b39a89ea2d49 DIFF: https://github.com/llvm/llvm-project/commit/f1e2d5851bf869685971d5acb894b39a89ea2d49.diff LOG: [OptTable] Rename PrintHelp to printHelp To be consistent with other member functions and match the coding standard. Added: Modified: clang/lib/Driver/Driver.cpp clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp clang/tools/driver/cc1as_main.cpp flang/lib/FrontendTool/ExecuteCompilerInvocation.cpp lld/COFF/DriverUtils.cpp lld/ELF/DriverUtils.cpp lld/MachO/DriverUtils.cpp lld/MinGW/Driver.cpp lld/lib/Driver/DarwinLdDriver.cpp lld/wasm/Driver.cpp lldb/tools/driver/Driver.cpp lldb/tools/lldb-server/lldb-gdbserver.cpp lldb/tools/lldb-vscode/lldb-vscode.cpp llvm/include/llvm/Option/OptTable.h llvm/lib/Option/OptTable.cpp llvm/lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp llvm/tools/dsymutil/dsymutil.cpp llvm/tools/llvm-cvtres/llvm-cvtres.cpp llvm/tools/llvm-lipo/llvm-lipo.cpp llvm/tools/llvm-ml/llvm-ml.cpp llvm/tools/llvm-mt/llvm-mt.cpp llvm/tools/llvm-objcopy/ConfigManager.cpp llvm/tools/llvm-objdump/llvm-objdump.cpp llvm/tools/llvm-rc/llvm-rc.cpp llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp llvm/unittests/Option/OptionParsingTest.cpp Removed: diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index 1afaaba79105b..6ea6e2e47e639 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -1635,7 +1635,7 @@ void Driver::PrintHelp(bool ShowHidden) const { ExcludedFlagsBitmask |= options::FlangOnlyOption; std::string Usage = llvm::formatv("{0} [options] file...", Name).str(); - getOpts().PrintHelp(llvm::outs(), Usage.c_str(), DriverTitle.c_str(), + getOpts().printHelp(llvm::outs(), Usage.c_str(), DriverTitle.c_str(), IncludedFlagsBitmask, ExcludedFlagsBitmask, /*ShowAllAliases=*/false); } diff --git a/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp b/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp index ac64e1708da6c..b95851e380d28 100644 --- a/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp +++ b/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp @@ -187,7 +187,7 @@ CreateFrontendAction(CompilerInstance ) { bool ExecuteCompilerInvocation(CompilerInstance *Clang) { // Honor -help. if (Clang->getFrontendOpts().ShowHelp) { -driver::getDriverOptTable().PrintHelp( +driver::getDriverOptTable().printHelp( llvm::outs(), "clang -cc1 [options] file...", "LLVM 'Clang' Compiler: http://clang.llvm.org;, /*Include=*/driver::options::CC1Option, diff --git a/clang/tools/driver/cc1as_main.cpp b/clang/tools/driver/cc1as_main.cpp index 9f6a58b634b4b..086ce0ea77875 100644 --- a/clang/tools/driver/cc1as_main.cpp +++ b/clang/tools/driver/cc1as_main.cpp @@ -585,7 +585,7 @@ int cc1as_main(ArrayRef Argv, const char *Argv0, void *MainAddr) { return 1; if (Asm.ShowHelp) { -getDriverOptTable().PrintHelp( +getDriverOptTable().printHelp( llvm::outs(), "clang -cc1as [options] file...", "Clang Integrated Assembler", /*Include=*/driver::options::CC1AsOption, /*Exclude=*/0, diff --git a/flang/lib/FrontendTool/ExecuteCompilerInvocation.cpp b/flang/lib/FrontendTool/ExecuteCompilerInvocation.cpp index e53f652d3b2c4..243e25163dc05 100644 --- a/flang/lib/FrontendTool/ExecuteCompilerInvocation.cpp +++ b/flang/lib/FrontendTool/ExecuteCompilerInvocation.cpp @@ -103,7 +103,7 @@ std::unique_ptr CreateFrontendAction(CompilerInstance ) { bool ExecuteCompilerInvocation(CompilerInstance *flang) { // Honor -help. if (flang->frontendOpts().showHelp_) { -clang::driver::getDriverOptTable().PrintHelp(llvm::outs(), +clang::driver::getDriverOptTable().printHelp(llvm::outs(), "flang-new -fc1 [options] file...", "LLVM 'Flang' Compiler", /*Include=*/clang::driver::options::FC1Option, /*Exclude=*/llvm::opt::DriverFlag::HelpHidden, diff --git a/lld/COFF/DriverUtils.cpp b/lld/COFF/DriverUtils.cpp index d6261209a9c1c..b5abe8b1196d9 100644 --- a/lld/COFF/DriverUtils.cpp +++ b/lld/COFF/DriverUtils.cpp @@ -933,7 +933,7 @@ std::vector ArgParser::tokenize(StringRef s) { } void printHelp(const char *argv0) { - optTable.PrintHelp(lld::outs(), + optTable.printHelp(lld::outs(), (std::string(argv0) + " [options] file...").c_str(), "LLVM Linker", false); } diff --git a/lld/ELF/DriverUtils.cpp b/lld/ELF/DriverUtils.cpp index a3fc522c708c2..f49deb9012b28 100644 --- a/lld/ELF/DriverUtils.cpp +++ b/lld/ELF/DriverUtils.cpp @@ -145,7
[Lldb-commits] [lldb] c2f819a - [MC] Refactor MCObjectFileInfo initialization and allow targets to create MCObjectFileInfo
Author: Philipp Krones Date: 2021-05-23T14:15:23-07:00 New Revision: c2f819af73c54a8cf923e5a25099ca95dbe76312 URL: https://github.com/llvm/llvm-project/commit/c2f819af73c54a8cf923e5a25099ca95dbe76312 DIFF: https://github.com/llvm/llvm-project/commit/c2f819af73c54a8cf923e5a25099ca95dbe76312.diff LOG: [MC] Refactor MCObjectFileInfo initialization and allow targets to create MCObjectFileInfo This makes it possible for targets to define their own MCObjectFileInfo. This MCObjectFileInfo is then used to determine things like section alignment. This is a follow up to D101462 and prepares for the RISCV backend defining the text section alignment depending on the enabled extensions. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D101921 Added: Modified: clang/lib/Parse/ParseStmtAsm.cpp clang/tools/driver/cc1as_main.cpp lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp lldb/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp llvm/include/llvm/MC/MCContext.h llvm/include/llvm/Support/TargetRegistry.h llvm/lib/CodeGen/MachineModuleInfo.cpp llvm/lib/DWARFLinker/DWARFStreamer.cpp llvm/lib/MC/MCContext.cpp llvm/lib/MC/MCDisassembler/Disassembler.cpp llvm/lib/Object/ModuleSymbolTable.cpp llvm/tools/llvm-cfi-verify/lib/FileAnalysis.cpp llvm/tools/llvm-cfi-verify/lib/FileAnalysis.h llvm/tools/llvm-dwp/llvm-dwp.cpp llvm/tools/llvm-exegesis/lib/Analysis.cpp llvm/tools/llvm-exegesis/lib/Analysis.h llvm/tools/llvm-exegesis/lib/LlvmState.cpp llvm/tools/llvm-exegesis/lib/SnippetFile.cpp llvm/tools/llvm-jitlink/llvm-jitlink.cpp llvm/tools/llvm-mc-assemble-fuzzer/llvm-mc-assemble-fuzzer.cpp llvm/tools/llvm-mc/llvm-mc.cpp llvm/tools/llvm-mca/llvm-mca.cpp llvm/tools/llvm-ml/Disassembler.cpp llvm/tools/llvm-ml/llvm-ml.cpp llvm/tools/llvm-objdump/MachODump.cpp llvm/tools/llvm-objdump/llvm-objdump.cpp llvm/tools/llvm-profgen/ProfiledBinary.cpp llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp llvm/tools/sancov/sancov.cpp llvm/unittests/CodeGen/MachineInstrTest.cpp llvm/unittests/CodeGen/MachineOperandTest.cpp llvm/unittests/CodeGen/TestAsmPrinter.cpp llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp llvm/unittests/MC/DwarfLineTables.cpp llvm/unittests/MC/SystemZ/SystemZAsmLexerTest.cpp mlir/lib/Dialect/GPU/Transforms/SerializeToHsaco.cpp Removed: diff --git a/clang/lib/Parse/ParseStmtAsm.cpp b/clang/lib/Parse/ParseStmtAsm.cpp index 4c11fc60b4a0..9037895a3bbf 100644 --- a/clang/lib/Parse/ParseStmtAsm.cpp +++ b/clang/lib/Parse/ParseStmtAsm.cpp @@ -577,20 +577,22 @@ StmtResult Parser::ParseMicrosoftAsmStatement(SourceLocation AsmLoc) { TheTarget->createMCAsmInfo(*MRI, TT, MCOptions)); // Get the instruction descriptor. std::unique_ptr MII(TheTarget->createMCInstrInfo()); - std::unique_ptr MOFI(new llvm::MCObjectFileInfo()); std::unique_ptr STI( TheTarget->createMCSubtargetInfo(TT, TO.CPU, FeaturesStr)); // Target MCTargetDesc may not be linked in clang-based tools. - if (!MAI || !MII || !MOFI || !STI) { + + if (!MAI || !MII || !STI) { Diag(AsmLoc, diag::err_msasm_unable_to_create_target) << "target MC unavailable"; return EmptyStmt(); } llvm::SourceMgr TempSrcMgr; - llvm::MCContext Ctx(TheTriple, MAI.get(), MRI.get(), MOFI.get(), STI.get(), - ); - MOFI->initMCObjectFileInfo(Ctx, /*PIC=*/false); + llvm::MCContext Ctx(TheTriple, MAI.get(), MRI.get(), STI.get(), ); + std::unique_ptr MOFI( + TheTarget->createMCObjectFileInfo(Ctx, /*PIC=*/false)); + Ctx.setObjectFileInfo(MOFI.get()); + std::unique_ptr Buffer = llvm::MemoryBuffer::getMemBuffer(AsmString, ""); diff --git a/clang/tools/driver/cc1as_main.cpp b/clang/tools/driver/cc1as_main.cpp index ec50e28f2796..9f6a58b634b4 100644 --- a/clang/tools/driver/cc1as_main.cpp +++ b/clang/tools/driver/cc1as_main.cpp @@ -383,10 +383,6 @@ static bool ExecuteAssemblerImpl(AssemblerInvocation , if (!Opts.SplitDwarfOutput.empty()) DwoOS = getOutputStream(Opts.SplitDwarfOutput, Diags, IsBinary); - // FIXME: This is not pretty. MCContext has a ptr to MCObjectFileInfo and - // MCObjectFileInfo needs a MCContext reference in order to initialize itself. - std::unique_ptr MOFI(new MCObjectFileInfo()); - // Build up the feature string from the target feature list. std::string FS = llvm::join(Opts.Features, ","); @@ -394,8 +390,8 @@ static bool ExecuteAssemblerImpl(AssemblerInvocation , TheTarget->createMCSubtargetInfo(Opts.Triple, Opts.CPU, FS)); assert(STI && "Unable to create subtarget info!"); - MCContext Ctx(Triple(Opts.Triple), MAI.get(), MRI.get(), MOFI.get(), -STI.get(), , ); + MCContext
[Lldb-commits] [lldb] 632ebc4 - [MC] Untangle MCContext and MCObjectFileInfo
Author: Philipp Krones Date: 2021-05-05T10:03:02-07:00 New Revision: 632ebc4ab4374e53fce1ec870465c587e0a33668 URL: https://github.com/llvm/llvm-project/commit/632ebc4ab4374e53fce1ec870465c587e0a33668 DIFF: https://github.com/llvm/llvm-project/commit/632ebc4ab4374e53fce1ec870465c587e0a33668.diff LOG: [MC] Untangle MCContext and MCObjectFileInfo This untangles the MCContext and the MCObjectFileInfo. There is a circular dependency between MCContext and MCObjectFileInfo. Currently this dependency also exists during construction: You can't contruct a MOFI without a MCContext without constructing the MCContext with a dummy version of that MOFI first. This removes this dependency during construction. In a perfect world, MCObjectFileInfo wouldn't depend on MCContext at all, but only be stored in the MCContext, like other MC information. This is future work. This also shifts/adds more information to the MCContext making it more available to the different targets. Namely: - TargetTriple - ObjectFileType - SubtargetInfo Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D101462 Added: Modified: clang/lib/Parse/ParseStmtAsm.cpp clang/tools/driver/cc1as_main.cpp lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp lldb/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp llvm/include/llvm/MC/MCContext.h llvm/include/llvm/MC/MCObjectFileInfo.h llvm/lib/CodeGen/MachineModuleInfo.cpp llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp llvm/lib/DWARFLinker/DWARFStreamer.cpp llvm/lib/MC/MCAsmStreamer.cpp llvm/lib/MC/MCContext.cpp llvm/lib/MC/MCDisassembler/Disassembler.cpp llvm/lib/MC/MCMachOStreamer.cpp llvm/lib/MC/MCObjectFileInfo.cpp llvm/lib/MC/MCParser/AsmParser.cpp llvm/lib/MC/MCParser/COFFAsmParser.cpp llvm/lib/MC/MCParser/DarwinAsmParser.cpp llvm/lib/MC/MCParser/MasmParser.cpp llvm/lib/MC/MCStreamer.cpp llvm/lib/MC/MCWinCOFFStreamer.cpp llvm/lib/Object/ModuleSymbolTable.cpp llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp llvm/lib/Target/NVPTX/MCTargetDesc/NVPTXTargetStreamer.cpp llvm/lib/Target/TargetLoweringObjectFile.cpp llvm/tools/llvm-cfi-verify/lib/FileAnalysis.cpp llvm/tools/llvm-dwp/llvm-dwp.cpp llvm/tools/llvm-exegesis/lib/Analysis.cpp llvm/tools/llvm-exegesis/lib/LlvmState.cpp llvm/tools/llvm-exegesis/lib/SnippetFile.cpp llvm/tools/llvm-jitlink/llvm-jitlink.cpp llvm/tools/llvm-mc-assemble-fuzzer/llvm-mc-assemble-fuzzer.cpp llvm/tools/llvm-mc/llvm-mc.cpp llvm/tools/llvm-mca/llvm-mca.cpp llvm/tools/llvm-ml/Disassembler.cpp llvm/tools/llvm-ml/llvm-ml.cpp llvm/tools/llvm-objdump/MachODump.cpp llvm/tools/llvm-objdump/llvm-objdump.cpp llvm/tools/llvm-profgen/ProfiledBinary.cpp llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp llvm/tools/sancov/sancov.cpp llvm/unittests/CodeGen/MachineInstrTest.cpp llvm/unittests/CodeGen/MachineOperandTest.cpp llvm/unittests/CodeGen/TestAsmPrinter.cpp llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp llvm/unittests/MC/DwarfLineTables.cpp llvm/unittests/MC/SystemZ/SystemZAsmLexerTest.cpp mlir/lib/Dialect/GPU/Transforms/SerializeToHsaco.cpp Removed: diff --git a/clang/lib/Parse/ParseStmtAsm.cpp b/clang/lib/Parse/ParseStmtAsm.cpp index bdf40c291cb6..4c11fc60b4a0 100644 --- a/clang/lib/Parse/ParseStmtAsm.cpp +++ b/clang/lib/Parse/ParseStmtAsm.cpp @@ -588,8 +588,9 @@ StmtResult Parser::ParseMicrosoftAsmStatement(SourceLocation AsmLoc) { } llvm::SourceMgr TempSrcMgr; - llvm::MCContext Ctx(MAI.get(), MRI.get(), MOFI.get(), ); - MOFI->InitMCObjectFileInfo(TheTriple, /*PIC*/ false, Ctx); + llvm::MCContext Ctx(TheTriple, MAI.get(), MRI.get(), MOFI.get(), STI.get(), + ); + MOFI->initMCObjectFileInfo(Ctx, /*PIC=*/false); std::unique_ptr Buffer = llvm::MemoryBuffer::getMemBuffer(AsmString, ""); diff --git a/clang/tools/driver/cc1as_main.cpp b/clang/tools/driver/cc1as_main.cpp index d4fa60c963d7..ec50e28f2796 100644 --- a/clang/tools/driver/cc1as_main.cpp +++ b/clang/tools/driver/cc1as_main.cpp @@ -387,7 +387,15 @@ static bool ExecuteAssemblerImpl(AssemblerInvocation , // MCObjectFileInfo needs a MCContext reference in order to initialize itself. std::unique_ptr MOFI(new MCObjectFileInfo()); - MCContext Ctx(MAI.get(), MRI.get(), MOFI.get(), , ); + // Build up the feature string from the target feature list. + std::string FS = llvm::join(Opts.Features, ","); + + std::unique_ptr STI( + TheTarget->createMCSubtargetInfo(Opts.Triple, Opts.CPU, FS)); + assert(STI && "Unable to create subtarget info!"); + + MCContext Ctx(Triple(Opts.Triple), MAI.get(), MRI.get(), MOFI.get(), +
[Lldb-commits] [lldb] 50830e5 - [lldb] Add -Wl, -rpath to make tests run with fresh built libc++
Author: Fangrui Song Date: 2021-01-24T20:21:57Z New Revision: 50830e50031b5420f09f79e82cf6ec984fb8328d URL: https://github.com/llvm/llvm-project/commit/50830e50031b5420f09f79e82cf6ec984fb8328d DIFF: https://github.com/llvm/llvm-project/commit/50830e50031b5420f09f79e82cf6ec984fb8328d.diff LOG: [lldb] Add -Wl,-rpath to make tests run with fresh built libc++ On my Debian machine, system libc++/libc++abi is not installed (`libc++1-9 libc++abi-9`), 21 check-lldb-api tests fail because -stdlib=libc++ linked executables cannot find runtime libc++.so.1 at runtime. Use the `-Wl,-rpath,$(LLVM_LIBS_DIR)` mechanism in `packages/Python/lldbsuite/test/make/Makefile.rules` (D58630 for NetBSD) to allow such tests compile/link with fresh libc++ built beside lldb. (A system libc++.so.1 is not guaranteed to match fresh libc++ header files.) Some tweaks to the existing NetBSD rule when generalizing: * Drop `-L$(LLVM_LIBS_DIR)` since Clang driver adds it correctly. * Add `-stdlib=libc++` only for `USE_LIBCPP`. Also, drop `-isystem /usr/include/c++/v1` introduced in D9426. It is not needed by Clang driver. GCC using libc++ requires more setup. I don't find any test needing `-Wl,-rpath` in `test/Shell/helper/{build,toolchain}.py` (D58630 for NetBSD added them). Reviewed By: labath Differential Revision: https://reviews.llvm.org/D94888 Added: Modified: lldb/packages/Python/lldbsuite/test/dotest.py lldb/packages/Python/lldbsuite/test/make/Makefile.rules Removed: diff --git a/lldb/packages/Python/lldbsuite/test/dotest.py b/lldb/packages/Python/lldbsuite/test/dotest.py index c728bf329202..b8bfbab7b1f0 100644 --- a/lldb/packages/Python/lldbsuite/test/dotest.py +++ b/lldb/packages/Python/lldbsuite/test/dotest.py @@ -761,8 +761,6 @@ def canRunLibcxxTests(): return True, "libc++ always present" if platform == "linux": -if os.path.isdir("/usr/include/c++/v1"): -return True, "Headers found, let's hope they work" with tempfile.NamedTemporaryFile() as f: cmd = [configuration.compiler, "-xc++", "-stdlib=libc++", "-o", f.name, "-"] p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True) diff --git a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules index 374dd6865d88..f4aa6d646711 100644 --- a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules +++ b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules @@ -279,11 +279,6 @@ CXXFLAGS += -std=c++11 $(CFLAGS) $(ARCH_CXXFLAGS) $(CXXFLAGS_EXTRAS) LD = $(CC) LDFLAGS ?= $(CFLAGS) LDFLAGS += $(LD_EXTRAS) $(ARCH_LDFLAGS) -ifneq (,$(LLVM_LIBS_DIR)) - ifeq ($(OS),NetBSD) - LDFLAGS += -L$(LLVM_LIBS_DIR) -Wl,-rpath,$(LLVM_LIBS_DIR) - endif -endif ifeq (,$(filter $(OS), Windows_NT Android Darwin)) ifneq (,$(filter YES,$(ENABLE_THREADS))) LDFLAGS += -pthread @@ -393,21 +388,18 @@ endif ifeq (1,$(USE_LIBCPP)) CXXFLAGS += -DLLDB_USING_LIBCPP - ifeq "$(OS)" "Linux" - ifneq (,$(findstring clang,$(CC))) - CXXFLAGS += -stdlib=libc++ - LDFLAGS += -stdlib=libc++ - else - CXXFLAGS += -isystem /usr/include/c++/v1 - LDFLAGS += -lc++ - endif - else ifeq "$(OS)" "Android" + ifeq "$(OS)" "Android" # Nothing to do, this is already handled in # Android.rules. else CXXFLAGS += -stdlib=libc++ LDFLAGS += -stdlib=libc++ endif + ifneq (,$(filter $(OS), FreeBSD Linux NetBSD)) + ifneq (,$(LLVM_LIBS_DIR)) + LDFLAGS += -Wl,-rpath,$(LLVM_LIBS_DIR) + endif + endif endif #-- ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] a2cd6d0 - [lldb] Fix demangler leaks in the DWARF AST parser
Author: Fangrui Song Date: 2021-04-19T16:36:54-07:00 New Revision: a2cd6d07691a645bfb8fb5eeeba2eb5970312c7f URL: https://github.com/llvm/llvm-project/commit/a2cd6d07691a645bfb8fb5eeeba2eb5970312c7f DIFF: https://github.com/llvm/llvm-project/commit/a2cd6d07691a645bfb8fb5eeeba2eb5970312c7f.diff LOG: [lldb] Fix demangler leaks in the DWARF AST parser This fixes 6 check-lldb-shell failures in a `-DLLVM_USE_SANITIZER=Leaks` build. Differential Revision: https://reviews.llvm.org/D100800 Added: Modified: lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp Removed: diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp index b9e10f94bf6cc..c417f8055c882 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp @@ -1226,6 +1226,7 @@ TypeSP DWARFASTParserClang::ParseSubroutine(const DWARFDIE , } if (!function_decl) { +char *name_buf = nullptr; llvm::StringRef name = attrs.name.GetStringRef(); // We currently generate function templates with template parameters in @@ -1233,8 +1234,10 @@ TypeSP DWARFASTParserClang::ParseSubroutine(const DWARFDIE , // we want to strip these from the name when creating the AST. if (attrs.mangled_name) { llvm::ItaniumPartialDemangler D; - if (!D.partialDemangle(attrs.mangled_name)) -name = D.getFunctionBaseName(nullptr, nullptr); + if (!D.partialDemangle(attrs.mangled_name)) { +name_buf = D.getFunctionBaseName(nullptr, nullptr); +name = name_buf; + } } // We just have a function that isn't part of a class @@ -1243,6 +1246,7 @@ TypeSP DWARFASTParserClang::ParseSubroutine(const DWARFDIE , : containing_decl_ctx, GetOwningClangModule(die), name, clang_type, attrs.storage, attrs.is_inline); +std::free(name_buf); if (has_template_params) { TypeSystemClang::TemplateParameterInfos template_param_infos; ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] cdae6d7 - [lldb] Fix one leak in reproducer
Author: Fangrui Song Date: 2021-04-19T19:39:10-07:00 New Revision: cdae6d7711d621c19623ae4fbfdde9e0301260c7 URL: https://github.com/llvm/llvm-project/commit/cdae6d7711d621c19623ae4fbfdde9e0301260c7 DIFF: https://github.com/llvm/llvm-project/commit/cdae6d7711d621c19623ae4fbfdde9e0301260c7.diff LOG: [lldb] Fix one leak in reproducer Use a variable of static storage duration to reference an intentionally leaked variable. A static data area is in the GC-set of various leak checkers. This fixes 3 `check-lldb-shell` tests in a `-DLLVM_USE_SANITIZER={Leaks,Address}` build, e.g. `test/Shell/Reproducer/TestHomeDir.test` Differential Revision: https://reviews.llvm.org/D100806 Added: Modified: lldb/tools/driver/Driver.cpp Removed: diff --git a/lldb/tools/driver/Driver.cpp b/lldb/tools/driver/Driver.cpp index e4a60127b65ed..c5121538741f8 100644 --- a/lldb/tools/driver/Driver.cpp +++ b/lldb/tools/driver/Driver.cpp @@ -784,8 +784,8 @@ static void printHelp(LLDBOptTable , llvm::StringRef tool_name) { llvm::outs() << examples << '\n'; } -llvm::Optional InitializeReproducer(llvm::StringRef argv0, - opt::InputArgList _args) { +static llvm::Optional InitializeReproducer(llvm::StringRef argv0, +opt::InputArgList _args) { if (auto *finalize_path = input_args.getLastArg(OPT_reproducer_finalize)) { if (const char *error = SBReproducer::Finalize(finalize_path->getValue())) { WithColor::error() << "reproducer finalization failed: " << error << '\n'; @@ -853,8 +853,7 @@ llvm::Optional InitializeReproducer(llvm::StringRef argv0, // Register the reproducer signal handler. if (!input_args.hasArg(OPT_no_generate_on_signal)) { if (const char *reproducer_path = SBReproducer::GetPath()) { -// Leaking the string on purpose. -std::string *finalize_cmd = new std::string(argv0); +static std::string *finalize_cmd = new std::string(argv0); finalize_cmd->append(" --reproducer-finalize '"); finalize_cmd->append(reproducer_path); finalize_cmd->append("'"); ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] 135d07f - [lldb][test] Fix Shell/SymbolFile/symbol-binding.test
Author: Fangrui Song Date: 2021-02-13T11:10:29-08:00 New Revision: 135d07fb0d8f7fed37c4f8cebb42c70cd05bfa84 URL: https://github.com/llvm/llvm-project/commit/135d07fb0d8f7fed37c4f8cebb42c70cd05bfa84 DIFF: https://github.com/llvm/llvm-project/commit/135d07fb0d8f7fed37c4f8cebb42c70cd05bfa84.diff LOG: [lldb][test] Fix Shell/SymbolFile/symbol-binding.test Added: Modified: lldb/test/Shell/SymbolFile/symbol-binding.test Removed: diff --git a/lldb/test/Shell/SymbolFile/symbol-binding.test b/lldb/test/Shell/SymbolFile/symbol-binding.test index 9bf6acfeae85..35faf844e9cc 100644 --- a/lldb/test/Shell/SymbolFile/symbol-binding.test +++ b/lldb/test/Shell/SymbolFile/symbol-binding.test @@ -18,5 +18,5 @@ image dump symtab # CHECK-NEXT:[4] 5 Code0x0005 0x0001 0x case2_local # CHECK-NEXT:[5] 6 X Code0x0004 0x0001 0x0010 case1_global # CHECK-NEXT:[6] 7 Code0x0005 0x0001 0x0020 case2_weak -# CHECK-NEXT:[7] 8 X Code0x0006 0x0001 0x0010 case3_global -# CHECK-NEXT:[8] 9 Code0x0006 0x0001 0x0020 case3_weak +# CHECK-NEXT:[7] 8 Code0x0006 0x0001 0x0020 case3_weak +# CHECK-NEXT:[8] 9 X Code0x0006 0x0001 0x0010 case3_global ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] 40aab04 - [test] Migrate -gcc-toolchain with space separator to --gcc-toolchain=
Author: Fangrui Song Date: 2021-08-20T15:24:58-07:00 New Revision: 40aab0412fe7a14781e133627c2bb0a22761eac8 URL: https://github.com/llvm/llvm-project/commit/40aab0412fe7a14781e133627c2bb0a22761eac8 DIFF: https://github.com/llvm/llvm-project/commit/40aab0412fe7a14781e133627c2bb0a22761eac8.diff LOG: [test] Migrate -gcc-toolchain with space separator to --gcc-toolchain= Space separated driver options are uncommon but Clang traditionally did not do a good job. --gcc-toolchain= is the preferred form. Added: Modified: clang/test/Driver/fuse-ld.c clang/test/Driver/gcc-toolchain.cpp libc/benchmarks/CMakeLists.txt libcxx/benchmarks/CMakeLists.txt lldb/packages/Python/lldbsuite/test/make/Android.rules llvm/docs/HowToCrossCompileBuiltinsOnArm.rst Removed: diff --git a/clang/test/Driver/fuse-ld.c b/clang/test/Driver/fuse-ld.c index 74a2e5f4d9654..dfcf31e25ffa6 100644 --- a/clang/test/Driver/fuse-ld.c +++ b/clang/test/Driver/fuse-ld.c @@ -60,19 +60,19 @@ // RUN: %clang %s -### -fuse-ld=ld \ // RUN: -target arm-linux-androideabi \ -// RUN: -gcc-toolchain %S/Inputs/basic_android_tree 2>&1 \ +// RUN: --gcc-toolchain=%S/Inputs/basic_android_tree 2>&1 \ // RUN: | FileCheck %s --check-prefix=CHECK-ANDROID-ARM-LD-TC // CHECK-ANDROID-ARM-LD-TC: Inputs/basic_android_tree/lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin{{/|\\+}}ld // RUN: %clang %s -### -fuse-ld=bfd \ // RUN: -target arm-linux-androideabi \ -// RUN: -gcc-toolchain %S/Inputs/basic_android_tree 2>&1 \ +// RUN: --gcc-toolchain=%S/Inputs/basic_android_tree 2>&1 \ // RUN: | FileCheck %s -check-prefix=CHECK-ANDROID-ARM-BFD-TC // CHECK-ANDROID-ARM-BFD-TC: Inputs/basic_android_tree/lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin{{/|\\+}}ld.bfd // RUN: %clang %s -### -fuse-ld=gold \ // RUN: -target arm-linux-androideabi \ -// RUN: -gcc-toolchain %S/Inputs/basic_android_tree 2>&1 \ +// RUN: --gcc-toolchain=%S/Inputs/basic_android_tree 2>&1 \ // RUN: | FileCheck %s -check-prefix=CHECK-ANDROID-ARM-GOLD-TC // CHECK-ANDROID-ARM-GOLD-TC: Inputs/basic_android_tree/lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin{{/|\\+}}ld.gold diff --git a/clang/test/Driver/gcc-toolchain.cpp b/clang/test/Driver/gcc-toolchain.cpp index 7cdba0841b8cd..e3a1670110a5f 100644 --- a/clang/test/Driver/gcc-toolchain.cpp +++ b/clang/test/Driver/gcc-toolchain.cpp @@ -8,7 +8,7 @@ // // Additionally check that the legacy spelling of the flag works. // RUN: %clangxx %s -### --target=x86_64-linux-gnu --sysroot= \ -// RUN: -gcc-toolchain %S/Inputs/ubuntu_14.04_multiarch_tree/usr -stdlib=libstdc++ --rtlib=libgcc 2>&1 | \ +// RUN: --gcc-toolchain=%S/Inputs/ubuntu_14.04_multiarch_tree/usr -stdlib=libstdc++ --rtlib=libgcc 2>&1 | \ // RUN: FileCheck %s // // Test for header search toolchain detection. diff --git a/libc/benchmarks/CMakeLists.txt b/libc/benchmarks/CMakeLists.txt index 3eece745096f9..2f06836b0fadd 100644 --- a/libc/benchmarks/CMakeLists.txt +++ b/libc/benchmarks/CMakeLists.txt @@ -10,7 +10,7 @@ set(LLVM_LINK_COMPONENTS Support) set(GOOGLE_BENCHMARK_TARGET_FLAGS ${BENCHMARK_DIALECT_FLAG}) if (LIBCXX_BENCHMARK_GCC_TOOLCHAIN) set(GOOGLE_BENCHMARK_TARGET_FLAGS - -gcc-toolchain ${LIBCXX_BENCHMARK_GCC_TOOLCHAIN}) + --gcc-toolchain=${LIBCXX_BENCHMARK_GCC_TOOLCHAIN}) endif() string(REPLACE ";" " " GOOGLE_BENCHMARK_TARGET_FLAGS "${GOOGLE_BENCHMARK_TARGET_FLAGS}") diff --git a/libcxx/benchmarks/CMakeLists.txt b/libcxx/benchmarks/CMakeLists.txt index c4b8247da63b1..8e33f8ebcf0cf 100644 --- a/libcxx/benchmarks/CMakeLists.txt +++ b/libcxx/benchmarks/CMakeLists.txt @@ -47,7 +47,7 @@ ExternalProject_Add(google-benchmark-libcxx set(BENCHMARK_NATIVE_TARGET_FLAGS) if (LIBCXX_BENCHMARK_NATIVE_GCC_TOOLCHAIN) set(BENCHMARK_NATIVE_TARGET_FLAGS - -gcc-toolchain ${LIBCXX_BENCHMARK_NATIVE_GCC_TOOLCHAIN}) + --gcc-toolchain=${LIBCXX_BENCHMARK_NATIVE_GCC_TOOLCHAIN}) endif() split_list(BENCHMARK_NATIVE_TARGET_FLAGS) diff --git a/lldb/packages/Python/lldbsuite/test/make/Android.rules b/lldb/packages/Python/lldbsuite/test/make/Android.rules index 7339c22d2e4c4..32f786aa34756 100644 --- a/lldb/packages/Python/lldbsuite/test/make/Android.rules +++ b/lldb/packages/Python/lldbsuite/test/make/Android.rules @@ -66,8 +66,8 @@ OBJCOPY ?= $(GCC_TOOLCHAIN)/bin/$(TOOL_PREFIX)-objcopy ARCHIVER ?= $(GCC_TOOLCHAIN)/bin/$(TOOL_PREFIX)-ar ifeq "$(findstring clang,$(CC))" "clang" - ARCH_CFLAGS += -target $(TRIPLE) -gcc-toolchain $(GCC_TOOLCHAIN) - ARCH_LDFLAGS += -target $(TRIPLE) -gcc-toolchain $(GCC_TOOLCHAIN) + ARCH_CFLAGS += -target $(TRIPLE) --gcc-toolchain=$(GCC_TOOLCHAIN) + ARCH_LDFLAGS += -target $(TRIPLE) --gcc-toolchain=$(GCC_TOOLCHAIN) endif ARCH_CFLAGS +=
[Lldb-commits] [lldb] 5a95ff2 - [lldb] Fix -Wunused-but-set-variable
Author: Fangrui Song Date: 2021-08-16T16:41:17-07:00 New Revision: 5a95ff2bfcc191f3ffecb69ac1d762a93b149eee URL: https://github.com/llvm/llvm-project/commit/5a95ff2bfcc191f3ffecb69ac1d762a93b149eee DIFF: https://github.com/llvm/llvm-project/commit/5a95ff2bfcc191f3ffecb69ac1d762a93b149eee.diff LOG: [lldb] Fix -Wunused-but-set-variable Added: Modified: lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp Removed: diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp index 79e6b3f609651..f2ed6330e36d1 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp @@ -1584,6 +1584,7 @@ DWARFASTParserClang::ParseStructureLikeDIE(const SymbolContext , } } assert(tag_decl_kind != -1); + (void)tag_decl_kind; bool clang_type_was_created = false; clang_type.SetCompilerType( _ast, dwarf->GetForwardDeclDieToClangType().lookup(die.GetDIE())); ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] e69d359 - [lldb] Actually fix format specifier after D108233
Author: Fangrui Song Date: 2021-09-13T13:40:37-07:00 New Revision: e69d359841b6358f1d17569212ef8cf91244ca11 URL: https://github.com/llvm/llvm-project/commit/e69d359841b6358f1d17569212ef8cf91244ca11 DIFF: https://github.com/llvm/llvm-project/commit/e69d359841b6358f1d17569212ef8cf91244ca11.diff LOG: [lldb] Actually fix format specifier after D108233 And revert c4fa2c8aa493e4c786446739ba3eb0eb4918d579 Added: Modified: lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.cpp Removed: diff --git a/lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.cpp b/lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.cpp index 03722b391004..a70e6a079f76 100644 --- a/lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.cpp +++ b/lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.cpp @@ -28,6 +28,8 @@ #include "Plugins/Process/minidump/MinidumpTypes.h" +#include + using namespace lldb; using namespace lldb_private; using namespace llvm::minidump; @@ -729,7 +731,7 @@ Status MinidumpFileBuilder::Dump(lldb::FileUP _file) const { if (error.Fail() || bytes_written != header_size) { if (bytes_written != header_size) error.SetErrorStringWithFormat( - "Unable to write the header. (written %ld/%ld).", bytes_written, + "unable to write the header (written %zd/%zd)", bytes_written, header_size); return error; } @@ -740,7 +742,7 @@ Status MinidumpFileBuilder::Dump(lldb::FileUP _file) const { if (error.Fail() || bytes_written != m_data.GetByteSize()) { if (bytes_written != m_data.GetByteSize()) error.SetErrorStringWithFormat( - "Unable to write the data. (written %ld/%llu).", bytes_written, + "unable to write the data (written %zd/%" PRIu64 ")", bytes_written, m_data.GetByteSize()); return error; } @@ -752,7 +754,7 @@ Status MinidumpFileBuilder::Dump(lldb::FileUP _file) const { if (error.Fail() || bytes_written != directory_size) { if (bytes_written != directory_size) error.SetErrorStringWithFormat( -"Unable to write the directory. (written %ld/%ld).", bytes_written, +"unable to write the directory (written %zd/%zd)", bytes_written, directory_size); return error; } ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] 172a55e - [lldb] Fix FunctionDecl::Create after D102343
Author: Fangrui Song Date: 2021-07-29T09:57:10-07:00 New Revision: 172a55e7a40d27c7882be2e86d515696d8e12427 URL: https://github.com/llvm/llvm-project/commit/172a55e7a40d27c7882be2e86d515696d8e12427 DIFF: https://github.com/llvm/llvm-project/commit/172a55e7a40d27c7882be2e86d515696d8e12427.diff LOG: [lldb] Fix FunctionDecl::Create after D102343 Added: Modified: lldb/source/Plugins/ExpressionParser/Clang/NameSearchContext.cpp Removed: diff --git a/lldb/source/Plugins/ExpressionParser/Clang/NameSearchContext.cpp b/lldb/source/Plugins/ExpressionParser/Clang/NameSearchContext.cpp index 829afa5ffcecc..d95b79a9b1f82 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/NameSearchContext.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/NameSearchContext.cpp @@ -77,7 +77,7 @@ clang::NamedDecl *NameSearchContext::AddFunDecl(const CompilerType , clang::FunctionDecl *func_decl = FunctionDecl::Create( ast, context, SourceLocation(), SourceLocation(), decl_name, qual_type, - nullptr, SC_Extern, isInlineSpecified, hasWrittenPrototype, + nullptr, SC_Extern, /*UsesFPIntrin=*/false, isInlineSpecified, hasWrittenPrototype, isConstexprSpecified ? ConstexprSpecKind::Constexpr : ConstexprSpecKind::Unspecified); ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] 72a8367 - Replace LLVM_ATTRIBUTE_NORETURN with C++11 [[noreturn]]. NFC
Author: Fangrui Song Date: 2021-07-29T09:59:45-07:00 New Revision: 72a83674dd3a13b59442cd7cb07b53902f7d6a33 URL: https://github.com/llvm/llvm-project/commit/72a83674dd3a13b59442cd7cb07b53902f7d6a33 DIFF: https://github.com/llvm/llvm-project/commit/72a83674dd3a13b59442cd7cb07b53902f7d6a33.diff LOG: Replace LLVM_ATTRIBUTE_NORETURN with C++11 [[noreturn]]. NFC [[noreturn]] can be used since Oct 2016 when the minimum compiler requirement was bumped to GCC 4.8/MSVC 2015. Added: Modified: clang-tools-extra/pp-trace/PPTrace.cpp clang/utils/TableGen/ClangDiagnosticsEmitter.cpp flang/include/flang/Optimizer/Support/FatalError.h lldb/source/Host/posix/ProcessLauncherPosixFork.cpp lldb/source/Plugins/Process/Linux/SingleStepCheck.cpp Removed: diff --git a/clang-tools-extra/pp-trace/PPTrace.cpp b/clang-tools-extra/pp-trace/PPTrace.cpp index 3fa16498fbefc..0b078c49a55b7 100644 --- a/clang-tools-extra/pp-trace/PPTrace.cpp +++ b/clang-tools-extra/pp-trace/PPTrace.cpp @@ -69,7 +69,7 @@ static cl::opt OutputFileName( cl::desc("Output trace to the given file name or '-' for stdout."), cl::cat(Cat)); -LLVM_ATTRIBUTE_NORETURN static void error(Twine Message) { +[[noreturn]] static void error(Twine Message) { WithColor::error() << Message << '\n'; exit(1); } diff --git a/clang/utils/TableGen/ClangDiagnosticsEmitter.cpp b/clang/utils/TableGen/ClangDiagnosticsEmitter.cpp index 014c1adcd8092..ad4bb8d78ced3 100644 --- a/clang/utils/TableGen/ClangDiagnosticsEmitter.cpp +++ b/clang/utils/TableGen/ClangDiagnosticsEmitter.cpp @@ -614,7 +614,7 @@ struct DiagnosticTextBuilder { return It->second.Root; } - LLVM_ATTRIBUTE_NORETURN void PrintFatalError(llvm::Twine const ) const { + [[noreturn]] void PrintFatalError(llvm::Twine const ) const { assert(EvaluatingRecord && "not evaluating a record?"); llvm::PrintFatalError(EvaluatingRecord->getLoc(), Msg); } diff --git a/flang/include/flang/Optimizer/Support/FatalError.h b/flang/include/flang/Optimizer/Support/FatalError.h index 602045346587c..8450b16a5baf4 100644 --- a/flang/include/flang/Optimizer/Support/FatalError.h +++ b/flang/include/flang/Optimizer/Support/FatalError.h @@ -20,8 +20,8 @@ namespace fir { /// Fatal error reporting helper. Report a fatal error with a source location /// and immediately abort flang. -LLVM_ATTRIBUTE_NORETURN inline void emitFatalError(mlir::Location loc, - const llvm::Twine ) { +[[noreturn]] inline void emitFatalError(mlir::Location loc, +const llvm::Twine ) { mlir::emitError(loc, message); llvm::report_fatal_error("aborting"); } diff --git a/lldb/source/Host/posix/ProcessLauncherPosixFork.cpp b/lldb/source/Host/posix/ProcessLauncherPosixFork.cpp index 25dcf1e592c57..b49b541927afe 100644 --- a/lldb/source/Host/posix/ProcessLauncherPosixFork.cpp +++ b/lldb/source/Host/posix/ProcessLauncherPosixFork.cpp @@ -46,8 +46,8 @@ static void FixupEnvironment(Environment ) { #endif } -static void LLVM_ATTRIBUTE_NORETURN ExitWithError(int error_fd, - const char *operation) { +[[noreturn]] static void ExitWithError(int error_fd, + const char *operation) { int err = errno; llvm::raw_fd_ostream os(error_fd, true); os << operation << " failed: " << llvm::sys::StrError(err); @@ -88,8 +88,8 @@ static void DupDescriptor(int error_fd, const FileSpec _spec, int fd, return; } -static void LLVM_ATTRIBUTE_NORETURN ChildFunc(int error_fd, - const ProcessLaunchInfo ) { +[[noreturn]] static void ChildFunc(int error_fd, + const ProcessLaunchInfo ) { if (info.GetFlags().Test(eLaunchFlagLaunchInSeparateProcessGroup)) { if (setpgid(0, 0) != 0) ExitWithError(error_fd, "setpgid"); diff --git a/lldb/source/Plugins/Process/Linux/SingleStepCheck.cpp b/lldb/source/Plugins/Process/Linux/SingleStepCheck.cpp index 5b337f1974ea5..5f8057d2fef63 100644 --- a/lldb/source/Plugins/Process/Linux/SingleStepCheck.cpp +++ b/lldb/source/Plugins/Process/Linux/SingleStepCheck.cpp @@ -29,7 +29,7 @@ using namespace lldb_private::process_linux; #if defined(__arm64__) || defined(__aarch64__) namespace { -void LLVM_ATTRIBUTE_NORETURN Child() { +[[noreturn]] void Child() { if (ptrace(PTRACE_TRACEME, 0, nullptr, nullptr) == -1) _exit(1); ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] 1b81581 - [lldb][test] Remove Intel MPX tests
Author: Fangrui Song Date: 2021-10-12T16:16:58-07:00 New Revision: 1b81581feec8cb6361d898dea17ed2f0ad7e5b13 URL: https://github.com/llvm/llvm-project/commit/1b81581feec8cb6361d898dea17ed2f0ad7e5b13 DIFF: https://github.com/llvm/llvm-project/commit/1b81581feec8cb6361d898dea17ed2f0ad7e5b13.diff LOG: [lldb][test] Remove Intel MPX tests Intel MPX failed to gain wide adoption and has been deprecated for a while. GCC 9.1 removed Intel MPX support. Linux kernel removed MPX in 2019. glibc 2.35 will remove the support. Added: Modified: Removed: lldb/test/API/commands/register/register/intel_xtended_registers/Makefile lldb/test/API/commands/register/register/intel_xtended_registers/TestMPXRegisters.py lldb/test/API/commands/register/register/intel_xtended_registers/main.cpp lldb/test/API/commands/register/register/intel_xtended_registers/mpx_bound_violation/Makefile lldb/test/API/commands/register/register/intel_xtended_registers/mpx_bound_violation/TestBoundViolation.py lldb/test/API/commands/register/register/intel_xtended_registers/mpx_bound_violation/main.cpp lldb/test/API/commands/register/register/intel_xtended_registers/mpx_offset_intersection/Makefile lldb/test/API/commands/register/register/intel_xtended_registers/mpx_offset_intersection/TestMPXOffsetIntersection.py lldb/test/API/commands/register/register/intel_xtended_registers/mpx_offset_intersection/main.cpp diff --git a/lldb/test/API/commands/register/register/intel_xtended_registers/Makefile b/lldb/test/API/commands/register/register/intel_xtended_registers/Makefile deleted file mode 100644 index 5cc7382f1d92f..0 --- a/lldb/test/API/commands/register/register/intel_xtended_registers/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -CXX_SOURCES := main.cpp - -CFLAGS_EXTRAS := -mmpx -fcheck-pointer-bounds -fuse-ld=bfd - -include Makefile.rules diff --git a/lldb/test/API/commands/register/register/intel_xtended_registers/TestMPXRegisters.py b/lldb/test/API/commands/register/register/intel_xtended_registers/TestMPXRegisters.py deleted file mode 100644 index 5644855868b3a..0 --- a/lldb/test/API/commands/register/register/intel_xtended_registers/TestMPXRegisters.py +++ /dev/null @@ -1,61 +0,0 @@ -""" -Test the Intel(R) MPX registers. -""" - - - -import lldb -from lldbsuite.test.decorators import * -from lldbsuite.test.lldbtest import * -from lldbsuite.test import lldbutil - - -class RegisterCommandsTestCase(TestBase): - -mydir = TestBase.compute_mydir(__file__) - -@skipIf(compiler="clang") -@skipIf(oslist=no_match(['linux'])) -@skipIf(archs=no_match(['i386', 'x86_64'])) -@skipIf(oslist=["linux"], compiler="gcc", compiler_version=["<", "5"]) #GCC version >= 5 supports Intel(R) MPX. -def test_mpx_registers_with_example_code(self): -"""Test Intel(R) MPX registers with example code.""" -self.build() -self.mpx_registers_with_example_code() - -def mpx_registers_with_example_code(self): -"""Test Intel(R) MPX registers after running example code.""" -self.line = line_number('main.cpp', '// Set a break point here.') - -exe = self.getBuildArtifact("a.out") -self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET) - -lldbutil.run_break_set_by_file_and_line(self, "main.cpp", self.line, num_expected_locations=1) -self.runCmd("run", RUN_SUCCEEDED) - -target = self.dbg.GetSelectedTarget() -process = target.GetProcess() - -if (process.GetState() == lldb.eStateExited): -self.skipTest("Intel(R) MPX is not supported.") -else: -self.expect("thread backtrace", STOPPED_DUE_TO_BREAKPOINT, -substrs = ["stop reason = breakpoint 1."]) - -if self.getArchitecture() == 'x86_64': -self.expect("register read -s 3", -substrs = ['bnd0 = {0x0010 0xffe6}', - 'bnd1 = {0x0020 0xffd6}', - 'bnd2 = {0x0030 0xffc6}', - 'bnd3 = {0x0040 0xffb6}', - 'bndcfgu = {0x01 0x80 0xb5 0x76 0xff 0x7f 0x00 0x00}', - 'bndstatus = {0x02 0x80 0xb5 0x76 0xff 0x7f 0x00 0x00}']) -if self.getArchitecture() == 'i386': -self.expect("register read -s 3", -substrs = ['bnd0 = {0x0010 0xffe6}', - 'bnd1 = {0x0020 0xffd6}', - 'bnd2 = {0x0030 0xffc6}', - 'bnd3 = {0x0040 0xffb6}', - 'bndcfgu = {0x01
[Lldb-commits] [lldb] b71b250 - [test] Fix PayloadString: in lldb tests
Author: Fangrui Song Date: 2021-07-26T10:00:05-07:00 New Revision: b71b25008f2a746d11ed1db1f49a6461b387cc8a URL: https://github.com/llvm/llvm-project/commit/b71b25008f2a746d11ed1db1f49a6461b387cc8a DIFF: https://github.com/llvm/llvm-project/commit/b71b25008f2a746d11ed1db1f49a6461b387cc8a.diff LOG: [test] Fix PayloadString: in lldb tests Added: Modified: lldb/test/API/macosx/version_zero/libDylib.dylib.yaml lldb/test/Shell/ObjectFile/MachO/lc_build_version.yaml lldb/test/Shell/ObjectFile/MachO/lc_build_version_notools.yaml lldb/test/Shell/ObjectFile/MachO/lc_version_min.yaml lldb/test/Shell/ObjectFile/MachO/symtab.yaml Removed: diff --git a/lldb/test/API/macosx/version_zero/libDylib.dylib.yaml b/lldb/test/API/macosx/version_zero/libDylib.dylib.yaml index a672f49fb4a0c..e0a0133960ef8 100644 --- a/lldb/test/API/macosx/version_zero/libDylib.dylib.yaml +++ b/lldb/test/API/macosx/version_zero/libDylib.dylib.yaml @@ -63,7 +63,7 @@ LoadCommands: timestamp: 1 current_version: 0 compatibility_version: 0 -PayloadString: '@executable_path/libDylib.dylib' +Content: '@executable_path/libDylib.dylib' ZeroPadBytes:1 - cmd: LC_DYLD_INFO_ONLY cmdsize: 48 @@ -125,7 +125,7 @@ LoadCommands: timestamp: 2 current_version: 83427328 compatibility_version: 65536 -PayloadString: '/usr/lib/libSystem.B.dylib' +Content: '/usr/lib/libSystem.B.dylib' ZeroPadBytes:6 - cmd: LC_FUNCTION_STARTS cmdsize: 16 diff --git a/lldb/test/Shell/ObjectFile/MachO/lc_build_version.yaml b/lldb/test/Shell/ObjectFile/MachO/lc_build_version.yaml index 576af4c225ee9..66245644a9cb3 100644 --- a/lldb/test/Shell/ObjectFile/MachO/lc_build_version.yaml +++ b/lldb/test/Shell/ObjectFile/MachO/lc_build_version.yaml @@ -113,7 +113,7 @@ LoadCommands: - cmd: LC_LOAD_DYLINKER cmdsize: 32 name:12 -PayloadString: /usr/lib/dyld +Content: /usr/lib/dyld ZeroPadBytes:7 - cmd: LC_UUID cmdsize: 24 @@ -141,7 +141,7 @@ LoadCommands: timestamp: 2 current_version: 82102276 compatibility_version: 65536 -PayloadString: /usr/lib/libSystem.B.dylib +Content: /usr/lib/libSystem.B.dylib ZeroPadBytes:6 - cmd: LC_FUNCTION_STARTS cmdsize: 16 diff --git a/lldb/test/Shell/ObjectFile/MachO/lc_build_version_notools.yaml b/lldb/test/Shell/ObjectFile/MachO/lc_build_version_notools.yaml index 21aebae764b0f..c45de703739a2 100644 --- a/lldb/test/Shell/ObjectFile/MachO/lc_build_version_notools.yaml +++ b/lldb/test/Shell/ObjectFile/MachO/lc_build_version_notools.yaml @@ -112,7 +112,7 @@ LoadCommands: - cmd: LC_LOAD_DYLINKER cmdsize: 32 name:12 -PayloadString: /usr/lib/dyld +Content: /usr/lib/dyld ZeroPadBytes:7 - cmd: LC_UUID cmdsize: 24 @@ -137,7 +137,7 @@ LoadCommands: timestamp: 2 current_version: 82102276 compatibility_version: 65536 -PayloadString: /usr/lib/libSystem.B.dylib +Content: /usr/lib/libSystem.B.dylib ZeroPadBytes:6 - cmd: LC_FUNCTION_STARTS cmdsize: 16 diff --git a/lldb/test/Shell/ObjectFile/MachO/lc_version_min.yaml b/lldb/test/Shell/ObjectFile/MachO/lc_version_min.yaml index 88d3f2814dd9a..227d278000241 100644 --- a/lldb/test/Shell/ObjectFile/MachO/lc_version_min.yaml +++ b/lldb/test/Shell/ObjectFile/MachO/lc_version_min.yaml @@ -113,7 +113,7 @@ LoadCommands: - cmd: LC_LOAD_DYLINKER cmdsize: 32 name:12 -PayloadString: /usr/lib/dyld +Content: /usr/lib/dyld ZeroPadBytes:7 - cmd: LC_UUID cmdsize: 24 @@ -136,7 +136,7 @@ LoadCommands: timestamp: 2 current_version: 82102276 compatibility_version: 65536 -PayloadString: /usr/lib/libSystem.B.dylib +Content: /usr/lib/libSystem.B.dylib ZeroPadBytes:6 - cmd: LC_FUNCTION_STARTS cmdsize: 16 diff --git a/lldb/test/Shell/ObjectFile/MachO/symtab.yaml b/lldb/test/Shell/ObjectFile/MachO/symtab.yaml index 9f5e1a02bbc82..6dd221eaa7207 100644 --- a/lldb/test/Shell/ObjectFile/MachO/symtab.yaml +++ b/lldb/test/Shell/ObjectFile/MachO/symtab.yaml @@ -247,7 +247,7 @@ LoadCommands: - cmd: LC_LOAD_DYLINKER cmdsize: 32 name:12 -PayloadString: '/usr/lib/dyld' +Content: '/usr/lib/dyld' ZeroPadBytes:7 - cmd: LC_UUID cmdsize: 24 @@ -275,7 +275,7 @@ LoadCommands: timestamp: 2 current_version: 14942208
[Lldb-commits] [lldb] d0fb3ea - [lldb] Fix use-after-move in SymbolFile/NativePDB
Author: Fangrui Song Date: 2022-02-14T11:03:26-08:00 New Revision: d0fb3eab74aaa357037fd2632f912e71222c5586 URL: https://github.com/llvm/llvm-project/commit/d0fb3eab74aaa357037fd2632f912e71222c5586 DIFF: https://github.com/llvm/llvm-project/commit/d0fb3eab74aaa357037fd2632f912e71222c5586.diff LOG: [lldb] Fix use-after-move in SymbolFile/NativePDB Added: Modified: lldb/source/Plugins/SymbolFile/NativePDB/CompileUnitIndex.cpp Removed: diff --git a/lldb/source/Plugins/SymbolFile/NativePDB/CompileUnitIndex.cpp b/lldb/source/Plugins/SymbolFile/NativePDB/CompileUnitIndex.cpp index d8f737612c257..d15c0ee99f96c 100644 --- a/lldb/source/Plugins/SymbolFile/NativePDB/CompileUnitIndex.cpp +++ b/lldb/source/Plugins/SymbolFile/NativePDB/CompileUnitIndex.cpp @@ -162,7 +162,7 @@ CompilandIndexItem ::GetOrCreateCompiland(uint16_t modi) { ParseExtendedInfo(m_index, *cci); ParseInlineeLineTableForCompileUnit(*cci); - cci->m_strings.initialize(debug_stream.getSubsectionsArray()); + cci->m_strings.initialize(cci->m_debug_stream.getSubsectionsArray()); PDBStringTable = cantFail(m_index.pdb().getStringTable()); cci->m_strings.setStrings(strings.getStringTable()); ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] 385f5c4 - [lldb][CMake] Fix linking of gdb-remote when LLVM_ENABLE_ZLIB is ON
Author: Mariusz Ceier Date: 2022-02-07T23:26:22-08:00 New Revision: 385f5c4d33799df25a85ceb54b6232499cb8a78d URL: https://github.com/llvm/llvm-project/commit/385f5c4d33799df25a85ceb54b6232499cb8a78d DIFF: https://github.com/llvm/llvm-project/commit/385f5c4d33799df25a85ceb54b6232499cb8a78d.diff LOG: [lldb][CMake] Fix linking of gdb-remote when LLVM_ENABLE_ZLIB is ON When LLVM_ENABLE_ZLIB is ON gdb-remote should link against ZLIB::ZLIB. This fixes ``` /mnt/b/yoe/master/build/tmp/hosttools/ld: lib/liblldbPluginProcessGDBRemote.a(GDBRemoteCommunication.cpp.o): in function `lldb_private::process_gdb_remote::GDBRemoteCommunication::DecompressPacket() [clone .localalias]': GDBRemoteCommunication.cpp:(.text._ZN12lldb_private18process_gdb_remote22GDBRemoteCommunication16DecompressPacketEv+0x59a): undefined reference to `inflateInit2_' /mnt/b/yoe/master/build/tmp/hosttools/ld: GDBRemoteCommunication.cpp:(.text._ZN12lldb_private18process_gdb_remote22GDBRemoteCommunication16DecompressPacketEv+0x5af): undefined reference to `inflate' ``` Reviewed By: JDevlieghere, MaskRay Differential Revision: https://reviews.llvm.org/D119186 Added: Modified: lldb/source/Plugins/Process/gdb-remote/CMakeLists.txt Removed: diff --git a/lldb/source/Plugins/Process/gdb-remote/CMakeLists.txt b/lldb/source/Plugins/Process/gdb-remote/CMakeLists.txt index 3a1a0e435ad25..e0c798187bd5b 100644 --- a/lldb/source/Plugins/Process/gdb-remote/CMakeLists.txt +++ b/lldb/source/Plugins/Process/gdb-remote/CMakeLists.txt @@ -15,6 +15,10 @@ if(HAVE_LIBCOMPRESSION) set(LIBCOMPRESSION compression) endif() +if(LLVM_ENABLE_ZLIB) + list(APPEND LLDB_SYSTEM_LIBS ZLIB::ZLIB) +endif() + add_lldb_library(lldbPluginProcessGDBRemote PLUGIN GDBRemoteClientBase.cpp GDBRemoteCommunication.cpp @@ -39,6 +43,7 @@ add_lldb_library(lldbPluginProcessGDBRemote PLUGIN lldbSymbol lldbTarget lldbUtility +${LLDB_SYSTEM_LIBS} ${LLDB_PLUGINS} ${LIBCOMPRESSION} LINK_COMPONENTS ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] ca68038 - Reland "[Driver] Default CLANG_DEFAULT_PIE_ON_LINUX to ON""
Author: Fangrui Song Date: 2022-04-08T23:40:18-07:00 New Revision: ca68038d12a23fa7ebb2b1ccbda93c321635e6bf URL: https://github.com/llvm/llvm-project/commit/ca68038d12a23fa7ebb2b1ccbda93c321635e6bf DIFF: https://github.com/llvm/llvm-project/commit/ca68038d12a23fa7ebb2b1ccbda93c321635e6bf.diff LOG: Reland "[Driver] Default CLANG_DEFAULT_PIE_ON_LINUX to ON"" (With C++ exceptions, `clang++ --target=mips64{,el}-linux-gnu -fpie -pie -fuse-ld=lld` has link errors (lld does not implement some strange R_MIPS_64 .eh_frame handling in GNU ld). However, sanitizer-x86_64-linux-qemu used this to build ScudoUnitTests. Pined ScudoUnitTests to -no-pie.) Default the option introduced in D113372 to ON to match all(?) major Linux distros. This matches GCC and improves consistency with Android and linux-musl which always default to PIE. Note: CLANG_DEFAULT_PIE_ON_LINUX may be removed in the future. Differential Revision: https://reviews.llvm.org/D120305 Added: Modified: clang/CMakeLists.txt clang/docs/ReleaseNotes.rst clang/test/Driver/hip-fpie-option.hip lldb/test/API/functionalities/tail_call_frames/unambiguous_sequence/TestUnambiguousTailCalls.py lldb/test/Shell/ObjectFile/ELF/minidebuginfo-set-and-hit-breakpoint.test llvm/utils/gn/secondary/clang/include/clang/Config/BUILD.gn utils/bazel/llvm-project-overlay/clang/include/clang/Config/config.h Removed: diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt index c0b1a20e8e8a0..3a77e7b0c8d60 100644 --- a/clang/CMakeLists.txt +++ b/clang/CMakeLists.txt @@ -245,7 +245,7 @@ set(PPC_LINUX_DEFAULT_IEEELONGDOUBLE OFF CACHE BOOL set(CLANG_SPAWN_CC1 OFF CACHE BOOL "Whether clang should use a new process for the CC1 invocation") -option(CLANG_DEFAULT_PIE_ON_LINUX "Default to -fPIE and -pie on Linux" OFF) +option(CLANG_DEFAULT_PIE_ON_LINUX "Default to -fPIE and -pie on linux-gnu" ON) # Manually handle default so we can change the meaning of a cached default. set(CLANG_ENABLE_OPAQUE_POINTERS "DEFAULT" CACHE STRING diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst index 7e8537e890714..079258c743704 100644 --- a/clang/docs/ReleaseNotes.rst +++ b/clang/docs/ReleaseNotes.rst @@ -288,6 +288,12 @@ Internal API Changes Build System Changes +* CMake ``-DCLANG_DEFAULT_PIE_ON_LINUX=ON`` is now the default. This is used by + linux-gnu systems to decide whether ``-fPIE -pie`` is the default (instead of + ``-fno-pic -no-pie``). This matches GCC installations on many Linux distros. + Note: linux-android and linux-musl always default to ``-fPIE -pie``, ignoring + this variable. ``-DCLANG_DEFAULT_PIE_ON_LINUX`` may be removed in the future. + AST Matchers diff --git a/clang/test/Driver/hip-fpie-option.hip b/clang/test/Driver/hip-fpie-option.hip index 2e296a099dea5..ffd639dd5a6de 100644 --- a/clang/test/Driver/hip-fpie-option.hip +++ b/clang/test/Driver/hip-fpie-option.hip @@ -1,15 +1,15 @@ -// REQUIRES: clang-driver, amdgpu-registered-target +// REQUIRES: clang-driver, amdgpu-registered-target, default-pie-on-linux // -fPIC and -fPIE only affects host relocation model. // device compilation always uses PIC. // RUN: %clang -### -target x86_64-unknown-linux-gnu \ // RUN: --offload-arch=gfx906 %s -nogpulib -nogpuinc \ -// RUN: 2>&1 | FileCheck -check-prefixes=DEV,HOST-STATIC %s +// RUN: 2>&1 | FileCheck -check-prefixes=DEV,HOST-PIE %s // RUN: %clang -### -target x86_64-unknown-linux-gnu \ // RUN: -fgpu-rdc --offload-arch=gfx906 %s -nogpulib -nogpuinc \ -// RUN: 2>&1 | FileCheck -check-prefixes=DEV,HOST-STATIC %s +// RUN: 2>&1 | FileCheck -check-prefixes=DEV,HOST-PIE %s // RUN: %clang -### -target x86_64-unknown-linux-gnu \ // RUN: --offload-arch=gfx906 %s -nogpulib -nogpuinc \ @@ -32,7 +32,6 @@ // RUN: 2>&1 | FileCheck -check-prefixes=DEV,HOST-PIE %s // DEV-DAG: {{".*clang.*".* "-triple" "amdgcn-amd-amdhsa".* "-mrelocation-model" "pic" "-pic-level" "[1|2]".* "-mframe-pointer=all"}} -// HOST-STATIC-DAG: {{".*clang.*".* "-triple" "x86_64-unknown-linux-gnu".* "-mrelocation-model" "static"}} // HOST-PIC-DAG: {{".*clang.*".* "-triple" "x86_64-unknown-linux-gnu".* "-mrelocation-model" "pic" "-pic-level" "2"}} // HOST-PIC-NOT: "-pic-is-pie" // HOST-PIE-DAG: {{".*clang.*".* "-triple" "x86_64-unknown-linux-gnu".* "-mrelocation-model" "pic" "-pic-level" "2" "-pic-is-pie"}} diff --git a/lldb/test/API/functionalities/tail_call_frames/unambiguous_sequence/TestUnambiguousTailCalls.py b/lldb/test/API/functionalities/tail_call_frames/unambiguous_sequence/TestUnambiguousTailCalls.py index 19aad2ab1ec32..cef500f0e7754 100644 --- a/lldb/test/API/functionalities/tail_call_frames/unambiguous_sequence/TestUnambiguousTailCalls.py +++ b/lldb/test/API/functionalities/tail_call_frames/unambiguous_sequence/TestUnambiguousTailCalls.py @@ -2,6 +2,7 @@ from
[Lldb-commits] [lldb] Support target names with dots in more utilities (PR #65812)
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/65812 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] Support target names with dots in more utilities (PR #65812)
@@ -390,6 +390,21 @@ StringRef stem(StringRef path, Style style = Style::native); /// @result The extension of \a path. StringRef extension(StringRef path, Style style = Style::native); +/// Get the program's name +/// +/// If the path ends with the string .exe, returns the stem of MaskRay wrote: .exe => ".exe" https://github.com/llvm/llvm-project/pull/65812 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] Support target names with dots in more utilities (PR #65812)
https://github.com/MaskRay approved this pull request. LGTM, but @jh7370 usually wants to have an eye on such changes. https://github.com/llvm/llvm-project/pull/65812 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [compiler-rt] [flang] [clang] [libc] [llvm] [clang-tools-extra] [libcxx] [lldb] [PowerPC] Support mcmodel=large for AIX (PR #70652)
@@ -5723,16 +5723,14 @@ void Clang::ConstructJob(Compilation , const JobAction , if (Arg *A = Args.getLastArg(options::OPT_mcmodel_EQ)) { StringRef CM = A->getValue(); bool Ok = false; -if (Triple.isOSAIX() && CM == "medium") { +if (Triple.isOSAIX() && CM == "medium") CM = "large"; - Ok = true; -} if (Triple.isAArch64(64)) { Ok = CM == "tiny" || CM == "small" || CM == "large"; if (CM == "large" && RelocationModel != llvm::Reloc::Static) D.Diag(diag::err_drv_argument_only_allowed_with) << A->getAsString(Args) << "-fno-pic"; -} else if (Triple.isPPC64()) { +} else if (Triple.isPPC64() || Triple.isOSAIX()) { MaskRay wrote: Hi, may I ask what `-mcmodel=large` does on a 32-bit AIX? `-mcmodel=large` is generally not supported for 32-bit systems and it seems that AIX does something special here. GCC's rs6000 doc says: > Generate PowerPC64 code for the large model: The TOC may be up to 4G in size. > Other data and code is only limited by the 64-bit address space. https://github.com/llvm/llvm-project/pull/70652 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] 34ee53c - [lldb][test] Fix TestCallBuiltinFunction.py
Author: Fangrui Song Date: 2023-09-27T22:37:24-07:00 New Revision: 34ee53c9e390019d757b453ceba9cc3e47ab0df1 URL: https://github.com/llvm/llvm-project/commit/34ee53c9e390019d757b453ceba9cc3e47ab0df1 DIFF: https://github.com/llvm/llvm-project/commit/34ee53c9e390019d757b453ceba9cc3e47ab0df1.diff LOG: [lldb][test] Fix TestCallBuiltinFunction.py A constant __builtin_abs(-14) cannot be evaluated without a running target as Clang now emits llvm.abs.* Added: Modified: lldb/test/API/commands/expression/call-function/TestCallBuiltinFunction.py Removed: diff --git a/lldb/test/API/commands/expression/call-function/TestCallBuiltinFunction.py b/lldb/test/API/commands/expression/call-function/TestCallBuiltinFunction.py index 1f79aae139a7bf3..80163147650a0f4 100644 --- a/lldb/test/API/commands/expression/call-function/TestCallBuiltinFunction.py +++ b/lldb/test/API/commands/expression/call-function/TestCallBuiltinFunction.py @@ -23,4 +23,3 @@ def test(self): "__builtin_isnormal(0.0f)", result_type="int", result_value="0" ) self.expect_expr("__builtin_constant_p(1)", result_type="int", result_value="1") -self.expect_expr("__builtin_abs(-14)", result_type="int", result_value="14") ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] c129220 - [lldb/gdb-remote] Fix -Wswitch after D116462
Author: Fangrui Song Date: 2022-04-19T18:01:06-07:00 New Revision: c129220eaa983d111c1432763db9da4526b405e3 URL: https://github.com/llvm/llvm-project/commit/c129220eaa983d111c1432763db9da4526b405e3 DIFF: https://github.com/llvm/llvm-project/commit/c129220eaa983d111c1432763db9da4526b405e3.diff LOG: [lldb/gdb-remote] Fix -Wswitch after D116462 Added: Modified: lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp Removed: diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp index 0ffc3289a7b9f..78818528a93e6 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp @@ -2228,6 +2228,7 @@ bool GDBRemoteCommunicationClient::GetCurrentProcessInfo(bool allow_lazy) { m_process_arch.SetArchitecture(eArchTypeCOFF, cpu, sub); break; case llvm::Triple::GOFF: +case llvm::Triple::SPIRV: case llvm::Triple::Wasm: case llvm::Triple::XCOFF: case llvm::Triple::DXContainer: ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] 2aca33b - Reland "[Driver] Default CLANG_DEFAULT_PIE_ON_LINUX to ON""
Author: Fangrui Song Date: 2022-04-06T20:19:07-07:00 New Revision: 2aca33baf15926afe2520a06b1427a9894226fd2 URL: https://github.com/llvm/llvm-project/commit/2aca33baf15926afe2520a06b1427a9894226fd2 DIFF: https://github.com/llvm/llvm-project/commit/2aca33baf15926afe2520a06b1427a9894226fd2.diff LOG: Reland "[Driver] Default CLANG_DEFAULT_PIE_ON_LINUX to ON"" (The upgrade of the ppc64le bot and D121257 have fixed compiler-rt failures. Tested by nemanjai.) Default the option introduced in D113372 to ON to match all(?) major Linux distros. This matches GCC and improves consistency with Android and linux-musl which always default to PIE. Note: CLANG_DEFAULT_PIE_ON_LINUX may be removed in the future. Differential Revision: https://reviews.llvm.org/D120305 Added: Modified: clang/CMakeLists.txt clang/docs/ReleaseNotes.rst clang/test/Driver/hip-fpie-option.hip lldb/test/API/functionalities/tail_call_frames/unambiguous_sequence/TestUnambiguousTailCalls.py lldb/test/Shell/ObjectFile/ELF/minidebuginfo-set-and-hit-breakpoint.test llvm/utils/gn/secondary/clang/include/clang/Config/BUILD.gn utils/bazel/llvm-project-overlay/clang/include/clang/Config/config.h Removed: diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt index 78f584f18bacd..931eecd9c9681 100644 --- a/clang/CMakeLists.txt +++ b/clang/CMakeLists.txt @@ -245,7 +245,7 @@ set(PPC_LINUX_DEFAULT_IEEELONGDOUBLE OFF CACHE BOOL set(CLANG_SPAWN_CC1 OFF CACHE BOOL "Whether clang should use a new process for the CC1 invocation") -option(CLANG_DEFAULT_PIE_ON_LINUX "Default to -fPIE and -pie on Linux" OFF) +option(CLANG_DEFAULT_PIE_ON_LINUX "Default to -fPIE and -pie on linux-gnu" ON) # TODO: verify the values against LangStandards.def? set(CLANG_DEFAULT_STD_C "" CACHE STRING diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst index df6a7d7539ee6..a64d9d383d957 100644 --- a/clang/docs/ReleaseNotes.rst +++ b/clang/docs/ReleaseNotes.rst @@ -279,6 +279,12 @@ Internal API Changes Build System Changes +* CMake ``-DCLANG_DEFAULT_PIE_ON_LINUX=ON`` is now the default. This is used by + linux-gnu systems to decide whether ``-fPIE -pie`` is the default (instead of + ``-fno-pic -no-pie``). This matches GCC installations on many Linux distros. + Note: linux-android and linux-musl always default to ``-fPIE -pie``, ignoring + this variable. ``-DCLANG_DEFAULT_PIE_ON_LINUX`` may be removed in the future. + AST Matchers diff --git a/clang/test/Driver/hip-fpie-option.hip b/clang/test/Driver/hip-fpie-option.hip index 2e296a099dea5..ffd639dd5a6de 100644 --- a/clang/test/Driver/hip-fpie-option.hip +++ b/clang/test/Driver/hip-fpie-option.hip @@ -1,15 +1,15 @@ -// REQUIRES: clang-driver, amdgpu-registered-target +// REQUIRES: clang-driver, amdgpu-registered-target, default-pie-on-linux // -fPIC and -fPIE only affects host relocation model. // device compilation always uses PIC. // RUN: %clang -### -target x86_64-unknown-linux-gnu \ // RUN: --offload-arch=gfx906 %s -nogpulib -nogpuinc \ -// RUN: 2>&1 | FileCheck -check-prefixes=DEV,HOST-STATIC %s +// RUN: 2>&1 | FileCheck -check-prefixes=DEV,HOST-PIE %s // RUN: %clang -### -target x86_64-unknown-linux-gnu \ // RUN: -fgpu-rdc --offload-arch=gfx906 %s -nogpulib -nogpuinc \ -// RUN: 2>&1 | FileCheck -check-prefixes=DEV,HOST-STATIC %s +// RUN: 2>&1 | FileCheck -check-prefixes=DEV,HOST-PIE %s // RUN: %clang -### -target x86_64-unknown-linux-gnu \ // RUN: --offload-arch=gfx906 %s -nogpulib -nogpuinc \ @@ -32,7 +32,6 @@ // RUN: 2>&1 | FileCheck -check-prefixes=DEV,HOST-PIE %s // DEV-DAG: {{".*clang.*".* "-triple" "amdgcn-amd-amdhsa".* "-mrelocation-model" "pic" "-pic-level" "[1|2]".* "-mframe-pointer=all"}} -// HOST-STATIC-DAG: {{".*clang.*".* "-triple" "x86_64-unknown-linux-gnu".* "-mrelocation-model" "static"}} // HOST-PIC-DAG: {{".*clang.*".* "-triple" "x86_64-unknown-linux-gnu".* "-mrelocation-model" "pic" "-pic-level" "2"}} // HOST-PIC-NOT: "-pic-is-pie" // HOST-PIE-DAG: {{".*clang.*".* "-triple" "x86_64-unknown-linux-gnu".* "-mrelocation-model" "pic" "-pic-level" "2" "-pic-is-pie"}} diff --git a/lldb/test/API/functionalities/tail_call_frames/unambiguous_sequence/TestUnambiguousTailCalls.py b/lldb/test/API/functionalities/tail_call_frames/unambiguous_sequence/TestUnambiguousTailCalls.py index 19aad2ab1ec32..cef500f0e7754 100644 --- a/lldb/test/API/functionalities/tail_call_frames/unambiguous_sequence/TestUnambiguousTailCalls.py +++ b/lldb/test/API/functionalities/tail_call_frames/unambiguous_sequence/TestUnambiguousTailCalls.py @@ -2,6 +2,7 @@ from lldbsuite.test import decorators decor = [decorators.skipUnlessHasCallSiteInfo, + decorators.skipIf(archs=['arm'],oslist=["linux"]), decorators.skipIf(dwarf_version=['<', '4']),
[Lldb-commits] [clang-tools-extra] [compiler-rt] [flang] [llvm] [lldb] [mlir] [clang] [Profile] Add binary profile correlation to offload profile metadata at runtime. (PR #69493)
@@ -1331,6 +1336,18 @@ static int merge_main(int argc, const char *argv[]) { "(default: 1)")); cl::ParseCommandLineOptions(argc, argv, "LLVM profile data merger\n"); + if (!DebugInfoFilename.empty() && !BinaryFilename.empty()) { +exitWithError("Expected only one of -debug-info, -binary-file"); + } + std::string CorrelateFilename = ""; MaskRay wrote: remove `= ""` https://github.com/llvm/llvm-project/pull/69493 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [compiler-rt] [clang-tools-extra] [lldb] [clang] [flang] [mlir] [llvm] [Profile] Add binary profile correlation to offload profile metadata at runtime. (PR #69493)
@@ -0,0 +1,11 @@ +; RUN: opt < %s -passes=instrprof -profile-correlate=binary -S | FileCheck %s MaskRay wrote: This isn't clear how `__profd_foo` is different from `-profile-correlate=none`. This test can be added to `coverage.ll` as a new RUN line https://github.com/llvm/llvm-project/pull/69493 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [clang] [clang-tools-extra] [mlir] [lldb] [llvm] [flang] [compiler-rt] [Profile] Add binary profile correlation to offload profile metadata at runtime. (PR #69493)
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/69493 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [clang-tools-extra] [flang] [mlir] [clang] [llvm] [compiler-rt] [Profile] Add binary profile correlation to offload profile metadata at runtime. (PR #69493)
@@ -0,0 +1,46 @@ +// REQUIRES: linux || windows MaskRay wrote: Add `// REQUIRES: lld-available` https://github.com/llvm/llvm-project/pull/69493 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [compiler-rt] [llvm] [flang] [clang-tools-extra] [mlir] [lldb] [clang] [Profile] Add binary profile correlation to offload profile metadata at runtime. (PR #69493)
https://github.com/MaskRay commented: The comment `The data and names sections are omitted in lightweight mode.` in compiler-rt should be updated since binary correlation is different from the lightweight mode https://github.com/llvm/llvm-project/pull/69493 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [clang-tools-extra] [clang] [lldb] [compiler-rt] [flang] [mlir] [llvm] [Profile] Add binary profile correlation to offload profile metadata at runtime. (PR #69493)
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/69493 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [compiler-rt] [flang] [llvm] [clang] [clang-tools-extra] [mlir] [Profile] Add binary profile correlation to offload profile metadata at runtime. (PR #69493)
@@ -0,0 +1,46 @@ +// REQUIRES: linux || windows +// Default +// RUN: %clang -o %t.normal -fprofile-instr-generate -fcoverage-mapping -fuse-ld=lld %S/Inputs/instrprof-debug-info-correlate-main.cpp %S/Inputs/instrprof-debug-info-correlate-foo.cpp +// RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t.normal +// RUN: llvm-profdata merge -o %t.normal.profdata %t.profraw +// RUN: llvm-cov report --instr-profile=%t.normal.profdata %t.normal > %t.normal.report +// RUN: llvm-cov show --instr-profile=%t.normal.profdata %t.normal > %t.normal.show + +// With -profile-correlate=binary flag +// RUN: %clang -o %t-1.exe -fprofile-instr-generate -fcoverage-mapping -mllvm -profile-correlate=binary -fuse-ld=lld %S/Inputs/instrprof-debug-info-correlate-main.cpp %S/Inputs/instrprof-debug-info-correlate-foo.cpp MaskRay wrote: You can omit `.exe`. Otherwise, I suspect the file will be named `%t-1.exe.exe` on Windows. https://github.com/llvm/llvm-project/pull/69493 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [flang] [clang] [mlir] [lldb] [clang-tools-extra] [llvm] [compiler-rt] [Profile] Add binary profile correlation to offload profile metadata at runtime. (PR #69493)
@@ -46,14 +73,38 @@ const char *InstrProfCorrelator::NumCountersAttributeName = "Num Counters"; llvm::Expected> InstrProfCorrelator::Context::get(std::unique_ptr Buffer, - const object::ObjectFile ) { + const object::ObjectFile , + ProfCorrelatorKind FileKind) { + auto C = std::make_unique(); auto CountersSection = getInstrProfSection(Obj, IPSK_cnts); if (auto Err = CountersSection.takeError()) return std::move(Err); - auto C = std::make_unique(); + if (FileKind == InstrProfCorrelator::BINARY) { +auto DataSection = getInstrProfSection(Obj, IPSK_data); +if (auto Err = DataSection.takeError()) + return std::move(Err); +auto DataOrErr = DataSection->getContents(); +if (!DataOrErr) + return DataOrErr.takeError(); +auto NameSection = getInstrProfSection(Obj, IPSK_name); +if (auto Err = NameSection.takeError()) + return std::move(Err); +auto NameOrErr = NameSection->getContents(); +if (!NameOrErr) + return NameOrErr.takeError(); +C->DataStart = DataOrErr->data(); +C->DataEnd = DataOrErr->data() + DataOrErr->size(); +C->NameStart = NameOrErr->data(); +C->NameSize = NameOrErr->size(); + } C->Buffer = std::move(Buffer); C->CountersSectionStart = CountersSection->getAddress(); C->CountersSectionEnd = C->CountersSectionStart + CountersSection->getSize(); + // In COFF object file, there's a null byte at the beginning of the counter + // section which doesn't exist in raw profile. + if (Obj.getTripleObjectFormat() == Triple::COFF) +C->CountersSectionStart++; MaskRay wrote: pre-increment https://llvm.org/docs/CodingStandards.html#prefer-preincrement https://github.com/llvm/llvm-project/pull/69493 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [compiler-rt] [lldb] [llvm] [flang] [clang] [mlir] [clang-tools-extra] [Profile] Add binary profile correlation to offload profile metadata at runtime. (PR #69493)
@@ -1331,6 +1336,18 @@ static int merge_main(int argc, const char *argv[]) { "(default: 1)")); cl::ParseCommandLineOptions(argc, argv, "LLVM profile data merger\n"); + if (!DebugInfoFilename.empty() && !BinaryFilename.empty()) { +exitWithError("Expected only one of -debug-info, -binary-file"); MaskRay wrote: drop braces https://llvm.org/docs/CodingStandards.html#don-t-use-braces-on-simple-single-statement-bodies-of-if-else-loop-statements https://github.com/llvm/llvm-project/pull/69493 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [compiler-rt] [mlir] [llvm] [clang] [clang-tools-extra] [flang] [lldb] [Profile] Add binary profile correlation to offload profile metadata at runtime. (PR #69493)
@@ -0,0 +1,9 @@ +// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -mllvm -profile-correlate=binary -fprofile-instrument=clang -fcoverage-mapping -emit-llvm -o - %s | FileCheck %s --check-prefix=BIN-CORRELATE MaskRay wrote: Specify an explicit `-target-triple` to test a COMDAT triple (e.g. Linux) and a non-COMDAT triple (e.g. macOS). Change `// CHECK: @__llvm_profile_raw_version = {{.*}} i64 9` to test more properties including the visibility and `comdat` https://github.com/llvm/llvm-project/pull/69493 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [clang-tools-extra] [flang] [mlir] [clang] [llvm] [compiler-rt] [Profile] Add binary profile correlation to offload profile metadata at runtime. (PR #69493)
MaskRay wrote: The patch does not apply cleanly at HEAD. The fix-up commit `resolve conflict` contains the rebased part and a lot of unrelated changes. I think in this case, it's cleaner to squash all the commits and force push to `binary-correlate`. (Force push is fine with me: https://discourse.llvm.org/t/force-push-and-rebase/73766/10) https://github.com/llvm/llvm-project/pull/69493 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [flang] [compiler-rt] [lldb] [clang] [llvm] [mlir] [clang-tools-extra] [Profile] Add binary profile correlation to offload profile metadata at runtime. (PR #69493)
@@ -195,8 +195,14 @@ OPTIONS .. option:: --debug-info= Specify the executable or ``.dSYM`` that contains debug info for the raw profile. - When ``-debug-info-correlate`` was used for instrumentation, use this option - to correlate the raw profile. + When ``-profile-correlate=debug-info`` was used for instrumentation, use this MaskRay wrote: `--profile-correlate=debug-info` (double-dash) https://github.com/llvm/llvm-project/pull/69493 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [clang-tools-extra] [llvm] [lldb] [flang] [mlir] [clang] [compiler-rt] [Profile] Add binary profile correlation to offload profile metadata at runtime. (PR #69493)
@@ -1341,20 +1344,26 @@ void InstrProfiling::createDataVariable(InstrProfCntrInstBase *Inc, } auto *Data = new GlobalVariable(*M, DataTy, false, Linkage, nullptr, DataVarName); - // Reference the counter variable with a label difference (link-time - // constant). - auto *RelativeCounterPtr = - ConstantExpr::getSub(ConstantExpr::getPtrToInt(CounterPtr, IntPtrTy), - ConstantExpr::getPtrToInt(Data, IntPtrTy)); - - // Bitmaps are relative to the same data variable as profile counters. + Constant *RelativeCounterPtr; GlobalVariable *BitmapPtr = PD.RegionBitmaps; Constant *RelativeBitmapPtr = ConstantInt::get(IntPtrTy, 0); - - if (BitmapPtr != nullptr) { -RelativeBitmapPtr = -ConstantExpr::getSub(ConstantExpr::getPtrToInt(BitmapPtr, IntPtrTy), + // By default counter ptr and bitmap ptr are address relative to data section. MaskRay wrote: This comment duplicates a bit of "// Reference the counter variable with a label difference (link-time". We can just say: With binary profile correlation, profd is not loaded into memory. profd must reference profc with an absolute relocation. https://github.com/llvm/llvm-project/pull/69493 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [clang-tools-extra] [compiler-rt] [flang] [llvm] [lldb] [mlir] [clang] [Profile] Add binary profile correlation to offload profile metadata at runtime. (PR #69493)
@@ -1829,6 +1833,22 @@ void CoverageMappingModuleGen::emit() { llvm::GlobalValue::InternalLinkage, NamesArrVal, llvm::getCoverageUnusedNamesVarName()); } + const StringRef VarName(INSTR_PROF_QUOTE(INSTR_PROF_RAW_VERSION_VAR)); + llvm::Type *IntTy64 = llvm::Type::getInt64Ty(Ctx); + uint64_t ProfileVersion = INSTR_PROF_RAW_VERSION; + if (llvm::ProfileCorrelate == llvm::InstrProfCorrelator::BINARY) +ProfileVersion |= VARIANT_MASK_BIN_CORRELATE; + auto *VersionVariable = new llvm::GlobalVariable( + CGM.getModule(), llvm::Type::getInt64Ty(Ctx), true, + llvm::GlobalValue::WeakAnyLinkage, + llvm::Constant::getIntegerValue(IntTy64, llvm::APInt(64, ProfileVersion)), + VarName); + VersionVariable->setVisibility(llvm::GlobalValue::HiddenVisibility); + llvm::Triple TT(CGM.getModule().getTargetTriple()); + if (TT.supportsCOMDAT()) { MaskRay wrote: `CGM.getTriple().supportsCOMDAT()` https://github.com/llvm/llvm-project/pull/69493 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [clang-tools-extra] [libcxx] [lldb] [flang] [lld] [llvm] [libc] [clang] [compiler-rt] [asan] Report executable/DSO name for report_globals=2 and odr-violation checking (PR #71879)
https://github.com/MaskRay closed https://github.com/llvm/llvm-project/pull/71879 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [libc] [lldb] [compiler-rt] [clang-tools-extra] [flang] [lld] [libcxx] [llvm] [clang] [asan] Report executable/DSO name for report_globals=2 and odr-violation checking (PR #71879)
https://github.com/MaskRay updated https://github.com/llvm/llvm-project/pull/71879 >From 573a5c0ea74284f572cb1cff7e8d3e2d9cac210b Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Thu, 9 Nov 2023 15:17:25 -0800 Subject: [PATCH 1/3] [asan] Report executable/DSO name for report_globals=2 and odr-violation checking For an odr-violation error due to a source file linked into two DSOs, or one DSO and the main executable, it can be difficult to identify the DSO name. Let's print the module name in the error report. ``` echo 'extern long var; int main() { return var; }' > a.cc echo 'long var;' > b.cc clang++ -fpic -fsanitize=address -shared b.cc -o b.so clang++ -fsanitize=address a.cc b.cc ./b.so -o a ``` w/o this patch: ``` ==1375386==ERROR: AddressSanitizer: odr-violation (0x56067cb06240): [1] size=8 'var' b.cc [2] size=8 'var' b.cc ... ``` w/ this patch: ``` ==1375386==ERROR: AddressSanitizer: odr-violation (0x56067cb06240): [1] size=8 'var' b.cc in /tmp/c/a [2] size=8 'var' b.cc in ./b.so ``` In addition, update the `report_globals=2` message to include the module name ``` ==1451005==Added Global[0x7fcfe59ae040]: beg=0x7fcfe59ae140 size=8/32 name=var source=b.cc module=./b.so dyn_init=0 odr_indicator=0x55754f939260 ``` --- compiler-rt/lib/asan/asan_descriptions.cpp| 2 +- compiler-rt/lib/asan/asan_errors.cpp | 4 ++-- compiler-rt/lib/asan/asan_globals.cpp | 15 ++- compiler-rt/lib/asan/asan_report.h| 3 ++- .../test/asan/TestCases/Linux/odr-violation.cpp | 2 +- .../test/asan/TestCases/Linux/odr_indicators.cpp | 6 +++--- 6 files changed, 19 insertions(+), 13 deletions(-) diff --git a/compiler-rt/lib/asan/asan_descriptions.cpp b/compiler-rt/lib/asan/asan_descriptions.cpp index 5f3d15bcc9e2b0b..ef6f3e0a096f828 100644 --- a/compiler-rt/lib/asan/asan_descriptions.cpp +++ b/compiler-rt/lib/asan/asan_descriptions.cpp @@ -291,7 +291,7 @@ static void DescribeAddressRelativeToGlobal(uptr addr, uptr access_size, } str.AppendF(" global variable '%s' defined in '", MaybeDemangleGlobalName(g.name)); - PrintGlobalLocation(, g); + PrintGlobalLocation(, g, /*print_module_name=*/false); str.AppendF("' (0x%zx) of size %zu\n", g.beg, g.size); str.Append(d.Default()); PrintGlobalNameIfASCII(, g); diff --git a/compiler-rt/lib/asan/asan_errors.cpp b/compiler-rt/lib/asan/asan_errors.cpp index 49f5b38c3338f61..3f2d13e3146406d 100644 --- a/compiler-rt/lib/asan/asan_errors.cpp +++ b/compiler-rt/lib/asan/asan_errors.cpp @@ -362,8 +362,8 @@ void ErrorODRViolation::Print() { Printf("%s", d.Default()); InternalScopedString g1_loc; InternalScopedString g2_loc; - PrintGlobalLocation(_loc, global1); - PrintGlobalLocation(_loc, global2); + PrintGlobalLocation(_loc, global1, /*print_module_name=*/true); + PrintGlobalLocation(_loc, global2, /*print_module_name=*/true); Printf(" [1] size=%zd '%s' %s\n", global1.size, MaybeDemangleGlobalName(global1.name), g1_loc.data()); Printf(" [2] size=%zd '%s' %s\n", global2.size, diff --git a/compiler-rt/lib/asan/asan_globals.cpp b/compiler-rt/lib/asan/asan_globals.cpp index 14c36bdc8e64296..9c95dd58661bd97 100644 --- a/compiler-rt/lib/asan/asan_globals.cpp +++ b/compiler-rt/lib/asan/asan_globals.cpp @@ -80,14 +80,16 @@ static bool IsAddressNearGlobal(uptr addr, const __asan_global ) { } static void ReportGlobal(const Global , const char *prefix) { + DataInfo info; + bool symbolized = Symbolizer::GetOrInit()->SymbolizeData(g.beg, ); Report( - "%s Global[%p]: beg=%p size=%zu/%zu name=%s module=%s dyn_init=%zu " + "%s Global[%p]: beg=%p size=%zu/%zu name=%s source=%s module=%s " + "dyn_init=%zu " "odr_indicator=%p\n", prefix, (void *), (void *)g.beg, g.size, g.size_with_redzone, g.name, - g.module_name, g.has_dynamic_init, (void *)g.odr_indicator); + g.module_name, info.module, g.has_dynamic_init, (void *)g.odr_indicator); - DataInfo info; - if (Symbolizer::GetOrInit()->SymbolizeData(g.beg, ) && info.line != 0) { + if (symbolized && info.line != 0) { Report(" location: name=%s, %d\n", info.file, static_cast(info.line)); } else if (g.gcc_location != 0) { // Fallback to Global::gcc_location @@ -297,7 +299,8 @@ void PrintGlobalNameIfASCII(InternalScopedString *str, const __asan_global ) { (char *)g.beg); } -void PrintGlobalLocation(InternalScopedString *str, const __asan_global ) { +void PrintGlobalLocation(InternalScopedString *str, const __asan_global , + bool print_module_name) { DataInfo info; if (Symbolizer::GetOrInit()->SymbolizeData(g.beg, ) && info.line != 0) { str->AppendF("%s:%d", info.file, static_cast(info.line)); @@ -312,6 +315,8 @@ void PrintGlobalLocation(InternalScopedString *str, const __asan_global ) { } else { str->AppendF("%s", g.module_name); } + if (print_module_name && info.module) +
[Lldb-commits] [lldb] b1aed14 - [llvm][lldb] use FindLibEdit.cmake everywhere
Author: Tobias Ribizel Date: 2022-05-12T15:59:41-07:00 New Revision: b1aed14bfea07508e4b9d864168c1ae6b5b5c665 URL: https://github.com/llvm/llvm-project/commit/b1aed14bfea07508e4b9d864168c1ae6b5b5c665 DIFF: https://github.com/llvm/llvm-project/commit/b1aed14bfea07508e4b9d864168c1ae6b5b5c665.diff LOG: [llvm][lldb] use FindLibEdit.cmake everywhere Currently, LLVM's LineEditor and LLDB both use libedit, but find them in different (inconsistent) ways. This causes issues e.g. when you are using a locally installed version of libedit, which will not be used by clang-query, but by lldb if picked up by FindLibEdit.cmake Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D124673 Added: cmake/Modules/FindLibEdit.cmake Modified: lldb/cmake/modules/LLDBStandalone.cmake lldb/source/Core/CMakeLists.txt lldb/source/Host/CMakeLists.txt lldb/source/Interpreter/CMakeLists.txt lldb/source/Plugins/ScriptInterpreter/Python/CMakeLists.txt llvm/cmake/config-ix.cmake llvm/lib/LineEditor/CMakeLists.txt llvm/utils/gn/secondary/lldb/source/Host/BUILD.gn Removed: lldb/cmake/modules/FindLibEdit.cmake diff --git a/lldb/cmake/modules/FindLibEdit.cmake b/cmake/Modules/FindLibEdit.cmake similarity index 88% rename from lldb/cmake/modules/FindLibEdit.cmake rename to cmake/Modules/FindLibEdit.cmake index 8b00d34de001a..94c6150cefda7 100644 --- a/lldb/cmake/modules/FindLibEdit.cmake +++ b/cmake/Modules/FindLibEdit.cmake @@ -62,3 +62,9 @@ else() mark_as_advanced(LibEdit_INCLUDE_DIRS LibEdit_LIBRARIES) endif() +if (LibEdit_FOUND AND NOT TARGET LibEdit::LibEdit) + add_library(LibEdit::LibEdit UNKNOWN IMPORTED) + set_target_properties(LibEdit::LibEdit PROPERTIES +IMPORTED_LOCATION ${LibEdit_LIBRARIES} +INTERFACE_INCLUDE_DIRECTORIES ${LibEdit_INCLUDE_DIRS}) +endif() diff --git a/lldb/cmake/modules/LLDBStandalone.cmake b/lldb/cmake/modules/LLDBStandalone.cmake index 1d3d1bbcc25da..d2f07576bf216 100644 --- a/lldb/cmake/modules/LLDBStandalone.cmake +++ b/lldb/cmake/modules/LLDBStandalone.cmake @@ -4,6 +4,12 @@ if(POLICY CMP0116) cmake_policy(SET CMP0116 OLD) endif() +if(NOT DEFINED LLVM_COMMON_CMAKE_UTILS) + set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake) +endif() + +list(APPEND CMAKE_MODULE_PATH "${LLVM_COMMON_CMAKE_UTILS}/Modules") + option(LLVM_INSTALL_TOOLCHAIN_ONLY "Only include toolchain files in the 'install' target." OFF) find_package(LLVM REQUIRED CONFIG HINTS ${LLVM_DIR} NO_CMAKE_FIND_ROOT_PATH) @@ -105,6 +111,10 @@ include_directories( "${LLVM_INCLUDE_DIRS}" "${CLANG_INCLUDE_DIRS}") +if(NOT DEFINED LLVM_COMMON_CMAKE_UTILS) + set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake) +endif() + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}) diff --git a/lldb/source/Core/CMakeLists.txt b/lldb/source/Core/CMakeLists.txt index 0efaab53f3132..d907177586e78 100644 --- a/lldb/source/Core/CMakeLists.txt +++ b/lldb/source/Core/CMakeLists.txt @@ -103,10 +103,6 @@ add_dependencies(lldbCore # TODO: Remove once we have better layering set_target_properties(lldbCore PROPERTIES LINK_INTERFACE_MULTIPLICITY 5) -if (LLDB_ENABLE_LIBEDIT) - target_include_directories(lldbCore PRIVATE ${LibEdit_INCLUDE_DIRS}) -endif() - if (LLDB_ENABLE_CURSES) target_include_directories(lldbCore PRIVATE ${CURSES_INCLUDE_DIRS}) endif() diff --git a/lldb/source/Host/CMakeLists.txt b/lldb/source/Host/CMakeLists.txt index 70942e0772aa6..64d9bb00ffab3 100644 --- a/lldb/source/Host/CMakeLists.txt +++ b/lldb/source/Host/CMakeLists.txt @@ -141,7 +141,7 @@ if (HAVE_LIBDL) list(APPEND EXTRA_LIBS ${CMAKE_DL_LIBS}) endif() if (LLDB_ENABLE_LIBEDIT) - list(APPEND EXTRA_LIBS ${LibEdit_LIBRARIES}) + list(APPEND EXTRA_LIBS LibEdit::LibEdit) endif() if (LLDB_ENABLE_LZMA) list(APPEND EXTRA_LIBS ${LIBLZMA_LIBRARIES}) @@ -151,7 +151,7 @@ if (WIN32) endif() if (LLDB_ENABLE_LIBEDIT) - list(APPEND LLDB_LIBEDIT_LIBS ${LibEdit_LIBRARIES}) + list(APPEND LLDB_LIBEDIT_LIBS LibEdit::LibEdit) if (LLVM_BUILD_STATIC) list(APPEND LLDB_SYSTEM_LIBS gpm) endif() @@ -171,6 +171,3 @@ add_lldb_library(lldbHost Support ) -if (LLDB_ENABLE_LIBEDIT) - target_include_directories(lldbHost PUBLIC ${LibEdit_INCLUDE_DIRS}) -endif() diff --git a/lldb/source/Interpreter/CMakeLists.txt b/lldb/source/Interpreter/CMakeLists.txt index af9b0ce86f345..d22e94a4ee4db 100644 --- a/lldb/source/Interpreter/CMakeLists.txt +++ b/lldb/source/Interpreter/CMakeLists.txt @@ -68,6 +68,3 @@ add_dependencies(lldbInterpreter LLDBInterpreterPropertiesGen LLDBInterpreterPropertiesEnumGen) -if (LLDB_ENABLE_LIBEDIT) -
[Lldb-commits] [lldb] ecfaf48 - [lldb] Remove ELF .zdebug support
Author: Fangrui Song Date: 2022-07-14T10:12:48-07:00 New Revision: ecfaf4801cd0cc85fdced820110652f0281765fa URL: https://github.com/llvm/llvm-project/commit/ecfaf4801cd0cc85fdced820110652f0281765fa DIFF: https://github.com/llvm/llvm-project/commit/ecfaf4801cd0cc85fdced820110652f0281765fa.diff LOG: [lldb] Remove ELF .zdebug support clang 14 removed -gz=zlib-gnu support and ld.lld/llvm-objcopy removed zlib-gnu support recently. Remove lldb support by migrating away from llvm::object::Decompressor::isCompressedELFSection. The API has another user llvm-dwp, so it is not removed in this patch. Reviewed By: labath Differential Revision: https://reviews.llvm.org/D129724 Added: Modified: lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp lldb/test/Shell/ObjectFile/ELF/compressed-sections.yaml Removed: lldb/test/Shell/SymbolFile/DWARF/x86/gnu-style-compression.yaml diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp index f9fb36890d5ac..122298d87bf8d 100644 --- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp @@ -1607,7 +1607,7 @@ lldb::user_id_t ObjectFileELF::GetSectionIndexByName(const char *name) { } static SectionType GetSectionTypeFromName(llvm::StringRef Name) { - if (Name.consume_front(".debug_") || Name.consume_front(".zdebug_")) { + if (Name.consume_front(".debug_")) { return llvm::StringSwitch(Name) .Case("abbrev", eSectionTypeDWARFDebugAbbrev) .Case("abbrev.dwo", eSectionTypeDWARFDebugAbbrevDwo) @@ -3365,8 +3365,7 @@ size_t ObjectFileELF::ReadSectionData(Section *section, return section->GetObjectFile()->ReadSectionData(section, section_data); size_t result = ObjectFile::ReadSectionData(section, section_data); - if (result == 0 || !llvm::object::Decompressor::isCompressedELFSection( - section->Get(), section->GetName().GetStringRef())) + if (result == 0 || !(section->Get() & llvm::ELF::SHF_COMPRESSED)) return result; auto Decompressor = llvm::object::Decompressor::create( diff --git a/lldb/test/Shell/ObjectFile/ELF/compressed-sections.yaml b/lldb/test/Shell/ObjectFile/ELF/compressed-sections.yaml index e252713210e62..d4d289954801a 100644 --- a/lldb/test/Shell/ObjectFile/ELF/compressed-sections.yaml +++ b/lldb/test/Shell/ObjectFile/ELF/compressed-sections.yaml @@ -16,6 +16,7 @@ Sections: Type:SHT_PROGBITS Flags: [ SHF_COMPRESSED ] Content: deadbeefbaadf00d +## The legacy .zdebug format is not supported. - Name:.zdebug_info Type:SHT_PROGBITS Content: 5A4C49420008789c533070084828689809c802c1 @@ -37,8 +38,8 @@ Sections: # CHECK-NEXT: Data: () # CHECK: Name: .zdebug_info -# CHECK: dwarf-info +# CHECK: regular # CHECK: File size: 28 # CHECK: Data: ( -# CHECK-NEXT: 20304050 60708090 +# CHECK-NEXT: 5A4C4942 0008 789C5330 70084828 6898 09C802C1 # CHECK-NEXT: ) diff --git a/lldb/test/Shell/SymbolFile/DWARF/x86/gnu-style-compression.yaml b/lldb/test/Shell/SymbolFile/DWARF/x86/gnu-style-compression.yaml deleted file mode 100644 index 069753835474b..0 --- a/lldb/test/Shell/SymbolFile/DWARF/x86/gnu-style-compression.yaml +++ /dev/null @@ -1,56 +0,0 @@ -## NB: This is a yaml file because llvm gnu-style writing support in 14.0 -## (2022, D117744). In due time we may want to remove it from lldb as well. - -## Debug info generated from the following sources using clang-13 -## struct A { -## long a = 42; -## }; -## extern constexpr short s = 47; -## extern constexpr A a{}; - -# REQUIRES: zlib - -# RUN: yaml2obj %s > %t -# RUN: %lldb %t -o "target var s a" -b | FileCheck %s - -# CHECK: (const short) s = 47 -# CHECK: (const A) a = (a = 42) - !ELF -FileHeader: - Class: ELFCLASS64 - Data:ELFDATA2LSB - Type:ET_EXEC - Machine: EM_X86_64 - Entry: 0x401000 -Sections: - - Name:.rodata -Type:SHT_PROGBITS -Flags: [ SHF_ALLOC ] -Address: 0x401000 -AddressAlign:0x8 -Offset: 0x1000 -Content: 2F002A00 - - Name:.zdebug_info -Type:SHT_PROGBITS -AddressAlign:0x1 -Content: 5A4C49420077789C2B666060606100010E4610A9C820CA00012640CCE407248C81989197939941C0012CC16C01D2130024589998C280540848011F2733074C4124488E35116C28171B48493E480937505B04488A830100368605A7 - - Name:.debug_abbrev -Type:SHT_PROGBITS -AddressAlign:0x1 -Content: 011101250E1305030E10171B0E023400030E49133F193A0B3B0B02180326004913042400030E3E0B0B0B051301360B030E0B0B3A0B3B0B060D00030E49133A0B3B0B380B00 - - Name:
[Lldb-commits] [lldb] e690137 - [Support] Change compression::zlib::{compress, uncompress} to use uint8_t *
Author: Fangrui Song Date: 2022-07-13T16:26:54-07:00 New Revision: e690137dde1c9b037e0c987d393da054d86eeeab URL: https://github.com/llvm/llvm-project/commit/e690137dde1c9b037e0c987d393da054d86eeeab DIFF: https://github.com/llvm/llvm-project/commit/e690137dde1c9b037e0c987d393da054d86eeeab.diff LOG: [Support] Change compression::zlib::{compress,uncompress} to use uint8_t * It's more natural to use uint8_t * (std::byte needs C++17 and llvm has too much uint8_t *) and most callers use uint8_t * instead of char *. The functions are recently moved into `llvm::compression::zlib::`, so downstream projects need to make adaption anyway. Added: Modified: clang-tools-extra/clangd/index/Serialization.cpp clang/lib/Serialization/ASTReader.cpp clang/lib/Serialization/ASTWriter.cpp lld/ELF/InputSection.cpp lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp llvm/include/llvm/Object/Decompressor.h llvm/include/llvm/Support/Compression.h llvm/lib/MC/ELFObjectWriter.cpp llvm/lib/ObjCopy/ELF/ELFObject.cpp llvm/lib/ObjCopy/ELF/ELFObject.h llvm/lib/Object/Decompressor.cpp llvm/lib/ProfileData/Coverage/CoverageMappingReader.cpp llvm/lib/ProfileData/Coverage/CoverageMappingWriter.cpp llvm/lib/ProfileData/InstrProf.cpp llvm/lib/ProfileData/SampleProfReader.cpp llvm/lib/ProfileData/SampleProfWriter.cpp llvm/lib/Support/Compression.cpp llvm/unittests/Support/CompressionTest.cpp Removed: diff --git a/clang-tools-extra/clangd/index/Serialization.cpp b/clang-tools-extra/clangd/index/Serialization.cpp index ee86ed5714ec..9fc1567ad919 100644 --- a/clang-tools-extra/clangd/index/Serialization.cpp +++ b/clang-tools-extra/clangd/index/Serialization.cpp @@ -191,10 +191,11 @@ class StringTableOut { RawTable.push_back(0); } if (llvm::compression::zlib::isAvailable()) { - llvm::SmallString<1> Compressed; - llvm::compression::zlib::compress(RawTable, Compressed); + llvm::SmallVector Compressed; + llvm::compression::zlib::compress(llvm::arrayRefFromStringRef(RawTable), +Compressed); write32(RawTable.size(), OS); - OS << Compressed; + OS << llvm::toStringRef(Compressed); } else { write32(0, OS); // No compression. OS << RawTable; @@ -220,7 +221,7 @@ llvm::Expected readStringTable(llvm::StringRef Data) { return error("Truncated string table"); llvm::StringRef Uncompressed; - llvm::SmallString<1> UncompressedStorage; + llvm::SmallVector UncompressedStorage; if (UncompressedSize == 0) // No compression Uncompressed = R.rest(); else if (llvm::compression::zlib::isAvailable()) { @@ -234,9 +235,10 @@ llvm::Expected readStringTable(llvm::StringRef Data) { R.rest().size(), UncompressedSize); if (llvm::Error E = llvm::compression::zlib::uncompress( -R.rest(), UncompressedStorage, UncompressedSize)) +llvm::arrayRefFromStringRef(R.rest()), UncompressedStorage, +UncompressedSize)) return std::move(E); -Uncompressed = UncompressedStorage; +Uncompressed = toStringRef(UncompressedStorage); } else return error("Compressed string table, but zlib is unavailable"); diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp index bb98660717e7..04ade0a3b9d0 100644 --- a/clang/lib/Serialization/ASTReader.cpp +++ b/clang/lib/Serialization/ASTReader.cpp @@ -1466,14 +1466,15 @@ bool ASTReader::ReadSLocEntry(int ID) { Error("zlib is not available"); return nullptr; } - SmallString<0> Uncompressed; + SmallVector Uncompressed; if (llvm::Error E = llvm::compression::zlib::uncompress( - Blob, Uncompressed, Record[0])) { + llvm::arrayRefFromStringRef(Blob), Uncompressed, Record[0])) { Error("could not decompress embedded file contents: " + llvm::toString(std::move(E))); return nullptr; } - return llvm::MemoryBuffer::getMemBufferCopy(Uncompressed, Name); + return llvm::MemoryBuffer::getMemBufferCopy( + llvm::toStringRef(Uncompressed), Name); } else if (RecCode == SM_SLOC_BUFFER_BLOB) { return llvm::MemoryBuffer::getMemBuffer(Blob.drop_back(1), Name, true); } else { diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp index 678105360431..fac8fc141d2c 100644 --- a/clang/lib/Serialization/ASTWriter.cpp +++ b/clang/lib/Serialization/ASTWriter.cpp @@ -2000,12 +2000,13 @@ static void emitBlob(llvm::BitstreamWriter , StringRef Blob, // Compress the buffer if possible. We expect that almost all PCM // consumers will not want its contents. - SmallString<0> CompressedBuffer; + SmallVector CompressedBuffer; if (llvm::compression::zlib::isAvailable()) { -
[Lldb-commits] [lldb] 3c849d0 - Modernize Optional::{getValueOr, hasValue}
Author: Fangrui Song Date: 2022-07-15T01:20:39-07:00 New Revision: 3c849d0aefa1101cf38586449c2105a97797c414 URL: https://github.com/llvm/llvm-project/commit/3c849d0aefa1101cf38586449c2105a97797c414 DIFF: https://github.com/llvm/llvm-project/commit/3c849d0aefa1101cf38586449c2105a97797c414.diff LOG: Modernize Optional::{getValueOr,hasValue} Added: Modified: clang-tools-extra/clangd/AST.cpp clang/lib/Analysis/FlowSensitive/DebugSupport.cpp clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp lldb/source/Plugins/Process/Linux/IntelPTCollector.cpp lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp llvm/include/llvm/Support/Casting.h llvm/lib/Target/LoongArch/LoongArchTargetMachine.cpp mlir/include/mlir/IR/OpImplementation.h mlir/lib/Dialect/Vector/Transforms/VectorTransforms.cpp Removed: diff --git a/clang-tools-extra/clangd/AST.cpp b/clang-tools-extra/clangd/AST.cpp index 6ceff56115721..4df043d18cfb7 100644 --- a/clang-tools-extra/clangd/AST.cpp +++ b/clang-tools-extra/clangd/AST.cpp @@ -942,7 +942,7 @@ resolveForwardingParameters(const FunctionDecl *D, unsigned MaxDepth) { TailIt = std::copy(Info.Tail.rbegin(), Info.Tail.rend(), TailIt); // Prepare next recursion level Pack = Info.Pack; - CurrentFunction = Info.PackTarget.getValueOr(nullptr); + CurrentFunction = Info.PackTarget.value_or(nullptr); Depth++; // If we are recursing into a previously encountered function: Abort if (CurrentFunction) { diff --git a/clang/lib/Analysis/FlowSensitive/DebugSupport.cpp b/clang/lib/Analysis/FlowSensitive/DebugSupport.cpp index 305d9d346089a..a2895d0197b1d 100644 --- a/clang/lib/Analysis/FlowSensitive/DebugSupport.cpp +++ b/clang/lib/Analysis/FlowSensitive/DebugSupport.cpp @@ -103,8 +103,7 @@ Constraints auto StatusString = debugString(Result.getStatus()); auto Solution = Result.getSolution(); -auto SolutionString = -Solution.hasValue() ? "\n" + debugString(Solution.value()) : ""; +auto SolutionString = Solution ? "\n" + debugString(Solution.value()) : ""; return formatv( Template, diff --git a/clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp b/clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp index 825b11adad405..08fac9fb2e698 100644 --- a/clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp +++ b/clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp @@ -504,7 +504,7 @@ void ExprEngine::handleConstructor(const Expr *E, unsigned Idx = 0; if (CE->getType()->isArrayType()) { - Idx = getIndexOfElementToConstruct(State, CE, LCtx).getValueOr(0u); + Idx = getIndexOfElementToConstruct(State, CE, LCtx).value_or(0u); State = setIndexOfElementToConstruct(State, CE, LCtx, Idx + 1); } diff --git a/lldb/source/Plugins/Process/Linux/IntelPTCollector.cpp b/lldb/source/Plugins/Process/Linux/IntelPTCollector.cpp index 2c44683ab1356..f89936445b2ba 100644 --- a/lldb/source/Plugins/Process/Linux/IntelPTCollector.cpp +++ b/lldb/source/Plugins/Process/Linux/IntelPTCollector.cpp @@ -124,7 +124,7 @@ Error IntelPTCollector::TraceStart(const TraceIntelPTStartRequest ) { // We try to use cgroup filtering whenever possible Optional cgroup_fd; - if (!request.disable_cgroup_filtering.getValueOr(false)) + if (!request.disable_cgroup_filtering.value_or(false)) cgroup_fd = GetCGroupFileDescriptor(m_process.GetID()); if (Expected trace = diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp index cbc24b1550c7c..8ee709db9cdb5 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -3475,10 +3475,9 @@ VariableSP SymbolFileDWARF::ParseVariableDIE(const SymbolContext , if (use_type_size_for_value && type_sp->GetType()) { DWARFExpression *location = location_list.GetMutableExpressionAtAddress(); -location->UpdateValue( -const_value_form.Unsigned(), -type_sp->GetType()->GetByteSize(nullptr).getValueOr(0), -die.GetCU()->GetAddressByteSize()); +location->UpdateValue(const_value_form.Unsigned(), + type_sp->GetType()->GetByteSize(nullptr).value_or(0), + die.GetCU()->GetAddressByteSize()); } return std::make_shared( diff --git a/llvm/include/llvm/Support/Casting.h b/llvm/include/llvm/Support/Casting.h index 5444d777b7493..b6bbff8ada10b 100644 --- a/llvm/include/llvm/Support/Casting.h +++ b/llvm/include/llvm/Support/Casting.h @@ -265,7 +265,7 @@ struct CastIsPossible { template struct CastIsPossible> { static inline bool isPossible(const Optional ) { -assert(f.hasValue() && "CastIsPossible::isPossible called on a nullopt!"); +assert(f && "CastIsPossible::isPossible called on a
[Lldb-commits] [lldb] 67854f9 - Use value_or instead of getValueOr. NFC
Author: Fangrui Song Date: 2022-06-29T21:55:02-07:00 New Revision: 67854f9ed0cd512f59736730f4c05de25501ae54 URL: https://github.com/llvm/llvm-project/commit/67854f9ed0cd512f59736730f4c05de25501ae54 DIFF: https://github.com/llvm/llvm-project/commit/67854f9ed0cd512f59736730f4c05de25501ae54.diff LOG: Use value_or instead of getValueOr. NFC Added: Modified: clang-tools-extra/clangd/unittests/support/FileCacheTests.cpp clang-tools-extra/clangd/xpc/XPCTransport.cpp lldb/source/Plugins/ABI/ARC/ABISysV_arc.cpp lldb/source/Plugins/Trace/intel-pt/TraceIntelPTBundleLoader.cpp llvm/lib/Bitcode/Reader/BitcodeReader.cpp llvm/lib/DebugInfo/Symbolize/MarkupFilter.cpp llvm/lib/Support/Windows/Threading.inc llvm/unittests/Support/UnicodeTest.cpp mlir/lib/TableGen/AttrOrTypeDef.cpp Removed: diff --git a/clang-tools-extra/clangd/unittests/support/FileCacheTests.cpp b/clang-tools-extra/clangd/unittests/support/FileCacheTests.cpp index 1f554806def08..8d2bc4d15d7b9 100644 --- a/clang-tools-extra/clangd/unittests/support/FileCacheTests.cpp +++ b/clang-tools-extra/clangd/unittests/support/FileCacheTests.cpp @@ -42,7 +42,7 @@ class TestCache : public FileCache { FS, FreshTime, [&](llvm::Optional Data) { GotParse = true; - Value = Data.getValueOr("").str(); + Value = Data.value_or("").str(); }, [&]() { GotRead = true; diff --git a/clang-tools-extra/clangd/xpc/XPCTransport.cpp b/clang-tools-extra/clangd/xpc/XPCTransport.cpp index 4c6308b3acae7..9c43647c3c767 100644 --- a/clang-tools-extra/clangd/xpc/XPCTransport.cpp +++ b/clang-tools-extra/clangd/xpc/XPCTransport.cpp @@ -38,7 +38,7 @@ json::Object encodeError(Error E) { Error decodeError(const json::Object ) { std::string Msg = - std::string(O.getString("message").getValueOr("Unspecified error")); + std::string(O.getString("message").value_or("Unspecified error")); if (auto Code = O.getInteger("code")) return make_error(std::move(Msg), ErrorCode(*Code)); return error("{0}", Msg); diff --git a/lldb/source/Plugins/ABI/ARC/ABISysV_arc.cpp b/lldb/source/Plugins/ABI/ARC/ABISysV_arc.cpp index 3620be6f274d9..a9c7af145338e 100644 --- a/lldb/source/Plugins/ABI/ARC/ABISysV_arc.cpp +++ b/lldb/source/Plugins/ABI/ARC/ABISysV_arc.cpp @@ -154,7 +154,7 @@ bool ABISysV_arc::IsRegisterFileReduced(RegisterContext _ctx) const { m_is_reg_file_reduced = (reg_value | rf_entries_bit) != 0; } - return m_is_reg_file_reduced.getValueOr(false); + return m_is_reg_file_reduced.value_or(false); } //-- @@ -458,7 +458,7 @@ ABISysV_arc::GetReturnValueObjectSimple(Thread , const uint32_t type_flags = compiler_type.GetTypeInfo(); // Integer return type. if (type_flags & eTypeIsInteger) { -const size_t byte_size = compiler_type.GetByteSize().getValueOr(0); +const size_t byte_size = compiler_type.GetByteSize().value_or(0); auto raw_value = ReadRawValue(reg_ctx, byte_size); const bool is_signed = (type_flags & eTypeIsSigned) != 0; @@ -482,7 +482,7 @@ ABISysV_arc::GetReturnValueObjectSimple(Thread , if (compiler_type.IsFloatingPointType(float_count, is_complex) && 1 == float_count && !is_complex) { - const size_t byte_size = compiler_type.GetByteSize().getValueOr(0); + const size_t byte_size = compiler_type.GetByteSize().value_or(0); auto raw_value = ReadRawValue(reg_ctx, byte_size); if (!SetSizedFloat(value.GetScalar(), raw_value, byte_size)) diff --git a/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTBundleLoader.cpp b/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTBundleLoader.cpp index 7962302aeb327..3715e46c659cf 100644 --- a/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTBundleLoader.cpp +++ b/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTBundleLoader.cpp @@ -92,7 +92,7 @@ Expected TraceIntelPTBundleLoader::ParseProcess(const JSONProcess ) { TargetSP target_sp; Status error = m_debugger.GetTargetList().CreateTarget( - m_debugger, /*user_exe_path*/ StringRef(), process.triple.getValueOr(""), + m_debugger, /*user_exe_path*/ StringRef(), process.triple.value_or(""), eLoadDependentsNo, /*platform_options*/ nullptr, target_sp); diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp index 5e5ca96aeb552..93b07fc0db302 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -3144,11 +3144,10 @@ Error BitcodeReader::parseConstants() { return error("Explicit gep operator type does not match pointee type " "of pointer operand"); - V = BitcodeConstant::create( - Alloc, CurTy, - {Instruction::GetElementPtr, InBounds, InRangeIndex.getValueOr(-1),
[Lldb-commits] [lldb] 115b189 - [lldb][ARC] Fix -Wtautological-bitwise-compare warning
Author: Fangrui Song Date: 2022-08-13T00:18:37-07:00 New Revision: 115b1899a114285981814a641587e9704c2b9eb9 URL: https://github.com/llvm/llvm-project/commit/115b1899a114285981814a641587e9704c2b9eb9 DIFF: https://github.com/llvm/llvm-project/commit/115b1899a114285981814a641587e9704c2b9eb9.diff LOG: [lldb][ARC] Fix -Wtautological-bitwise-compare warning Added: Modified: lldb/source/Plugins/ABI/ARC/ABISysV_arc.cpp Removed: diff --git a/lldb/source/Plugins/ABI/ARC/ABISysV_arc.cpp b/lldb/source/Plugins/ABI/ARC/ABISysV_arc.cpp index a9c7af145338e..f202d581dd5f9 100644 --- a/lldb/source/Plugins/ABI/ARC/ABISysV_arc.cpp +++ b/lldb/source/Plugins/ABI/ARC/ABISysV_arc.cpp @@ -151,7 +151,7 @@ bool ABISysV_arc::IsRegisterFileReduced(RegisterContext _ctx) const { /*fail_value*/ 0); // RF_BUILD "Number of Entries" bit. const uint32_t rf_entries_bit = 1U << 9U; -m_is_reg_file_reduced = (reg_value | rf_entries_bit) != 0; +m_is_reg_file_reduced = (reg_value & rf_entries_bit) != 0; } return m_is_reg_file_reduced.value_or(false); ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] cdeb50c - [lldb] Remove include/lldb/lldb-private.h
Author: Fangrui Song Date: 2022-08-08T12:03:53-07:00 New Revision: cdeb50c3215593bffe9e5a46bdc9a9e34fd93dcc URL: https://github.com/llvm/llvm-project/commit/cdeb50c3215593bffe9e5a46bdc9a9e34fd93dcc DIFF: https://github.com/llvm/llvm-project/commit/cdeb50c3215593bffe9e5a46bdc9a9e34fd93dcc.diff LOG: [lldb] Remove include/lldb/lldb-private.h The header from 62e0681afb478a4005efb6ba3598c24dc24866ee does something with LLVM_FALLTHROUGH. Now that llvm-project has switched to C++17 and LLVM_FALLTHROUGH uses have been migrated to [[fallthrough]], the header is unneeded. Reviewed By: JDevlieghere Differential Revision: https://reviews.llvm.org/D131422 Added: Modified: clang/docs/tools/clang-formatted-files.txt lldb/include/lldb/lldb-private.h lldb/include/lldb/module.modulemap Removed: lldb/include/lldb/lldb-private-defines.h diff --git a/clang/docs/tools/clang-formatted-files.txt b/clang/docs/tools/clang-formatted-files.txt index 81d0e9522e604..f89e19ca7cd3a 100644 --- a/clang/docs/tools/clang-formatted-files.txt +++ b/clang/docs/tools/clang-formatted-files.txt @@ -3591,7 +3591,6 @@ lldb/examples/plugins/commands/fooplugin.cpp lldb/examples/synthetic/bitfield/program.cpp lldb/include/lldb/lldb-defines.h lldb/include/lldb/lldb-forward.h -lldb/include/lldb/lldb-private-defines.h lldb/include/lldb/lldb-private.h lldb/include/lldb/lldb-public.h lldb/include/lldb/lldb-versioning.h diff --git a/lldb/include/lldb/lldb-private-defines.h b/lldb/include/lldb/lldb-private-defines.h deleted file mode 100644 index d66e6ef1518d7..0 --- a/lldb/include/lldb/lldb-private-defines.h +++ /dev/null @@ -1,36 +0,0 @@ -//===-- lldb-private-defines.h --*- C++ -*-===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===--===// - -#ifndef LLDB_LLDB_PRIVATE_DEFINES_H -#define LLDB_LLDB_PRIVATE_DEFINES_H - -#if defined(__cplusplus) - -// Include Compiler.h here so we don't define LLVM_FALLTHROUGH and then -// Compiler.h later tries to redefine it. -#include "llvm/Support/Compiler.h" - -#ifndef LLVM_FALLTHROUGH - -#ifndef __has_cpp_attribute -#define __has_cpp_attribute(x) 0 -#endif - -/// \macro LLVM_FALLTHROUGH -/// Marks an empty statement preceding a deliberate switch fallthrough. -#if __has_cpp_attribute(clang::fallthrough) -#define LLVM_FALLTHROUGH [[clang::fallthrough]] -#else -#define LLVM_FALLTHROUGH -#endif - -#endif // ifndef LLVM_FALLTHROUGH - -#endif // #if defined(__cplusplus) - -#endif // LLDB_LLDB_PRIVATE_DEFINES_H diff --git a/lldb/include/lldb/lldb-private.h b/lldb/include/lldb/lldb-private.h index ac07047fb4edb..f56af06ec5973 100644 --- a/lldb/include/lldb/lldb-private.h +++ b/lldb/include/lldb/lldb-private.h @@ -11,7 +11,6 @@ #if defined(__cplusplus) -#include "lldb/lldb-private-defines.h" #include "lldb/lldb-private-enumerations.h" #include "lldb/lldb-private-interfaces.h" #include "lldb/lldb-private-types.h" diff --git a/lldb/include/lldb/module.modulemap b/lldb/include/lldb/module.modulemap index 303d6b15e808c..c06e026076f49 100644 --- a/lldb/include/lldb/module.modulemap +++ b/lldb/include/lldb/module.modulemap @@ -134,7 +134,6 @@ module lldb_Utility { module lldb_enumerations { header "lldb-enumerations.h" export * } module lldb_forward { header "lldb-forward.h" export * } module lldb_private_enumerations { header "lldb-private-enumerations.h" export * } - module lldb_private_defines { header "lldb-private-defines.h" export * } module lldb_private_forward { header "lldb-private-forward.h" export * } module lldb_private { header "lldb-private.h" export * } module lldb_private_interfaces { header "lldb-private-interfaces.h" export * } ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] 59d2495 - [lldb] LLVM_FALLTHROUGH => [[fallthrough]]. NFC
Author: Fangrui Song Date: 2022-08-08T11:31:49-07:00 New Revision: 59d2495fe2c1254f84ad4d2bd61a41e79ff0d44d URL: https://github.com/llvm/llvm-project/commit/59d2495fe2c1254f84ad4d2bd61a41e79ff0d44d DIFF: https://github.com/llvm/llvm-project/commit/59d2495fe2c1254f84ad4d2bd61a41e79ff0d44d.diff LOG: [lldb] LLVM_FALLTHROUGH => [[fallthrough]]. NFC Added: Modified: lldb/source/Commands/CommandObjectMemory.cpp lldb/source/Core/Address.cpp lldb/source/Core/AddressRange.cpp lldb/source/Core/Communication.cpp lldb/source/Core/FormatEntity.cpp lldb/source/Core/ValueObject.cpp lldb/source/Expression/DWARFExpression.cpp lldb/source/Expression/REPL.cpp lldb/source/Interpreter/OptionValueArray.cpp lldb/source/Interpreter/OptionValueFileSpecList.cpp lldb/source/Interpreter/OptionValuePathMappings.cpp lldb/source/Interpreter/Options.cpp lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp lldb/source/Plugins/Language/ObjC/Cocoa.cpp lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.cpp lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp lldb/source/Plugins/Process/Windows/Common/NativeProcessWindows.cpp lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp lldb/source/Target/Process.cpp lldb/source/Target/StackFrame.cpp lldb/source/Target/StackFrameList.cpp lldb/source/Utility/ArchSpec.cpp lldb/tools/lldb-test/lldb-test.cpp lldb/unittests/Expression/DWARFExpressionTest.cpp Removed: diff --git a/lldb/source/Commands/CommandObjectMemory.cpp b/lldb/source/Commands/CommandObjectMemory.cpp index 5051f9aeec851..22483e7c597c7 100644 --- a/lldb/source/Commands/CommandObjectMemory.cpp +++ b/lldb/source/Commands/CommandObjectMemory.cpp @@ -427,7 +427,7 @@ class CommandObjectMemoryRead : public CommandObjectParsed { switch (type_str[type_str.size() - 1]) { case '*': ++pointer_count; -LLVM_FALLTHROUGH; +[[fallthrough]]; case ' ': case '\t': type_str.erase(type_str.size() - 1); diff --git a/lldb/source/Core/Address.cpp b/lldb/source/Core/Address.cpp index b84e1ac8e1695..5969cf11d865c 100644 --- a/lldb/source/Core/Address.cpp +++ b/lldb/source/Core/Address.cpp @@ -451,7 +451,7 @@ bool Address::Dump(Stream *s, ExecutionContextScope *exe_scope, DumpStyle style, else s->Printf("%s[", ""); } -LLVM_FALLTHROUGH; +[[fallthrough]]; case DumpStyleFileAddress: { addr_t file_addr = GetFileAddress(); if (file_addr == LLDB_INVALID_ADDRESS) { diff --git a/lldb/source/Core/AddressRange.cpp b/lldb/source/Core/AddressRange.cpp index 66dcda574890a..1830f2ccd47fe 100644 --- a/lldb/source/Core/AddressRange.cpp +++ b/lldb/source/Core/AddressRange.cpp @@ -169,7 +169,7 @@ bool AddressRange::Dump(Stream *s, Target *target, Address::DumpStyle style, case Address::DumpStyleModuleWithFileAddress: show_module = true; -LLVM_FALLTHROUGH; +[[fallthrough]]; case Address::DumpStyleFileAddress: vmaddr = m_base_addr.GetFileAddress(); break; diff --git a/lldb/source/Core/Communication.cpp b/lldb/source/Core/Communication.cpp index f41ce46ede88f..d5f8f8922f5e1 100644 --- a/lldb/source/Core/Communication.cpp +++ b/lldb/source/Core/Communication.cpp @@ -356,7 +356,7 @@ lldb::thread_result_t Communication::ReadThread() { case eConnectionStatusLostConnection: // Lost connection while connected to // a valid connection done = true; - LLVM_FALLTHROUGH; + [[fallthrough]]; case eConnectionStatusTimedOut: // Request timed out if (error.Fail()) LLDB_LOG(log, "error: {0}, status = {1}", error, diff --git a/lldb/source/Core/FormatEntity.cpp b/lldb/source/Core/FormatEntity.cpp index 6e7f44e461fa6..0ac8fcabc61b9 100644 --- a/lldb/source/Core/FormatEntity.cpp +++ b/lldb/source/Core/FormatEntity.cpp @@ -696,7 +696,7 @@ static bool DumpValue(Stream , const SymbolContext *sc,
[Lldb-commits] [lldb] 5146f84 - LLVM_NODISCARD => [[nodiscard]]. NFC
Author: Fangrui Song Date: 2022-08-09T07:16:34Z New Revision: 5146f84fd616084fb63025a3e8a172179137b1ce URL: https://github.com/llvm/llvm-project/commit/5146f84fd616084fb63025a3e8a172179137b1ce DIFF: https://github.com/llvm/llvm-project/commit/5146f84fd616084fb63025a3e8a172179137b1ce.diff LOG: LLVM_NODISCARD => [[nodiscard]]. NFC Added: Modified: lldb/include/lldb/Interpreter/CommandInterpreter.h lldb/source/Plugins/ExpressionParser/Clang/CppModuleConfiguration.h lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp mlir/include/mlir/Analysis/AliasAnalysis.h mlir/include/mlir/Dialect/Transform/IR/TransformInterfaces.h mlir/include/mlir/IR/OpImplementation.h mlir/include/mlir/Support/LogicalResult.h Removed: diff --git a/lldb/include/lldb/Interpreter/CommandInterpreter.h b/lldb/include/lldb/Interpreter/CommandInterpreter.h index 55971136b63b..0f137a7b3c49 100644 --- a/lldb/include/lldb/Interpreter/CommandInterpreter.h +++ b/lldb/include/lldb/Interpreter/CommandInterpreter.h @@ -588,7 +588,7 @@ class CommandInterpreter : public Broadcaster, /// \return True if the exit code was successfully set; false if the /// interpreter doesn't allow custom exit codes. /// \see AllowExitCodeOnQuit - LLVM_NODISCARD bool SetQuitExitCode(int exit_code); + [[nodiscard]] bool SetQuitExitCode(int exit_code); /// Returns the exit code that the user has specified when running the /// 'quit' command. diff --git a/lldb/source/Plugins/ExpressionParser/Clang/CppModuleConfiguration.h b/lldb/source/Plugins/ExpressionParser/Clang/CppModuleConfiguration.h index 5db8abbdbdf3..3a87570bf804 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/CppModuleConfiguration.h +++ b/lldb/source/Plugins/ExpressionParser/Clang/CppModuleConfiguration.h @@ -30,7 +30,7 @@ class CppModuleConfiguration { public: /// Try setting the path. Returns true if the path was set and false if /// the path was already set. -LLVM_NODISCARD bool TrySet(llvm::StringRef path); +[[nodiscard]] bool TrySet(llvm::StringRef path); /// Return the path if there is one. llvm::StringRef Get() const { assert(m_valid && "Called Get() on an invalid SetOncePath?"); diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp index dfa2d4c05126..d71ce0faa7b2 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp @@ -503,7 +503,7 @@ ValueObjectSP AppleObjCRuntime::GetExceptionObjectForThread( /// \param msg The message to add to the log. /// \return An invalid ThreadSP to be returned from /// GetBacktraceThreadFromException. -LLVM_NODISCARD +[[nodiscard]] static ThreadSP FailExceptionParsing(llvm::StringRef msg) { Log *log = GetLog(LLDBLog::Language); LLDB_LOG(log, "Failed getting backtrace from exception: {0}", msg); diff --git a/mlir/include/mlir/Analysis/AliasAnalysis.h b/mlir/include/mlir/Analysis/AliasAnalysis.h index fd36b2db3e50..5beae79ad1a0 100644 --- a/mlir/include/mlir/Analysis/AliasAnalysis.h +++ b/mlir/include/mlir/Analysis/AliasAnalysis.h @@ -87,7 +87,7 @@ inline raw_ostream <<(raw_ostream , const AliasResult ) { /// The possible results of whether a memory access modifies or references /// a memory location. The possible results are: no access at all, a /// modification, a reference, or both a modification and a reference. -class LLVM_NODISCARD ModRefResult { +class [[nodiscard]] ModRefResult { /// Note: This is a simplified version of the ModRefResult in /// `llvm/Analysis/AliasAnalysis.h`, and namely removes the `Must` concept. If /// this becomes useful/necessary we should add it here. @@ -123,23 +123,23 @@ class LLVM_NODISCARD ModRefResult { static ModRefResult getModAndRef() { return Kind::ModRef; } /// Returns if this result does not modify or reference memory. - LLVM_NODISCARD bool isNoModRef() const { return kind == Kind::NoModRef; } + [[nodiscard]] bool isNoModRef() const { return kind == Kind::NoModRef; } /// Returns if this result modifies memory. - LLVM_NODISCARD bool isMod() const { + [[nodiscard]] bool isMod() const { return static_cast(kind) & static_cast(Kind::Mod); } /// Returns if this result references memory. - LLVM_NODISCARD bool isRef() const { + [[nodiscard]] bool isRef() const { return static_cast(kind) & static_cast(Kind::Ref); } /// Returns if this result modifies *or* references memory. - LLVM_NODISCARD bool isModOrRef() const { return kind != Kind::NoModRef; } + [[nodiscard]] bool isModOrRef() const { return kind != Kind::NoModRef; } /// Returns if this result modifies *and* references memory.
[Lldb-commits] [lldb] 4215a84 - [lldb] Remove unneeded .get() NFC
Author: Fangrui Song Date: 2023-01-04T22:05:40-08:00 New Revision: 4215a84559bb872363eaa4ac724be8ef86c2e683 URL: https://github.com/llvm/llvm-project/commit/4215a84559bb872363eaa4ac724be8ef86c2e683 DIFF: https://github.com/llvm/llvm-project/commit/4215a84559bb872363eaa4ac724be8ef86c2e683.diff LOG: [lldb] Remove unneeded .get() NFC Added: Modified: lldb/include/lldb/Target/Process.h lldb/source/API/SBExpressionOptions.cpp lldb/source/API/SBSourceManager.cpp lldb/source/Interpreter/ScriptInterpreter.cpp lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h lldb/source/Target/Thread.cpp lldb/source/Target/ThreadPlanStack.cpp Removed: diff --git a/lldb/include/lldb/Target/Process.h b/lldb/include/lldb/Target/Process.h index 47040137078f6..8bb8b85e22fbc 100644 --- a/lldb/include/lldb/Target/Process.h +++ b/lldb/include/lldb/Target/Process.h @@ -2704,7 +2704,7 @@ void PruneThreadPlans(); }; void SetNextEventAction(Process::NextEventAction *next_event_action) { -if (m_next_event_action_up.get()) +if (m_next_event_action_up) m_next_event_action_up->HandleBeingUnshipped(); m_next_event_action_up.reset(next_event_action); diff --git a/lldb/source/API/SBExpressionOptions.cpp b/lldb/source/API/SBExpressionOptions.cpp index d07acbc0aa2db..6ae57f24606af 100644 --- a/lldb/source/API/SBExpressionOptions.cpp +++ b/lldb/source/API/SBExpressionOptions.cpp @@ -254,5 +254,5 @@ EvaluateExpressionOptions *SBExpressionOptions::get() const { } EvaluateExpressionOptions ::ref() const { - return *(m_opaque_up.get()); + return *m_opaque_up; } diff --git a/lldb/source/API/SBSourceManager.cpp b/lldb/source/API/SBSourceManager.cpp index 7729f5d9d69f8..68815026c464d 100644 --- a/lldb/source/API/SBSourceManager.cpp +++ b/lldb/source/API/SBSourceManager.cpp @@ -88,14 +88,14 @@ SBSourceManager::SBSourceManager(const SBSourceManager ) { if ( == this) return; - m_opaque_up = std::make_unique(*(rhs.m_opaque_up.get())); + m_opaque_up = std::make_unique(*rhs.m_opaque_up); } const lldb::SBSourceManager :: operator=(const lldb::SBSourceManager ) { LLDB_INSTRUMENT_VA(this, rhs); - m_opaque_up = std::make_unique(*(rhs.m_opaque_up.get())); + m_opaque_up = std::make_unique(*rhs.m_opaque_up); return *this; } diff --git a/lldb/source/Interpreter/ScriptInterpreter.cpp b/lldb/source/Interpreter/ScriptInterpreter.cpp index 0820755545622..9572176fdf7be 100644 --- a/lldb/source/Interpreter/ScriptInterpreter.cpp +++ b/lldb/source/Interpreter/ScriptInterpreter.cpp @@ -82,7 +82,7 @@ ScriptInterpreter::GetDataExtractorFromSBData(const lldb::SBData ) const { Status ScriptInterpreter::GetStatusFromSBError(const lldb::SBError ) const { if (error.m_opaque_up) -return *error.m_opaque_up.get(); +return *error.m_opaque_up; return Status(); } diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp index 5f7bb1262f8cf..cba8191887900 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp @@ -116,7 +116,7 @@ std::shared_ptr ClangPersistentVariables::GetClangModulesDeclVendor() { if (!m_modules_decl_vendor_sp) { m_modules_decl_vendor_sp.reset( -ClangModulesDeclVendor::Create(*m_target_sp.get())); +ClangModulesDeclVendor::Create(*m_target_sp)); } return m_modules_decl_vendor_sp; } diff --git a/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h b/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h index 796e7e50a8b90..d03a8ce4e9241 100644 --- a/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h +++ b/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h @@ -67,7 +67,7 @@ class UnwindAssemblyInstEmulation : public lldb_private::UnwindAssembly { m_initial_sp(0), m_cfa_reg_info(), m_fp_is_cfa(false), m_register_values(), m_pushed_regs(), m_curr_row_modified(false), m_forward_branch_offset(0) { -if (m_inst_emulator_up.get()) { +if (m_inst_emulator_up) { m_inst_emulator_up->SetBaton(this); m_inst_emulator_up->SetCallbacks(ReadMemory, WriteMemory, ReadRegister, WriteRegister); diff --git a/lldb/source/Target/Thread.cpp b/lldb/source/Target/Thread.cpp index 5b4c5db2d9286..10bdb51540616 100644 --- a/lldb/source/Target/Thread.cpp +++ b/lldb/source/Target/Thread.cpp @@ -1084,7 +1084,7 @@ ThreadPlanStack ::GetPlans() const { // queries GetDescription makes, and only assert if you try to run the thread. if
[Lldb-commits] [lldb] 3dfacc0 - CheckedArithmetic: llvm::Optional => std::optional
Author: Fangrui Song Date: 2022-12-05T04:30:54Z New Revision: 3dfacc0a56e9d5718f51b1d3ce63070e79fc2608 URL: https://github.com/llvm/llvm-project/commit/3dfacc0a56e9d5718f51b1d3ce63070e79fc2608 DIFF: https://github.com/llvm/llvm-project/commit/3dfacc0a56e9d5718f51b1d3ce63070e79fc2608.diff LOG: CheckedArithmetic: llvm::Optional => std::optional Added: Modified: lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp llvm/include/llvm/Analysis/VectorUtils.h llvm/include/llvm/Support/CheckedArithmetic.h llvm/lib/FileCheck/FileCheck.cpp llvm/unittests/Support/CheckedArithmeticTest.cpp Removed: diff --git a/lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp b/lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp index 3fc529ae20281..25042b12f1939 100644 --- a/lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp +++ b/lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp @@ -560,7 +560,7 @@ uint64_t EmulateInstructionARM64:: AddWithCarry(uint32_t N, uint64_t x, uint64_t y, bit carry_in, EmulateInstructionARM64::ProcState _state) { uint64_t unsigned_sum = UInt(x) + UInt(y) + UInt(carry_in); - llvm::Optional signed_sum = llvm::checkedAdd(SInt(x), SInt(y)); + std::optional signed_sum = llvm::checkedAdd(SInt(x), SInt(y)); bool overflow = !signed_sum; if (!overflow) overflow |= !llvm::checkedAdd(*signed_sum, SInt(carry_in)); diff --git a/llvm/include/llvm/Analysis/VectorUtils.h b/llvm/include/llvm/Analysis/VectorUtils.h index 0f2346cf7c57e..02271d5780c82 100644 --- a/llvm/include/llvm/Analysis/VectorUtils.h +++ b/llvm/include/llvm/Analysis/VectorUtils.h @@ -641,7 +641,7 @@ template class InterleaveGroup { /// \returns false if the instruction doesn't belong to the group. bool insertMember(InstTy *Instr, int32_t Index, Align NewAlign) { // Make sure the key fits in an int32_t. -Optional MaybeKey = checkedAdd(Index, SmallestKey); +std::optional MaybeKey = checkedAdd(Index, SmallestKey); if (!MaybeKey) return false; int32_t Key = *MaybeKey; @@ -664,7 +664,7 @@ template class InterleaveGroup { } else if (Key < SmallestKey) { // Make sure the largest index fits in an int32_t. - Optional MaybeLargestIndex = checkedSub(LargestKey, Key); + std::optional MaybeLargestIndex = checkedSub(LargestKey, Key); if (!MaybeLargestIndex) return false; diff --git a/llvm/include/llvm/Support/CheckedArithmetic.h b/llvm/include/llvm/Support/CheckedArithmetic.h index c9db239672d36..5bfc551b2cc5b 100644 --- a/llvm/include/llvm/Support/CheckedArithmetic.h +++ b/llvm/include/llvm/Support/CheckedArithmetic.h @@ -15,8 +15,8 @@ #define LLVM_SUPPORT_CHECKEDARITHMETIC_H #include "llvm/ADT/APInt.h" -#include "llvm/ADT/Optional.h" +#include #include namespace { @@ -26,7 +26,7 @@ namespace { /// \return Empty optional if the operation overflows, or result otherwise. template std::enable_if_t::value && sizeof(T) * 8 <= 64, - llvm::Optional> + std::optional> checkedOp(T LHS, T RHS, F Op, bool Signed = true) { llvm::APInt ALHS(sizeof(T) * 8, LHS, Signed); llvm::APInt ARHS(sizeof(T) * 8, RHS, Signed); @@ -44,7 +44,7 @@ namespace llvm { /// \return Optional of sum if no signed overflow occurred, /// \c None otherwise. template -std::enable_if_t::value, llvm::Optional> +std::enable_if_t::value, std::optional> checkedAdd(T LHS, T RHS) { return checkedOp(LHS, RHS, ::APInt::sadd_ov); } @@ -53,7 +53,7 @@ checkedAdd(T LHS, T RHS) { /// \return Optional of sum if no signed overflow occurred, /// \c None otherwise. template -std::enable_if_t::value, llvm::Optional> +std::enable_if_t::value, std::optional> checkedSub(T LHS, T RHS) { return checkedOp(LHS, RHS, ::APInt::ssub_ov); } @@ -62,7 +62,7 @@ checkedSub(T LHS, T RHS) { /// \return Optional of product if no signed overflow occurred, /// \c None otherwise. template -std::enable_if_t::value, llvm::Optional> +std::enable_if_t::value, std::optional> checkedMul(T LHS, T RHS) { return checkedOp(LHS, RHS, ::APInt::smul_ov); } @@ -71,7 +71,7 @@ checkedMul(T LHS, T RHS) { /// \return Optional of result if no signed overflow occurred, /// \c None otherwise. template -std::enable_if_t::value, llvm::Optional> +std::enable_if_t::value, std::optional> checkedMulAdd(T A, T B, T C) { if (auto Product = checkedMul(A, B)) return checkedAdd(*Product, C); @@ -82,7 +82,7 @@ checkedMulAdd(T A, T B, T C) { /// \return Optional of sum if no unsigned overflow occurred, /// \c None otherwise. template -std::enable_if_t::value, llvm::Optional> +std::enable_if_t::value, std::optional> checkedAddUnsigned(T LHS, T RHS) { return checkedOp(LHS, RHS, ::APInt::uadd_ov, /*Signed=*/false); } @@ -91,7 +91,7 @@ checkedAddUnsigned(T LHS, T RHS) {
[Lldb-commits] [lldb] a996cc2 - Remove unused #include "llvm/ADT/Optional.h"
Author: Fangrui Song Date: 2022-12-05T06:31:11Z New Revision: a996cc217cefb9071888de38c6f05e5742d0106f URL: https://github.com/llvm/llvm-project/commit/a996cc217cefb9071888de38c6f05e5742d0106f DIFF: https://github.com/llvm/llvm-project/commit/a996cc217cefb9071888de38c6f05e5742d0106f.diff LOG: Remove unused #include "llvm/ADT/Optional.h" Added: Modified: clang-tools-extra/clang-include-fixer/find-all-symbols/SymbolInfo.h clang-tools-extra/clang-query/Query.h clang-tools-extra/clang-tidy/readability/AvoidConstParamsInDecls.cpp clang-tools-extra/clangd/refactor/Tweak.cpp clang-tools-extra/clangd/refactor/tweaks/ObjCLocalizeStringLiteral.cpp clang-tools-extra/clangd/refactor/tweaks/SwapIfBranches.cpp clang/include/clang/IndexSerialization/SerializablePathCollection.h clang/include/clang/Serialization/InMemoryModuleCache.h clang/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h clang/include/clang/StaticAnalyzer/Core/PathSensitive/DynamicType.h clang/include/clang/Tooling/Refactoring/RefactoringActionRule.h clang/lib/Basic/Stack.cpp clang/lib/Driver/ToolChains/Arch/RISCV.cpp clang/lib/Driver/ToolChains/Cuda.h clang/lib/Tooling/Syntax/Mutations.cpp clang/unittests/Analysis/FlowSensitive/SignAnalysisTest.cpp clang/unittests/Analysis/FlowSensitive/TestingSupport.cpp clang/unittests/CrossTU/CrossTranslationUnitTest.cpp flang/lib/Optimizer/Transforms/AffineDemotion.cpp lld/MachO/SyntheticSections.h lld/include/lld/Common/Strings.h lldb/include/lldb/Expression/DWARFExpressionList.h lldb/source/Plugins/Instruction/RISCV/RISCVCInstructions.h lldb/source/Plugins/SymbolFile/NativePDB/PdbUtil.h lldb/source/Utility/Listener.cpp lldb/unittests/ObjectFile/ELF/TestObjectFileELF.cpp llvm/include/llvm/ADT/StringSwitch.h llvm/include/llvm/ADT/TypeSwitch.h llvm/include/llvm/Analysis/BasicAliasAnalysis.h llvm/include/llvm/Analysis/DemandedBits.h llvm/include/llvm/Analysis/LazyCallGraph.h llvm/include/llvm/Analysis/ModuleSummaryAnalysis.h llvm/include/llvm/CodeGen/BasicBlockSectionsProfileReader.h llvm/include/llvm/CodeGen/TargetRegisterInfo.h llvm/include/llvm/ExecutionEngine/ExecutionEngine.h llvm/include/llvm/ExecutionEngine/Orc/JITTargetMachineBuilder.h llvm/include/llvm/MC/MCAsmBackend.h llvm/include/llvm/MC/MCDwarf.h llvm/include/llvm/MC/MCInstrAnalysis.h llvm/include/llvm/MC/MCSubtargetInfo.h llvm/include/llvm/MC/MCSymbolXCOFF.h llvm/include/llvm/ObjCopy/ELF/ELFConfig.h llvm/include/llvm/Object/DXContainer.h llvm/include/llvm/Support/CachePruning.h llvm/include/llvm/Support/CommandLine.h llvm/include/llvm/Support/GlobPattern.h llvm/include/llvm/Support/ToolOutputFile.h llvm/include/llvm/Support/raw_ostream.h llvm/include/llvm/Target/CGPassBuilderOption.h llvm/include/llvm/Testing/Support/Annotations.h llvm/include/llvm/WindowsDriver/MSVCPaths.h llvm/lib/Analysis/CGSCCPassManager.cpp llvm/lib/CodeGen/SelectionDAG/FastISel.cpp llvm/lib/DebugInfo/CodeView/TypeStreamMerger.cpp llvm/lib/DebugInfo/DWARF/DWARFDebugInfoEntry.cpp llvm/lib/DebugInfo/PDB/Native/NativeEnumTypes.cpp llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp llvm/lib/ObjCopy/ELF/ELFObjcopy.cpp llvm/lib/Support/GlobPattern.cpp llvm/lib/Transforms/IPO/Inliner.cpp llvm/lib/Transforms/IPO/PartialInlining.cpp llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp llvm/lib/Transforms/Scalar/IndVarSimplify.cpp llvm/lib/Transforms/Utils/LoopUnrollAndJam.cpp llvm/tools/llvm-cov/CoverageExporterJson.cpp llvm/tools/llvm-exegesis/lib/Clustering.h llvm/tools/llvm-jitlink/llvm-jitlink.h llvm/tools/llvm-objcopy/ObjcopyOptions.cpp llvm/tools/llvm-pdbutil/DumpOutputStyle.h llvm/tools/llvm-pdbutil/TypeReferenceTracker.h llvm/tools/llvm-remark-size-diff/RemarkSizeDiff.cpp llvm/tools/llvm-tapi-diff/DiffEngine.h llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp polly/lib/Transform/MatmulOptimizer.cpp Removed: diff --git a/clang-tools-extra/clang-include-fixer/find-all-symbols/SymbolInfo.h b/clang-tools-extra/clang-include-fixer/find-all-symbols/SymbolInfo.h index 7f8fa9089865a..1a93dff4100b0 100644 --- a/clang-tools-extra/clang-include-fixer/find-all-symbols/SymbolInfo.h +++ b/clang-tools-extra/clang-include-fixer/find-all-symbols/SymbolInfo.h @@ -9,7 +9,6 @@ #ifndef LLVM_CLANG_TOOLS_EXTRA_INCLUDE_FIXER_FIND_ALL_SYMBOLS_SYMBOLINFO_H #define LLVM_CLANG_TOOLS_EXTRA_INCLUDE_FIXER_FIND_ALL_SYMBOLS_SYMBOLINFO_H -#include "llvm/ADT/Optional.h" #include "llvm/ADT/StringRef.h" #include "llvm/Support/YAMLTraits.h" #include "llvm/Support/raw_ostream.h" diff --git a/clang-tools-extra/clang-query/Query.h
[Lldb-commits] [lldb] 95ec1a6 - [trace] Change /sys/bus const char * variables to const char []
Author: Fangrui Song Date: 2022-12-16T08:07:07Z New Revision: 95ec1a60986c13628c6f608fc0ed1f1fafb1b033 URL: https://github.com/llvm/llvm-project/commit/95ec1a60986c13628c6f608fc0ed1f1fafb1b033 DIFF: https://github.com/llvm/llvm-project/commit/95ec1a60986c13628c6f608fc0ed1f1fafb1b033.diff LOG: [trace] Change /sys/bus const char * variables to const char [] Added: Modified: lldb/source/Plugins/Process/Linux/IntelPTSingleBufferTrace.cpp Removed: diff --git a/lldb/source/Plugins/Process/Linux/IntelPTSingleBufferTrace.cpp b/lldb/source/Plugins/Process/Linux/IntelPTSingleBufferTrace.cpp index 269b7ca9dee9..36ee0260d3d2 100644 --- a/lldb/source/Plugins/Process/Linux/IntelPTSingleBufferTrace.cpp +++ b/lldb/source/Plugins/Process/Linux/IntelPTSingleBufferTrace.cpp @@ -22,19 +22,19 @@ using namespace lldb_private; using namespace process_linux; using namespace llvm; -const char *kOSEventIntelPTTypeFile = +const char kOSEventIntelPTTypeFile[] = "/sys/bus/event_source/devices/intel_pt/type"; -const char *kPSBPeriodCapFile = +const char kPSBPeriodCapFile[] = "/sys/bus/event_source/devices/intel_pt/caps/psb_cyc"; -const char *kPSBPeriodValidValuesFile = +const char kPSBPeriodValidValuesFile[] = "/sys/bus/event_source/devices/intel_pt/caps/psb_periods"; -const char *kPSBPeriodBitOffsetFile = +const char kPSBPeriodBitOffsetFile[] = "/sys/bus/event_source/devices/intel_pt/format/psb_period"; -const char *kTSCBitOffsetFile = +const char kTSCBitOffsetFile[] = "/sys/bus/event_source/devices/intel_pt/format/tsc"; enum IntelPTConfigFileType { ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits