[Lldb-commits] [lldb] r345882 - Fix clang -Wimplicit-fallthrough warnings across llvm, NFC

2018-11-01 Thread Reid Kleckner via lldb-commits
Author: rnk
Date: Thu Nov  1 12:54:45 2018
New Revision: 345882

URL: http://llvm.org/viewvc/llvm-project?rev=345882&view=rev
Log:
Fix clang -Wimplicit-fallthrough warnings across llvm, NFC

This patch should not introduce any behavior changes. It consists of
mostly one of two changes:
1. Replacing fall through comments with the LLVM_FALLTHROUGH macro
2. Inserting 'break' before falling through into a case block consisting
   of only 'break'.

We were already using this warning with GCC, but its warning behaves
slightly differently. In this patch, the following differences are
relevant:
1. GCC recognizes comments that say "fall through" as annotations, clang
   doesn't
2. GCC doesn't warn on "case N: foo(); default: break;", clang does
3. GCC doesn't warn when the case contains a switch, but falls through
   the outer case.

I will enable the warning separately in a follow-up patch so that it can
be cleanly reverted if necessary.

Reviewers: alexfh, rsmith, lattner, rtrieu, EricWF, bollu

Differential Revision: https://reviews.llvm.org/D53950

Modified:
lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
lldb/trunk/tools/lldb-test/lldb-test.cpp

Modified: lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp?rev=345882&r1=345881&r2=345882&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp Thu Nov  1 
12:54:45 2018
@@ -288,6 +288,7 @@ GetClassOrFunctionParent(const llvm::pdb
 auto class_parent_id = raw.getClassParentId();
 if (auto class_parent = session.getSymbolById(class_parent_id))
   return class_parent;
+break;
   }
   default:
 break;

Modified: lldb/trunk/tools/lldb-test/lldb-test.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-test/lldb-test.cpp?rev=345882&r1=345881&r2=345882&view=diff
==
--- lldb/trunk/tools/lldb-test/lldb-test.cpp (original)
+++ lldb/trunk/tools/lldb-test/lldb-test.cpp Thu Nov  1 12:54:45 2018
@@ -285,7 +285,7 @@ std::string opts::breakpoint::substitute
 OS << sys::path::parent_path(breakpoint::CommandFile);
 break;
   }
-  // fall through
+  LLVM_FALLTHROUGH;
 default:
   size_t pos = Cmd.find('%');
   OS << Cmd.substr(0, pos);


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r347254 - Fix clang test suite on Windows by reverting part of r347216

2018-11-19 Thread Reid Kleckner via lldb-commits
Author: rnk
Date: Mon Nov 19 11:36:28 2018
New Revision: 347254

URL: http://llvm.org/viewvc/llvm-project?rev=347254&view=rev
Log:
Fix clang test suite on Windows by reverting part of r347216

Otherwise, the clang analyzer tests fail on Windows when attempting to
unpickle AnalyzerTest objects in the worker processes. The pattern of,
add to path, import, remove from path, serialize, deserialize, doesn't
work. Once something gets added to the path, if we want to move it
across the wire for multiprocessing, we need to keep the module on
sys.path.

Modified:
lldb/trunk/lit/lit.cfg.py

Modified: lldb/trunk/lit/lit.cfg.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/lit.cfg.py?rev=347254&r1=347253&r2=347254&view=diff
==
--- lldb/trunk/lit/lit.cfg.py (original)
+++ lldb/trunk/lit/lit.cfg.py Mon Nov 19 11:36:28 2018
@@ -11,6 +11,7 @@ from lit.llvm import llvm_config
 from lit.llvm.subst import FindTool
 from lit.llvm.subst import ToolSubst
 
+site.addsitedir(os.path.dirname(__file__))
 from helper import toolchain
 
 # name: The name of this test suite.


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r339910 - Update LLDB for LLVM CodeView API change in r339907

2018-08-16 Thread Reid Kleckner via lldb-commits
Author: rnk
Date: Thu Aug 16 10:51:58 2018
New Revision: 339910

URL: http://llvm.org/viewvc/llvm-project?rev=339910&view=rev
Log:
Update LLDB for LLVM CodeView API change in r339907

Modified:
lldb/trunk/source/Plugins/SymbolFile/PDB/PDBLocationToDWARFExpression.cpp

Modified: 
lldb/trunk/source/Plugins/SymbolFile/PDB/PDBLocationToDWARFExpression.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/PDB/PDBLocationToDWARFExpression.cpp?rev=339910&r1=339909&r2=339910&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/PDB/PDBLocationToDWARFExpression.cpp 
(original)
+++ lldb/trunk/source/Plugins/SymbolFile/PDB/PDBLocationToDWARFExpression.cpp 
Thu Aug 16 10:51:58 2018
@@ -26,51 +26,51 @@ using namespace llvm::pdb;
 
 namespace {
 const uint32_t g_code_view_to_lldb_registers_x86[] = {
-LLDB_INVALID_REGNUM, // CVRegNONE
-lldb_al_i386,// CVRegAL
-lldb_cl_i386,// CVRegCL
-lldb_dl_i386,// CVRegDL
-lldb_bl_i386,// CVRegBL
-lldb_ah_i386,// CVRegAH
-lldb_ch_i386,// CVRegCH
-lldb_dh_i386,// CVRegDH
-lldb_bh_i386,// CVRegBH
-lldb_ax_i386,// CVRegAX
-lldb_cx_i386,// CVRegCX
-lldb_dx_i386,// CVRegDX
-lldb_bx_i386,// CVRegBX
-lldb_sp_i386,// CVRegSP
-lldb_bp_i386,// CVRegBP
-lldb_si_i386,// CVRegSI
-lldb_di_i386,// CVRegDI
-lldb_eax_i386,   // CVRegEAX
-lldb_ecx_i386,   // CVRegECX
-lldb_edx_i386,   // CVRegEDX
-lldb_ebx_i386,   // CVRegEBX
-lldb_esp_i386,   // CVRegESP
-lldb_ebp_i386,   // CVRegEBP
-lldb_esi_i386,   // CVRegESI
-lldb_edi_i386,   // CVRegEDI
-lldb_es_i386,// CVRegES
-lldb_cs_i386,// CVRegCS
-lldb_ss_i386,// CVRegSS
-lldb_ds_i386,// CVRegDS
-lldb_fs_i386,// CVRegFS
-lldb_gs_i386,// CVRegGS
-LLDB_INVALID_REGNUM, // CVRegIP
-LLDB_INVALID_REGNUM, // CVRegFLAGS
-lldb_eip_i386,   // CVRegEIP
-lldb_eflags_i386,// CVRegEFLAGS
+LLDB_INVALID_REGNUM, // NONE
+lldb_al_i386,// AL
+lldb_cl_i386,// CL
+lldb_dl_i386,// DL
+lldb_bl_i386,// BL
+lldb_ah_i386,// AH
+lldb_ch_i386,// CH
+lldb_dh_i386,// DH
+lldb_bh_i386,// BH
+lldb_ax_i386,// AX
+lldb_cx_i386,// CX
+lldb_dx_i386,// DX
+lldb_bx_i386,// BX
+lldb_sp_i386,// SP
+lldb_bp_i386,// BP
+lldb_si_i386,// SI
+lldb_di_i386,// DI
+lldb_eax_i386,   // EAX
+lldb_ecx_i386,   // ECX
+lldb_edx_i386,   // EDX
+lldb_ebx_i386,   // EBX
+lldb_esp_i386,   // ESP
+lldb_ebp_i386,   // EBP
+lldb_esi_i386,   // ESI
+lldb_edi_i386,   // EDI
+lldb_es_i386,// ES
+lldb_cs_i386,// CS
+lldb_ss_i386,// SS
+lldb_ds_i386,// DS
+lldb_fs_i386,// FS
+lldb_gs_i386,// GS
+LLDB_INVALID_REGNUM, // IP
+LLDB_INVALID_REGNUM, // FLAGS
+lldb_eip_i386,   // EIP
+lldb_eflags_i386,// EFLAGS
 LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
 LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
-LLDB_INVALID_REGNUM, // CVRegTEMP
-LLDB_INVALID_REGNUM, // CVRegTEMPH
-LLDB_INVALID_REGNUM, // CVRegQUOTE
-LLDB_INVALID_REGNUM, // CVRegPCDR3
-LLDB_INVALID_REGNUM, // CVRegPCDR4
-LLDB_INVALID_REGNUM, // CVRegPCDR5
-LLDB_INVALID_REGNUM, // CVRegPCDR6
-LLDB_INVALID_REGNUM, // CVRegPCDR7
+LLDB_INVALID_REGNUM, // TEMP
+LLDB_INVALID_REGNUM, // TEMPH
+LLDB_INVALID_REGNUM, // QUOTE
+LLDB_INVALID_REGNUM, // PCDR3
+LLDB_INVALID_REGNUM, // PCDR4
+LLDB_INVALID_REGNUM, // PCDR5
+LLDB_INVALID_REGNUM, // PCDR6
+LLDB_INVALID_REGNUM, // PCDR7
 LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
 LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
 LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
@@ -82,123 +82,123 @@ const uint32_t g_code_view_to_lldb_regis
 LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
 LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
 LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
-LLDB_INVALID_REGNUM, // CVRegCR0
-LLDB_INVALID_REGNUM, // CVRegCR1
-LLDB_INVALID_REGNUM, // CVRegCR2
-LLDB_INVALID_REGNUM, // CVRegCR3
-LLDB_INVALID_REGNUM, // CVRegCR4
+LLDB_INVALID_REGNUM, // CR0
+LLDB_INVALID_REGNUM, // CR1
+LLDB_INVALID_REGNUM, // CR2
+LLDB_INVALID_REGNUM, // CR3
+LLDB_INVALID_REGNUM, // CR4
 LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
 LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
-lldb

[Lldb-commits] [lldb] r339920 - Fix lldb-vscode build on Windows

2018-08-16 Thread Reid Kleckner via lldb-commits
Author: rnk
Date: Thu Aug 16 11:24:59 2018
New Revision: 339920

URL: http://llvm.org/viewvc/llvm-project?rev=339920&view=rev
Log:
Fix lldb-vscode build on Windows

Include PosixAPI.h to get a PATH_MAX definition and replace CreateEvent
with CreateEventObject to avoid conflicts with the windows.h definition
of CreateEvent to CreateEventW.

Modified:
lldb/trunk/tools/lldb-vscode/JSONUtils.cpp
lldb/trunk/tools/lldb-vscode/JSONUtils.h
lldb/trunk/tools/lldb-vscode/VSCode.cpp
lldb/trunk/tools/lldb-vscode/lldb-vscode.cpp

Modified: lldb/trunk/tools/lldb-vscode/JSONUtils.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-vscode/JSONUtils.cpp?rev=339920&r1=339919&r2=339920&view=diff
==
--- lldb/trunk/tools/lldb-vscode/JSONUtils.cpp (original)
+++ lldb/trunk/tools/lldb-vscode/JSONUtils.cpp Thu Aug 16 11:24:59 2018
@@ -12,6 +12,7 @@
 #include "lldb/API/SBBreakpoint.h"
 #include "lldb/API/SBBreakpointLocation.h"
 #include "lldb/API/SBValue.h"
+#include "lldb/Host/PosixApi.h"
 
 #include "ExceptionBreakpoint.h"
 #include "JSONUtils.h"
@@ -351,7 +352,7 @@ void AppendBreakpoint(lldb::SBBreakpoint
 //   "required": [ "seq", "type" ]
 // }
 //--
-llvm::json::Object CreateEvent(const llvm::StringRef event_name) {
+llvm::json::Object CreateEventObject(const llvm::StringRef event_name) {
   llvm::json::Object event;
   event.try_emplace("seq", 0);
   event.try_emplace("type", "event");
@@ -734,7 +735,7 @@ llvm::json::Value CreateThread(lldb::SBT
 //--
 llvm::json::Value CreateThreadStopped(lldb::SBThread &thread,
   uint32_t stop_id) {
-  llvm::json::Object event(CreateEvent("stopped"));
+  llvm::json::Object event(CreateEventObject("stopped"));
   llvm::json::Object body;
   switch (thread.GetStopReason()) {
   case lldb::eStopReasonTrace:

Modified: lldb/trunk/tools/lldb-vscode/JSONUtils.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-vscode/JSONUtils.h?rev=339920&r1=339919&r2=339920&view=diff
==
--- lldb/trunk/tools/lldb-vscode/JSONUtils.h (original)
+++ lldb/trunk/tools/lldb-vscode/JSONUtils.h Thu Aug 16 11:24:59 2018
@@ -225,7 +225,7 @@ llvm::json::Value CreateBreakpoint(lldb:
 /// A "Event" JSON object with that follows the formal JSON
 /// definition outlined by Microsoft.
 //--
-llvm::json::Object CreateEvent(const llvm::StringRef event_name);
+llvm::json::Object CreateEventObject(const llvm::StringRef event_name);
 
 //--
 /// Create a "ExceptionBreakpointsFilter" JSON object as described in

Modified: lldb/trunk/tools/lldb-vscode/VSCode.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-vscode/VSCode.cpp?rev=339920&r1=339919&r2=339920&view=diff
==
--- lldb/trunk/tools/lldb-vscode/VSCode.cpp (original)
+++ lldb/trunk/tools/lldb-vscode/VSCode.cpp Thu Aug 16 11:24:59 2018
@@ -226,7 +226,7 @@ void VSCode::SendOutput(OutputType o, co
   if (output.empty())
 return;
 
-  llvm::json::Object event(CreateEvent("output"));
+  llvm::json::Object event(CreateEventObject("output"));
   llvm::json::Object body;
   const char *category = nullptr;
   switch (o) {

Modified: lldb/trunk/tools/lldb-vscode/lldb-vscode.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-vscode/lldb-vscode.cpp?rev=339920&r1=339919&r2=339920&view=diff
==
--- lldb/trunk/tools/lldb-vscode/lldb-vscode.cpp (original)
+++ lldb/trunk/tools/lldb-vscode/lldb-vscode.cpp Thu Aug 16 11:24:59 2018
@@ -122,7 +122,7 @@ std::vector MakeArgv(const
 // Send a "exited" event to indicate the process has exited.
 //--
 void SendProcessExitedEvent(lldb::SBProcess &process) {
-  llvm::json::Object event(CreateEvent("exited"));
+  llvm::json::Object event(CreateEventObject("exited"));
   llvm::json::Object body;
   body.try_emplace("exitCode", (int64_t)process.GetExitStatus());
   event.try_emplace("body", std::move(body));
@@ -130,7 +130,7 @@ void SendProcessExitedEvent(lldb::SBProc
 }
 
 void SendThreadExitedEvent(lldb::tid_t tid) {
-  llvm::json::Object event(CreateEvent("thread"));
+  llvm::json::Object event(CreateEventObject("thread"));
   llvm::json::Object body;
   body.try_emplace("reason", "exited");
   body.try_emplace("threadId", (int64_t)tid);
@@ -146,7 +146,7 @@ void SendTerminatedEvent() {
   if (!g_vsc.sent_terminated_event) {
 g_vsc.sent_terminated_event = true;
 // Send a "terminated" event

[Lldb-commits] [lldb] r298399 - Update for LLVM API rename of AttributeSet -> AttributeList

2017-03-21 Thread Reid Kleckner via lldb-commits
Author: rnk
Date: Tue Mar 21 12:09:20 2017
New Revision: 298399

URL: http://llvm.org/viewvc/llvm-project?rev=298399&view=rev
Log:
Update for LLVM API rename of AttributeSet -> AttributeList

Modified:

lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp

Modified: 
lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp?rev=298399&r1=298398&r2=298399&view=diff
==
--- 
lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp
 (original)
+++ 
lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp
 Tue Mar 21 12:09:20 2017
@@ -248,7 +248,7 @@ bool fixupRSAllocationStructByValCalls(l
 rs_functions.insert(call_inst->getCalledFunction());
 
 // get the function attributes
-llvm::AttributeSet call_attribs = call_inst->getAttributes();
+llvm::AttributeList call_attribs = call_inst->getAttributes();
 
 // iterate over the argument attributes
 for (size_t i = 1; i <= call_attribs.getNumSlots(); ++i) {
@@ -261,15 +261,12 @@ bool fixupRSAllocationStructByValCalls(l
 }
   }
 
-  llvm::AttributeSet attr_byval =
-  llvm::AttributeSet::get(module.getContext(), 1u, llvm::Attribute::ByVal);
-
   // for all called function decls
   for (auto func : rs_functions) {
 // inspect all of the arguments in the call
 for (auto &arg : func->args()) {
   if (arg.hasByValAttr()) {
-arg.removeAttr(attr_byval);
+arg.removeAttr(llvm::Attribute::ByVal));
 changed = true;
   }
 }


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r298402 - Remove stray paren that got in while attempting to fix the build for AttributeList

2017-03-21 Thread Reid Kleckner via lldb-commits
Author: rnk
Date: Tue Mar 21 12:15:50 2017
New Revision: 298402

URL: http://llvm.org/viewvc/llvm-project?rev=298402&view=rev
Log:
Remove stray paren that got in while attempting to fix the build for 
AttributeList

Modified:

lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp

Modified: 
lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp?rev=298402&r1=298401&r2=298402&view=diff
==
--- 
lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp
 (original)
+++ 
lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp
 Tue Mar 21 12:15:50 2017
@@ -266,7 +266,7 @@ bool fixupRSAllocationStructByValCalls(l
 // inspect all of the arguments in the call
 for (auto &arg : func->args()) {
   if (arg.hasByValAttr()) {
-arg.removeAttr(llvm::Attribute::ByVal));
+arg.removeAttr(llvm::Attribute::ByVal);
 changed = true;
   }
 }


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r313332 - Fix syntax in lldb lit.cfg

2017-09-14 Thread Reid Kleckner via lldb-commits
Author: rnk
Date: Thu Sep 14 18:30:52 2017
New Revision: 313332

URL: http://llvm.org/viewvc/llvm-project?rev=313332&view=rev
Log:
Fix syntax in lldb lit.cfg

Modified:
lldb/trunk/lit/lit.cfg

Modified: lldb/trunk/lit/lit.cfg
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/lit.cfg?rev=313332&r1=313331&r2=313332&view=diff
==
--- lldb/trunk/lit/lit.cfg (original)
+++ lldb/trunk/lit/lit.cfg Thu Sep 14 18:30:52 2017
@@ -46,7 +46,7 @@ config.environment['LD_LIBRARY_PATH'] =
 config.environment['LLVM_SRC_ROOT'] = getattr(config, 'llvm_src_root', '')
 
 # Propagate PYTHON_EXECUTABLE into the environment
-config.environment['PYTHON_EXECUTABLE'] = getattr(config, 'python_executable',
+config.environment['PYTHON_EXECUTABLE'] = getattr(config, 'python_executable', 
'')
 
 # Register substitutions
 config.substitutions.append(('%python', config.python_executable))


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r357658 - [codeview] Remove Type member from CVRecord

2019-04-03 Thread Reid Kleckner via lldb-commits
Author: rnk
Date: Wed Apr  3 17:28:48 2019
New Revision: 357658

URL: http://llvm.org/viewvc/llvm-project?rev=357658&view=rev
Log:
[codeview] Remove Type member from CVRecord

Summary:
Now CVType and CVSymbol are effectively type-safe wrappers around
ArrayRef. Make the kind() accessor load it from the
RecordPrefix, which is the same for types and symbols.

Reviewers: zturner, aganea

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D60018

Modified:
lldb/trunk/source/Plugins/SymbolFile/NativePDB/UdtRecordCompleter.cpp

Modified: lldb/trunk/source/Plugins/SymbolFile/NativePDB/UdtRecordCompleter.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/NativePDB/UdtRecordCompleter.cpp?rev=357658&r1=357657&r2=357658&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/NativePDB/UdtRecordCompleter.cpp 
(original)
+++ lldb/trunk/source/Plugins/SymbolFile/NativePDB/UdtRecordCompleter.cpp Wed 
Apr  3 17:28:48 2019
@@ -188,7 +188,7 @@ Error UdtRecordCompleter::visitKnownMemb
   TypeIndex method_list_idx = overloaded.MethodList;
 
   CVType method_list_type = m_tpi.getType(method_list_idx);
-  assert(method_list_type.Type == LF_METHODLIST);
+  assert(method_list_type.kind() == LF_METHODLIST);
 
   MethodOverloadListRecord method_list;
   llvm::cantFail(TypeDeserializer::deserializeAs(


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r298011 - Update for LLVM API removal of Function::getArgumentList()

2017-03-16 Thread Reid Kleckner via lldb-commits
Author: rnk
Date: Thu Mar 16 18:13:49 2017
New Revision: 298011

URL: http://llvm.org/viewvc/llvm-project?rev=298011&view=rev
Log:
Update for LLVM API removal of Function::getArgumentList()

Modified:
lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp

lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp

Modified: lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp?rev=298011&r1=298010&r2=298011&view=diff
==
--- lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp (original)
+++ lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp Thu Mar 16 
18:13:49 2017
@@ -1853,9 +1853,9 @@ bool IRForTarget::ReplaceVariables(Funct
   if (!m_decl_map->GetStructInfo(num_elements, size, alignment))
 return false;
 
-  Function::arg_iterator iter(llvm_function.getArgumentList().begin());
+  Function::arg_iterator iter(llvm_function.arg_begin());
 
-  if (iter == llvm_function.getArgumentList().end()) {
+  if (iter == llvm_function.arg_end()) {
 m_error_stream.Printf("Internal error [IRForTarget]: Wrapper takes no "
   "arguments (should take at least a struct pointer)");
 
@@ -1867,7 +1867,7 @@ bool IRForTarget::ReplaceVariables(Funct
   if (argument->getName().equals("this")) {
 ++iter;
 
-if (iter == llvm_function.getArgumentList().end()) {
+if (iter == llvm_function.arg_end()) {
   m_error_stream.Printf("Internal error [IRForTarget]: Wrapper takes only "
 "'this' argument (should take a struct pointer "
 "too)");
@@ -1879,7 +1879,7 @@ bool IRForTarget::ReplaceVariables(Funct
   } else if (argument->getName().equals("self")) {
 ++iter;
 
-if (iter == llvm_function.getArgumentList().end()) {
+if (iter == llvm_function.arg_end()) {
   m_error_stream.Printf("Internal error [IRForTarget]: Wrapper takes only "
 "'self' argument (should take '_cmd' and a struct "
 "pointer too)");
@@ -1897,7 +1897,7 @@ bool IRForTarget::ReplaceVariables(Funct
 
 ++iter;
 
-if (iter == llvm_function.getArgumentList().end()) {
+if (iter == llvm_function.arg_end()) {
   m_error_stream.Printf("Internal error [IRForTarget]: Wrapper takes only "
 "'self' and '_cmd' arguments (should take a struct 
"
 "pointer too)");

Modified: 
lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp?rev=298011&r1=298010&r2=298011&view=diff
==
--- 
lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp
 (original)
+++ 
lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp
 Thu Mar 16 18:13:49 2017
@@ -267,8 +267,7 @@ bool fixupRSAllocationStructByValCalls(l
   // for all called function decls
   for (auto func : rs_functions) {
 // inspect all of the arguments in the call
-llvm::SymbolTableList &arg_list = func->getArgumentList();
-for (auto &arg : arg_list) {
+for (auto &arg : func->args()) {
   if (arg.hasByValAttr()) {
 arg.removeAttr(attr_byval);
 changed = true;


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r259689 - Fix sign conversion warnings in LLDB Python unittests

2016-02-03 Thread Reid Kleckner via lldb-commits
Author: rnk
Date: Wed Feb  3 14:48:09 2016
New Revision: 259689

URL: http://llvm.org/viewvc/llvm-project?rev=259689&view=rev
Log:
Fix sign conversion warnings in LLDB Python unittests

Modified:
lldb/trunk/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp

Modified: 
lldb/trunk/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp?rev=259689&r1=259688&r2=259689&view=diff
==
--- lldb/trunk/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp 
(original)
+++ lldb/trunk/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp 
Wed Feb  3 14:48:09 2016
@@ -244,7 +244,6 @@ TEST_F(PythonDataObjectsTest, TestPython
 
 static const char *test_string = 
"PythonDataObjectsTest::TestPythonString1";
 static const char *test_string2 = 
"PythonDataObjectsTest::TestPythonString2";
-static const char *test_string3 = 
"PythonDataObjectsTest::TestPythonString3";
 
 #if PY_MAJOR_VERSION < 3
 // Verify that `PythonString` works correctly when given a PyString object.
@@ -266,8 +265,8 @@ TEST_F(PythonDataObjectsTest, TestPython
 
 // Test that creating a `PythonString` object works correctly with the
 // string constructor
-PythonString constructed_string(test_string3);
-EXPECT_STREQ(test_string3, constructed_string.GetString().str().c_str());
+PythonString constructed_string(test_string2);
+EXPECT_STREQ(test_string2, constructed_string.GetString().str().c_str());
 }
 
 TEST_F(PythonDataObjectsTest, TestPythonStringToStr)
@@ -289,7 +288,7 @@ TEST_F(PythonDataObjectsTest, TestPython
 {
 PythonInteger integer(7);
 auto int_sp = integer.CreateStructuredInteger();
-EXPECT_EQ(7, int_sp->GetValue());
+EXPECT_EQ(7U, int_sp->GetValue());
 }
 
 TEST_F(PythonDataObjectsTest, TestPythonStringToStructuredString)
@@ -304,7 +303,7 @@ TEST_F(PythonDataObjectsTest, TestPython
 {
 // Test that a list which is built through the native
 // Python API behaves correctly when wrapped by a PythonList.
-static const int list_size = 2;
+static const unsigned list_size = 2;
 static const long long_value0 = 5;
 static const char *const string_value1 = "String Index 1";
 
@@ -316,7 +315,7 @@ TEST_F(PythonDataObjectsTest, TestPython
 list_items[0].Reset(PythonInteger(long_value0));
 list_items[1].Reset(PythonString(string_value1));
 
-for (int i = 0; i < list_size; ++i)
+for (unsigned i = 0; i < list_size; ++i)
 list.SetItemAtIndex(i, list_items[i]);
 
 EXPECT_EQ(list_size, list.GetSize());
@@ -349,7 +348,7 @@ TEST_F(PythonDataObjectsTest, TestPython
 
 list.AppendItem(integer);
 list.AppendItem(string);
-EXPECT_EQ(2, list.GetSize());
+EXPECT_EQ(2U, list.GetSize());
 
 // Verify that the values match
 PythonObject chk_value1 = list.GetItemAtIndex(0);
@@ -380,17 +379,17 @@ TEST_F(PythonDataObjectsTest, TestPython
 auto int_sp = array_sp->GetItemAtIndex(0)->GetAsInteger();
 auto string_sp = array_sp->GetItemAtIndex(1)->GetAsString();
 
-EXPECT_EQ(long_value0, int_sp->GetValue());
+EXPECT_EQ(long_value0, long(int_sp->GetValue()));
 EXPECT_STREQ(string_value1, string_sp->GetValue().c_str());
 }
 
 TEST_F(PythonDataObjectsTest, TestPythonTupleSize)
 {
 PythonTuple tuple(PyInitialValue::Empty);
-EXPECT_EQ(0, tuple.GetSize());
+EXPECT_EQ(0U, tuple.GetSize());
 
 tuple = PythonTuple(3);
-EXPECT_EQ(3, tuple.GetSize());
+EXPECT_EQ(3U, tuple.GetSize());
 }
 
 TEST_F(PythonDataObjectsTest, TestPythonTupleValues)
@@ -416,7 +415,7 @@ TEST_F(PythonDataObjectsTest, TestPython
 PythonString string_value("Test");
 PythonObject none_value(PyRefType::Borrowed, Py_None);
 PythonTuple tuple{ int_value, string_value, none_value };
-EXPECT_EQ(3, tuple.GetSize());
+EXPECT_EQ(3U, tuple.GetSize());
 
 EXPECT_EQ(tuple.GetItemAtIndex(0).get(), int_value.get());
 EXPECT_EQ(tuple.GetItemAtIndex(1).get(), string_value.get());
@@ -430,7 +429,7 @@ TEST_F(PythonDataObjectsTest, TestPython
 PythonObject none_value(PyRefType::Borrowed, Py_None);
 
 PythonTuple tuple{ int_value.get(), string_value.get(), none_value.get() };
-EXPECT_EQ(3, tuple.GetSize());
+EXPECT_EQ(3U, tuple.GetSize());
 
 EXPECT_EQ(tuple.GetItemAtIndex(0).get(), int_value.get());
 EXPECT_EQ(tuple.GetItemAtIndex(1).get(), string_value.get());
@@ -454,7 +453,7 @@ TEST_F(PythonDataObjectsTest, TestPython
 {
 // Test that a dictionary which is built through the native
 // Python API behaves correctly when wrapped by a PythonDictionary.
-static const int dict_entries = 2;
+static const unsigned dict_entries = 2;
 const char *key_0 = "Key 0";
 int key_1 = 1;
 const int value_0 = 0;
@@ -472,7 +471,7 @@ TEST_F(PythonDataObjectsTest, TestPython
 EXPECT

[Lldb-commits] [compiler-rt] [clang] [flang] [clang-tools-extra] [mlir] [lldb] [llvm] [Profile] Add binary profile correlation for code coverage. (PR #69493)

2023-12-11 Thread Reid Kleckner via lldb-commits

rnk wrote:

@david-xl , Zequan posted an 
[RFC](https://discourse.llvm.org/t/rfc-add-binary-profile-correlation-to-not-load-profile-metadata-sections-into-memory-at-runtime/74565/8)
 for this. Is there a PGO tag, or something we can use to increase visibility 
for PGO reviewers? I think most of the complexity for this new mode is in the 
PGO code, so I think the best person to review it would be someone with an 
interest in PGO.

I'll tag some folks, but let me know if there is a better way: @kparzysz 
@snehasish 

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] [openmp] [lld] [mlir] [clang-tools-extra] [libcxx] [clang] [flang] [clang] Add `intrin0.h` header to mimic `intrin0.h` used by MSVC STL for clang-cl (PR #757

2024-01-09 Thread Reid Kleckner via lldb-commits

rnk wrote:

> > I would like some measurements so we can compare build times on Windows.
> 
> I took some benchmarks with `-ftime-trace` on the parse times with and 
> without this change. 
> ...
> clang-cl built with this PR frontend took ~1368ms to parse. `intrin.h` took 
> ~969ms to parse. Most of that time is from `` as expected. 
> `intrin0.h` took ~2ms to parse.

Thank you for remeasuring! Roughly speaking, anyone using a clang from between 
the time that this PR lands and they update the MSVC STL will experience a 1 
second slowdown in every compilation that didn't already use `immintrin.h`.

> We have some options. I am fine with whatever the consensus is as long as I 
> can move this over the finish line.
> 
> 1. Users who upgrade clang-cl before MSVC STL officially supports the new 
> version of clang-cl will suffer slower builds.
>I would classify this as an unsupported config since once VS ships with 
> support for the new clang-cl, intentionally building against an older 
> `VCToolsDir` will also incur the include overhead. Up to you guys if view 
> this as an unsupported config.
> 2. Add a config define that users can define to enable the old behaviour in 
> the interim. Once MSVC STL supports the new version of clang-cl we can remove 
> this config define in the next release.
> 3. Release clang with `intrin0.h`. Get a change into MSVC STL. Wait for MSVC 
> STL release. Release another clang with `intrin.h` changes. I am not well 
> versed on what changes clang allows in patch or minor releases but this feels 
> like it would have a long lag time before clang-cl can become usable for us.

I think I favor 2. Users (Chromium included) use recent versions of Clang that 
are not vendored by Microsoft. Users can also use the LLVM OSS releases. I 
think most users probably won't notice the compile time regression, and it will 
silently go away the next time the update MSVC, but if they do and they care 
(and this should be in the release notes), it would be nice to have a macro to 
get the old behavior. There may also be users permanently targeting old MSVC 
STL versions and they will never get the update to use `intrin0.h`, but I 
believe fewer people do this since MSVC stabilized the standard library ABI.

It would be nice to factor out the `!defined(__SCE__) || 
__has_feature(modules)` condition into something more descriptive like 
`__CLANG_ENABLE_ALL_INTEL_INTRIN`, to clean up the conditional includes 
regardless of whether we add this opt-out flag.

https://github.com/llvm/llvm-project/pull/75711
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [NFC][CodeGen] Change CodeGenOpt::{Level, FileType} into enum classes (PR #66295)

2023-09-13 Thread Reid Kleckner via lldb-commits

https://github.com/rnk commented:

Seems reasonable to me.

https://github.com/llvm/llvm-project/pull/66295
___
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] [compiler-rt] [flang] [lld] [lldb] [llvm] [mlir] [openmp] [pstl] Finally formalise our defacto line-ending policy (PR #86318)

2024-03-22 Thread Reid Kleckner via lldb-commits

rnk wrote:

I think it makes sense to remove carriage returns on checkin, but I'm not sure 
it makes sense to add them back on checkout on Windows. Historically, it's been 
really easy to write LLVM tests that fail when the source is checked out with 
CRLF. Many Windows developers have noted that LLVM tests fail when using the 
git config options to accomplish this. So, is there a way to do CRLF -> LF on 
checkin, but do nothing on checkout?

I think all modern editors on Windows can read LF files, it's just that they 
tend to prefer to write files out in CRLF, and that's the main source of 
friction.

https://github.com/llvm/llvm-project/pull/86318
___
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] [compiler-rt] [flang] [lld] [lldb] [llvm] [mlir] [openmp] [pstl] Finally formalise our defacto line-ending policy (PR #86318)

2024-03-22 Thread Reid Kleckner via lldb-commits

rnk wrote:

> As a data point, I've been setting core.autocrlf=true on Windows for years. 

If that's the case, my information is stale, which I accept.

> To be clear, this may do nothing on checkout if a user has set a config 
> option. 

That addresses my concerns.


https://github.com/llvm/llvm-project/pull/86318
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 34312ed - Remove unneeded Compiler.h and DataTypes.h includes, NFC

2020-02-26 Thread Reid Kleckner via lldb-commits

Author: Reid Kleckner
Date: 2020-02-26T10:36:17-08:00
New Revision: 34312ed24e17a0e8269611b954e489fa7759f115

URL: 
https://github.com/llvm/llvm-project/commit/34312ed24e17a0e8269611b954e489fa7759f115
DIFF: 
https://github.com/llvm/llvm-project/commit/34312ed24e17a0e8269611b954e489fa7759f115.diff

LOG: Remove unneeded Compiler.h and DataTypes.h includes, NFC

Added: 


Modified: 
lldb/source/Utility/Timer.cpp
llvm/include/llvm/Support/MathExtras.h
llvm/include/llvm/Support/SwapByteOrder.h

Removed: 




diff  --git a/lldb/source/Utility/Timer.cpp b/lldb/source/Utility/Timer.cpp
index 003afa1cb114..d55c9863117b 100644
--- a/lldb/source/Utility/Timer.cpp
+++ b/lldb/source/Utility/Timer.cpp
@@ -15,6 +15,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 

diff  --git a/llvm/include/llvm/Support/MathExtras.h 
b/llvm/include/llvm/Support/MathExtras.h
index 5ad055a4f478..67a96911a765 100644
--- a/llvm/include/llvm/Support/MathExtras.h
+++ b/llvm/include/llvm/Support/MathExtras.h
@@ -18,6 +18,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 

diff  --git a/llvm/include/llvm/Support/SwapByteOrder.h 
b/llvm/include/llvm/Support/SwapByteOrder.h
index 700ede7eb589..94ba1aa0a266 100644
--- a/llvm/include/llvm/Support/SwapByteOrder.h
+++ b/llvm/include/llvm/Support/SwapByteOrder.h
@@ -14,9 +14,8 @@
 #ifndef LLVM_SUPPORT_SWAPBYTEORDER_H
 #define LLVM_SUPPORT_SWAPBYTEORDER_H
 
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/DataTypes.h"
 #include 
+#include 
 #include 
 #if defined(_MSC_VER) && !defined(_DEBUG)
 #include 



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 4c2a656 - Avoid ASTContext.h -> TargetInfo.h dep

2020-02-27 Thread Reid Kleckner via lldb-commits

Author: Reid Kleckner
Date: 2020-02-27T14:35:00-08:00
New Revision: 4c2a6567bb12559cfc091bca2b25ae907cbd4e0f

URL: 
https://github.com/llvm/llvm-project/commit/4c2a6567bb12559cfc091bca2b25ae907cbd4e0f
DIFF: 
https://github.com/llvm/llvm-project/commit/4c2a6567bb12559cfc091bca2b25ae907cbd4e0f.diff

LOG: Avoid ASTContext.h -> TargetInfo.h dep

This has been done before in 2008: ab13857072
But these things regress easily.
Move some things out of line.

Saves 316 includes + transitive stuff:
316 -../clang/include/clang/Basic/TargetOptions.h
316 -../clang/include/clang/Basic/TargetInfo.h
316 -../clang/include/clang/Basic/TargetCXXABI.h
316 -../clang/include/clang/Basic/OpenCLOptions.h
316 -../clang/include/clang/Basic/OpenCLExtensions.def
302 -../llvm/include/llvm/Target/TargetOptions.h
302 -../llvm/include/llvm/Support/CodeGen.h
302 -../llvm/include/llvm/MC/MCTargetOptions.h
302 -../llvm/include/llvm/ADT/FloatingPointMode.h
302 -../clang/include/clang/Basic/XRayInstr.h
302 -../clang/include/clang/Basic/DebugInfoOptions.h
302 -../clang/include/clang/Basic/CodeGenOptions.h
302 -../clang/include/clang/Basic/CodeGenOptions.def
257 -../llvm/include/llvm/Support/Regex.h
 79 -../llvm/include/llvm/ADT/SmallSet.h
 68 -MSVCSTL/include/set
 66 -../llvm/include/llvm/ADT/SmallPtrSet.h
 62 -../llvm/include/llvm/ADT/StringSwitch.h

Added: 


Modified: 
clang/include/clang/AST/ASTContext.h
clang/include/clang/Basic/TargetInfo.h
clang/include/clang/StaticAnalyzer/Core/PathSensitive/SMTConstraintManager.h
clang/lib/AST/ASTContext.cpp
clang/lib/AST/Interp/ByteCodeExprGen.h
clang/lib/AST/Interp/Context.cpp
clang/lib/CodeGen/CodeGenModule.h
clang/lib/CodeGen/PatternInit.cpp
clang/unittests/CodeGen/TBAAMetadataTest.cpp
lldb/source/Plugins/Language/ObjC/NSArray.cpp

lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp

lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.cpp
lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h

Removed: 




diff  --git a/clang/include/clang/AST/ASTContext.h 
b/clang/include/clang/AST/ASTContext.h
index 2640c66cc8dd..92e5921fa375 100644
--- a/clang/include/clang/AST/ASTContext.h
+++ b/clang/include/clang/AST/ASTContext.h
@@ -39,7 +39,6 @@
 #include "clang/Basic/SanitizerBlacklist.h"
 #include "clang/Basic/SourceLocation.h"
 #include "clang/Basic/Specifiers.h"
-#include "clang/Basic/TargetInfo.h"
 #include "clang/Basic/XRayLists.h"
 #include "llvm/ADT/APSInt.h"
 #include "llvm/ADT/ArrayRef.h"
@@ -74,6 +73,7 @@
 namespace llvm {
 
 struct fltSemantics;
+template  class SmallPtrSet;
 
 } // namespace llvm
 
@@ -131,7 +131,6 @@ class VarTemplateDecl;
 class VTableContextBase;
 struct BlockVarCopyInit;
 
-
 namespace Builtin {
 
 class Context;
@@ -139,6 +138,7 @@ class Context;
 } // namespace Builtin
 
 enum BuiltinTemplateKind : int;
+enum OpenCLTypeKind : uint8_t;
 
 namespace comments {
 
@@ -1205,7 +1205,7 @@ class ASTContext : public RefCountedBase {
   QualType getBlockDescriptorExtendedType() const;
 
   /// Map an AST Type to an OpenCLTypeKind enum value.
-  TargetInfo::OpenCLTypeKind getOpenCLTypeKind(const Type *T) const;
+  OpenCLTypeKind getOpenCLTypeKind(const Type *T) const;
 
   /// Get address space for OpenCL type.
   LangAS getOpenCLTypeAddrSpace(const Type *T) const;
@@ -1635,23 +1635,9 @@ class ASTContext : public RefCountedBase {
 return NSCopyingName;
   }
 
-  CanQualType getNSUIntegerType() const {
-assert(Target && "Expected target to be initialized");
-const llvm::Triple &T = Target->getTriple();
-// Windows is LLP64 rather than LP64
-if (T.isOSWindows() && T.isArch64Bit())
-  return UnsignedLongLongTy;
-return UnsignedLongTy;
-  }
+  CanQualType getNSUIntegerType() const;
 
-  CanQualType getNSIntegerType() const {
-assert(Target && "Expected target to be initialized");
-const llvm::Triple &T = Target->getTriple();
-// Windows is LLP64 rather than LP64
-if (T.isOSWindows() && T.isArch64Bit())
-  return LongLongTy;
-return LongTy;
-  }
+  CanQualType getNSIntegerType() const;
 
   /// Retrieve the identifier 'bool'.
   IdentifierInfo *getBoolName() const {
@@ -2129,9 +2115,7 @@ class ASTContext : public RefCountedBase {
   /// Return the alignment (in bytes) of the thrown exception object. This is
   /// only meaningful for targets that allocate C++ exceptions in a system
   /// runtime, such as those using the Itanium C++ ABI.
-  CharUnits getExnObjectAlignment() const {
-return toCharUnitsFromBits(Target->getExnObjectAlignment());
-  }
+  CharUnits getExnObjectAlignment() const;
 
   /// Get or compute information about the layout of the specified
   /// record (struct/union/cla

[Lldb-commits] [lldb] e3a9b0f - [Support] Remove byte swapping from MathExtras.h

2020-02-27 Thread Reid Kleckner via lldb-commits

Author: Reid Kleckner
Date: 2020-02-27T17:23:48-08:00
New Revision: e3a9b0f35955ab0fdcba3da713bb2f4cd0b29680

URL: 
https://github.com/llvm/llvm-project/commit/e3a9b0f35955ab0fdcba3da713bb2f4cd0b29680
DIFF: 
https://github.com/llvm/llvm-project/commit/e3a9b0f35955ab0fdcba3da713bb2f4cd0b29680.diff

LOG: [Support] Remove byte swapping from MathExtras.h

MathExtras.h was just wrapping SwapByteOrder.h functionality, so have
the callers use it directly.  Use the MathExtras.h name (ByteSwap_NN) as
the standard naming, since it appears to be the most popular.

Added: 


Modified: 
lldb/include/lldb/Core/Opcode.h
llvm/include/llvm/Support/MathExtras.h
llvm/include/llvm/Support/SwapByteOrder.h
llvm/lib/Support/ConvertUTFWrapper.cpp
llvm/lib/Support/Triple.cpp
llvm/unittests/Support/MathExtrasTest.cpp
llvm/unittests/Support/SwapByteOrderTest.cpp

Removed: 




diff  --git a/lldb/include/lldb/Core/Opcode.h b/lldb/include/lldb/Core/Opcode.h
index f06ef38cfbd0..a812ae23f6b7 100644
--- a/lldb/include/lldb/Core/Opcode.h
+++ b/lldb/include/lldb/Core/Opcode.h
@@ -12,7 +12,7 @@
 #include "lldb/Utility/Endian.h"
 #include "lldb/lldb-enumerations.h"
 
-#include "llvm/Support/MathExtras.h"
+#include "llvm/Support/SwapByteOrder.h"
 
 #include 
 #include 

diff  --git a/llvm/include/llvm/Support/MathExtras.h 
b/llvm/include/llvm/Support/MathExtras.h
index 67a96911a765..f07d0b7d9f7e 100644
--- a/llvm/include/llvm/Support/MathExtras.h
+++ b/llvm/include/llvm/Support/MathExtras.h
@@ -14,7 +14,6 @@
 #define LLVM_SUPPORT_MATHEXTRAS_H
 
 #include "llvm/Support/Compiler.h"
-#include "llvm/Support/SwapByteOrder.h"
 #include 
 #include 
 #include 
@@ -470,21 +469,6 @@ constexpr inline bool isPowerOf2_64(uint64_t Value) {
   return Value && !(Value & (Value - 1));
 }
 
-/// Return a byte-swapped representation of the 16-bit argument.
-inline uint16_t ByteSwap_16(uint16_t Value) {
-  return sys::SwapByteOrder_16(Value);
-}
-
-/// Return a byte-swapped representation of the 32-bit argument.
-inline uint32_t ByteSwap_32(uint32_t Value) {
-  return sys::SwapByteOrder_32(Value);
-}
-
-/// Return a byte-swapped representation of the 64-bit argument.
-inline uint64_t ByteSwap_64(uint64_t Value) {
-  return sys::SwapByteOrder_64(Value);
-}
-
 /// Count the number of ones from the most significant bit to the first
 /// zero bit.
 ///

diff  --git a/llvm/include/llvm/Support/SwapByteOrder.h 
b/llvm/include/llvm/Support/SwapByteOrder.h
index a8bfc39c7049..a9f43735328f 100644
--- a/llvm/include/llvm/Support/SwapByteOrder.h
+++ b/llvm/include/llvm/Support/SwapByteOrder.h
@@ -42,19 +42,10 @@
 #endif
 
 namespace llvm {
-namespace sys {
-
-#if defined(BYTE_ORDER) && defined(BIG_ENDIAN) && BYTE_ORDER == BIG_ENDIAN
-constexpr bool IsBigEndianHost = true;
-#else
-constexpr bool IsBigEndianHost = false;
-#endif
 
-static const bool IsLittleEndianHost = !IsBigEndianHost;
-
-/// SwapByteOrder_16 - This function returns a byte-swapped representation of
+/// ByteSwap_16 - This function returns a byte-swapped representation of
 /// the 16-bit argument.
-inline uint16_t SwapByteOrder_16(uint16_t value) {
+inline uint16_t ByteSwap_16(uint16_t value) {
 #if defined(_MSC_VER) && !defined(_DEBUG)
   // The DLL version of the runtime lacks these functions (bug!?), but in a
   // release build they're replaced with BSWAP instructions anyway.
@@ -67,7 +58,7 @@ inline uint16_t SwapByteOrder_16(uint16_t value) {
 }
 
 /// This function returns a byte-swapped representation of the 32-bit argument.
-inline uint32_t SwapByteOrder_32(uint32_t value) {
+inline uint32_t ByteSwap_32(uint32_t value) {
 #if defined(__llvm__) || (defined(__GNUC__) && !defined(__ICC))
   return __builtin_bswap32(value);
 #elif defined(_MSC_VER) && !defined(_DEBUG)
@@ -82,44 +73,54 @@ inline uint32_t SwapByteOrder_32(uint32_t value) {
 }
 
 /// This function returns a byte-swapped representation of the 64-bit argument.
-inline uint64_t SwapByteOrder_64(uint64_t value) {
+inline uint64_t ByteSwap_64(uint64_t value) {
 #if defined(__llvm__) || (defined(__GNUC__) && !defined(__ICC))
   return __builtin_bswap64(value);
 #elif defined(_MSC_VER) && !defined(_DEBUG)
   return _byteswap_uint64(value);
 #else
-  uint64_t Hi = SwapByteOrder_32(uint32_t(value));
-  uint32_t Lo = SwapByteOrder_32(uint32_t(value >> 32));
+  uint64_t Hi = ByteSwap_32(uint32_t(value));
+  uint32_t Lo = ByteSwap_32(uint32_t(value >> 32));
   return (Hi << 32) | Lo;
 #endif
 }
 
+namespace sys {
+
+#if defined(BYTE_ORDER) && defined(BIG_ENDIAN) && BYTE_ORDER == BIG_ENDIAN
+constexpr bool IsBigEndianHost = true;
+#else
+constexpr bool IsBigEndianHost = false;
+#endif
+
+static const bool IsLittleEndianHost = !IsBigEndianHost;
+
 inline unsigned char  getSwappedBytes(unsigned char C) { return C; }
 inline   signed char  getSwappedBytes(signed char C) { return C; }
 inline  char  getSwappedBytes(char C) { return C

[Lldb-commits] [lldb] c915cb9 - Avoid including Module.h from ExternalASTSource.h

2020-03-11 Thread Reid Kleckner via lldb-commits

Author: Reid Kleckner
Date: 2020-03-11T13:37:41-07:00
New Revision: c915cb957dc37275ce1ca1a0b993239c82f12692

URL: 
https://github.com/llvm/llvm-project/commit/c915cb957dc37275ce1ca1a0b993239c82f12692
DIFF: 
https://github.com/llvm/llvm-project/commit/c915cb957dc37275ce1ca1a0b993239c82f12692.diff

LOG: Avoid including Module.h from ExternalASTSource.h

Module.h takes 86ms to parse, mostly parsing the class itself. Avoid it
if possible. ASTContext.h depends on ExternalASTSource.h.

A few NFC changes were needed to make this possible:

- Move ASTSourceDescriptor to Module.h. This needs Module to be
  complete, and seems more related to modules and AST files than
  external AST sources.
- Move "import complete" bit from Module* pointer int pair to
  NextLocalImport pointer. Required because PointerIntPair
  requires Module to be complete, and now it may not be.

Reviewed By: aaron.ballman, hans

Differential Revision: https://reviews.llvm.org/D75784

Added: 


Modified: 
clang/include/clang/AST/ASTContext.h
clang/include/clang/AST/Decl.h
clang/include/clang/AST/ExternalASTSource.h
clang/include/clang/Basic/Module.h
clang/include/clang/StaticAnalyzer/Frontend/CheckerRegistry.h
clang/lib/AST/ASTContext.cpp
clang/lib/AST/Decl.cpp
clang/lib/AST/ExternalASTSource.cpp
clang/lib/AST/ItaniumMangle.cpp
clang/lib/AST/TextNodeDumper.cpp
clang/lib/Basic/Module.cpp
clang/lib/CodeGen/CGDebugInfo.cpp
clang/lib/CodeGen/CGDebugInfo.h
clang/lib/Serialization/ASTReader.cpp
clang/lib/Serialization/ASTReaderDecl.cpp
lldb/source/Plugins/ExpressionParser/Clang/ASTUtils.h
lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h

Removed: 




diff  --git a/clang/include/clang/AST/ASTContext.h 
b/clang/include/clang/AST/ASTContext.h
index 92e5921fa375..75ab911d2459 100644
--- a/clang/include/clang/AST/ASTContext.h
+++ b/clang/include/clang/AST/ASTContext.h
@@ -121,6 +121,7 @@ class Preprocessor;
 class Stmt;
 class StoredDeclsMap;
 class TargetAttr;
+class TargetInfo;
 class TemplateDecl;
 class TemplateParameterList;
 class TemplateTemplateParmDecl;
@@ -881,7 +882,7 @@ class ASTContext : public RefCountedBase {
   void addedLocalImportDecl(ImportDecl *Import);
 
   static ImportDecl *getNextLocalImport(ImportDecl *Import) {
-return Import->NextLocalImport;
+return Import->getNextLocalImport();
   }
 
   using import_range = llvm::iterator_range;
@@ -909,13 +910,7 @@ class ASTContext : public RefCountedBase {
 
   /// Get the additional modules in which the definition \p Def has
   /// been merged.
-  ArrayRef getModulesWithMergedDefinition(const NamedDecl *Def) {
-auto MergedIt =
-MergedDefModules.find(cast(Def->getCanonicalDecl()));
-if (MergedIt == MergedDefModules.end())
-  return None;
-return MergedIt->second;
-  }
+  ArrayRef getModulesWithMergedDefinition(const NamedDecl *Def);
 
   /// Add a declaration to the list of declarations that are initialized
   /// for a module. This will typically be a global variable (with internal

diff  --git a/clang/include/clang/AST/Decl.h b/clang/include/clang/AST/Decl.h
index b31cbab50222..bc7676534175 100644
--- a/clang/include/clang/AST/Decl.h
+++ b/clang/include/clang/AST/Decl.h
@@ -4340,17 +4340,18 @@ class ImportDecl final : public Decl,
   friend class ASTReader;
   friend TrailingObjects;
 
-  /// The imported module, along with a bit that indicates whether
-  /// we have source-location information for each identifier in the module
-  /// name.
-  ///
-  /// When the bit is false, we only have a single source location for the
-  /// end of the import declaration.
-  llvm::PointerIntPair ImportedAndComplete;
+  /// The imported module.
+  Module *ImportedModule = nullptr;
 
   /// The next import in the list of imports local to the translation
   /// unit being parsed (not loaded from an AST file).
-  ImportDecl *NextLocalImport = nullptr;
+  ///
+  /// Includes a bit that indicates whether we have source-location information
+  /// for each identifier in the module name.
+  ///
+  /// When the bit is false, we only have a single source location for the
+  /// end of the import declaration.
+  llvm::PointerIntPair NextLocalImportAndComplete;
 
   ImportDecl(DeclContext *DC, SourceLocation StartLoc, Module *Imported,
  ArrayRef IdentifierLocs);
@@ -4360,6 +4361,20 @@ class ImportDecl final : public Decl,
 
   ImportDecl(EmptyShell Empty) : Decl(Import, Empty) {}
 
+  bool isImportComplete() const { return NextLocalImportAndComplete.getInt(); }
+
+  void setImportComplete(bool C) { NextLocalImportAndComplete.setInt(C); }
+
+  /// The next import in the list of imports local to the translation
+  /// unit being parsed (not loaded from an AST file).
+  ImportDecl *getNextLocalImport() const {
+return NextLocalImportAndComplete.getPointer();
+  }
+
+  void setNextLocalImport(ImportDecl *Im

[Lldb-commits] [lldb] e08464f - Avoid including FileManager.h from SourceManager.h

2020-03-11 Thread Reid Kleckner via lldb-commits

Author: Reid Kleckner
Date: 2020-03-11T13:53:12-07:00
New Revision: e08464fb450456881733c885267b32dc7339cf11

URL: 
https://github.com/llvm/llvm-project/commit/e08464fb450456881733c885267b32dc7339cf11
DIFF: 
https://github.com/llvm/llvm-project/commit/e08464fb450456881733c885267b32dc7339cf11.diff

LOG: Avoid including FileManager.h from SourceManager.h

Most clients of SourceManager.h need to do things like turning source
locations into file & line number pairs, but this doesn't require
bringing in FileManager.h and LLVM's FS headers.

The main code change here is to sink SM::createFileID into the cpp file.
I reason that this is not performance critical because it doesn't happen
on the diagnostic path, it happens along the paths of macro expansion
(could be hot) and new includes (less hot).

Saves some includes:
309 -
/usr/local/google/home/rnk/llvm-project/clang/include/clang/Basic/FileManager.h
272 -
/usr/local/google/home/rnk/llvm-project/clang/include/clang/Basic/FileSystemOptions.h
271 -
/usr/local/google/home/rnk/llvm-project/llvm/include/llvm/Support/VirtualFileSystem.h
267 -
/usr/local/google/home/rnk/llvm-project/llvm/include/llvm/Support/FileSystem.h
266 -
/usr/local/google/home/rnk/llvm-project/llvm/include/llvm/Support/Chrono.h

Differential Revision: https://reviews.llvm.org/D75406

Added: 


Modified: 
clang-tools-extra/clang-include-fixer/find-all-symbols/FindAllMacros.cpp
clang-tools-extra/clang-tidy/ExpandModularHeadersPPCallbacks.cpp
clang-tools-extra/clang-tidy/ExpandModularHeadersPPCallbacks.h
clang-tools-extra/clangd/Format.cpp
clang-tools-extra/pp-trace/PPCallbacksTracker.cpp
clang/include/clang/ASTMatchers/ASTMatchers.h
clang/include/clang/Basic/SourceManager.h
clang/include/clang/Frontend/CompilerInstance.h
clang/include/clang/Frontend/VerifyDiagnosticConsumer.h
clang/include/clang/Lex/DirectoryLookup.h
clang/include/clang/Lex/ModuleMap.h
clang/include/clang/Lex/PPCallbacks.h
clang/lib/AST/ExternalASTSource.cpp
clang/lib/AST/MicrosoftMangle.cpp
clang/lib/Basic/SanitizerBlacklist.cpp
clang/lib/Basic/SourceManager.cpp
clang/lib/Basic/XRayLists.cpp
clang/lib/CodeGen/CGOpenMPRuntime.cpp
clang/lib/CodeGen/CodeGenModule.cpp
clang/lib/CodeGen/CoverageMappingGen.cpp
clang/lib/Frontend/CompilerInstance.cpp
clang/lib/Frontend/PrecompiledPreamble.cpp
clang/lib/Index/CommentToXML.cpp
clang/lib/Index/USRGeneration.cpp
clang/lib/Lex/ModuleMap.cpp
clang/lib/Lex/PPCallbacks.cpp
clang/lib/Lex/PPLexerChange.cpp
clang/lib/Parse/Parser.cpp
clang/lib/StaticAnalyzer/Core/SarifDiagnostics.cpp
clang/lib/Tooling/Inclusions/HeaderIncludes.cpp
clang/tools/clang-import-test/clang-import-test.cpp
clang/tools/clang-refactor/TestSupport.cpp
clang/tools/libclang/CXSourceLocation.cpp
clang/unittests/Frontend/ASTUnitTest.cpp
clang/unittests/Frontend/CompilerInstanceTest.cpp
lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp
lldb/source/Plugins/Language/ClangCommon/ClangHighlighter.cpp

Removed: 




diff  --git 
a/clang-tools-extra/clang-include-fixer/find-all-symbols/FindAllMacros.cpp 
b/clang-tools-extra/clang-include-fixer/find-all-symbols/FindAllMacros.cpp
index ed1bc2f490ae..0f6ebbf2e23b 100644
--- a/clang-tools-extra/clang-include-fixer/find-all-symbols/FindAllMacros.cpp
+++ b/clang-tools-extra/clang-include-fixer/find-all-symbols/FindAllMacros.cpp
@@ -10,6 +10,7 @@
 #include "HeaderMapCollector.h"
 #include "PathConfig.h"
 #include "SymbolInfo.h"
+#include "clang/Basic/FileManager.h"
 #include "clang/Basic/IdentifierTable.h"
 #include "clang/Basic/SourceManager.h"
 #include "clang/Lex/MacroInfo.h"

diff  --git a/clang-tools-extra/clang-tidy/ExpandModularHeadersPPCallbacks.cpp 
b/clang-tools-extra/clang-tidy/ExpandModularHeadersPPCallbacks.cpp
index 483177454527..7e5501ccc60a 100644
--- a/clang-tools-extra/clang-tidy/ExpandModularHeadersPPCallbacks.cpp
+++ b/clang-tools-extra/clang-tidy/ExpandModularHeadersPPCallbacks.cpp
@@ -7,6 +7,7 @@
 
//===--===//
 
 #include "ExpandModularHeadersPPCallbacks.h"
+#include "clang/Basic/FileManager.h"
 #include "clang/Frontend/CompilerInstance.h"
 #include "clang/Lex/PreprocessorOptions.h"
 #include "clang/Serialization/ASTReader.h"

diff  --git a/clang-tools-extra/clang-tidy/ExpandModularHeadersPPCallbacks.h 
b/clang-tools-extra/clang-tidy/ExpandModularHeadersPPCallbacks.h
index 30c8236e7f91..fe1b00b4680a 100644
--- a/clang-tools-extra/clang-tidy/ExpandModularHeadersPPCallbacks.h
+++ b/clang-tools-extra/clang-tidy/ExpandModularHeadersPPCallbacks.h
@@ -13,6 +13,13 @@
 #include "clang/Lex/Preprocessor.h"
 #include "llvm/ADT/DenseSet.h"
 
+namespace llvm {
+namespace vfs {
+class OverlayFileSystem;
+class InMemoryFil

[Lldb-commits] [lldb] 213aea4 - Remove unused Endian.h includes, NFC

2020-03-11 Thread Reid Kleckner via lldb-commits

Author: Reid Kleckner
Date: 2020-03-11T15:45:34-07:00
New Revision: 213aea4c5836934771eb97eb97e4c964053a8596

URL: 
https://github.com/llvm/llvm-project/commit/213aea4c5836934771eb97eb97e4c964053a8596
DIFF: 
https://github.com/llvm/llvm-project/commit/213aea4c5836934771eb97eb97e4c964053a8596.diff

LOG: Remove unused Endian.h includes, NFC

Mainly avoids including Host.h everywhere:

$ diff -u <(sort thedeps-before.txt) <(sort thedeps-after.txt) \
| grep '^[-+] ' | sort | uniq -c | sort -nr
   3141 - 
/usr/local/google/home/rnk/llvm-project/llvm/include/llvm/Support/Host.h

Added: 


Modified: 
clang/lib/Driver/Distro.cpp
clang/lib/Driver/Driver.cpp
clang/lib/Driver/ToolChains/Cuda.cpp
clang/lib/Tooling/ExpandResponseFilesCompilationDatabase.cpp
clang/tools/driver/cc1gen_reproducer_main.cpp
clang/unittests/AST/StructuralEquivalenceTest.cpp
clang/unittests/CodeGen/TBAAMetadataTest.cpp
clang/unittests/Driver/DistroTest.cpp
clang/unittests/Tooling/RecursiveASTVisitorTests/LambdaExpr.cpp
lld/ELF/DriverUtils.cpp
lld/MinGW/Driver.cpp
lld/wasm/Driver.cpp
lldb/source/Plugins/SymbolFile/NativePDB/DWARFLocationExpression.h
llvm/include/llvm/Support/Endian.h
llvm/tools/llvm-ar/llvm-ar.cpp
llvm/tools/llvm-exegesis/lib/LlvmState.cpp
llvm/tools/llvm-objcopy/llvm-objcopy.cpp
llvm/unittests/Support/CommandLineTest.cpp

Removed: 




diff  --git a/clang/lib/Driver/Distro.cpp b/clang/lib/Driver/Distro.cpp
index 06707fefc9d0..acfde7d8bd0b 100644
--- a/clang/lib/Driver/Distro.cpp
+++ b/clang/lib/Driver/Distro.cpp
@@ -11,9 +11,10 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/ADT/StringSwitch.h"
+#include "llvm/ADT/Triple.h"
 #include "llvm/Support/ErrorOr.h"
+#include "llvm/Support/Host.h"
 #include "llvm/Support/MemoryBuffer.h"
-#include "llvm/ADT/Triple.h"
 
 using namespace clang::driver;
 using namespace clang;

diff  --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index 642b00b57fb6..37761893f137 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -38,8 +38,8 @@
 #include "ToolChains/NaCl.h"
 #include "ToolChains/NetBSD.h"
 #include "ToolChains/OpenBSD.h"
-#include "ToolChains/PS4CPU.h"
 #include "ToolChains/PPCLinux.h"
+#include "ToolChains/PS4CPU.h"
 #include "ToolChains/RISCVToolchain.h"
 #include "ToolChains/Solaris.h"
 #include "ToolChains/TCE.h"
@@ -71,6 +71,7 @@
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/FormatVariadic.h"
+#include "llvm/Support/Host.h"
 #include "llvm/Support/Path.h"
 #include "llvm/Support/PrettyStackTrace.h"
 #include "llvm/Support/Process.h"

diff  --git a/clang/lib/Driver/ToolChains/Cuda.cpp 
b/clang/lib/Driver/ToolChains/Cuda.cpp
index d6050925cd9e..01c5a9175da2 100644
--- a/clang/lib/Driver/ToolChains/Cuda.cpp
+++ b/clang/lib/Driver/ToolChains/Cuda.cpp
@@ -18,6 +18,7 @@
 #include "clang/Driver/Options.h"
 #include "llvm/Option/ArgList.h"
 #include "llvm/Support/FileSystem.h"
+#include "llvm/Support/Host.h"
 #include "llvm/Support/Path.h"
 #include "llvm/Support/Process.h"
 #include "llvm/Support/Program.h"

diff  --git a/clang/lib/Tooling/ExpandResponseFilesCompilationDatabase.cpp 
b/clang/lib/Tooling/ExpandResponseFilesCompilationDatabase.cpp
index 99298316718b..f1ab2aed54c0 100644
--- a/clang/lib/Tooling/ExpandResponseFilesCompilationDatabase.cpp
+++ b/clang/lib/Tooling/ExpandResponseFilesCompilationDatabase.cpp
@@ -12,6 +12,7 @@
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/ConvertUTF.h"
 #include "llvm/Support/ErrorOr.h"
+#include "llvm/Support/Host.h"
 #include "llvm/Support/MemoryBuffer.h"
 #include "llvm/Support/Path.h"
 #include "llvm/Support/StringSaver.h"

diff  --git a/clang/tools/driver/cc1gen_reproducer_main.cpp 
b/clang/tools/driver/cc1gen_reproducer_main.cpp
index 4aadab7301bc..472055ee2170 100644
--- a/clang/tools/driver/cc1gen_reproducer_main.cpp
+++ b/clang/tools/driver/cc1gen_reproducer_main.cpp
@@ -18,6 +18,7 @@
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/Support/FileSystem.h"
+#include "llvm/Support/Host.h"
 #include "llvm/Support/TargetSelect.h"
 #include "llvm/Support/VirtualFileSystem.h"
 #include "llvm/Support/YAMLTraits.h"

diff  --git a/clang/unittests/AST/StructuralEquivalenceTest.cpp 
b/clang/unittests/AST/StructuralEquivalenceTest.cpp
index 8e467527eadb..493b847fa5fa 100644
--- a/clang/unittests/AST/StructuralEquivalenceTest.cpp
+++ b/clang/unittests/AST/StructuralEquivalenceTest.cpp
@@ -1,8 +1,9 @@
 #include "clang/AST/ASTContext.h"
-#include "clang/ASTMatchers/ASTMatchers.h"
 #include "clang/AST/ASTStructuralEquivalence.h"
+#include "clang/ASTMatchers/ASTMatchers.h"
 #include "clang/Frontend/ASTUnit.h"
 #include "clang/Tooling/Tooling.h"
+#include "llvm/Support/Host.h"
 
 #include "Language.h"
 #include 

Re: [Lldb-commits] Upcoming upgrade of LLVM buildbot

2020-10-12 Thread Reid Kleckner via lldb-commits
On Wed, Oct 7, 2020 at 4:32 PM Galina Kistanova via lldb-commits <
lldb-commits@lists.llvm.org> wrote:

> They are online now - http://lab.llvm.org:8011/#/waterfall?tags=sanitizer
>
> AnnotatedCommand has severe design conflict with the new buildbot.
> We have changed it to be safe and still do something useful, but it will
> need more love and care.
>
> Please let me know if you have some spare time to work on porting
> AnnotatedCommand.
>

That's unfortunate, it would've been good to know that earlier. I and
another team member have spent a fair amount of time porting things to use
more AnnotatedCommand steps, because it gives us the flexibility to test
steps locally and make changes to the steps without restarting the buildbot
master. IMO that is the Right Way to define steps: a script that you can
run locally on a machine that satisfies the OS and dep requirements of the
script.

I am restarting the two bots that I am responsible for, and may need some
help debugging further issues soon. I'll let you know.
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] Upcoming upgrade of LLVM buildbot

2020-10-13 Thread Reid Kleckner via lldb-commits
FWIW, I don't see any issues with my two bots that use buildbot annotated
commands:
http://lab.llvm.org:8011/#/builders/sanitizer-windows
http://lab.llvm.org:8011/#/builders/clang-x64-windows-msvc
The individual steps don't highlight as green or red, but that's OK for now.

On Mon, Oct 12, 2020 at 7:19 PM Galina Kistanova 
wrote:

> We have a better version of AnnotatedCommand on the staging. It should be
> a functional equivalent of the old one.
> We need to stress test it well before moving to the production build bot.
>
> For that we need all sanitizer + other bots which use the AnnotatedCommand
> directly or indirectly moved temporarily to the staging.
>
> Please let me know when that could be arranged.
>
> Thanks
>
> Galina
>
> On Mon, Oct 12, 2020 at 11:39 AM Reid Kleckner  wrote:
>
>> On Wed, Oct 7, 2020 at 4:32 PM Galina Kistanova via lldb-commits <
>> lldb-commits@lists.llvm.org> wrote:
>>
>>> They are online now -
>>> http://lab.llvm.org:8011/#/waterfall?tags=sanitizer
>>>
>>> AnnotatedCommand has severe design conflict with the new buildbot.
>>> We have changed it to be safe and still do something useful, but it will
>>> need more love and care.
>>>
>>> Please let me know if you have some spare time to work on porting
>>> AnnotatedCommand.
>>>
>>
>> That's unfortunate, it would've been good to know that earlier. I and
>> another team member have spent a fair amount of time porting things to use
>> more AnnotatedCommand steps, because it gives us the flexibility to test
>> steps locally and make changes to the steps without restarting the buildbot
>> master. IMO that is the Right Way to define steps: a script that you can
>> run locally on a machine that satisfies the OS and dep requirements of the
>> script.
>>
>> I am restarting the two bots that I am responsible for, and may need some
>> help debugging further issues soon. I'll let you know.
>>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 90c64a3 - Move endian constant from Host.h to SwapByteOrder.h, prune include

2019-10-18 Thread Reid Kleckner via lldb-commits

Author: Reid Kleckner
Date: 2019-10-19T00:48:11Z
New Revision: 90c64a3456b972432a21ef043b205c18a91e011b

URL: 
https://github.com/llvm/llvm-project/commit/90c64a3456b972432a21ef043b205c18a91e011b
DIFF: 
https://github.com/llvm/llvm-project/commit/90c64a3456b972432a21ef043b205c18a91e011b.diff

LOG: Move endian constant from Host.h to SwapByteOrder.h, prune include

Works on this dependency chain:
  ArrayRef.h ->
  Hashing.h -> --CUT--
  Host.h ->
  StringMap.h / StringRef.h

ArrayRef is very popular, but Host.h is rarely needed. Move the
IsBigEndianHost constant to SwapByteOrder.h. Clients of that header are
more likely to need it.

llvm-svn: 375316

Added: 


Modified: 
clang-tools-extra/clangd/FileDistance.h
clang/lib/Driver/ToolChains/Arch/AArch64.cpp
clang/lib/Driver/ToolChains/Arch/ARM.cpp
clang/lib/Driver/ToolChains/Arch/PPC.cpp
clang/lib/Driver/ToolChains/Arch/X86.cpp
lld/include/lld/Common/LLVM.h
lld/include/lld/Core/File.h
lld/lib/ReaderWriter/MachO/DebugInfo.h
lld/tools/lld/lld.cpp
lldb/include/lldb/Utility/UUID.h
llvm/include/llvm/ADT/Hashing.h
llvm/include/llvm/BinaryFormat/Wasm.h
llvm/include/llvm/Support/Host.h
llvm/include/llvm/Support/SHA1.h
llvm/include/llvm/Support/SwapByteOrder.h
llvm/lib/ExecutionEngine/Orc/JITTargetMachineBuilder.cpp
llvm/lib/Support/Windows/WindowsSupport.h
llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.cpp
llvm/tools/llvm-exegesis/lib/RegisterValue.cpp

Removed: 




diff  --git a/clang-tools-extra/clangd/FileDistance.h 
b/clang-tools-extra/clangd/FileDistance.h
index e7174bccb9dd..88bb30c14270 100644
--- a/clang-tools-extra/clangd/FileDistance.h
+++ b/clang-tools-extra/clangd/FileDistance.h
@@ -43,6 +43,7 @@
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/DenseMapInfo.h"
 #include "llvm/ADT/SmallString.h"
+#include "llvm/ADT/StringMap.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/Allocator.h"
 #include "llvm/Support/Path.h"

diff  --git a/clang/lib/Driver/ToolChains/Arch/AArch64.cpp 
b/clang/lib/Driver/ToolChains/Arch/AArch64.cpp
index 35d11f4e2d3b..3a5fe6ddeaed 100644
--- a/clang/lib/Driver/ToolChains/Arch/AArch64.cpp
+++ b/clang/lib/Driver/ToolChains/Arch/AArch64.cpp
@@ -12,6 +12,7 @@
 #include "clang/Driver/Options.h"
 #include "llvm/Option/ArgList.h"
 #include "llvm/Support/TargetParser.h"
+#include "llvm/Support/Host.h"
 
 using namespace clang::driver;
 using namespace clang::driver::tools;

diff  --git a/clang/lib/Driver/ToolChains/Arch/ARM.cpp 
b/clang/lib/Driver/ToolChains/Arch/ARM.cpp
index b99a1b4d3694..68a57310ad40 100644
--- a/clang/lib/Driver/ToolChains/Arch/ARM.cpp
+++ b/clang/lib/Driver/ToolChains/Arch/ARM.cpp
@@ -13,6 +13,7 @@
 #include "llvm/ADT/StringSwitch.h"
 #include "llvm/Option/ArgList.h"
 #include "llvm/Support/TargetParser.h"
+#include "llvm/Support/Host.h"
 
 using namespace clang::driver;
 using namespace clang::driver::tools;

diff  --git a/clang/lib/Driver/ToolChains/Arch/PPC.cpp 
b/clang/lib/Driver/ToolChains/Arch/PPC.cpp
index 59ff7cbc787c..3e02e57e0f6c 100644
--- a/clang/lib/Driver/ToolChains/Arch/PPC.cpp
+++ b/clang/lib/Driver/ToolChains/Arch/PPC.cpp
@@ -13,6 +13,7 @@
 #include "clang/Driver/Options.h"
 #include "llvm/ADT/StringSwitch.h"
 #include "llvm/Option/ArgList.h"
+#include "llvm/Support/Host.h"
 
 using namespace clang::driver;
 using namespace clang::driver::tools;

diff  --git a/clang/lib/Driver/ToolChains/Arch/X86.cpp 
b/clang/lib/Driver/ToolChains/Arch/X86.cpp
index 34be226b69e9..d2b97bf6ad71 100644
--- a/clang/lib/Driver/ToolChains/Arch/X86.cpp
+++ b/clang/lib/Driver/ToolChains/Arch/X86.cpp
@@ -13,6 +13,7 @@
 #include "clang/Driver/Options.h"
 #include "llvm/ADT/StringSwitch.h"
 #include "llvm/Option/ArgList.h"
+#include "llvm/Support/Host.h"
 
 using namespace clang::driver;
 using namespace clang::driver::tools;

diff  --git a/lld/include/lld/Common/LLVM.h b/lld/include/lld/Common/LLVM.h
index f7ed1d793ca7..34b7b0d194ab 100644
--- a/lld/include/lld/Common/LLVM.h
+++ b/lld/include/lld/Common/LLVM.h
@@ -17,6 +17,7 @@
 // This should be the only #include, force #includes of all the others on
 // clients.
 #include "llvm/ADT/Hashing.h"
+#include "llvm/ADT/StringRef.h"
 #include "llvm/Support/Casting.h"
 #include 
 

diff  --git a/lld/include/lld/Core/File.h b/lld/include/lld/Core/File.h
index 492f35989f16..df014669eb62 100644
--- a/lld/include/lld/Core/File.h
+++ b/lld/include/lld/Core/File.h
@@ -16,6 +16,7 @@
 #include "llvm/ADT/Optional.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/Twine.h"
+#include "llvm/Support/Allocator.h"
 #include "llvm/Support/ErrorHandling.h"
 #include 
 #include 

diff  --git a/lld/lib/ReaderWriter/MachO/DebugInfo.h 
b/lld/lib/ReaderWriter/MachO/DebugInfo.h
index 959e10f9a073..591dd1ebad86 100644
--- a/lld/lib/ReaderWriter/MachO/DebugInfo.h
+++ b/lld/lib/ReaderWriter/Ma

[Lldb-commits] [lldb] bfe663c - Revert a hunk from 9634064cfa1b9bf7b7

2019-11-13 Thread Reid Kleckner via lldb-commits

Author: Reid Kleckner
Date: 2019-11-13T15:43:54-08:00
New Revision: bfe663ce22db6697459510ae5c139da2197df56c

URL: 
https://github.com/llvm/llvm-project/commit/bfe663ce22db6697459510ae5c139da2197df56c
DIFF: 
https://github.com/llvm/llvm-project/commit/bfe663ce22db6697459510ae5c139da2197df56c.diff

LOG: Revert a hunk from 9634064cfa1b9bf7b7

This causes errors when building LLDB because the Windows implementation
doesn't implement this method:

C:\src\llvm-project\lldb\source\Plugins\ScriptInterpreter\Python\ScriptInterpreterPython.cpp(915,19):
 error: allocating an object of abstract class type 
'lldb_private::ConnectionGenericFile'
  new ConnectionGenericFile(read_file, true));
  ^
C:\src\llvm-project\lldb\include\lldb/Utility/Connection.h(174,28): note: 
unimplemented pure virtual method 'GetReadObject' in 'ConnectionGenericFile'
  virtual lldb::IOObjectSP GetReadObject() = 0;
   ^

Added: 


Modified: 
lldb/include/lldb/Utility/Connection.h

Removed: 




diff  --git a/lldb/include/lldb/Utility/Connection.h 
b/lldb/include/lldb/Utility/Connection.h
index 2ff905d11833..9e66dee1363b 100644
--- a/lldb/include/lldb/Utility/Connection.h
+++ b/lldb/include/lldb/Utility/Connection.h
@@ -171,7 +171,7 @@ class Connection {
   ///
   /// \return
   /// The underlying IOObject used for reading.
-  virtual lldb::IOObjectSP GetReadObject() = 0;
+  virtual lldb::IOObjectSP GetReadObject() { return lldb::IOObjectSP(); };
 
 private:
   // For Connection only



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] a36f316 - Forward declare Optional in STLExtras.h

2019-11-13 Thread Reid Kleckner via lldb-commits

Author: Reid Kleckner
Date: 2019-11-13T16:34:00-08:00
New Revision: a36f316390d4bc1bcb0e9de0f55831385ab24099

URL: 
https://github.com/llvm/llvm-project/commit/a36f316390d4bc1bcb0e9de0f55831385ab24099
DIFF: 
https://github.com/llvm/llvm-project/commit/a36f316390d4bc1bcb0e9de0f55831385ab24099.diff

LOG: Forward declare Optional in STLExtras.h

WIP stats

Added: 


Modified: 
lldb/include/lldb/Utility/UserIDResolver.h
llvm/include/llvm/ADT/STLExtras.h
llvm/include/llvm/ADT/StringSwitch.h
llvm/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h
llvm/include/llvm/Support/CachePruning.h
llvm/include/llvm/Support/Error.h
llvm/include/llvm/Support/Format.h
llvm/include/llvm/Support/Threading.h
llvm/lib/MC/MCInstrAnalysis.cpp
llvm/lib/Support/CrashRecoveryContext.cpp
llvm/lib/Support/DJB.cpp

Removed: 




diff  --git a/lldb/include/lldb/Utility/UserIDResolver.h 
b/lldb/include/lldb/Utility/UserIDResolver.h
index bca82a11b660..60f3982f573d 100644
--- a/lldb/include/lldb/Utility/UserIDResolver.h
+++ b/lldb/include/lldb/Utility/UserIDResolver.h
@@ -10,6 +10,7 @@
 #define LLDB_UTILITY_USERIDRESOLVER_H
 
 #include "llvm/ADT/DenseMap.h"
+#include "llvm/ADT/Optional.h"
 #include "llvm/ADT/StringRef.h"
 #include 
 

diff  --git a/llvm/include/llvm/ADT/STLExtras.h 
b/llvm/include/llvm/ADT/STLExtras.h
index 274933bc5204..c3b704c3fd79 100644
--- a/llvm/include/llvm/ADT/STLExtras.h
+++ b/llvm/include/llvm/ADT/STLExtras.h
@@ -16,8 +16,6 @@
 #ifndef LLVM_ADT_STLEXTRAS_H
 #define LLVM_ADT_STLEXTRAS_H
 
-#include "llvm/ADT/Optional.h"
-#include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/iterator.h"
 #include "llvm/ADT/iterator_range.h"
 #include "llvm/Config/abi-breaking.h"
@@ -42,6 +40,9 @@
 
 namespace llvm {
 
+template  class Optional;
+template  class SmallVector;
+
 // Only used by compiler if both template types are the same.  Useful when
 // using SFINAE to test for the existence of member functions.
 template  struct SameType;

diff  --git a/llvm/include/llvm/ADT/StringSwitch.h 
b/llvm/include/llvm/ADT/StringSwitch.h
index fea911f6928b..d2a657ecbbee 100644
--- a/llvm/include/llvm/ADT/StringSwitch.h
+++ b/llvm/include/llvm/ADT/StringSwitch.h
@@ -12,6 +12,7 @@
 #ifndef LLVM_ADT_STRINGSWITCH_H
 #define LLVM_ADT_STRINGSWITCH_H
 
+#include "llvm/ADT/Optional.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/Compiler.h"
 #include 

diff  --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h 
b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h
index c6539df0d756..5edf92a95f84 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h
@@ -10,9 +10,10 @@
 #define LLVM_DEBUGINFO_DWARF_DWARFDEBUGFRAME_H
 
 #include "llvm/ADT/ArrayRef.h"
-#include "llvm/ADT/iterator.h"
+#include "llvm/ADT/Optional.h"
 #include "llvm/ADT/SmallString.h"
 #include "llvm/ADT/Triple.h"
+#include "llvm/ADT/iterator.h"
 #include "llvm/DebugInfo/DWARF/DWARFDataExtractor.h"
 #include "llvm/DebugInfo/DWARF/DWARFExpression.h"
 #include "llvm/Support/Error.h"

diff  --git a/llvm/include/llvm/Support/CachePruning.h 
b/llvm/include/llvm/Support/CachePruning.h
index a72a86439f6a..297aa6d1ab8b 100644
--- a/llvm/include/llvm/Support/CachePruning.h
+++ b/llvm/include/llvm/Support/CachePruning.h
@@ -14,6 +14,7 @@
 #ifndef LLVM_SUPPORT_CACHE_PRUNING_H
 #define LLVM_SUPPORT_CACHE_PRUNING_H
 
+#include "llvm/ADT/Optional.h"
 #include "llvm/ADT/StringRef.h"
 #include 
 

diff  --git a/llvm/include/llvm/Support/Error.h 
b/llvm/include/llvm/Support/Error.h
index 350877a219bf..01bfc4a5fb5f 100644
--- a/llvm/include/llvm/Support/Error.h
+++ b/llvm/include/llvm/Support/Error.h
@@ -14,6 +14,7 @@
 #define LLVM_SUPPORT_ERROR_H
 
 #include "llvm-c/Error.h"
+#include "llvm/ADT/Optional.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringExtras.h"

diff  --git a/llvm/include/llvm/Support/Format.h 
b/llvm/include/llvm/Support/Format.h
index 9dd7b401b46a..3f5251ca8d24 100644
--- a/llvm/include/llvm/Support/Format.h
+++ b/llvm/include/llvm/Support/Format.h
@@ -23,6 +23,7 @@
 #define LLVM_SUPPORT_FORMAT_H
 
 #include "llvm/ADT/ArrayRef.h"
+#include "llvm/ADT/Optional.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/DataTypes.h"

diff  --git a/llvm/include/llvm/Support/Threading.h 
b/llvm/include/llvm/Support/Threading.h
index bacab8fa23b6..f53c116f0d44 100644
--- a/llvm/include/llvm/Support/Threading.h
+++ b/llvm/include/llvm/Support/Threading.h
@@ -15,6 +15,7 @@
 #define LLVM_SUPPORT_THREADING_H
 
 #include "llvm/ADT/FunctionExtras.h"
+#include "llvm/ADT/Optional.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/Config/llvm-config.h" // for LLVM_ON_UNIX
 #include "llvm/Support/Compiler.h"

diff  --git a/llvm/lib/MC/MCInstrAnalysis.cpp b/llvm/lib/MC/MCInstrAnalysis.cpp
index 54741fdd686

[Lldb-commits] [lldb] 5565d36 - Revert "Forward declare Optional in STLExtras.h"

2019-11-13 Thread Reid Kleckner via lldb-commits

Author: Reid Kleckner
Date: 2019-11-13T16:36:21-08:00
New Revision: 5565d365f2af0f6d17f12ed1a980e6d9415a6607

URL: 
https://github.com/llvm/llvm-project/commit/5565d365f2af0f6d17f12ed1a980e6d9415a6607
DIFF: 
https://github.com/llvm/llvm-project/commit/5565d365f2af0f6d17f12ed1a980e6d9415a6607.diff

LOG: Revert "Forward declare Optional in STLExtras.h"

This reverts commit a36f316390d4bc1bcb0e9de0f55831385ab24099.

I did not intend to push this with the InitializePasses.h change.

Added: 


Modified: 
lldb/include/lldb/Utility/UserIDResolver.h
llvm/include/llvm/ADT/STLExtras.h
llvm/include/llvm/ADT/StringSwitch.h
llvm/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h
llvm/include/llvm/Support/CachePruning.h
llvm/include/llvm/Support/Error.h
llvm/include/llvm/Support/Format.h
llvm/include/llvm/Support/Threading.h
llvm/lib/MC/MCInstrAnalysis.cpp
llvm/lib/Support/CrashRecoveryContext.cpp
llvm/lib/Support/DJB.cpp

Removed: 




diff  --git a/lldb/include/lldb/Utility/UserIDResolver.h 
b/lldb/include/lldb/Utility/UserIDResolver.h
index 60f3982f573d..bca82a11b660 100644
--- a/lldb/include/lldb/Utility/UserIDResolver.h
+++ b/lldb/include/lldb/Utility/UserIDResolver.h
@@ -10,7 +10,6 @@
 #define LLDB_UTILITY_USERIDRESOLVER_H
 
 #include "llvm/ADT/DenseMap.h"
-#include "llvm/ADT/Optional.h"
 #include "llvm/ADT/StringRef.h"
 #include 
 

diff  --git a/llvm/include/llvm/ADT/STLExtras.h 
b/llvm/include/llvm/ADT/STLExtras.h
index c3b704c3fd79..274933bc5204 100644
--- a/llvm/include/llvm/ADT/STLExtras.h
+++ b/llvm/include/llvm/ADT/STLExtras.h
@@ -16,6 +16,8 @@
 #ifndef LLVM_ADT_STLEXTRAS_H
 #define LLVM_ADT_STLEXTRAS_H
 
+#include "llvm/ADT/Optional.h"
+#include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/iterator.h"
 #include "llvm/ADT/iterator_range.h"
 #include "llvm/Config/abi-breaking.h"
@@ -40,9 +42,6 @@
 
 namespace llvm {
 
-template  class Optional;
-template  class SmallVector;
-
 // Only used by compiler if both template types are the same.  Useful when
 // using SFINAE to test for the existence of member functions.
 template  struct SameType;

diff  --git a/llvm/include/llvm/ADT/StringSwitch.h 
b/llvm/include/llvm/ADT/StringSwitch.h
index d2a657ecbbee..fea911f6928b 100644
--- a/llvm/include/llvm/ADT/StringSwitch.h
+++ b/llvm/include/llvm/ADT/StringSwitch.h
@@ -12,7 +12,6 @@
 #ifndef LLVM_ADT_STRINGSWITCH_H
 #define LLVM_ADT_STRINGSWITCH_H
 
-#include "llvm/ADT/Optional.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/Compiler.h"
 #include 

diff  --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h 
b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h
index 5edf92a95f84..c6539df0d756 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h
@@ -10,10 +10,9 @@
 #define LLVM_DEBUGINFO_DWARF_DWARFDEBUGFRAME_H
 
 #include "llvm/ADT/ArrayRef.h"
-#include "llvm/ADT/Optional.h"
+#include "llvm/ADT/iterator.h"
 #include "llvm/ADT/SmallString.h"
 #include "llvm/ADT/Triple.h"
-#include "llvm/ADT/iterator.h"
 #include "llvm/DebugInfo/DWARF/DWARFDataExtractor.h"
 #include "llvm/DebugInfo/DWARF/DWARFExpression.h"
 #include "llvm/Support/Error.h"

diff  --git a/llvm/include/llvm/Support/CachePruning.h 
b/llvm/include/llvm/Support/CachePruning.h
index 297aa6d1ab8b..a72a86439f6a 100644
--- a/llvm/include/llvm/Support/CachePruning.h
+++ b/llvm/include/llvm/Support/CachePruning.h
@@ -14,7 +14,6 @@
 #ifndef LLVM_SUPPORT_CACHE_PRUNING_H
 #define LLVM_SUPPORT_CACHE_PRUNING_H
 
-#include "llvm/ADT/Optional.h"
 #include "llvm/ADT/StringRef.h"
 #include 
 

diff  --git a/llvm/include/llvm/Support/Error.h 
b/llvm/include/llvm/Support/Error.h
index 01bfc4a5fb5f..350877a219bf 100644
--- a/llvm/include/llvm/Support/Error.h
+++ b/llvm/include/llvm/Support/Error.h
@@ -14,7 +14,6 @@
 #define LLVM_SUPPORT_ERROR_H
 
 #include "llvm-c/Error.h"
-#include "llvm/ADT/Optional.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringExtras.h"

diff  --git a/llvm/include/llvm/Support/Format.h 
b/llvm/include/llvm/Support/Format.h
index 3f5251ca8d24..9dd7b401b46a 100644
--- a/llvm/include/llvm/Support/Format.h
+++ b/llvm/include/llvm/Support/Format.h
@@ -23,7 +23,6 @@
 #define LLVM_SUPPORT_FORMAT_H
 
 #include "llvm/ADT/ArrayRef.h"
-#include "llvm/ADT/Optional.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/DataTypes.h"

diff  --git a/llvm/include/llvm/Support/Threading.h 
b/llvm/include/llvm/Support/Threading.h
index f53c116f0d44..bacab8fa23b6 100644
--- a/llvm/include/llvm/Support/Threading.h
+++ b/llvm/include/llvm/Support/Threading.h
@@ -15,7 +15,6 @@
 #define LLVM_SUPPORT_THREADING_H
 
 #include "llvm/ADT/FunctionExtras.h"
-#include "llvm/ADT/Optional.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/Config/llvm-config.h" // for LLVM_ON_UNIX
 #incl

[Lldb-commits] [lldb] 4d23764 - Fix -Wunused-result warnings in LLDB

2019-11-16 Thread Reid Kleckner via lldb-commits

Author: Reid Kleckner
Date: 2019-11-15T16:38:00-08:00
New Revision: 4d23764dddc23e74ad165086d7f471a3e0e52bf8

URL: 
https://github.com/llvm/llvm-project/commit/4d23764dddc23e74ad165086d7f471a3e0e52bf8
DIFF: 
https://github.com/llvm/llvm-project/commit/4d23764dddc23e74ad165086d7f471a3e0e52bf8.diff

LOG: Fix -Wunused-result warnings in LLDB

Three uses of try_lock intentionally ignore the result, as explained in
the comment. Make that explicit with a void cast.

Add what appears to be a missing return in the clang expression parser
code. It's a functional change, but presumably the right one.

Differential Revision: https://reviews.llvm.org/D70281

Added: 


Modified: 
lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h
lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp

Removed: 




diff  --git 
a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h 
b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h
index 39b143022809..152549f8dd56 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h
@@ -312,7 +312,7 @@ class ClangExpressionDeclMap : public ClangASTSource {
   if (m_exe_ctx.GetTargetPtr())
 return m_exe_ctx.GetTargetPtr();
   else if (m_sym_ctx.target_sp)
-m_sym_ctx.target_sp.get();
+return m_sym_ctx.target_sp.get();
   return nullptr;
 }
 

diff  --git 
a/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp 
b/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp
index b777a5319104..5761b39f1115 100644
--- a/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp
+++ b/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp
@@ -166,7 +166,7 @@ bool OperatingSystemPython::UpdateThreadList(ThreadList 
&old_thread_list,
   Target &target = m_process->GetTarget();
   std::unique_lock api_lock(target.GetAPIMutex(),
   std::defer_lock);
-  api_lock.try_lock();
+  (void)api_lock.try_lock(); // See above.
   auto interpreter_lock = m_interpreter->AcquireInterpreterLock();
 
   LLDB_LOGF(log,
@@ -308,7 +308,7 @@ 
OperatingSystemPython::CreateRegisterContextForThread(Thread *thread,
   Target &target = m_process->GetTarget();
   std::unique_lock api_lock(target.GetAPIMutex(),
   std::defer_lock);
-  api_lock.try_lock();
+  (void)api_lock.try_lock(); // See above.
   auto interpreter_lock = m_interpreter->AcquireInterpreterLock();
 
   Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_THREAD));
@@ -395,7 +395,7 @@ lldb::ThreadSP 
OperatingSystemPython::CreateThread(lldb::tid_t tid,
 Target &target = m_process->GetTarget();
 std::unique_lock api_lock(target.GetAPIMutex(),
 std::defer_lock);
-api_lock.try_lock();
+(void)api_lock.try_lock(); // See above.
 auto interpreter_lock = m_interpreter->AcquireInterpreterLock();
 
 StructuredData::DictionarySP thread_info_dict =



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r360076 - Fix the cmake build by removing non-existant source file

2019-05-06 Thread Reid Kleckner via lldb-commits
Author: rnk
Date: Mon May  6 13:36:58 2019
New Revision: 360076

URL: http://llvm.org/viewvc/llvm-project?rev=360076&view=rev
Log:
Fix the cmake build by removing non-existant source file

Modified:
lldb/trunk/unittests/Symbol/CMakeLists.txt

Modified: lldb/trunk/unittests/Symbol/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Symbol/CMakeLists.txt?rev=360076&r1=360075&r2=360076&view=diff
==
--- lldb/trunk/unittests/Symbol/CMakeLists.txt (original)
+++ lldb/trunk/unittests/Symbol/CMakeLists.txt Mon May  6 13:36:58 2019
@@ -4,7 +4,6 @@ add_lldb_unittest(SymbolTests
   TestClangASTContext.cpp
   TestDWARFCallFrameInfo.cpp
   TestType.cpp
-  TestLineEntry.cpp
 
   LINK_LIBS
 lldbHost


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r366247 - Fix LLDB Windows build Python version logic after r366243

2019-07-16 Thread Reid Kleckner via lldb-commits
Author: rnk
Date: Tue Jul 16 11:46:51 2019
New Revision: 366247

URL: http://llvm.org/viewvc/llvm-project?rev=366247&view=rev
Log:
Fix LLDB Windows build Python version logic after r366243

Modified:
lldb/trunk/cmake/modules/LLDBConfig.cmake

Modified: lldb/trunk/cmake/modules/LLDBConfig.cmake
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/LLDBConfig.cmake?rev=366247&r1=366246&r2=366247&view=diff
==
--- lldb/trunk/cmake/modules/LLDBConfig.cmake (original)
+++ lldb/trunk/cmake/modules/LLDBConfig.cmake Tue Jul 16 11:46:51 2019
@@ -139,6 +139,7 @@ function(find_python_libs_windows)
  PYTHONLIBS_VERSION_STRING "${python_version_str}")
 message(STATUS "Found Python version ${PYTHONLIBS_VERSION_STRING}")
 string(REGEX REPLACE "([0-9]+)[.]([0-9]+)[.][0-9]+" "python\\1\\2" 
PYTHONLIBS_BASE_NAME "${PYTHONLIBS_VERSION_STRING}")
+set(PYTHONLIBS_VERSION_STRING "${PYTHONLIBS_VERSION_STRING}" PARENT_SCOPE)
 unset(python_version_str)
   else()
 message(WARNING "Unable to find ${PYTHON_INCLUDE_DIR}/patchlevel.h, Python 
installation is corrupt.")


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r361915 - build: only search for the needed python type

2019-07-16 Thread Reid Kleckner via lldb-commits
Doesn't this regress building with the VS generator? Was that already
broken? It seems like this should've been sent to Zach, who added this
logic, for review.

On Tue, May 28, 2019 at 7:23 PM Saleem Abdulrasool via lldb-commits <
lldb-commits@lists.llvm.org> wrote:

> Author: compnerd
> Date: Tue May 28 19:26:29 2019
> New Revision: 361915
>
> URL: http://llvm.org/viewvc/llvm-project?rev=361915&view=rev
> Log:
> build: only search for the needed python type
>
> Windows has different types of runtime libraries which are ABI
> incompatible with one another.  This requires that the debug build of
> lldb link against the debug build of python.  Adjust the python search
> to search for only the required type of python.  This permits building a
> release build of lldb against just the release build of python.
>
> Modified:
> lldb/trunk/cmake/modules/LLDBConfig.cmake
>
> Modified: lldb/trunk/cmake/modules/LLDBConfig.cmake
> URL:
> http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/LLDBConfig.cmake?rev=361915&r1=361914&r2=361915&view=diff
>
> ==
> --- lldb/trunk/cmake/modules/LLDBConfig.cmake (original)
> +++ lldb/trunk/cmake/modules/LLDBConfig.cmake Tue May 28 19:26:29 2019
> @@ -153,83 +153,39 @@ function(find_python_libs_windows)
>endif()
>
>file(TO_CMAKE_PATH "${PYTHON_HOME}" PYTHON_HOME)
> -  file(TO_CMAKE_PATH "${PYTHON_HOME}/python_d.exe" PYTHON_DEBUG_EXE)
> -  file(TO_CMAKE_PATH "${PYTHON_HOME}/libs/${PYTHONLIBS_BASE_NAME}_d.lib"
> PYTHON_DEBUG_LIB)
> -  file(TO_CMAKE_PATH "${PYTHON_HOME}/${PYTHONLIBS_BASE_NAME}_d.dll"
> PYTHON_DEBUG_DLL)
> -
> -  file(TO_CMAKE_PATH "${PYTHON_HOME}/python.exe" PYTHON_RELEASE_EXE)
> -  file(TO_CMAKE_PATH "${PYTHON_HOME}/libs/${PYTHONLIBS_BASE_NAME}.lib"
> PYTHON_RELEASE_LIB)
> -  file(TO_CMAKE_PATH "${PYTHON_HOME}/${PYTHONLIBS_BASE_NAME}.dll"
> PYTHON_RELEASE_DLL)
> -
> -  if (NOT EXISTS ${PYTHON_DEBUG_EXE})
> -message("Unable to find ${PYTHON_DEBUG_EXE}")
> -unset(PYTHON_DEBUG_EXE)
> -  endif()
> -
> -  if (NOT EXISTS ${PYTHON_RELEASE_EXE})
> -message("Unable to find ${PYTHON_RELEASE_EXE}")
> -unset(PYTHON_RELEASE_EXE)
> -  endif()
> -
> -  if (NOT EXISTS ${PYTHON_DEBUG_LIB})
> -message("Unable to find ${PYTHON_DEBUG_LIB}")
> -unset(PYTHON_DEBUG_LIB)
> -  endif()
> -
> -  if (NOT EXISTS ${PYTHON_RELEASE_LIB})
> -message("Unable to find ${PYTHON_RELEASE_LIB}")
> -unset(PYTHON_RELEASE_LIB)
> -  endif()
> -
> -  if (NOT EXISTS ${PYTHON_DEBUG_DLL})
> -message("Unable to find ${PYTHON_DEBUG_DLL}")
> -unset(PYTHON_DEBUG_DLL)
> -  endif()
> +  # TODO(compnerd) when CMake Policy `CMP0091` is set to NEW, we should
> use
> +  # if(CMAKE_MSVC_RUNTIME_LIBRARY MATCHES MultiThreadedDebug)
> +  if(CMAKE_BUILD_TYPE STREQUAL Debug)
> +file(TO_CMAKE_PATH "${PYTHON_HOME}/python_d.exe" PYTHON_EXE)
> +file(TO_CMAKE_PATH
> "${PYTHON_HOME}/libs/${PYTHONLIBS_BASE_NAME}_d.lib" PYTHON_LIB)
> +file(TO_CMAKE_PATH "${PYTHON_HOME}/${PYTHONLIBS_BASE_NAME}_d.dll"
> PYTHON_DLL)
> +  else()
> +file(TO_CMAKE_PATH "${PYTHON_HOME}/python.exe" PYTHON_EXE)
> +file(TO_CMAKE_PATH "${PYTHON_HOME}/libs/${PYTHONLIBS_BASE_NAME}.lib"
> PYTHON_LIB)
> +file(TO_CMAKE_PATH "${PYTHON_HOME}/${PYTHONLIBS_BASE_NAME}.dll"
> PYTHON_DLL)
> +  endif()
> +
> +  foreach(component PYTHON_EXE;PYTHON_LIB;PYTHON_DLL)
> +if(NOT EXISTS ${${component}})
> +  message("unable to find ${component}")
> +  unset(${component})
> +endif()
> +  endforeach()
>
> -  if (NOT EXISTS ${PYTHON_RELEASE_DLL})
> -message("Unable to find ${PYTHON_RELEASE_DLL}")
> -unset(PYTHON_RELEASE_DLL)
> -  endif()
> -
> -  if (NOT (PYTHON_DEBUG_EXE AND PYTHON_RELEASE_EXE AND PYTHON_DEBUG_LIB
> AND PYTHON_RELEASE_LIB AND PYTHON_DEBUG_DLL AND PYTHON_RELEASE_DLL))
> -message("Python installation is corrupt. Python support will be
> disabled for this build.")
> +  if (NOT PYTHON_EXE OR NOT PYTHON_LIB OR NOT PYTHON_DLL)
> +message("Unable to find all Python components.  Python support will
> be disabled for this build.")
>  set(LLDB_DISABLE_PYTHON 1 PARENT_SCOPE)
>  return()
>endif()
>
> -  # Generator expressions are evaluated in the context of each build
> configuration generated
> -  # by CMake. Here we use the $:VALUE logical generator
> expression to ensure
> -  # that the debug Python library, DLL, and executable are used in the
> Debug build configuration.
> -  #
> -  # Generator expressions can be difficult to grok at first so here's a
> breakdown of the one
> -  # used for PYTHON_LIBRARY:
> -  #
> -  # 1. $ evaluates to 1 when the Debug configuration is
> being generated,
> -  #or 0 in all other cases.
> -  # 2. $<$:${PYTHON_DEBUG_LIB}> expands to
> ${PYTHON_DEBUG_LIB} when the Debug
> -  #configuration is being generated, or nothing (literally) in all
> other cases.
> -  # 3. $<$>:${PYTHON_RELEASE_LIB}> expands to
> ${PYTHON_RELEASE_LIB} when
> -  #   

[Lldb-commits] [lldb] 58c7bf2 - Update LLDB filespec tests for remove_dots change

2020-05-04 Thread Reid Kleckner via lldb-commits

Author: Reid Kleckner
Date: 2020-05-04T17:27:16-07:00
New Revision: 58c7bf246ec4056ca40ea37f16cb3314161863f7

URL: 
https://github.com/llvm/llvm-project/commit/58c7bf246ec4056ca40ea37f16cb3314161863f7
DIFF: 
https://github.com/llvm/llvm-project/commit/58c7bf246ec4056ca40ea37f16cb3314161863f7.diff

LOG: Update LLDB filespec tests for remove_dots change

It looks like the new implementation is correct, since there were TODOs
here about getting the new behavior.

I am not sure if "C:..\.." should become "C:" or "C:\", though. The new
output doesn't precisely match the TODO message, but it seems
appropriate given the specification of remove_dots and how .. traversals
work at the root directory.

Added: 


Modified: 
lldb/unittests/Utility/FileSpecTest.cpp

Removed: 




diff  --git a/lldb/unittests/Utility/FileSpecTest.cpp 
b/lldb/unittests/Utility/FileSpecTest.cpp
index 690c5ae331ee..ad2e328ce82f 100644
--- a/lldb/unittests/Utility/FileSpecTest.cpp
+++ b/lldb/unittests/Utility/FileSpecTest.cpp
@@ -246,13 +246,11 @@ TEST(FileSpecTest, GetPath) {
   {R"(\\net)", R"(\\net)"},
   {R"(c:\..)", R"(c:\)"},
   {R"(c:\.)", R"(c:\)"},
-  // TODO: fix llvm::sys::path::remove_dots() to return "\" below.
-  {R"(\..)", R"(\..)"},
+  {R"(\..)", R"(\)"},
   //  {R"(c:..)", R"(c:..)"},
   {R"(..)", R"(..)"},
   {R"(.)", R"(.)"},
-  // TODO: fix llvm::sys::path::remove_dots() to return "c:\" below.
-  {R"(c:..\..)", R"(c:\..\..)"},
+  {R"(c:..\..)", R"(c:)"},
   {R"(..\..)", R"(..\..)"},
   {R"(foo\..)", R"(.)"},
   {R"(foo\..\bar)", R"(bar)"},



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 47cc6db - Re-land [Debug][CodeView] Emit fully qualified names for globals

2020-05-18 Thread Reid Kleckner via lldb-commits

Author: Reid Kleckner
Date: 2020-05-18T17:31:00-07:00
New Revision: 47cc6db928d063d96e11e70c196bd5601b2bdd06

URL: 
https://github.com/llvm/llvm-project/commit/47cc6db928d063d96e11e70c196bd5601b2bdd06
DIFF: 
https://github.com/llvm/llvm-project/commit/47cc6db928d063d96e11e70c196bd5601b2bdd06.diff

LOG: Re-land [Debug][CodeView] Emit fully qualified names for globals

This reverts commit 525a591f0f48b9d54018bf5245f2abee09c9c1c8.

Fixed an issue with pointers to members based on typedefs. In this case,
LLVM would emit a second UDT. I fixed it by not passing the class type
to getTypeIndex when the base type is not a function type. lowerType
only uses the class type for direct function types. This suggests if we
have a PMF with a function typedef, there may be an issue, but that can
be solved separately.

Added: 
llvm/test/DebugInfo/COFF/udts-fixpoint.ll

Modified: 
lldb/test/Shell/SymbolFile/PDB/variables.test
llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h
llvm/test/DebugInfo/COFF/global-constants.ll
llvm/test/DebugInfo/COFF/global_visibility.ll
llvm/test/DebugInfo/COFF/globals.ll
llvm/test/DebugInfo/COFF/types-array-unsized.ll

Removed: 




diff  --git a/lldb/test/Shell/SymbolFile/PDB/variables.test 
b/lldb/test/Shell/SymbolFile/PDB/variables.test
index ae14f02754ce..a6c715360958 100644
--- a/lldb/test/Shell/SymbolFile/PDB/variables.test
+++ b/lldb/test/Shell/SymbolFile/PDB/variables.test
@@ -13,12 +13,12 @@ GLOBALS: SymbolFile pdb ([[MOD]])
 GLOBALS: CompileUnit{{.*}}, language = "c++", file = 
'{{.*}}\VariablesTest.cpp'
 GLOBALS-DAG:   Variable{{.*}}, name = "g_IntVar"
 GLOBALS-SAME:  scope = global, location = {{.*}}, external
-GLOBALS-DAG:   Variable{{.*}}, name = "m_StaticClassMember"
-GLOBALS-SAME:  scope = global, location = {{.*}}, external
 GLOBALS-DAG:   Variable{{.*}}, name = "g_pConst"
 GLOBALS-SAME:  scope = global, location = {{.*}}, external
 GLOBALS-DAG:   Variable{{.*}}, name = "same_name_var"
 GLOBALS-SAME:  scope = global, location = {{.*}}, external
+GLOBALS-DAG:   Variable{{.*}}, name = "Class::m_StaticClassMember"
+GLOBALS-SAME:  scope = global, location = {{.*}}, external
 GLOBALS-DAG:   Variable{{.*}}, name = "g_EnumVar"
 GLOBALS-SAME:  scope = global, location = {{.*}}, external
 GLOBALS-DAG:   Variable{{.*}}, name = "g_tls"

diff  --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp 
b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
index f167cead4e2c..de2b9bcc58c7 100644
--- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
@@ -343,18 +343,6 @@ static std::string formatNestedName(ArrayRef 
QualifiedNameComponents,
   return FullyQualifiedName;
 }
 
-std::string CodeViewDebug::getFullyQualifiedName(const DIScope *Scope,
- StringRef Name) {
-  SmallVector QualifiedNameComponents;
-  collectParentScopeNames(Scope, QualifiedNameComponents);
-  return formatNestedName(QualifiedNameComponents, Name);
-}
-
-std::string CodeViewDebug::getFullyQualifiedName(const DIScope *Ty) {
-  const DIScope *Scope = Ty->getScope();
-  return getFullyQualifiedName(Scope, getPrettyScopeName(Ty));
-}
-
 struct CodeViewDebug::TypeLoweringScope {
   TypeLoweringScope(CodeViewDebug &CVD) : CVD(CVD) { ++CVD.TypeEmissionLevel; }
   ~TypeLoweringScope() {
@@ -367,6 +355,22 @@ struct CodeViewDebug::TypeLoweringScope {
   CodeViewDebug &CVD;
 };
 
+std::string CodeViewDebug::getFullyQualifiedName(const DIScope *Scope,
+ StringRef Name) {
+  // Ensure types in the scope chain are emitted as soon as possible.
+  // This can create otherwise a situation where S_UDTs are emitted while
+  // looping in emitDebugInfoForUDTs.
+  TypeLoweringScope S(*this);
+  SmallVector QualifiedNameComponents;
+  collectParentScopeNames(Scope, QualifiedNameComponents);
+  return formatNestedName(QualifiedNameComponents, Name);
+}
+
+std::string CodeViewDebug::getFullyQualifiedName(const DIScope *Ty) {
+  const DIScope *Scope = Ty->getScope();
+  return getFullyQualifiedName(Scope, getPrettyScopeName(Ty));
+}
+
 TypeIndex CodeViewDebug::getScopeIndex(const DIScope *Scope) {
   // No scope means global scope and that uses the zero index.
   if (!Scope || isa(Scope))
@@ -1784,11 +1788,12 @@ translatePtrToMemberRep(unsigned SizeInBytes, bool 
IsPMF, unsigned Flags) {
 TypeIndex CodeViewDebug::lowerTypeMemberPointer(const DIDerivedType *Ty,
 PointerOptions PO) {
   assert(Ty->getTag() == dwarf::DW_TAG_ptr_to_member_type);
+  bool IsPMF = isa(Ty->getBaseType());
   TypeIndex ClassTI = getTypeIndex(Ty->getClassType());
-  TypeIndex PointeeTI = getTypeIndex(Ty->getBaseType(), Ty->getClassType());
+  TypeIndex PointeeTI =
+  getTypeIndex(Ty->getBaseType(), IsPMF ? Ty->getClassType() : null

[Lldb-commits] [lldb] 1c03389 - Re-land "Migrate the rest of COFFObjectFile to Error"

2020-06-11 Thread Reid Kleckner via lldb-commits

Author: Reid Kleckner
Date: 2020-06-11T14:46:16-07:00
New Revision: 1c03389c29f32cce81a642365c484c71aba1a1cb

URL: 
https://github.com/llvm/llvm-project/commit/1c03389c29f32cce81a642365c484c71aba1a1cb
DIFF: 
https://github.com/llvm/llvm-project/commit/1c03389c29f32cce81a642365c484c71aba1a1cb.diff

LOG: Re-land "Migrate the rest of COFFObjectFile to Error"

This reverts commit 101fbc01382edd89ea7b671104c68b30b2446cc0.

Remove leftover debugging attribute.

Update LLDB as well, which was missed before.

Added: 


Modified: 
lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
llvm/include/llvm/Object/COFF.h
llvm/lib/DebugInfo/PDB/Native/NativeSession.cpp
llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp
llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.h
llvm/lib/DebugInfo/Symbolize/Symbolize.cpp
llvm/lib/Object/COFFObjectFile.cpp
llvm/tools/llvm-objcopy/COFF/Reader.cpp
llvm/tools/llvm-objdump/COFFDump.cpp
llvm/tools/llvm-objdump/llvm-objdump.cpp
llvm/tools/llvm-readobj/COFFDumper.cpp
llvm/tools/obj2yaml/coff2yaml.cpp
llvm/tools/sancov/sancov.cpp

Removed: 




diff  --git a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp 
b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
index fe567187e2b4..0a5a1d318fbe 100644
--- a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
+++ b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
@@ -969,13 +969,12 @@ uint32_t ObjectFilePECOFF::ParseDependentModules() {
 
   for (const auto &entry : COFFObj->import_directories()) {
 llvm::StringRef dll_name;
-auto ec = entry.getName(dll_name);
 // Report a bogus entry.
-if (ec != std::error_code()) {
+if (llvm::Error e = entry.getName(dll_name)) {
   LLDB_LOGF(log,
 "ObjectFilePECOFF::ParseDependentModules() - failed to get "
 "import directory entry name: %s",
-ec.message().c_str());
+llvm::toString(std::move(e)).c_str());
   continue;
 }
 

diff  --git a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp 
b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
index 2f8b1dcc9135..cce06473d92f 100644
--- a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
+++ b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
@@ -129,14 +129,15 @@ loadMatchingPDBFile(std::string exe_path, 
llvm::BumpPtrAllocator &allocator) {
 
   // If it doesn't have a debug directory, fail.
   llvm::StringRef pdb_file;
-  auto ec = obj->getDebugPDBInfo(pdb_info, pdb_file);
-  if (ec)
+  if (llvm::Error e = obj->getDebugPDBInfo(pdb_info, pdb_file)) {
+consumeError(std::move(e));
 return nullptr;
+  }
 
   // if the file doesn't exist, is not a pdb, or doesn't have a matching guid,
   // fail.
   llvm::file_magic magic;
-  ec = llvm::identify_magic(pdb_file, magic);
+  auto ec = llvm::identify_magic(pdb_file, magic);
   if (ec || magic != llvm::file_magic::pdb)
 return nullptr;
   std::unique_ptr pdb = loadPDBFile(std::string(pdb_file), allocator);

diff  --git a/llvm/include/llvm/Object/COFF.h b/llvm/include/llvm/Object/COFF.h
index a8455e02563f..8aef00a8809d 100644
--- a/llvm/include/llvm/Object/COFF.h
+++ b/llvm/include/llvm/Object/COFF.h
@@ -799,13 +799,13 @@ class COFFObjectFile : public ObjectFile {
   // Finish initializing the object and return success or an error.
   Error initialize();
 
-  std::error_code initSymbolTablePtr();
-  std::error_code initImportTablePtr();
-  std::error_code initDelayImportTablePtr();
-  std::error_code initExportTablePtr();
-  std::error_code initBaseRelocPtr();
-  std::error_code initDebugDirectoryPtr();
-  std::error_code initLoadConfigPtr();
+  Error initSymbolTablePtr();
+  Error initImportTablePtr();
+  Error initDelayImportTablePtr();
+  Error initExportTablePtr();
+  Error initBaseRelocPtr();
+  Error initDebugDirectoryPtr();
+  Error initLoadConfigPtr();
 
 public:
   static Expected>
@@ -989,8 +989,7 @@ class COFFObjectFile : public ObjectFile {
   const pe32_header *getPE32Header() const { return PE32Header; }
   const pe32plus_header *getPE32PlusHeader() const { return PE32PlusHeader; }
 
-  std::error_code getDataDirectory(uint32_t index,
-   const data_directory *&Res) const;
+  const data_directory *getDataDirectory(uint32_t index) const;
   Expected getSection(int32_t index) const;
 
   Expected getSymbol(uint32_t index) const {
@@ -1004,12 +1003,12 @@ class COFFObjectFile : public ObjectFile {
   }
 
   template 
-  std::error_code getAuxSymbol(uint32_t index, const T *&Res) const {
+  Error getAuxSymbol(uint32_t index, const T *&Res) const {
 Expected S = getSymbol(index);
 if (Error E = S.takeError())
-  return errorToErrorCode(std::move(E));
+ 

[Lldb-commits] [lldb] 8a81daa - [AST] Split parent map traversal logic into ParentMapContext.h

2020-01-24 Thread Reid Kleckner via lldb-commits

Author: Reid Kleckner
Date: 2020-01-24T13:42:28-08:00
New Revision: 8a81daaa8b58aeaa192a47c4ce7f94b4d59ce082

URL: 
https://github.com/llvm/llvm-project/commit/8a81daaa8b58aeaa192a47c4ce7f94b4d59ce082
DIFF: 
https://github.com/llvm/llvm-project/commit/8a81daaa8b58aeaa192a47c4ce7f94b4d59ce082.diff

LOG: [AST] Split parent map traversal logic into ParentMapContext.h

The only part of ASTContext.h that requires most AST types to be
complete is the parent map. Nothing in Clang proper uses the ParentMap,
so split it out into its own class. Make ASTContext own the
ParentMapContext so there is still a one-to-one relationship.

After this change, 562 fewer files depend on ASTTypeTraits.h, and 66
fewer depend on TypeLoc.h:
  $ diff -u deps-before.txt deps-after.txt | \
grep '^[-+] ' | sort | uniq -c | sort -nr | less
  562 -../clang/include/clang/AST/ASTTypeTraits.h
  340 +../clang/include/clang/AST/ParentMapContext.h
   66 -../clang/include/clang/AST/TypeLocNodes.def
   66 -../clang/include/clang/AST/TypeLoc.h
   15 -../clang/include/clang/AST/TemplateBase.h
  ...
I computed deps-before.txt and deps-after.txt with `ninja -t deps`.

This removes a common and key dependency on TemplateBase.h and
TypeLoc.h.

This also has the effect of breaking the ParentMap RecursiveASTVisitor
instantiation into its own file, which roughly halves the compilation
time of ASTContext.cpp (29.75s -> 17.66s). The new file takes 13.8s to
compile.

I left behind forwarding methods for getParents(), but clients will need
to include a new header to make them work:
  #include "clang/AST/ParentMapContext.h"

I noticed that this parent map functionality is unfortunately duplicated
in ParentMap.h, which only works for Stmt nodes.

Reviewed By: rsmith

Differential Revision: https://reviews.llvm.org/D71313

Added: 
clang/include/clang/AST/ParentMapContext.h
clang/lib/AST/ParentMapContext.cpp

Modified: 

clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsArrayToPointerDecayCheck.cpp
clang-tools-extra/clang-tidy/readability/MakeMemberFunctionConstCheck.cpp
clang-tools-extra/clang-tidy/utils/ExprSequence.cpp
clang/include/clang/AST/ASTContext.h
clang/include/clang/AST/ASTNodeTraverser.h
clang/include/clang/ASTMatchers/ASTMatchers.h
clang/include/clang/Sema/Sema.h
clang/lib/AST/ASTContext.cpp
clang/lib/AST/CMakeLists.txt
clang/lib/AST/Linkage.h
clang/lib/ASTMatchers/ASTMatchFinder.cpp
clang/lib/ASTMatchers/ASTMatchersInternal.cpp
clang/lib/CodeGen/CGCall.h
clang/lib/Tooling/ASTDiff/ASTDiff.cpp
clang/lib/Tooling/Refactoring/Rename/USRLocFinder.cpp
lldb/include/lldb/Symbol/TypeSystemClang.h

Removed: 




diff  --git 
a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsArrayToPointerDecayCheck.cpp
 
b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsArrayToPointerDecayCheck.cpp
index 6939ec9b2e07..760073fcaac2 100644
--- 
a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsArrayToPointerDecayCheck.cpp
+++ 
b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsArrayToPointerDecayCheck.cpp
@@ -8,6 +8,7 @@
 
 #include "ProBoundsArrayToPointerDecayCheck.h"
 #include "clang/AST/ASTContext.h"
+#include "clang/AST/ParentMapContext.h"
 #include "clang/ASTMatchers/ASTMatchFinder.h"
 
 using namespace clang::ast_matchers;
@@ -35,8 +36,7 @@ AST_MATCHER_P(Expr, hasParentIgnoringImpCasts,
   ast_matchers::internal::Matcher, InnerMatcher) {
   const Expr *E = &Node;
   do {
-ASTContext::DynTypedNodeList Parents =
-Finder->getASTContext().getParents(*E);
+DynTypedNodeList Parents = Finder->getASTContext().getParents(*E);
 if (Parents.size() != 1)
   return false;
 E = Parents[0].get();

diff  --git 
a/clang-tools-extra/clang-tidy/readability/MakeMemberFunctionConstCheck.cpp 
b/clang-tools-extra/clang-tidy/readability/MakeMemberFunctionConstCheck.cpp
index aca8d0fe89d8..3f1dcfe803e2 100644
--- a/clang-tools-extra/clang-tidy/readability/MakeMemberFunctionConstCheck.cpp
+++ b/clang-tools-extra/clang-tidy/readability/MakeMemberFunctionConstCheck.cpp
@@ -8,6 +8,7 @@
 
 #include "MakeMemberFunctionConstCheck.h"
 #include "clang/AST/ASTContext.h"
+#include "clang/AST/ParentMapContext.h"
 #include "clang/AST/RecursiveASTVisitor.h"
 #include "clang/ASTMatchers/ASTMatchFinder.h"
 
@@ -57,7 +58,7 @@ class FindUsageOfThis : public 
RecursiveASTVisitor {
   UsageKind Usage = Unused;
 
   template  const T *getParent(const Expr *E) {
-ASTContext::DynTypedNodeList Parents = Ctxt.getParents(*E);
+DynTypedNodeList Parents = Ctxt.getParents(*E);
 if (Parents.size() != 1)
   return nullptr;
 

diff  --git a/clang-tools-extra/clang-tidy/utils/ExprSequence.cpp 
b/clang-tools-extra/clang-tidy/utils/ExprSequence.cpp
index 6ed595e4a0d6..3505f31c92a2 100644
--- a/clang-tools-extra/clang-tidy/utils/ExprSequence.

[Lldb-commits] [lldb] 0c86dfb - Fix -Wunused-result warnings in LLDB

2020-02-04 Thread Reid Kleckner via lldb-commits

Author: Reid Kleckner
Date: 2020-02-04T15:58:38-08:00
New Revision: 0c86dfb86de53e74f376c3f2800fc114afaae2ba

URL: 
https://github.com/llvm/llvm-project/commit/0c86dfb86de53e74f376c3f2800fc114afaae2ba
DIFF: 
https://github.com/llvm/llvm-project/commit/0c86dfb86de53e74f376c3f2800fc114afaae2ba.diff

LOG: Fix -Wunused-result warnings in LLDB

These try_lock usages intentionally ignore the result, as commented.

Similar to 4d23764dddc23e74ad165086d7f471a3e0e52bf8, which was reviewed
previously.

Added: 


Modified: 
lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp
lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp
lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp
lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp

Removed: 




diff  --git 
a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp 
b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp
index fc5c5a65ce44..7dfa759a7fb1 100644
--- a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp
+++ b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp
@@ -106,7 +106,7 @@ void AppleGetItemInfoHandler::Detach() {
   m_get_item_info_return_buffer_addr != LLDB_INVALID_ADDRESS) {
 std::unique_lock lock(m_get_item_info_retbuffer_mutex,
   std::defer_lock);
-lock.try_lock(); // Even if we don't get the lock, deallocate the buffer
+(void)lock.try_lock(); // Even if we don't get the lock, deallocate the 
buffer
 m_process->DeallocateMemory(m_get_item_info_return_buffer_addr);
   }
 }

diff  --git 
a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp 
b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp
index 2c220357ce56..ff57aa2afc99 100644
--- a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp
+++ b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp
@@ -109,7 +109,7 @@ void AppleGetPendingItemsHandler::Detach() {
   m_get_pending_items_return_buffer_addr != LLDB_INVALID_ADDRESS) {
 std::unique_lock lock(m_get_pending_items_retbuffer_mutex,
   std::defer_lock);
-lock.try_lock(); // Even if we don't get the lock, deallocate the buffer
+(void)lock.try_lock(); // Even if we don't get the lock, deallocate the 
buffer
 m_process->DeallocateMemory(m_get_pending_items_return_buffer_addr);
   }
 }

diff  --git 
a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp 
b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp
index 574e32760027..632f18d6ea85 100644
--- a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp
+++ b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp
@@ -107,7 +107,7 @@ void AppleGetQueuesHandler::Detach() {
   m_get_queues_return_buffer_addr != LLDB_INVALID_ADDRESS) {
 std::unique_lock lock(m_get_queues_retbuffer_mutex,
   std::defer_lock);
-lock.try_lock(); // Even if we don't get the lock, deallocate the buffer
+(void)lock.try_lock(); // Even if we don't get the lock, deallocate the 
buffer
 m_process->DeallocateMemory(m_get_queues_return_buffer_addr);
   }
 }

diff  --git 
a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp 
b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp
index c86d40655a05..6bfdbaca27d7 100644
--- a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp
+++ b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp
@@ -115,7 +115,7 @@ void AppleGetThreadItemInfoHandler::Detach() {
   m_get_thread_item_info_return_buffer_addr != LLDB_INVALID_ADDRESS) {
 std::unique_lock lock(m_get_thread_item_info_retbuffer_mutex,
   std::defer_lock);
-lock.try_lock(); // Even if we don't get the lock, deallocate the buffer
+(void)lock.try_lock(); // Even if we don't get the lock, deallocate the 
buffer
 m_process->DeallocateMemory(m_get_thread_item_info_return_buffer_addr);
   }
 }



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 50d2d33 - Fix BroadcasterManager::RemoveListener to really remove the listener

2020-02-04 Thread Reid Kleckner via lldb-commits

Author: Reid Kleckner
Date: 2020-02-04T17:19:44-08:00
New Revision: 50d2d33b8ef530fbee369cbf8e7ea4479597742d

URL: 
https://github.com/llvm/llvm-project/commit/50d2d33b8ef530fbee369cbf8e7ea4479597742d
DIFF: 
https://github.com/llvm/llvm-project/commit/50d2d33b8ef530fbee369cbf8e7ea4479597742d.diff

LOG: Fix BroadcasterManager::RemoveListener to really remove the listener

This appears to be a real bug caught by -Wunused-value. std::find_if
doesn't modify the underlying collection, it just returns an iterator
pointing to the matching element.

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D74010

Added: 


Modified: 
lldb/source/Utility/Broadcaster.cpp

Removed: 




diff  --git a/lldb/source/Utility/Broadcaster.cpp 
b/lldb/source/Utility/Broadcaster.cpp
index 2a5339482772..de59a5c4362e 100644
--- a/lldb/source/Utility/Broadcaster.cpp
+++ b/lldb/source/Utility/Broadcaster.cpp
@@ -406,7 +406,7 @@ void BroadcasterManager::RemoveListener(Listener *listener) 
{
   listener_collection::iterator iter = m_listeners.begin(),
 end_iter = m_listeners.end();
 
-  std::find_if(iter, end_iter, predicate);
+  iter = std::find_if(iter, end_iter, predicate);
   if (iter != end_iter)
 m_listeners.erase(iter);
 



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][NativePDB] Parse global variables. (PR #114303)

2024-10-31 Thread Reid Kleckner via lldb-commits

https://github.com/rnk approved this pull request.


https://github.com/llvm/llvm-project/pull/114303
___
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] [lld] [lldb] [llvm] Rework the `Option` library to reduce dynamic relocations (PR #119198)

2024-12-09 Thread Reid Kleckner via lldb-commits


@@ -80,15 +78,56 @@ class OptTable {
 const char *AliasArgs;
 const char *Values;
 
-StringRef getName() const {
-  unsigned PrefixLength = Prefixes.empty() ? 0 : Prefixes[0].size();
-  return PrefixedName.drop_front(PrefixLength);
+bool hasNoPrefix() const { return PrefixesOffset == 0; }
+
+unsigned getNumPrefixes(ArrayRef PrefixesTable) const {
+  return PrefixesTable[PrefixesOffset];
+}
+
+ArrayRef
+getPrefixOffsets(ArrayRef PrefixesTable) const {
+  return hasNoPrefix() ? ArrayRef()
+   : PrefixesTable.slice(PrefixesOffset + 1,
+ 
getNumPrefixes(PrefixesTable));
+}
+
+void appendPrefixes(const char *StrTable, ArrayRef PrefixesTable,
+SmallVectorImpl &Prefixes) const {
+  for (unsigned PrefixOffset : getPrefixOffsets(PrefixesTable))
+Prefixes.push_back(&StrTable[PrefixOffset]);
+}
+
+StringRef getPrefix(const char *StrTable, ArrayRef PrefixesTable,
+unsigned PrefixIndex) const {
+  return &StrTable[getPrefixOffsets(PrefixesTable)[PrefixIndex]];
+}
+
+StringRef getPrefixedName(const char *StrTable) const {
+  return &StrTable[PrefixedNameOffset];
+}
+
+StringRef getName(const char *StrTable,
+  ArrayRef PrefixesTable) const {
+  unsigned PrefixLength =
+  hasNoPrefix() ? 0 : getPrefix(StrTable, PrefixesTable, 0).size();
+  return getPrefixedName(StrTable).drop_front(PrefixLength);
 }
   };
 
 private:
+  // A unified string table for these options. Individual strings are stored as
+  // null terminated C-strings at offsets within this table.
+  const char *StrTable;

rnk wrote:

Can this be a size-bearing type like StringRef? The "safe" way to extract a C 
string at an offset becomes something like:
```
  StrTable.drop_front(PrefixOffset).split('\0').first;
```

https://github.com/llvm/llvm-project/pull/119198
___
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] [lld] [lldb] [llvm] Rework the `Option` library to reduce dynamic relocations (PR #119198)

2024-12-09 Thread Reid Kleckner via lldb-commits


@@ -53,10 +53,8 @@ class OptTable {
 public:
   /// Entry for a single option instance in the option data table.
   struct Info {
-/// A null terminated array of prefix strings to apply to name while
-/// matching.
-ArrayRef Prefixes;
-StringLiteral PrefixedName;
+unsigned PrefixesOffset;
+unsigned PrefixedNameOffset;
 const char *HelpText;

rnk wrote:

Presumably applying similar techniques to HelpText and the remaining character 
pointers is a logical next step.

https://github.com/llvm/llvm-project/pull/119198
___
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] [lld] [lldb] [llvm] Rework the `Option` library to reduce dynamic relocations (PR #119198)

2024-12-09 Thread Reid Kleckner via lldb-commits


@@ -53,10 +53,8 @@ class OptTable {
 public:
   /// Entry for a single option instance in the option data table.
   struct Info {
-/// A null terminated array of prefix strings to apply to name while
-/// matching.
-ArrayRef Prefixes;
-StringLiteral PrefixedName;
+unsigned PrefixesOffset;

rnk wrote:

It would be nice to have some kind of abstraction here rather than using raw 
integer types, especially if we plan to proceed to give this same treatment to 
the Clang BuiltinInfo struct. `class StrtabOffset` comes to mind. If could have 
some method, `StringRef StrtabOffset::toStr(StringRef StrTable)` that does the 
lookup, with bounds checking, or you could wrap a class on the string table and 
reorder the parameters. Clearly, the class would be trivial and 4 bytes.

https://github.com/llvm/llvm-project/pull/119198
___
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] [lld] [lldb] [llvm] Rework the `Option` library to reduce dynamic relocations (PR #119198)

2024-12-11 Thread Reid Kleckner via lldb-commits


@@ -53,10 +53,8 @@ class OptTable {
 public:
   /// Entry for a single option instance in the option data table.
   struct Info {
-/// A null terminated array of prefix strings to apply to name while
-/// matching.
-ArrayRef Prefixes;
-StringLiteral PrefixedName;
+unsigned PrefixesOffset;

rnk wrote:

Thanks! I'm lean towards incremental development and progress, so let's proceed 
and land this and refactor to align.

https://github.com/llvm/llvm-project/pull/119198
___
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] [lld] [lldb] [llvm] Rework the `Option` library to reduce dynamic relocations (PR #119198)

2024-12-11 Thread Reid Kleckner via lldb-commits


@@ -845,13 +845,14 @@ MemoryBufferRef 
LinkerDriver::convertResToCOFF(ArrayRef mbs,
 
 // Create OptTable
 
+#define OPTTABLE_STR_TABLE_CODE

rnk wrote:

I convinced myself this is not worth it. The changes to the 
`PrecomputedOptTable` are hard to abstract away. It would be easy to move the 
PREFIX macro definition here into the table generated file separately from the 
string table offset change, but we'd still have to touch all these files.

https://github.com/llvm/llvm-project/pull/119198
___
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] [lld] [lldb] [llvm] Rework the `Option` library to reduce dynamic relocations (PR #119198)

2024-12-11 Thread Reid Kleckner via lldb-commits

https://github.com/rnk approved this pull request.

Thanks! I think this is ready to land.

https://github.com/llvm/llvm-project/pull/119198
___
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] [lld] [lldb] [llvm] Rework the `Option` library to reduce dynamic relocations (PR #119198)

2024-12-09 Thread Reid Kleckner via lldb-commits


@@ -845,13 +845,14 @@ MemoryBufferRef 
LinkerDriver::convertResToCOFF(ArrayRef mbs,
 
 // Create OptTable
 
+#define OPTTABLE_STR_TABLE_CODE

rnk wrote:

Is it feasible to split out all the tool driver updates, like refactor all 
these PREFIX definitions into the table-generated file guarded by 
`OPTTABLE_STR_TABLE_CODE`, and then make your changes on top of that?

https://github.com/llvm/llvm-project/pull/119198
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [lldb] [llvm] [StrTable] Switch the option parser to `llvm::StringTable` (PR #123308)

2025-01-22 Thread Reid Kleckner via lldb-commits


@@ -117,13 +121,13 @@ class OptTable {
 private:
   // A unified string table for these options. Individual strings are stored as
   // null terminated C-strings at offsets within this table.
-  const char *StrTable;
+  const StringTable *StrTable;

rnk wrote:

Can this be a const reference instead? Is there a reason you chose to make this 
a pointer?

https://github.com/llvm/llvm-project/pull/123308
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [lldb] [llvm] [StrTable] Switch the option parser to `llvm::StringTable` (PR #123308)

2025-01-22 Thread Reid Kleckner via lldb-commits

https://github.com/rnk edited https://github.com/llvm/llvm-project/pull/123308
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [lldb] [llvm] [StrTable] Switch the option parser to `llvm::StringTable` (PR #123308)

2025-01-22 Thread Reid Kleckner via lldb-commits


@@ -33,25 +33,26 @@ using namespace llvm::opt;
 
 namespace {
 struct OptNameLess {
-  const char *StrTable;
-  ArrayRef PrefixesTable;
+  const StringTable *StrTable;

rnk wrote:

Can this be a const reference instead? Is there a reason you chose to make this 
a pointer?

https://github.com/llvm/llvm-project/pull/123308
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [lldb] [llvm] [StrTable] Switch the option parser to `llvm::StringTable` (PR #123308)

2025-01-22 Thread Reid Kleckner via lldb-commits

https://github.com/rnk commented:

Thanks, I just had one question.

https://github.com/llvm/llvm-project/pull/123308
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [lldb] [llvm] [StrTable] Switch the option parser to `llvm::StringTable` (PR #123308)

2025-01-22 Thread Reid Kleckner via lldb-commits


@@ -117,13 +121,13 @@ class OptTable {
 private:
   // A unified string table for these options. Individual strings are stored as
   // null terminated C-strings at offsets within this table.
-  const char *StrTable;
+  const StringTable *StrTable;

rnk wrote:

Got it, and I do seem to recall we sometimes use OptTable as a value type, even 
if that is somewhat questionable.

https://github.com/llvm/llvm-project/pull/123308
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [lldb] [llvm] [StrTable] Switch the option parser to `llvm::StringTable` (PR #123308)

2025-01-22 Thread Reid Kleckner via lldb-commits

https://github.com/rnk approved this pull request.


https://github.com/llvm/llvm-project/pull/123308
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Combine disassembler gtest binaries for efficiency (PR #133539)

2025-03-30 Thread Reid Kleckner via lldb-commits


@@ -1,11 +1,32 @@
+set(disas_srcs "")
+
 if("ARM" IN_LIST LLVM_TARGETS_TO_BUILD)
-  add_subdirectory(ARM)
+  set(disas_srcs ${disas_srcs}

rnk wrote:

Good idea, done.

https://github.com/llvm/llvm-project/pull/133539
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Combine disassembler gtest binaries for efficiency (PR #133539)

2025-03-30 Thread Reid Kleckner via lldb-commits

https://github.com/rnk updated https://github.com/llvm/llvm-project/pull/133539

>From 1c16745d1779d91bcc0b34e1a82cc98e70def316 Mon Sep 17 00:00:00 2001
From: Reid Kleckner 
Date: Fri, 28 Mar 2025 15:37:49 -0700
Subject: [PATCH 1/2] [lldb] Combine disassembler gtest binaries for efficiency

Each of these executables is 642MB for me locally with split DWARF, and
we don't need 3 statically linked gtest binaries when one will do.
---
 .../unittests/Disassembler/ARM/CMakeLists.txt | 12 -
 lldb/unittests/Disassembler/CMakeLists.txt| 27 ---
 .../Disassembler/RISCV/CMakeLists.txt | 12 -
 .../unittests/Disassembler/x86/CMakeLists.txt | 12 -
 4 files changed, 24 insertions(+), 39 deletions(-)
 delete mode 100644 lldb/unittests/Disassembler/ARM/CMakeLists.txt
 delete mode 100644 lldb/unittests/Disassembler/RISCV/CMakeLists.txt
 delete mode 100644 lldb/unittests/Disassembler/x86/CMakeLists.txt

diff --git a/lldb/unittests/Disassembler/ARM/CMakeLists.txt 
b/lldb/unittests/Disassembler/ARM/CMakeLists.txt
deleted file mode 100644
index 91af06fa19d6f..0
--- a/lldb/unittests/Disassembler/ARM/CMakeLists.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-add_lldb_unittest(DisassemblerTests
-  TestArm64Disassembly.cpp
-  TestArmv7Disassembly.cpp
-  LINK_LIBS
-lldbCore
-lldbSymbol
-lldbTarget
-lldbPluginDisassemblerLLVMC
-lldbPluginProcessUtility
-  LINK_COMPONENTS
-Support
-${LLVM_TARGETS_TO_BUILD})
diff --git a/lldb/unittests/Disassembler/CMakeLists.txt 
b/lldb/unittests/Disassembler/CMakeLists.txt
index 208f1807427f4..4d443b69f29b1 100644
--- a/lldb/unittests/Disassembler/CMakeLists.txt
+++ b/lldb/unittests/Disassembler/CMakeLists.txt
@@ -1,11 +1,32 @@
+set(disas_srcs "")
+
 if("ARM" IN_LIST LLVM_TARGETS_TO_BUILD)
-  add_subdirectory(ARM)
+  set(disas_srcs ${disas_srcs}
+ARM/TestArm64Disassembly.cpp
+ARM/TestArmv7Disassembly.cpp
+  )
 endif()
 
 if("X86" IN_LIST LLVM_TARGETS_TO_BUILD)
-  add_subdirectory(x86)
+  set(disas_srcs ${disas_srcs}
+x86/TestGetControlFlowKindx86.cpp
+  )
 endif()
 
 if("RISCV" IN_LIST LLVM_TARGETS_TO_BUILD)
-   add_subdirectory(RISCV)
+  set(disas_srcs ${disas_srcs}
+RISCV/TestMCDisasmInstanceRISCV.cpp
+  )
 endif()
+
+add_lldb_unittest(DisassemblerTests
+  ${disas_srcs}
+  LINK_LIBS
+lldbCore
+lldbSymbol
+lldbTarget
+lldbPluginDisassemblerLLVMC
+lldbPluginProcessUtility
+  LINK_COMPONENTS
+Support
+${LLVM_TARGETS_TO_BUILD})
diff --git a/lldb/unittests/Disassembler/RISCV/CMakeLists.txt 
b/lldb/unittests/Disassembler/RISCV/CMakeLists.txt
deleted file mode 100644
index 5bcc3e948335c..0
--- a/lldb/unittests/Disassembler/RISCV/CMakeLists.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-add_lldb_unittest(MCDisasmInstanceRISCVTests
-   TestMCDisasmInstanceRISCV.cpp
-LINK_LIBS
-  lldbCore
-  lldbSymbol
-  lldbTarget
-  lldbPluginDisassemblerLLVMC
-  lldbPluginProcessUtility
-LINK_COMPONENTS
-  Support
-  ${LLVM_TARGETS_TO_BUILD}
-  )
diff --git a/lldb/unittests/Disassembler/x86/CMakeLists.txt 
b/lldb/unittests/Disassembler/x86/CMakeLists.txt
deleted file mode 100644
index 31d84cf5d8365..0
--- a/lldb/unittests/Disassembler/x86/CMakeLists.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-add_lldb_unittest(GetControlFlowKindx86Tests
-TestGetControlFlowKindx86.cpp
-LINK_LIBS
-  lldbCore
-  lldbSymbol
-  lldbTarget
-  lldbPluginDisassemblerLLVMC
-  lldbPluginProcessUtility
-LINK_COMPONENTS
-  Support
-  ${LLVM_TARGETS_TO_BUILD}
-  )

>From ea81332c53b326b5d70844692b9a55845b09c23c Mon Sep 17 00:00:00 2001
From: Reid Kleckner 
Date: Sun, 30 Mar 2025 14:49:38 -0700
Subject: [PATCH 2/2] use list(APPEND)

---
 lldb/unittests/Disassembler/CMakeLists.txt | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lldb/unittests/Disassembler/CMakeLists.txt 
b/lldb/unittests/Disassembler/CMakeLists.txt
index 4d443b69f29b1..81aff5902db74 100644
--- a/lldb/unittests/Disassembler/CMakeLists.txt
+++ b/lldb/unittests/Disassembler/CMakeLists.txt
@@ -1,20 +1,20 @@
 set(disas_srcs "")
 
 if("ARM" IN_LIST LLVM_TARGETS_TO_BUILD)
-  set(disas_srcs ${disas_srcs}
+  list(APPEND
 ARM/TestArm64Disassembly.cpp
 ARM/TestArmv7Disassembly.cpp
   )
 endif()
 
 if("X86" IN_LIST LLVM_TARGETS_TO_BUILD)
-  set(disas_srcs ${disas_srcs}
+  list(APPEND disas_srcs
 x86/TestGetControlFlowKindx86.cpp
   )
 endif()
 
 if("RISCV" IN_LIST LLVM_TARGETS_TO_BUILD)
-  set(disas_srcs ${disas_srcs}
+  list(APPEND disas_srcs
 RISCV/TestMCDisasmInstanceRISCV.cpp
   )
 endif()

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Combine disassembler gtest binaries for efficiency (PR #133539)

2025-03-28 Thread Reid Kleckner via lldb-commits

https://github.com/rnk created https://github.com/llvm/llvm-project/pull/133539

Each of these executables is 642MB for me locally with split DWARF, and we 
don't need 3 statically linked gtest binaries when one will do.

>From 1c16745d1779d91bcc0b34e1a82cc98e70def316 Mon Sep 17 00:00:00 2001
From: Reid Kleckner 
Date: Fri, 28 Mar 2025 15:37:49 -0700
Subject: [PATCH] [lldb] Combine disassembler gtest binaries for efficiency

Each of these executables is 642MB for me locally with split DWARF, and
we don't need 3 statically linked gtest binaries when one will do.
---
 .../unittests/Disassembler/ARM/CMakeLists.txt | 12 -
 lldb/unittests/Disassembler/CMakeLists.txt| 27 ---
 .../Disassembler/RISCV/CMakeLists.txt | 12 -
 .../unittests/Disassembler/x86/CMakeLists.txt | 12 -
 4 files changed, 24 insertions(+), 39 deletions(-)
 delete mode 100644 lldb/unittests/Disassembler/ARM/CMakeLists.txt
 delete mode 100644 lldb/unittests/Disassembler/RISCV/CMakeLists.txt
 delete mode 100644 lldb/unittests/Disassembler/x86/CMakeLists.txt

diff --git a/lldb/unittests/Disassembler/ARM/CMakeLists.txt 
b/lldb/unittests/Disassembler/ARM/CMakeLists.txt
deleted file mode 100644
index 91af06fa19d6f..0
--- a/lldb/unittests/Disassembler/ARM/CMakeLists.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-add_lldb_unittest(DisassemblerTests
-  TestArm64Disassembly.cpp
-  TestArmv7Disassembly.cpp
-  LINK_LIBS
-lldbCore
-lldbSymbol
-lldbTarget
-lldbPluginDisassemblerLLVMC
-lldbPluginProcessUtility
-  LINK_COMPONENTS
-Support
-${LLVM_TARGETS_TO_BUILD})
diff --git a/lldb/unittests/Disassembler/CMakeLists.txt 
b/lldb/unittests/Disassembler/CMakeLists.txt
index 208f1807427f4..4d443b69f29b1 100644
--- a/lldb/unittests/Disassembler/CMakeLists.txt
+++ b/lldb/unittests/Disassembler/CMakeLists.txt
@@ -1,11 +1,32 @@
+set(disas_srcs "")
+
 if("ARM" IN_LIST LLVM_TARGETS_TO_BUILD)
-  add_subdirectory(ARM)
+  set(disas_srcs ${disas_srcs}
+ARM/TestArm64Disassembly.cpp
+ARM/TestArmv7Disassembly.cpp
+  )
 endif()
 
 if("X86" IN_LIST LLVM_TARGETS_TO_BUILD)
-  add_subdirectory(x86)
+  set(disas_srcs ${disas_srcs}
+x86/TestGetControlFlowKindx86.cpp
+  )
 endif()
 
 if("RISCV" IN_LIST LLVM_TARGETS_TO_BUILD)
-   add_subdirectory(RISCV)
+  set(disas_srcs ${disas_srcs}
+RISCV/TestMCDisasmInstanceRISCV.cpp
+  )
 endif()
+
+add_lldb_unittest(DisassemblerTests
+  ${disas_srcs}
+  LINK_LIBS
+lldbCore
+lldbSymbol
+lldbTarget
+lldbPluginDisassemblerLLVMC
+lldbPluginProcessUtility
+  LINK_COMPONENTS
+Support
+${LLVM_TARGETS_TO_BUILD})
diff --git a/lldb/unittests/Disassembler/RISCV/CMakeLists.txt 
b/lldb/unittests/Disassembler/RISCV/CMakeLists.txt
deleted file mode 100644
index 5bcc3e948335c..0
--- a/lldb/unittests/Disassembler/RISCV/CMakeLists.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-add_lldb_unittest(MCDisasmInstanceRISCVTests
-   TestMCDisasmInstanceRISCV.cpp
-LINK_LIBS
-  lldbCore
-  lldbSymbol
-  lldbTarget
-  lldbPluginDisassemblerLLVMC
-  lldbPluginProcessUtility
-LINK_COMPONENTS
-  Support
-  ${LLVM_TARGETS_TO_BUILD}
-  )
diff --git a/lldb/unittests/Disassembler/x86/CMakeLists.txt 
b/lldb/unittests/Disassembler/x86/CMakeLists.txt
deleted file mode 100644
index 31d84cf5d8365..0
--- a/lldb/unittests/Disassembler/x86/CMakeLists.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-add_lldb_unittest(GetControlFlowKindx86Tests
-TestGetControlFlowKindx86.cpp
-LINK_LIBS
-  lldbCore
-  lldbSymbol
-  lldbTarget
-  lldbPluginDisassemblerLLVMC
-  lldbPluginProcessUtility
-LINK_COMPONENTS
-  Support
-  ${LLVM_TARGETS_TO_BUILD}
-  )

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Combine disassembler gtest binaries for efficiency (PR #133539)

2025-03-30 Thread Reid Kleckner via lldb-commits

rnk wrote:

Thanks!

https://github.com/llvm/llvm-project/pull/133539
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Combine disassembler gtest binaries for efficiency (PR #133539)

2025-03-30 Thread Reid Kleckner via lldb-commits

https://github.com/rnk closed https://github.com/llvm/llvm-project/pull/133539
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 92e5916 - [lldb] Fix cmake logic when no targets are configured

2025-03-30 Thread Reid Kleckner via lldb-commits

Author: Reid Kleckner
Date: 2025-03-30T15:14:48-07:00
New Revision: 92e591684576e7244d53722b04e840f28c3f03c3

URL: 
https://github.com/llvm/llvm-project/commit/92e591684576e7244d53722b04e840f28c3f03c3
DIFF: 
https://github.com/llvm/llvm-project/commit/92e591684576e7244d53722b04e840f28c3f03c3.diff

LOG: [lldb] Fix cmake logic when no targets are configured

Should fix reported lldb-remote-linux-ubuntu bot post-submit failure

Added: 


Modified: 
lldb/unittests/Disassembler/CMakeLists.txt

Removed: 




diff  --git a/lldb/unittests/Disassembler/CMakeLists.txt 
b/lldb/unittests/Disassembler/CMakeLists.txt
index 81aff5902db74..2a76158bf90fd 100644
--- a/lldb/unittests/Disassembler/CMakeLists.txt
+++ b/lldb/unittests/Disassembler/CMakeLists.txt
@@ -19,14 +19,16 @@ if("RISCV" IN_LIST LLVM_TARGETS_TO_BUILD)
   )
 endif()
 
-add_lldb_unittest(DisassemblerTests
-  ${disas_srcs}
-  LINK_LIBS
-lldbCore
-lldbSymbol
-lldbTarget
-lldbPluginDisassemblerLLVMC
-lldbPluginProcessUtility
-  LINK_COMPONENTS
-Support
-${LLVM_TARGETS_TO_BUILD})
+if (disas_srcs)
+  add_lldb_unittest(DisassemblerTests
+${disas_srcs}
+LINK_LIBS
+  lldbCore
+  lldbSymbol
+  lldbTarget
+  lldbPluginDisassemblerLLVMC
+  lldbPluginProcessUtility
+LINK_COMPONENTS
+  Support
+  ${LLVM_TARGETS_TO_BUILD})
+endif()



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits