[Lldb-commits] [PATCH] D56822: [Reproducers] Tool to insert SBReproducer macros

2019-01-28 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

Is this ready for review now?




Comment at: tools/sbrepro/SBRepro.cpp:98
+
+static std::string GetRegisterConstructorMacroMacro(StringRef Class,
+StringRef Signature) {

`MacroMacro`?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56822/new/

https://reviews.llvm.org/D56822



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


[Lldb-commits] [PATCH] D54617: [Reproducers] Add file provider

2019-01-28 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

I don't have any major issues with this patch. The thing I'd like to see though 
is one test which uses a path with `..` components and symlinks. If nothing 
else, it would serve as a good documentation for how these are supposed to be 
handled.




Comment at: include/lldb/Utility/Reproducer.h:91-92
+
+const char *FileInfo::name = "files";
+const char *FileInfo::file = "files.yaml";
+

JDevlieghere wrote:
> labath wrote:
> > Are you sure this can be in a header? I would expect this to give you 
> > multiply-defined symbols errors.
> You are correct, should be in the implementation. 
It looks like these are still in the header. :)



Comment at: source/Utility/FileCollector.cpp:27-33
+  // Change path to all upper case and ask for its real path, if the latter
+  // exists and is equal to path, it's not case sensitive. Default to case
+  // sensitive in the absence of real_path, since this is the YAMLVFSWriter
+  // default.
+  upper_dest = path.upper();
+  if (sys::fs::real_path(upper_dest, real_dest) && path.equals(real_dest))
+return false;

JDevlieghere wrote:
> davide wrote:
> > should this be a function in FS to check the case-sensitiveness?
> As Host depends on Utility, we cannot depend on the filesystem class here.
FWIW, I think it makes sense for FileCollector to *not* use the FileSystem 
class, as FileCollector is pretty much an implementation detail of the 
FileSystem.



Comment at: unittests/Utility/FileCollectorTest.cpp:31-67
+TEST(FileCollectorTest, AddFile) {
+  FileSpec root("/root", FileSpec::Style::posix);
+  TestingFileCollector file_collector(root);
+
+  file_collector.AddFile("/path/to/a");
+  file_collector.AddFile("/path/to/b");
+  file_collector.AddFile(FileSpec("/path/to/c", FileSpec::Style::posix));

I have some doubts about whether this will correctly run on windows (mixing of 
posix and native paths sounds worrying). It might be better to just have this 
test always work with host paths (as these class should always deal with files 
on the host system anyway).



Comment at: unittests/Utility/FileCollectorTest.cpp:71-72
+  std::error_code ec;
+  // Create a unique directory. We cannot depend on lldb's filesystem for this
+  // because it depends on Utility.
+  SmallString<128> collector_root;

For testing, you can theoretically pull in other modules if they are needed 
(but I don't think that's the case here).



Comment at: unittests/Utility/FileCollectorTest.cpp:78-80
+  SmallString<128> file_a;
+  ec = sys::fs::createTemporaryFile("file", "a", file_a);
+  EXPECT_FALSE(ec);

If you made these into `ScopedFile` classes like the VFS tests do then besides 
making this shorter, you'd also make this test self-cleaning in most of the 
cases (I fear this can start choking the buildbots after a couple of thousand 
runs...)


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D54617/new/

https://reviews.llvm.org/D54617



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


[Lldb-commits] [PATCH] D57273: Make Type::GetByteSize optional

2019-01-28 Thread Pavel Labath via Phabricator via lldb-commits
labath accepted this revision.
labath added a comment.
This revision is now accepted and ready to land.

Looks fine to me.

I guess this would be the place I'd start thinking about an `OptionalSize` 
class (to replace the two fields in the Type class). But I don't think that's 
necessary yet...


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57273/new/

https://reviews.llvm.org/D57273



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


[Lldb-commits] [PATCH] D57275: [testsuite] Remove seven dependency

2019-01-28 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

+1 for keeping seven.py. Anything that moves code out of dotest.py is a good 
thing.


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57275/new/

https://reviews.llvm.org/D57275



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


[Lldb-commits] [PATCH] D55318: [Expressions] Add support of expressions evaluation in some object's context

2019-01-28 Thread Aleksandr Urakov via Phabricator via lldb-commits
aleksandr.urakov updated this revision to Diff 183816.
aleksandr.urakov added a comment.
Herald added a reviewer: serge-sans-paille.

Sorry for the long delay with reply. My colleague with a Mac (and Obj-C 
knowledge) have created the test for the Obj-C case. Can you take a look, 
please?


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55318/new/

https://reviews.llvm.org/D55318

Files:
  include/lldb/API/SBValue.h
  include/lldb/Expression/ExpressionSourceCode.h
  include/lldb/Expression/UserExpression.h
  include/lldb/Symbol/ClangASTContext.h
  include/lldb/Symbol/TypeSystem.h
  include/lldb/Target/Target.h
  packages/Python/lldbsuite/test/expression_command/context-object-objc/Makefile
  
packages/Python/lldbsuite/test/expression_command/context-object-objc/TestContextObjectObjc.py
  packages/Python/lldbsuite/test/expression_command/context-object-objc/main.m
  packages/Python/lldbsuite/test/expression_command/context-object/Makefile
  
packages/Python/lldbsuite/test/expression_command/context-object/TestContextObject.py
  packages/Python/lldbsuite/test/expression_command/context-object/main.cpp
  scripts/interface/SBValue.i
  source/API/SBValue.cpp
  source/Breakpoint/BreakpointLocation.cpp
  source/Breakpoint/Watchpoint.cpp
  source/Commands/CommandObjectExpression.cpp
  source/Expression/ExpressionSourceCode.cpp
  source/Expression/UserExpression.cpp
  source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
  source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h
  source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
  source/Plugins/ExpressionParser/Clang/ClangUserExpression.h
  source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp
  source/Symbol/ClangASTContext.cpp
  source/Target/Target.cpp

Index: source/Target/Target.cpp
===
--- source/Target/Target.cpp
+++ source/Target/Target.cpp
@@ -2199,7 +2199,8 @@
 UserExpression *Target::GetUserExpressionForLanguage(
 llvm::StringRef expr, llvm::StringRef prefix, lldb::LanguageType language,
 Expression::ResultType desired_type,
-const EvaluateExpressionOptions &options, Status &error) {
+const EvaluateExpressionOptions &options,
+ValueObject *ctx_obj, Status &error) {
   Status type_system_error;
 
   TypeSystem *type_system =
@@ -2215,7 +2216,7 @@
   }
 
   user_expr = type_system->GetUserExpression(expr, prefix, language,
- desired_type, options);
+ desired_type, options, ctx_obj);
   if (!user_expr)
 error.SetErrorStringWithFormat(
 "Could not create an expression for language %s",
@@ -2356,7 +2357,8 @@
 ExpressionResults Target::EvaluateExpression(
 llvm::StringRef expr, ExecutionContextScope *exe_scope,
 lldb::ValueObjectSP &result_valobj_sp,
-const EvaluateExpressionOptions &options, std::string *fixed_expression) {
+const EvaluateExpressionOptions &options, std::string *fixed_expression,
+ValueObject *ctx_obj) {
   result_valobj_sp.reset();
 
   ExpressionResults execution_results = eExpressionSetupError;
@@ -2397,7 +2399,9 @@
 execution_results = UserExpression::Evaluate(exe_ctx, options, expr, prefix,
  result_valobj_sp, error,
  0, // Line Number
- fixed_expression);
+ fixed_expression,
+ nullptr, // Module
+ ctx_obj);
   }
 
   m_suppress_stop_hooks = old_suppress_value;
Index: source/Symbol/ClangASTContext.cpp
===
--- source/Symbol/ClangASTContext.cpp
+++ source/Symbol/ClangASTContext.cpp
@@ -10318,13 +10318,14 @@
 UserExpression *ClangASTContextForExpressions::GetUserExpression(
 llvm::StringRef expr, llvm::StringRef prefix, lldb::LanguageType language,
 Expression::ResultType desired_type,
-const EvaluateExpressionOptions &options) {
+const EvaluateExpressionOptions &options,
+ValueObject *ctx_obj) {
   TargetSP target_sp = m_target_wp.lock();
   if (!target_sp)
 return nullptr;
 
   return new ClangUserExpression(*target_sp.get(), expr, prefix, language,
- desired_type, options);
+ desired_type, options, ctx_obj);
 }
 
 FunctionCaller *ClangASTContextForExpressions::GetFunctionCaller(
Index: source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp
===
--- source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp
+++ source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp
@@ -156,5 +156,6 @@
 void ClangUtilityFunction::ClangUtilityFunctionHelper::ResetDecl

[Lldb-commits] [PATCH] D56904: [NativePDB] Process virtual bases in the correct order

2019-01-28 Thread Aleksandr Urakov via Phabricator via lldb-commits
aleksandr.urakov added a comment.

Ping! Can you take a look, please?


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56904/new/

https://reviews.llvm.org/D56904



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


[Lldb-commits] [PATCH] D56126: [NativePDB] Add basic support of methods recostruction in AST

2019-01-28 Thread Aleksandr Urakov via Phabricator via lldb-commits
aleksandr.urakov added a comment.

Ping! Can you take a look, please?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56126/new/

https://reviews.llvm.org/D56126



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


[Lldb-commits] [PATCH] D57282: [cmake] Fix get_llvm_lit_path() to respect LLVM_EXTERNAL_LIT always

2019-01-28 Thread Stefan Gränitz via Phabricator via lldb-commits
sgraenitz accepted this revision.
sgraenitz added a comment.
This revision is now accepted and ready to land.

LGTM


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57282/new/

https://reviews.llvm.org/D57282



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


[Lldb-commits] [lldb] r352374 - [cmake] Fix get_llvm_lit_path() to respect LLVM_EXTERNAL_LIT always

2019-01-28 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Mon Jan 28 07:16:03 2019
New Revision: 352374

URL: http://llvm.org/viewvc/llvm-project?rev=352374&view=rev
Log:
[cmake] Fix get_llvm_lit_path() to respect LLVM_EXTERNAL_LIT always

Refactor the get_llvm_lit_path() logic to respect LLVM_EXTERNAL_LIT,
and require the fallback to be defined explicitly
as LLVM_DEFAULT_EXTERNAL_LIT. This fixes building libcxx standalone
after r346888.

The old logic was using LLVM_EXTERNAL_LIT both as user-defined cache
variable and an optional pre-definition of default value from caller
(e.g. libcxx). It included a hack to make this work by assigning
the value back and forth but it was fragile and stopped working
in libcxx.

The new logic is simpler and more transparent. Default value is
provided in a separate variable, and used only when user-specified
variable is empty (i.e. not overriden).

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

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

Modified: lldb/trunk/cmake/modules/LLDBStandalone.cmake
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/LLDBStandalone.cmake?rev=352374&r1=352373&r2=352374&view=diff
==
--- lldb/trunk/cmake/modules/LLDBStandalone.cmake (original)
+++ lldb/trunk/cmake/modules/LLDBStandalone.cmake Mon Jan 28 07:16:03 2019
@@ -23,7 +23,7 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURR
   set(LLVM_MAIN_INCLUDE_DIR ${LLVM_BUILD_MAIN_INCLUDE_DIR} CACHE PATH "Path to 
llvm/include")
   set(LLVM_LIBRARY_DIR ${LLVM_BUILD_LIBRARY_DIR} CACHE PATH "Path to llvm/lib")
   set(LLVM_BINARY_DIR ${LLVM_BUILD_BINARY_DIR} CACHE PATH "Path to LLVM build 
tree")
-  set(LLVM_EXTERNAL_LIT ${LLVM_TOOLS_BINARY_DIR}/llvm-lit CACHE PATH "Path to 
llvm-lit")
+  set(LLVM_DEFAULT_EXTERNAL_LIT ${LLVM_TOOLS_BINARY_DIR}/llvm-lit CACHE PATH 
"Path to llvm-lit")
 
   if(CMAKE_CROSSCOMPILING)
 set(LLVM_NATIVE_BUILD "${LLDB_PATH_TO_LLVM_BUILD}/NATIVE")


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


[Lldb-commits] [PATCH] D57282: [cmake] Fix get_llvm_lit_path() to respect LLVM_EXTERNAL_LIT always

2019-01-28 Thread Michał Górny via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL352374: [cmake] Fix get_llvm_lit_path() to respect 
LLVM_EXTERNAL_LIT always (authored by mgorny, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D57282?vs=183693&id=183855#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57282/new/

https://reviews.llvm.org/D57282

Files:
  libcxx/trunk/cmake/Modules/HandleOutOfTreeLLVM.cmake
  libcxxabi/trunk/cmake/Modules/HandleOutOfTreeLLVM.cmake
  lldb/trunk/cmake/modules/LLDBStandalone.cmake
  llvm/trunk/cmake/modules/AddLLVM.cmake


Index: lldb/trunk/cmake/modules/LLDBStandalone.cmake
===
--- lldb/trunk/cmake/modules/LLDBStandalone.cmake
+++ lldb/trunk/cmake/modules/LLDBStandalone.cmake
@@ -23,7 +23,7 @@
   set(LLVM_MAIN_INCLUDE_DIR ${LLVM_BUILD_MAIN_INCLUDE_DIR} CACHE PATH "Path to 
llvm/include")
   set(LLVM_LIBRARY_DIR ${LLVM_BUILD_LIBRARY_DIR} CACHE PATH "Path to llvm/lib")
   set(LLVM_BINARY_DIR ${LLVM_BUILD_BINARY_DIR} CACHE PATH "Path to LLVM build 
tree")
-  set(LLVM_EXTERNAL_LIT ${LLVM_TOOLS_BINARY_DIR}/llvm-lit CACHE PATH "Path to 
llvm-lit")
+  set(LLVM_DEFAULT_EXTERNAL_LIT ${LLVM_TOOLS_BINARY_DIR}/llvm-lit CACHE PATH 
"Path to llvm-lit")
 
   if(CMAKE_CROSSCOMPILING)
 set(LLVM_NATIVE_BUILD "${LLDB_PATH_TO_LLVM_BUILD}/NATIVE")
Index: libcxxabi/trunk/cmake/Modules/HandleOutOfTreeLLVM.cmake
===
--- libcxxabi/trunk/cmake/Modules/HandleOutOfTreeLLVM.cmake
+++ libcxxabi/trunk/cmake/Modules/HandleOutOfTreeLLVM.cmake
@@ -119,7 +119,7 @@
 # Required LIT Configuration 

 # Define the default arguments to use with 'lit', and an option for the 
user
 # to override.
-set(LLVM_EXTERNAL_LIT "${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py")
+set(LLVM_DEFAULT_EXTERNAL_LIT "${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py")
 set(LIT_ARGS_DEFAULT "-sv --show-xfail --show-unsupported")
 if (MSVC OR XCODE)
   set(LIT_ARGS_DEFAULT "${LIT_ARGS_DEFAULT} --no-progress-bar")
Index: libcxx/trunk/cmake/Modules/HandleOutOfTreeLLVM.cmake
===
--- libcxx/trunk/cmake/Modules/HandleOutOfTreeLLVM.cmake
+++ libcxx/trunk/cmake/Modules/HandleOutOfTreeLLVM.cmake
@@ -116,7 +116,7 @@
 # Required LIT Configuration 

 # Define the default arguments to use with 'lit', and an option for the 
user
 # to override.
-set(LLVM_EXTERNAL_LIT "${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py")
+set(LLVM_DEFAULT_EXTERNAL_LIT "${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py")
 set(LIT_ARGS_DEFAULT "-sv --show-xfail --show-unsupported")
 if (MSVC OR XCODE)
   set(LIT_ARGS_DEFAULT "${LIT_ARGS_DEFAULT} --no-progress-bar")
Index: llvm/trunk/cmake/modules/AddLLVM.cmake
===
--- llvm/trunk/cmake/modules/AddLLVM.cmake
+++ llvm/trunk/cmake/modules/AddLLVM.cmake
@@ -1280,7 +1280,6 @@
   cmake_parse_arguments(ARG "ALLOW_EXTERNAL" "" "" ${ARGN})
 
   if (ARG_ALLOW_EXTERNAL)
-set(LLVM_DEFAULT_EXTERNAL_LIT "${LLVM_EXTERNAL_LIT}")
 set (LLVM_EXTERNAL_LIT "" CACHE STRING "Command used to spawn lit")
 if ("${LLVM_EXTERNAL_LIT}" STREQUAL "")
   set(LLVM_EXTERNAL_LIT "${LLVM_DEFAULT_EXTERNAL_LIT}")


Index: lldb/trunk/cmake/modules/LLDBStandalone.cmake
===
--- lldb/trunk/cmake/modules/LLDBStandalone.cmake
+++ lldb/trunk/cmake/modules/LLDBStandalone.cmake
@@ -23,7 +23,7 @@
   set(LLVM_MAIN_INCLUDE_DIR ${LLVM_BUILD_MAIN_INCLUDE_DIR} CACHE PATH "Path to llvm/include")
   set(LLVM_LIBRARY_DIR ${LLVM_BUILD_LIBRARY_DIR} CACHE PATH "Path to llvm/lib")
   set(LLVM_BINARY_DIR ${LLVM_BUILD_BINARY_DIR} CACHE PATH "Path to LLVM build tree")
-  set(LLVM_EXTERNAL_LIT ${LLVM_TOOLS_BINARY_DIR}/llvm-lit CACHE PATH "Path to llvm-lit")
+  set(LLVM_DEFAULT_EXTERNAL_LIT ${LLVM_TOOLS_BINARY_DIR}/llvm-lit CACHE PATH "Path to llvm-lit")
 
   if(CMAKE_CROSSCOMPILING)
 set(LLVM_NATIVE_BUILD "${LLDB_PATH_TO_LLVM_BUILD}/NATIVE")
Index: libcxxabi/trunk/cmake/Modules/HandleOutOfTreeLLVM.cmake
===
--- libcxxabi/trunk/cmake/Modules/HandleOutOfTreeLLVM.cmake
+++ libcxxabi/trunk/cmake/Modules/HandleOutOfTreeLLVM.cmake
@@ -119,7 +119,7 @@
 # Required LIT Configuration 
 # Define the default arguments to use with 'lit', and an option for the user
 # to override.
-set(LLVM_EXTERNAL_LIT "${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py")
+set(LLVM_DEFAULT_EXTERNAL_LIT "${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py")
 set(LIT_ARGS_DEFAULT "-sv --show-xfail --show-unsupported")
 if (MSVC OR XCODE)
   set(LIT_ARGS_DEFAULT "${LIT_ARGS_DEFAULT} --n

[Lldb-commits] [PATCH] D57330: Adjust documentation for git migration.

2019-01-28 Thread James Y Knight via Phabricator via lldb-commits
jyknight created this revision.
jyknight added reviewers: jlebar, rnk, mehdi_amini.
Herald added subscribers: jsji, jfb, arphaman, christof, delcypher, hiraditya, 
nhaehnle, jvesely, nemanjai, kubamracek, arsenm.
Herald added a reviewer: bollu.
Herald added a reviewer: serge-sans-paille.

This fixes most references to the paths:
 llvm.org/svn/
 llvm.org/git/
 llvm.org/viewvc/
 github.com/llvm-mirror/
 github.com/llvm-project/
 reviews.llvm.org/diffusion/

to instead point to https://github.com/llvm/llvm-project.

This is *not* a trivial substitution, because additionally, all the
checkout instructions had to be migrated to instruct users on how to
use the monorepo layout, setting LLVM_ENABLE_PROJECTS instead of
checking out various projects into various subdirectories.

I've attempted to *NOT* change any scripts here, only
documentation. The scripts will have to be addressed separately.


https://reviews.llvm.org/D57330

Files:
  clang-tools-extra/docs/clang-rename.rst
  clang-tools-extra/docs/clang-tidy/Contributing.rst
  clang-tools-extra/docs/clang-tidy/Integrations.rst
  clang/.gitignore
  clang/docs/ClangPlugins.rst
  clang/docs/ClangTools.rst
  clang/docs/ControlFlowIntegrityDesign.rst
  clang/docs/InternalsManual.rst
  clang/docs/LibASTMatchersTutorial.rst
  clang/docs/LibTooling.rst
  clang/docs/Toolchain.rst
  clang/lib/CodeGen/CGOpenMPRuntime.cpp
  clang/www/analyzer/checker_dev_manual.html
  clang/www/get_started.html
  clang/www/hacking.html
  clang/www/menu.html.incl
  compiler-rt/include/sanitizer/tsan_interface_atomic.h
  compiler-rt/lib/tsan/rtl/tsan_interface.h
  compiler-rt/www/index.html
  compiler-rt/www/menu.html.incl
  libclc/www/index.html
  libcxx/docs/BuildingLibcxx.rst
  libcxx/docs/index.rst
  libcxx/www/TS_deprecation.html
  libcxx/www/atomic_design.html
  libcxx/www/atomic_design_a.html
  libcxx/www/atomic_design_b.html
  libcxx/www/atomic_design_c.html
  libcxx/www/cxx1y_status.html
  libcxx/www/cxx1z_status.html
  libcxx/www/cxx2a_status.html
  libcxx/www/index.html
  libcxx/www/ts1z_status.html
  libcxx/www/type_traits_design.html
  libcxx/www/upcoming_meeting.html
  libcxxabi/www/index.html
  libunwind/docs/BuildingLibunwind.rst
  libunwind/docs/index.rst
  lld/docs/getting_started.rst
  lld/docs/index.rst
  lldb/docs/building-with-debug-llvm.txt
  
lldb/packages/Python/lldbsuite/test/functionalities/command_source/TestCommandSource.py
  
lldb/packages/Python/lldbsuite/test/lang/objc/objc-optimized/TestObjcOptimized.py
  lldb/utils/vim-lldb/doc/lldb.txt
  lldb/www/adding-language-support.html
  lldb/www/build.html
  lldb/www/index.html
  lldb/www/python-reference.html
  lldb/www/scripting.html
  lldb/www/sidebar.incl
  lldb/www/source.html
  lldb/www/symbolication.html
  lldb/www/varformats.html
  llgo/README.TXT
  llvm/docs/CompileCudaWithLLVM.rst
  llvm/docs/LibFuzzer.rst
  llvm/docs/TestSuiteMakefileGuide.rst
  llvm/docs/TestingGuide.rst
  llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
  llvm/lib/Target/AMDGPU/AMDGPUISelLowering.h
  llvm/test/CodeGen/PowerPC/pr24546.ll
  llvm/utils/lit/setup.py
  openmp/www/index.html
  polly/docs/TipsAndTricks.rst
  polly/www/get_started.html
  polly/www/menu.html.incl
  polly/www/todo.html

Index: polly/www/todo.html
===
--- polly/www/todo.html
+++ polly/www/todo.html
@@ -411,12 +411,6 @@
 >http://llvm.org/svn/llvm-project/polly
  Tobias
 
-
-
- Git mirror
-
-git://llvm.org/git/polly.git
- Tobias
 
 
  Commit mails
Index: polly/www/menu.html.incl
===
--- polly/www/menu.html.incl
+++ polly/www/menu.html.incl
@@ -34,7 +34,7 @@
 http://lab.llvm.org:8080/coverage/coverage-reports/polly/index.html";>Code Coverage
 http://llvm.org/reports/scan-build/";>Static analysis
 Doxygen
-https://github.com/llvm-mirror/polly";>Source @ GitHub
+https://github.com/llvm/llvm-project/tree/master/polly";>Source @ GitHub
   
 
   
Index: polly/www/get_started.html
===
--- polly/www/get_started.html
+++ polly/www/get_started.html
@@ -33,20 +33,14 @@
  Manual 
  Get the code 
 
-Warning: Polly/LLVM/clang need to be checked out at the same time.
-
 
-git clone http://llvm.org/git/llvm.git llvm_git
-git clone http://llvm.org/git/polly.git llvm_git/tools/polly
-
-# Also build the matching clang-version (optional)
-git clone http://llvm.org/git/clang.git llvm_git/tools/clang
+git clone http://github.com/llvm/llvm-project.git llvm_git
 
 Build Polly
 
 
 mkdir llvm_build && cd llvm_build
-cmake ../llvm_git && make
+cmake -DLLVM_ENABLE_PROJECTS='polly;clang' ../llvm_git/llvm && make
 
 
  Test Polly
@@ -59,7 +53,7 @@
 build. To configure Polly to use a pre-built LLVM, set the
 -DCMAKE_PREFIX_PATH option:
 
-cmake -DCMAKE_PREFIX_PATH=${LLVM_PREFIX}/lib/cmake/llvm
+cmake -DCMAKE_PREFIX_PATH=${LLVM_PREFIX}/lib/cmake/llvm ../llvm_git/polly
 
 To run unittests,

[Lldb-commits] [lldb] r352382 - [CMake] Quick-Fix targets don't exist when building against LLVM install-tree with LLDB_INCLUDE_TESTS=ON

2019-01-28 Thread Stefan Granitz via lldb-commits
Author: stefan.graenitz
Date: Mon Jan 28 08:15:27 2019
New Revision: 352382

URL: http://llvm.org/viewvc/llvm-project?rev=352382&view=rev
Log:
[CMake] Quick-Fix targets don't exist when building against LLVM install-tree 
with LLDB_INCLUDE_TESTS=ON

The issue came up during release testing for LLVM 8: 
https://bugs.llvm.org/show_bug.cgi?id=40443

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

Modified:
lldb/trunk/cmake/modules/AddLLDB.cmake
lldb/trunk/lit/CMakeLists.txt

Modified: lldb/trunk/cmake/modules/AddLLDB.cmake
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/AddLLDB.cmake?rev=352382&r1=352381&r2=352382&view=diff
==
--- lldb/trunk/cmake/modules/AddLLDB.cmake (original)
+++ lldb/trunk/cmake/modules/AddLLDB.cmake Mon Jan 28 08:15:27 2019
@@ -88,7 +88,9 @@ function(add_lldb_library name)
   # Hack: only some LLDB libraries depend on the clang autogenerated headers,
   # but it is simple enough to make all of LLDB depend on some of those
   # headers without negatively impacting much of anything.
-  add_dependencies(${name} clang-tablegen-targets)
+  if(NOT LLDB_BUILT_STANDALONE)
+add_dependencies(${name} clang-tablegen-targets)
+  endif()
 
   # Add in any extra C++ compilation flags for this library.
   target_compile_options(${name} PRIVATE ${PARAM_EXTRA_CXXFLAGS})

Modified: lldb/trunk/lit/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/CMakeLists.txt?rev=352382&r1=352381&r2=352382&view=diff
==
--- lldb/trunk/lit/CMakeLists.txt (original)
+++ lldb/trunk/lit/CMakeLists.txt Mon Jan 28 08:15:27 2019
@@ -26,9 +26,6 @@ list(APPEND LLDB_TEST_DEPS
   llvm-config
   llvm-mc
   llvm-objcopy
-  FileCheck
-  count
-  not
   )
 
 if(TARGET lld)
@@ -55,6 +52,14 @@ configure_lit_site_cfg(
   ${CMAKE_CURRENT_SOURCE_DIR}/Suite/lit.site.cfg.in
   ${CMAKE_CURRENT_BINARY_DIR}/Suite/lit.site.cfg)
 
+if(NOT LLDB_BUILT_STANDALONE)
+  list(APPEND LLDB_TEST_DEPS
+FileCheck
+count
+not
+  )
+endif()
+
 add_lit_testsuite(check-lldb-lit "Running lldb lit test suite"
   ${CMAKE_CURRENT_BINARY_DIR}
   DEPENDS ${LLDB_TEST_DEPS}


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


[Lldb-commits] [PATCH] D57233: [CMake] Quick-Fix targets don't exist when building against LLVM install-tree with LLDB_INCLUDE_TESTS=ON

2019-01-28 Thread Phabricator via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rLLDB352382: [CMake] Quick-Fix targets don't exist when 
building against LLVM install-tree… (authored by stefan.graenitz, committed by 
).
Herald added a subscriber: teemperor.

Changed prior to commit:
  https://reviews.llvm.org/D57233?vs=183522&id=183869#toc

Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57233/new/

https://reviews.llvm.org/D57233

Files:
  cmake/modules/AddLLDB.cmake
  lit/CMakeLists.txt


Index: lit/CMakeLists.txt
===
--- lit/CMakeLists.txt
+++ lit/CMakeLists.txt
@@ -26,9 +26,6 @@
   llvm-config
   llvm-mc
   llvm-objcopy
-  FileCheck
-  count
-  not
   )
 
 if(TARGET lld)
@@ -55,6 +52,14 @@
   ${CMAKE_CURRENT_SOURCE_DIR}/Suite/lit.site.cfg.in
   ${CMAKE_CURRENT_BINARY_DIR}/Suite/lit.site.cfg)
 
+if(NOT LLDB_BUILT_STANDALONE)
+  list(APPEND LLDB_TEST_DEPS
+FileCheck
+count
+not
+  )
+endif()
+
 add_lit_testsuite(check-lldb-lit "Running lldb lit test suite"
   ${CMAKE_CURRENT_BINARY_DIR}
   DEPENDS ${LLDB_TEST_DEPS}
Index: cmake/modules/AddLLDB.cmake
===
--- cmake/modules/AddLLDB.cmake
+++ cmake/modules/AddLLDB.cmake
@@ -88,7 +88,9 @@
   # Hack: only some LLDB libraries depend on the clang autogenerated headers,
   # but it is simple enough to make all of LLDB depend on some of those
   # headers without negatively impacting much of anything.
-  add_dependencies(${name} clang-tablegen-targets)
+  if(NOT LLDB_BUILT_STANDALONE)
+add_dependencies(${name} clang-tablegen-targets)
+  endif()
 
   # Add in any extra C++ compilation flags for this library.
   target_compile_options(${name} PRIVATE ${PARAM_EXTRA_CXXFLAGS})


Index: lit/CMakeLists.txt
===
--- lit/CMakeLists.txt
+++ lit/CMakeLists.txt
@@ -26,9 +26,6 @@
   llvm-config
   llvm-mc
   llvm-objcopy
-  FileCheck
-  count
-  not
   )
 
 if(TARGET lld)
@@ -55,6 +52,14 @@
   ${CMAKE_CURRENT_SOURCE_DIR}/Suite/lit.site.cfg.in
   ${CMAKE_CURRENT_BINARY_DIR}/Suite/lit.site.cfg)
 
+if(NOT LLDB_BUILT_STANDALONE)
+  list(APPEND LLDB_TEST_DEPS
+FileCheck
+count
+not
+  )
+endif()
+
 add_lit_testsuite(check-lldb-lit "Running lldb lit test suite"
   ${CMAKE_CURRENT_BINARY_DIR}
   DEPENDS ${LLDB_TEST_DEPS}
Index: cmake/modules/AddLLDB.cmake
===
--- cmake/modules/AddLLDB.cmake
+++ cmake/modules/AddLLDB.cmake
@@ -88,7 +88,9 @@
   # Hack: only some LLDB libraries depend on the clang autogenerated headers,
   # but it is simple enough to make all of LLDB depend on some of those
   # headers without negatively impacting much of anything.
-  add_dependencies(${name} clang-tablegen-targets)
+  if(NOT LLDB_BUILT_STANDALONE)
+add_dependencies(${name} clang-tablegen-targets)
+  endif()
 
   # Add in any extra C++ compilation flags for this library.
   target_compile_options(${name} PRIVATE ${PARAM_EXTRA_CXXFLAGS})
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D57213: [Scalar] Add support for 512-bits values.

2019-01-28 Thread Davide Italiano via Phabricator via lldb-commits
davide added a comment.

Thanks for the review, Greg!


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57213/new/

https://reviews.llvm.org/D57213



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


[Lldb-commits] [PATCH] D57334: [CMake] Accept ENTITLEMENTS in llvm_add_library()

2019-01-28 Thread Stefan Gränitz via Phabricator via lldb-commits
sgraenitz created this revision.
sgraenitz added a reviewer: beanz.
Herald added subscribers: llvm-commits, mgorny.

We added support for code signing entitlements in add_llvm_executable() with 
D54443 . In the future it would be useful to 
have this functionality available also for libraries.


Repository:
  rL LLVM

https://reviews.llvm.org/D57334

Files:
  cmake/modules/AddLLVM.cmake


Index: cmake/modules/AddLLVM.cmake
===
--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -380,7 +380,7 @@
 function(llvm_add_library name)
   cmake_parse_arguments(ARG
 
"MODULE;SHARED;STATIC;OBJECT;DISABLE_LLVM_LINK_LLVM_DYLIB;SONAME;NO_INSTALL_RPATH"
-"OUTPUT_NAME;PLUGIN_TOOL"
+"OUTPUT_NAME;PLUGIN_TOOL;ENTITLEMENTS"
 "ADDITIONAL_HEADERS;DEPENDS;LINK_COMPONENTS;LINK_LIBS;OBJLIBS"
 ${ARGN})
   list(APPEND LLVM_COMMON_DEPENDS ${ARG_DEPENDS})
@@ -584,7 +584,7 @@
 
   if(ARG_SHARED OR ARG_MODULE)
 llvm_externalize_debuginfo(${name})
-llvm_codesign(${name})
+llvm_codesign(${name} ENTITLEMENTS ${ARG_ENTITLEMENTS})
   endif()
 endfunction()
 


Index: cmake/modules/AddLLVM.cmake
===
--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -380,7 +380,7 @@
 function(llvm_add_library name)
   cmake_parse_arguments(ARG
 "MODULE;SHARED;STATIC;OBJECT;DISABLE_LLVM_LINK_LLVM_DYLIB;SONAME;NO_INSTALL_RPATH"
-"OUTPUT_NAME;PLUGIN_TOOL"
+"OUTPUT_NAME;PLUGIN_TOOL;ENTITLEMENTS"
 "ADDITIONAL_HEADERS;DEPENDS;LINK_COMPONENTS;LINK_LIBS;OBJLIBS"
 ${ARGN})
   list(APPEND LLVM_COMMON_DEPENDS ${ARG_DEPENDS})
@@ -584,7 +584,7 @@
 
   if(ARG_SHARED OR ARG_MODULE)
 llvm_externalize_debuginfo(${name})
-llvm_codesign(${name})
+llvm_codesign(${name} ENTITLEMENTS ${ARG_ENTITLEMENTS})
   endif()
 endfunction()
 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D57273: Make Type::GetByteSize optional

2019-01-28 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added inline comments.



Comment at: include/lldb/Symbol/Type.h:221
+  uint64_t m_byte_size : 63;
+  unsigned m_byte_size_has_value : 1;
   Declaration m_decl;

Does this need to be uint64_t to share the same space as m_byte_size?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57273/new/

https://reviews.llvm.org/D57273



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


[Lldb-commits] [PATCH] D57273: Make Type::GetByteSize optional

2019-01-28 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl marked an inline comment as done.
aprantl added inline comments.



Comment at: include/lldb/Symbol/Type.h:221
+  uint64_t m_byte_size : 63;
+  unsigned m_byte_size_has_value : 1;
   Declaration m_decl;

clayborg wrote:
> Does this need to be uint64_t to share the same space as m_byte_size?
I don't think so, but it might be more readable.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57273/new/

https://reviews.llvm.org/D57273



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


[Lldb-commits] [PATCH] D56237: Implement GetFileLoadAddress for the Windows process plugin

2019-01-28 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment.

In D56237#1373234 , @labath wrote:

> I think there are some architectural issues here in how ProcessWindows works. 
> Normally (i.e., on all non-windows process classes), it is the job of the 
> dynamic loader plugin to create modules and set their load addresses. 
> However, ProcessWindows does things differently, and creates the modules by 
> itself (ProcessWindows::OnLoadDLL).
>  I think the behavior of ProcessWindows is fine (it flows naturally from how 
> modules are handled on windows), but if it's going to handle module loading 
> by itself, then I think it should do the job completely, and not only 
> half-way. So, if we want ProcessWindows to do the module loading, then it 
> should return a null value for `GetDynamicLoader()` (or a reasonably stubbed 
> out implementation) instead of relying on a generic dynamic loader plugin to 
> finish the job.
>
> Or, if we want to have the DynamicLoader plugin, then ProcessWindows should 
> stop meddling with the module list in the OnLoadDLL function. One way to 
> achieve that would be:
>
> - ProcessWindows::OnLoadDLL calls DynamicLoaderWindowsDYLD::OnLoadDll
> - dynamic loader loads the module and sets load address
> - dynamic loader does not have to call `ProcessWindows::GetFileLoadAddress` 
> as it already got the load address from in the OnLoadDLL function This would 
> make the flow very similar to how other platforms handle it (the only 
> difference would be that the "OnLoadDLL" equivalent is called from a 
> breakpoint callback function, instead of from a special debug event callback, 
> but that's just due to a difference in how modules are reported).


I would like the see the dynamic loader do all of the work. We can easily add 
any new virtual functions to the DynamicLoader class to fit how windows does 
things.


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56237/new/

https://reviews.llvm.org/D56237



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


[Lldb-commits] [PATCH] D57275: [testsuite] Remove seven dependency

2019-01-28 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere updated this revision to Diff 183877.
JDevlieghere added a comment.

- Remove trailing characters from get_command_status_output.
- Remove unused seven imports.

(I'll land this as two separate commits)


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57275/new/

https://reviews.llvm.org/D57275

Files:
  packages/Python/lldbsuite/support/seven.py
  packages/Python/lldbsuite/test/functionalities/exec/TestExec.py
  packages/Python/lldbsuite/test/functionalities/fat_archives/TestFatArchives.py
  packages/Python/lldbsuite/test/lang/objc/ivar-IMP/TestObjCiVarIMP.py


Index: packages/Python/lldbsuite/test/lang/objc/ivar-IMP/TestObjCiVarIMP.py
===
--- packages/Python/lldbsuite/test/lang/objc/ivar-IMP/TestObjCiVarIMP.py
+++ packages/Python/lldbsuite/test/lang/objc/ivar-IMP/TestObjCiVarIMP.py
@@ -10,21 +10,11 @@
 import re
 
 import lldb
-from lldbsuite.support import seven
 from lldbsuite.test.decorators import *
 from lldbsuite.test.lldbtest import *
 from lldbsuite.test import lldbutil
 
 
-def execute_command(command):
-# print('%% %s' % (command))
-(exit_status, output) = seven.get_command_status_output(command)
-# if output:
-# print(output)
-# print('status = %u' % (exit_status))
-return exit_status
-
-
 class ObjCiVarIMPTestCase(TestBase):
 
 mydir = TestBase.compute_mydir(__file__)
Index: 
packages/Python/lldbsuite/test/functionalities/fat_archives/TestFatArchives.py
===
--- 
packages/Python/lldbsuite/test/functionalities/fat_archives/TestFatArchives.py
+++ 
packages/Python/lldbsuite/test/functionalities/fat_archives/TestFatArchives.py
@@ -7,7 +7,6 @@
 import lldb
 import os
 import time
-import lldbsuite.support.seven as seven
 from lldbsuite.test.decorators import *
 from lldbsuite.test.lldbtest import *
 from lldbsuite.test import lldbutil
Index: packages/Python/lldbsuite/test/functionalities/exec/TestExec.py
===
--- packages/Python/lldbsuite/test/functionalities/exec/TestExec.py
+++ packages/Python/lldbsuite/test/functionalities/exec/TestExec.py
@@ -7,21 +7,11 @@
 import lldb
 import os
 import time
-from lldbsuite.support import seven
 from lldbsuite.test.decorators import *
 from lldbsuite.test.lldbtest import *
 from lldbsuite.test import lldbutil
 
 
-def execute_command(command):
-#print('%% %s' % (command))
-(exit_status, output) = seven.get_command_status_output(command)
-# if output:
-#print(output)
-#print('status = %u' % (exit_status))
-return exit_status
-
-
 class ExecTestCase(TestBase):
 
 NO_DEBUG_INFO_TESTCASE = True
Index: packages/Python/lldbsuite/support/seven.py
===
--- packages/Python/lldbsuite/support/seven.py
+++ packages/Python/lldbsuite/support/seven.py
@@ -15,7 +15,7 @@
 subprocess.check_output(
 command,
 shell=True,
-universal_newlines=True))
+universal_newlines=True).rstrip())
 except subprocess.CalledProcessError as e:
 return (e.returncode, e.output)
 


Index: packages/Python/lldbsuite/test/lang/objc/ivar-IMP/TestObjCiVarIMP.py
===
--- packages/Python/lldbsuite/test/lang/objc/ivar-IMP/TestObjCiVarIMP.py
+++ packages/Python/lldbsuite/test/lang/objc/ivar-IMP/TestObjCiVarIMP.py
@@ -10,21 +10,11 @@
 import re
 
 import lldb
-from lldbsuite.support import seven
 from lldbsuite.test.decorators import *
 from lldbsuite.test.lldbtest import *
 from lldbsuite.test import lldbutil
 
 
-def execute_command(command):
-# print('%% %s' % (command))
-(exit_status, output) = seven.get_command_status_output(command)
-# if output:
-# print(output)
-# print('status = %u' % (exit_status))
-return exit_status
-
-
 class ObjCiVarIMPTestCase(TestBase):
 
 mydir = TestBase.compute_mydir(__file__)
Index: packages/Python/lldbsuite/test/functionalities/fat_archives/TestFatArchives.py
===
--- packages/Python/lldbsuite/test/functionalities/fat_archives/TestFatArchives.py
+++ packages/Python/lldbsuite/test/functionalities/fat_archives/TestFatArchives.py
@@ -7,7 +7,6 @@
 import lldb
 import os
 import time
-import lldbsuite.support.seven as seven
 from lldbsuite.test.decorators import *
 from lldbsuite.test.lldbtest import *
 from lldbsuite.test import lldbutil
Index: packages/Python/lldbsuite/test/functionalities/exec/TestExec.py
===
--- packages/Python/lldbsuite/test/functionalities/exec/TestExec.py
+++ packages/Python/lldbsuite/test/functionalities/exec/TestExec.py
@@ -7,21 +7,11 @@
 import lldb
 import os
 import time
-from lldbsui

[Lldb-commits] [lldb] r352387 - [CMake] Dump LLDB.framework tools at configuration time

2019-01-28 Thread Stefan Granitz via lldb-commits
Author: stefan.graenitz
Date: Mon Jan 28 08:57:19 2019
New Revision: 352387

URL: http://llvm.org/viewvc/llvm-project?rev=352387&view=rev
Log:
[CMake] Dump LLDB.framework tools at configuration time

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

Modified: lldb/trunk/cmake/modules/LLDBFramework.cmake
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/LLDBFramework.cmake?rev=352387&r1=352386&r2=352387&view=diff
==
--- lldb/trunk/cmake/modules/LLDBFramework.cmake (original)
+++ lldb/trunk/cmake/modules/LLDBFramework.cmake Mon Jan 28 08:57:19 2019
@@ -41,6 +41,7 @@ add_dependencies(lldb-framework liblldb)
 
 # Dependencies are defined once tools are added (see AddLLDB.cmake)
 if(LLDB_FRAMEWORK_TOOLS)
+  message(STATUS "LLDB.framework: adding tools ${LLDB_FRAMEWORK_TOOLS}")
   foreach(tool ${LLDB_FRAMEWORK_TOOLS})
 add_custom_command(TARGET lldb-framework POST_BUILD
   COMMAND ${CMAKE_COMMAND} -E copy $ 
$/Resources


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


[Lldb-commits] [lldb] r352388 - [CMake] Add code signing for lldb-server on iOS

2019-01-28 Thread Stefan Granitz via lldb-commits
Author: stefan.graenitz
Date: Mon Jan 28 08:57:23 2019
New Revision: 352388

URL: http://llvm.org/viewvc/llvm-project?rev=352388&view=rev
Log:
[CMake] Add code signing for lldb-server on iOS

Modified:
lldb/trunk/tools/lldb-server/CMakeLists.txt

Modified: lldb/trunk/tools/lldb-server/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-server/CMakeLists.txt?rev=352388&r1=352387&r2=352388&view=diff
==
--- lldb/trunk/tools/lldb-server/CMakeLists.txt (original)
+++ lldb/trunk/tools/lldb-server/CMakeLists.txt Mon Jan 28 08:57:23 2019
@@ -42,6 +42,18 @@ else()
   list(APPEND LLDB_PLUGINS lldbPluginObjectFileELF)
 endif()
 
+if(IOS)
+  if(LLDB_CODESIGN_IDENTITY)
+# Use explicit LLDB identity
+set(LLVM_CODESIGNING_IDENTITY ${LLDB_CODESIGN_IDENTITY})
+  else()
+# Use explicit LLVM identity or default to lldb_codesign if empty
+if(NOT LLVM_CODESIGNING_IDENTITY)
+  set(LLVM_CODESIGNING_IDENTITY lldb_codesign)
+endif()
+  endif()
+endif()
+
 add_lldb_tool(lldb-server
 Acceptor.cpp
 lldb-gdbserver.cpp


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


[Lldb-commits] [PATCH] D56822: [Reproducers] Tool to insert SBReproducer macros

2019-01-28 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere updated this revision to Diff 183888.
JDevlieghere added reviewers: labath, davide, friss.
JDevlieghere added a comment.

Fix `MacroMacro` and other code cleanups.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56822/new/

https://reviews.llvm.org/D56822

Files:
  tools/CMakeLists.txt
  tools/sbrepro/CMakeLists.txt
  tools/sbrepro/SBRepro.cpp

Index: tools/sbrepro/SBRepro.cpp
===
--- /dev/null
+++ tools/sbrepro/SBRepro.cpp
@@ -0,0 +1,254 @@
+#include "clang/AST/AST.h"
+#include "clang/AST/ASTConsumer.h"
+#include "clang/AST/RecursiveASTVisitor.h"
+#include "clang/Frontend/ASTConsumers.h"
+#include "clang/Frontend/CompilerInstance.h"
+#include "clang/Frontend/FrontendActions.h"
+#include "clang/Rewrite/Core/Rewriter.h"
+#include "clang/Tooling/CommonOptionsParser.h"
+#include "clang/Tooling/Tooling.h"
+
+#include "llvm/Support/raw_ostream.h"
+
+#include 
+#include 
+
+using namespace clang;
+using namespace clang::driver;
+using namespace clang::tooling;
+
+static llvm::cl::OptionCategory ReproCategory("SB Reproducer");
+
+static std::string Join(const std::vector &V) {
+  std::string Str;
+  llvm::raw_string_ostream OS(Str);
+  for (std::size_t I = 0, E = V.size(); I < E; ++I) {
+OS << V[I];
+if (I != E - 1)
+  OS << ", ";
+  }
+  return OS.str();
+}
+
+static std::string GetRecordMethodMacroName(bool Static, bool Const,
+bool NoArgs) {
+  std::string Macro;
+  llvm::raw_string_ostream OS(Macro);
+
+  OS << "SB_RECORD";
+  if (Static)
+OS << "_STATIC";
+  OS << "_METHOD";
+  if (Const)
+OS << "_CONST";
+  if (NoArgs)
+OS << "_NO_ARGS";
+
+  return OS.str();
+}
+
+static std::string GetRegisterMethodMacroName(bool Static, bool Const) {
+  std::string Macro;
+  llvm::raw_string_ostream OS(Macro);
+
+  OS << "SB_REGISTER";
+  if (Static)
+OS << "_STATIC";
+  OS << "_METHOD";
+  if (Const)
+OS << "_CONST";
+
+  return OS.str();
+}
+
+static std::string GetRecordMethodMacro(StringRef Result, StringRef Class,
+StringRef Method, StringRef Signature,
+StringRef Values, bool Static,
+bool Const) {
+  std::string Macro;
+  llvm::raw_string_ostream OS(Macro);
+
+  OS << GetRecordMethodMacroName(Static, Const, Values.empty());
+  OS << "(" << Result << ", " << Class << ", " << Method;
+
+  if (!Values.empty()) {
+OS << ", (" << Signature << "), " << Values << ");\n";
+  } else {
+OS << ");\n";
+  }
+
+  return OS.str();
+}
+
+static std::string GetRecordConstructorMacro(StringRef Class,
+ StringRef Signature,
+ StringRef Values) {
+  std::string Macro;
+  llvm::raw_string_ostream OS(Macro);
+  if (!Values.empty()) {
+OS << "SB_RECORD_CONSTRUCTOR(" << Class << ", (" << Signature << "), "
+   << Values << ");\n";
+  } else {
+OS << "SB_RECORD_CONSTRUCTOR_NO_ARGS(" << Class << ");\n";
+  }
+  return OS.str();
+}
+
+static std::string GetRegisterConstructorMacro(StringRef Class,
+   StringRef Signature) {
+  std::string Macro;
+  llvm::raw_string_ostream OS(Macro);
+  OS << "SB_REGISTER_CONSTRUCTOR(" << Class << ", (" << Signature << "));\n";
+  return OS.str();
+}
+
+static std::string GetRegisterMethodMacro(StringRef Result, StringRef Class,
+  StringRef Method, StringRef Signature,
+  bool Static, bool Const) {
+  std::string Macro;
+  llvm::raw_string_ostream OS(Macro);
+  OS << GetRegisterMethodMacroName(Static, Const);
+  OS << "(" << Result << ", " << Class << ", " << Method << ", (" << Signature
+ << "));\n";
+  return OS.str();
+}
+
+class SBVisitor : public RecursiveASTVisitor {
+public:
+  SBVisitor(Rewriter &R, ASTContext &Context)
+  : MyRewriter(R), Context(Context) {}
+
+  bool VisitCXXMethodDecl(CXXMethodDecl *Decl) {
+if (Skip(Decl))
+  return false;
+
+// Print 'bool' instead of '_Bool'.
+PrintingPolicy Policy(Context.getLangOpts());
+Policy.Bool = true;
+
+std::vector ParamTypes;
+std::vector ParamNames;
+for (auto *P : Decl->parameters()) {
+  QualType T = P->getType();
+
+  // Currently we don't support functions that have function pointers as an
+  // argument.
+  if (T->isFunctionPointerType())
+return false;
+
+  // Currently we don't support functions that have void pointers as an
+  // argument.
+  if (T->isVoidPointerType())
+return false;
+
+  ParamTypes.push_back(T.getAsString(Policy));
+  ParamNames.push_back(P->getNameAsString());
+}
+std::string ParamTypesStr = Join(ParamTypes);
+std::string ParamNamesStr = Join(ParamNames);
+
+CXXRecordDecl *Record = Decl->getParent();
+QualT

[Lldb-commits] [PATCH] D57330: Adjust documentation for git migration.

2019-01-28 Thread James Y Knight via Phabricator via lldb-commits
jyknight updated this revision to Diff 183891.
jyknight added a comment.

Fix some warnings I added.

Restore TestSuiteMakefileGuide.rst, which apparently isn't 100%
obsolete. (But it is incorrect, and I'm not sure exactly how to fix
it, so I just left a FIXME).


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57330/new/

https://reviews.llvm.org/D57330

Files:
  clang-tools-extra/docs/clang-rename.rst
  clang-tools-extra/docs/clang-tidy/Contributing.rst
  clang-tools-extra/docs/clang-tidy/Integrations.rst
  clang/.gitignore
  clang/docs/ClangPlugins.rst
  clang/docs/ClangTools.rst
  clang/docs/ControlFlowIntegrityDesign.rst
  clang/docs/InternalsManual.rst
  clang/docs/LibASTMatchersTutorial.rst
  clang/docs/LibTooling.rst
  clang/docs/Toolchain.rst
  clang/lib/CodeGen/CGOpenMPRuntime.cpp
  clang/www/analyzer/checker_dev_manual.html
  clang/www/get_started.html
  clang/www/hacking.html
  clang/www/menu.html.incl
  compiler-rt/include/sanitizer/tsan_interface_atomic.h
  compiler-rt/lib/tsan/rtl/tsan_interface.h
  compiler-rt/www/index.html
  compiler-rt/www/menu.html.incl
  libclc/www/index.html
  libcxx/docs/BuildingLibcxx.rst
  libcxx/docs/index.rst
  libcxx/www/TS_deprecation.html
  libcxx/www/atomic_design.html
  libcxx/www/atomic_design_a.html
  libcxx/www/atomic_design_b.html
  libcxx/www/atomic_design_c.html
  libcxx/www/cxx1y_status.html
  libcxx/www/cxx1z_status.html
  libcxx/www/cxx2a_status.html
  libcxx/www/index.html
  libcxx/www/ts1z_status.html
  libcxx/www/type_traits_design.html
  libcxx/www/upcoming_meeting.html
  libcxxabi/www/index.html
  libunwind/docs/BuildingLibunwind.rst
  libunwind/docs/index.rst
  lld/docs/getting_started.rst
  lld/docs/index.rst
  lldb/docs/building-with-debug-llvm.txt
  
lldb/packages/Python/lldbsuite/test/functionalities/command_source/TestCommandSource.py
  
lldb/packages/Python/lldbsuite/test/lang/objc/objc-optimized/TestObjcOptimized.py
  lldb/utils/vim-lldb/doc/lldb.txt
  lldb/www/adding-language-support.html
  lldb/www/build.html
  lldb/www/index.html
  lldb/www/python-reference.html
  lldb/www/scripting.html
  lldb/www/sidebar.incl
  lldb/www/source.html
  lldb/www/symbolication.html
  lldb/www/varformats.html
  llgo/README.TXT
  llvm/docs/CompileCudaWithLLVM.rst
  llvm/docs/LibFuzzer.rst
  llvm/docs/TestSuiteGuide.md
  llvm/docs/TestSuiteMakefileGuide.rst
  llvm/docs/TestingGuide.rst
  llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
  llvm/lib/Target/AMDGPU/AMDGPUISelLowering.h
  llvm/test/CodeGen/PowerPC/pr24546.ll
  llvm/utils/lit/setup.py
  openmp/www/index.html
  polly/docs/TipsAndTricks.rst
  polly/www/get_started.html
  polly/www/menu.html.incl
  polly/www/todo.html

Index: polly/www/todo.html
===
--- polly/www/todo.html
+++ polly/www/todo.html
@@ -411,12 +411,6 @@
 >http://llvm.org/svn/llvm-project/polly
  Tobias
 
-
-
- Git mirror
-
-git://llvm.org/git/polly.git
- Tobias
 
 
  Commit mails
Index: polly/www/menu.html.incl
===
--- polly/www/menu.html.incl
+++ polly/www/menu.html.incl
@@ -34,7 +34,7 @@
 http://lab.llvm.org:8080/coverage/coverage-reports/polly/index.html";>Code Coverage
 http://llvm.org/reports/scan-build/";>Static analysis
 Doxygen
-https://github.com/llvm-mirror/polly";>Source @ GitHub
+https://github.com/llvm/llvm-project/tree/master/polly";>Source @ GitHub
   
 
   
Index: polly/www/get_started.html
===
--- polly/www/get_started.html
+++ polly/www/get_started.html
@@ -33,20 +33,14 @@
  Manual 
  Get the code 
 
-Warning: Polly/LLVM/clang need to be checked out at the same time.
-
 
-git clone http://llvm.org/git/llvm.git llvm_git
-git clone http://llvm.org/git/polly.git llvm_git/tools/polly
-
-# Also build the matching clang-version (optional)
-git clone http://llvm.org/git/clang.git llvm_git/tools/clang
+git clone http://github.com/llvm/llvm-project.git llvm_git
 
 Build Polly
 
 
 mkdir llvm_build && cd llvm_build
-cmake ../llvm_git && make
+cmake -DLLVM_ENABLE_PROJECTS='polly;clang' ../llvm_git/llvm && make
 
 
  Test Polly
@@ -59,7 +53,7 @@
 build. To configure Polly to use a pre-built LLVM, set the
 -DCMAKE_PREFIX_PATH option:
 
-cmake -DCMAKE_PREFIX_PATH=${LLVM_PREFIX}/lib/cmake/llvm
+cmake -DCMAKE_PREFIX_PATH=${LLVM_PREFIX}/lib/cmake/llvm ../llvm_git/polly
 
 To run unittests, however, you need to have the LLVM source directory around.
 Polly will use the llvm-config of the LLVM you're building against
Index: polly/docs/TipsAndTricks.rst
===
--- polly/docs/TipsAndTricks.rst
+++ polly/docs/TipsAndTricks.rst
@@ -47,7 +47,7 @@
 the regression.
 
 LLVM has a single repository that contains all projects. It can be cloned at:
-``_. How to bisect on a
+``_. Ho

[Lldb-commits] [lldb] r352394 - Make Type::GetByteSize optional (NFC)

2019-01-28 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Mon Jan 28 09:49:33 2019
New Revision: 352394

URL: http://llvm.org/viewvc/llvm-project?rev=352394&view=rev
Log:
Make Type::GetByteSize optional (NFC)

This is a continuation of my quest to make the size 0 a supported value.

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

Modified:
lldb/trunk/include/lldb/Symbol/Type.h
lldb/trunk/source/Core/ValueObjectMemory.cpp
lldb/trunk/source/Expression/Materializer.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
lldb/trunk/source/Symbol/Type.cpp

Modified: lldb/trunk/include/lldb/Symbol/Type.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/Type.h?rev=352394&r1=352393&r2=352394&view=diff
==
--- lldb/trunk/include/lldb/Symbol/Type.h (original)
+++ lldb/trunk/include/lldb/Symbol/Type.h Mon Jan 28 09:49:33 2019
@@ -95,7 +95,7 @@ public:
   } ResolveState;
 
   Type(lldb::user_id_t uid, SymbolFile *symbol_file, const ConstString &name,
-   uint64_t byte_size, SymbolContextScope *context,
+   llvm::Optional byte_size, SymbolContextScope *context,
lldb::user_id_t encoding_uid, EncodingDataType encoding_uid_type,
const Declaration &decl, const CompilerType &compiler_qual_type,
ResolveState compiler_type_resolve_state);
@@ -127,7 +127,7 @@ public:
 
   const ConstString &GetName();
 
-  uint64_t GetByteSize();
+  llvm::Optional GetByteSize();
 
   uint32_t GetNumChildren(bool omit_empty_base_classes);
 
@@ -217,7 +217,8 @@ protected:
   Type *m_encoding_type;
   lldb::user_id_t m_encoding_uid;
   EncodingDataType m_encoding_uid_type;
-  uint64_t m_byte_size;
+  uint64_t m_byte_size : 63;
+  uint64_t m_byte_size_has_value : 1;
   Declaration m_decl;
   CompilerType m_compiler_type;
 

Modified: lldb/trunk/source/Core/ValueObjectMemory.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectMemory.cpp?rev=352394&r1=352393&r2=352394&view=diff
==
--- lldb/trunk/source/Core/ValueObjectMemory.cpp (original)
+++ lldb/trunk/source/Core/ValueObjectMemory.cpp Mon Jan 28 09:49:33 2019
@@ -136,10 +136,8 @@ size_t ValueObjectMemory::CalculateNumCh
 
 uint64_t ValueObjectMemory::GetByteSize() {
   if (m_type_sp)
-return m_type_sp->GetByteSize();
-  if (llvm::Optional size = m_compiler_type.GetByteSize(nullptr))
-return *size;
-  return 0;
+return m_type_sp->GetByteSize().getValueOr(0);
+  return m_compiler_type.GetByteSize(nullptr).getValueOr(0);
 }
 
 lldb::ValueType ValueObjectMemory::GetValueType() const {

Modified: lldb/trunk/source/Expression/Materializer.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/Materializer.cpp?rev=352394&r1=352393&r2=352394&view=diff
==
--- lldb/trunk/source/Expression/Materializer.cpp (original)
+++ lldb/trunk/source/Expression/Materializer.cpp Mon Jan 28 09:49:33 2019
@@ -537,7 +537,8 @@ public:
 "size of variable %s (%" PRIu64
 ") is larger than the ValueObject's size (%" PRIu64 ")",
 m_variable_sp->GetName().AsCString(),
-m_variable_sp->GetType()->GetByteSize(), data.GetByteSize());
+m_variable_sp->GetType()->GetByteSize().getValueOr(0),
+data.GetByteSize());
   }
   return;
 }

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp?rev=352394&r1=352393&r2=352394&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp 
(original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp Mon Jan 
28 09:49:33 2019
@@ -264,7 +264,7 @@ TypeSP DWARFASTParserClang::ParseTypeFro
   const char *mangled_name_cstr = NULL;
   ConstString type_name_const_str;
   Type::ResolveState resolve_state = Type::eResolveStateUnresolved;
-  uint64_t byte_size = 0;
+  llvm::Optional byte_size;
   Declaration decl;
 
   Type::EncodingDataType encoding_data_type = Type::eEncodingIsUID;
@@ -386,7 +386,7 @@ TypeSP DWARFASTParserClang::ParseTypeFro
 case DW_TAG_base_type:
   resolve_state = Type::eResolveStateFull;
   clang_type = m_ast.GetBuiltinTypeForDWARFEncodingAndBitSize(
-  type_name_cstr, encoding, byte_size * 8);
+  type_name_cstr, encoding, byte_size.getValueOr(0) * 8);
   break;
 
 case DW_TAG_pointer_type:
@@ -535,7 +535,6 @@ TypeSP DWARFASTParserClang::ParseTypeFro
   case DW_TAG_class_type: {
 // Set a bit that lets us know th

[Lldb-commits] [PATCH] D57273: Make Type::GetByteSize optional

2019-01-28 Thread Phabricator via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL352394: Make Type::GetByteSize optional (NFC) (authored by 
adrian, committed by ).
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D57273?vs=183671&id=183895#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57273/new/

https://reviews.llvm.org/D57273

Files:
  lldb/trunk/include/lldb/Symbol/Type.h
  lldb/trunk/source/Core/ValueObjectMemory.cpp
  lldb/trunk/source/Expression/Materializer.cpp
  lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
  lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  lldb/trunk/source/Symbol/Type.cpp

Index: lldb/trunk/source/Expression/Materializer.cpp
===
--- lldb/trunk/source/Expression/Materializer.cpp
+++ lldb/trunk/source/Expression/Materializer.cpp
@@ -537,7 +537,8 @@
 "size of variable %s (%" PRIu64
 ") is larger than the ValueObject's size (%" PRIu64 ")",
 m_variable_sp->GetName().AsCString(),
-m_variable_sp->GetType()->GetByteSize(), data.GetByteSize());
+m_variable_sp->GetType()->GetByteSize().getValueOr(0),
+data.GetByteSize());
   }
   return;
 }
Index: lldb/trunk/source/Core/ValueObjectMemory.cpp
===
--- lldb/trunk/source/Core/ValueObjectMemory.cpp
+++ lldb/trunk/source/Core/ValueObjectMemory.cpp
@@ -136,10 +136,8 @@
 
 uint64_t ValueObjectMemory::GetByteSize() {
   if (m_type_sp)
-return m_type_sp->GetByteSize();
-  if (llvm::Optional size = m_compiler_type.GetByteSize(nullptr))
-return *size;
-  return 0;
+return m_type_sp->GetByteSize().getValueOr(0);
+  return m_compiler_type.GetByteSize(nullptr).getValueOr(0);
 }
 
 lldb::ValueType ValueObjectMemory::GetValueType() const {
Index: lldb/trunk/source/Symbol/Type.cpp
===
--- lldb/trunk/source/Symbol/Type.cpp
+++ lldb/trunk/source/Symbol/Type.cpp
@@ -107,7 +107,7 @@
 }
 
 Type::Type(lldb::user_id_t uid, SymbolFile *symbol_file,
-   const ConstString &name, uint64_t byte_size,
+   const ConstString &name, llvm::Optional byte_size,
SymbolContextScope *context, user_id_t encoding_uid,
EncodingDataType encoding_uid_type, const Declaration &decl,
const CompilerType &compiler_type,
@@ -115,7 +115,14 @@
 : std::enable_shared_from_this(), UserID(uid), m_name(name),
   m_symbol_file(symbol_file), m_context(context), m_encoding_type(nullptr),
   m_encoding_uid(encoding_uid), m_encoding_uid_type(encoding_uid_type),
-  m_byte_size(byte_size), m_decl(decl), m_compiler_type(compiler_type) {
+  m_decl(decl), m_compiler_type(compiler_type) {
+  if (byte_size) {
+m_byte_size = *byte_size;
+m_byte_size_has_value = true;
+  } else {
+m_byte_size = 0;
+m_byte_size_has_value = false;
+  }
   m_flags.compiler_type_resolve_state =
   (compiler_type ? compiler_type_resolve_state : eResolveStateUnresolved);
   m_flags.is_complete_objc_class = false;
@@ -125,7 +132,8 @@
 : std::enable_shared_from_this(), UserID(0), m_name(""),
   m_symbol_file(nullptr), m_context(nullptr), m_encoding_type(nullptr),
   m_encoding_uid(LLDB_INVALID_UID), m_encoding_uid_type(eEncodingInvalid),
-  m_byte_size(0), m_decl(), m_compiler_type() {
+  m_byte_size(0), m_byte_size_has_value(false), m_decl(),
+  m_compiler_type() {
   m_flags.compiler_type_resolve_state = eResolveStateUnresolved;
   m_flags.is_complete_objc_class = false;
 }
@@ -135,7 +143,8 @@
   m_symbol_file(rhs.m_symbol_file), m_context(rhs.m_context),
   m_encoding_type(rhs.m_encoding_type), m_encoding_uid(rhs.m_encoding_uid),
   m_encoding_uid_type(rhs.m_encoding_uid_type),
-  m_byte_size(rhs.m_byte_size), m_decl(rhs.m_decl),
+  m_byte_size(rhs.m_byte_size),
+  m_byte_size_has_value(rhs.m_byte_size_has_value), m_decl(rhs.m_decl),
   m_compiler_type(rhs.m_compiler_type), m_flags(rhs.m_flags) {}
 
 const Type &Type::operator=(const Type &rhs) {
@@ -213,7 +222,7 @@
   if (m_name)
 *s << ", name = \"" << m_name << "\"";
 
-  if (m_byte_size != 0)
+  if (m_byte_size_has_value)
 s->Printf(", size = %" PRIu64, m_byte_size);
 
   if (show_context && m_context != nullptr) {
@@ -292,7 +301,7 @@
 
 GetForwardCompilerType().DumpValue(
 exe_ctx, s, format == lldb::eFormatDefault ? GetFormat() : format, data,
-data_byte_offset, GetByteSize(),
+data_byte_offset, GetByteSize().getValueOr(0),
 0, // Bitfield bit size
 0, // Bitfield bit offset
 show_types, show_summary, verbose, 0);
@@ -305,36 +314,46 @@
   return m_encoding_type;
 }
 
-uint64_t Type::GetByteSize() {
-  if (m_byte_size == 0) {
-   

[Lldb-commits] [lldb] r352397 - [testsuite] Remove trailing characters from command output.

2019-01-28 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Mon Jan 28 10:07:28 2019
New Revision: 352397

URL: http://llvm.org/viewvc/llvm-project?rev=352397&view=rev
Log:
[testsuite] Remove trailing characters from command output.

When running the test suite on macOS with Python 3 we noticed a
difference in behavior between Python 2 and Python 3 for
seven.get_command_output. The output contained a newline with Python 3,
but not for Python 2. This resulted in an invalid SDK path passed to the
compiler.

Differential revision: https://reviews.llvm.org/D57275

Modified:
lldb/trunk/packages/Python/lldbsuite/support/seven.py

Modified: lldb/trunk/packages/Python/lldbsuite/support/seven.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/support/seven.py?rev=352397&r1=352396&r2=352397&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/support/seven.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/support/seven.py Mon Jan 28 10:07:28 
2019
@@ -15,7 +15,7 @@ else:
 subprocess.check_output(
 command,
 shell=True,
-universal_newlines=True))
+universal_newlines=True).rstrip())
 except subprocess.CalledProcessError as e:
 return (e.returncode, e.output)
 


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


[Lldb-commits] [lldb] r352398 - [testsuite] Remove unused seven module imports.

2019-01-28 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Mon Jan 28 10:07:41 2019
New Revision: 352398

URL: http://llvm.org/viewvc/llvm-project?rev=352398&view=rev
Log:
[testsuite] Remove unused seven module imports.

Modified:
lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/fat_archives/TestFatArchives.py

lldb/trunk/packages/Python/lldbsuite/test/lang/objc/ivar-IMP/TestObjCiVarIMP.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py?rev=352398&r1=352397&r2=352398&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py 
(original)
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py 
Mon Jan 28 10:07:41 2019
@@ -7,21 +7,11 @@ from __future__ import print_function
 import lldb
 import os
 import time
-from lldbsuite.support import seven
 from lldbsuite.test.decorators import *
 from lldbsuite.test.lldbtest import *
 from lldbsuite.test import lldbutil
 
 
-def execute_command(command):
-#print('%% %s' % (command))
-(exit_status, output) = seven.get_command_status_output(command)
-# if output:
-#print(output)
-#print('status = %u' % (exit_status))
-return exit_status
-
-
 class ExecTestCase(TestBase):
 
 NO_DEBUG_INFO_TESTCASE = True

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/fat_archives/TestFatArchives.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/fat_archives/TestFatArchives.py?rev=352398&r1=352397&r2=352398&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/fat_archives/TestFatArchives.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/fat_archives/TestFatArchives.py
 Mon Jan 28 10:07:41 2019
@@ -7,7 +7,6 @@ from __future__ import print_function
 import lldb
 import os
 import time
-import lldbsuite.support.seven as seven
 from lldbsuite.test.decorators import *
 from lldbsuite.test.lldbtest import *
 from lldbsuite.test import lldbutil

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/lang/objc/ivar-IMP/TestObjCiVarIMP.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/objc/ivar-IMP/TestObjCiVarIMP.py?rev=352398&r1=352397&r2=352398&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/lang/objc/ivar-IMP/TestObjCiVarIMP.py 
(original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/lang/objc/ivar-IMP/TestObjCiVarIMP.py 
Mon Jan 28 10:07:41 2019
@@ -10,21 +10,11 @@ import time
 import re
 
 import lldb
-from lldbsuite.support import seven
 from lldbsuite.test.decorators import *
 from lldbsuite.test.lldbtest import *
 from lldbsuite.test import lldbutil
 
 
-def execute_command(command):
-# print('%% %s' % (command))
-(exit_status, output) = seven.get_command_status_output(command)
-# if output:
-# print(output)
-# print('status = %u' % (exit_status))
-return exit_status
-
-
 class ObjCiVarIMPTestCase(TestBase):
 
 mydir = TestBase.compute_mydir(__file__)


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


[Lldb-commits] [PATCH] D57275: [seven] Remove trailing characters from command output.

2019-01-28 Thread Jonas Devlieghere via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rLLDB352397: [testsuite] Remove trailing characters from 
command output. (authored by JDevlieghere, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D57275?vs=183877&id=183900#toc

Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57275/new/

https://reviews.llvm.org/D57275

Files:
  packages/Python/lldbsuite/support/seven.py


Index: packages/Python/lldbsuite/support/seven.py
===
--- packages/Python/lldbsuite/support/seven.py
+++ packages/Python/lldbsuite/support/seven.py
@@ -15,7 +15,7 @@
 subprocess.check_output(
 command,
 shell=True,
-universal_newlines=True))
+universal_newlines=True).rstrip())
 except subprocess.CalledProcessError as e:
 return (e.returncode, e.output)
 


Index: packages/Python/lldbsuite/support/seven.py
===
--- packages/Python/lldbsuite/support/seven.py
+++ packages/Python/lldbsuite/support/seven.py
@@ -15,7 +15,7 @@
 subprocess.check_output(
 command,
 shell=True,
-universal_newlines=True))
+universal_newlines=True).rstrip())
 except subprocess.CalledProcessError as e:
 return (e.returncode, e.output)
 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D57213: [Scalar] Add support for 512-bits values.

2019-01-28 Thread Zachary Turner via Phabricator via lldb-commits
zturner added inline comments.



Comment at: lldb/source/Utility/Scalar.cpp:161
+if (endian::InlHostByteOrder() == eByteOrderBig) {
+  swapped_words[0] = apint_words[7];
+  swapped_words[1] = apint_words[6];

I'm confused.  You say it returns a pointer to an array of four `uint64_t` 
values, but here you're clearly swapping the order of //eight// `uint64_t` 
values.  Is the comment wrong?

Anyway, how about:

```
std::swap(apint_words[0], apint_words[7]);
std::swap(apint_words[1], apint_words[6]);
std::swap(apint_words[2], apint_words[5]);
std::swap(apint_words[3], apint_words[4]);
```


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57213/new/

https://reviews.llvm.org/D57213



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


[Lldb-commits] [PATCH] D56126: [NativePDB] Add basic support of methods recostruction in AST

2019-01-28 Thread Zachary Turner via Phabricator via lldb-commits
zturner added a comment.

Thanks for the reminder!


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56126/new/

https://reviews.llvm.org/D56126



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


[Lldb-commits] [PATCH] D57213: [Scalar] Add support for 512-bits values.

2019-01-28 Thread Davide Italiano via Phabricator via lldb-commits
davide marked an inline comment as done.
davide added inline comments.



Comment at: lldb/source/Utility/Scalar.cpp:161
+if (endian::InlHostByteOrder() == eByteOrderBig) {
+  swapped_words[0] = apint_words[7];
+  swapped_words[1] = apint_words[6];

zturner wrote:
> I'm confused.  You say it returns a pointer to an array of four `uint64_t` 
> values, but here you're clearly swapping the order of //eight// `uint64_t` 
> values.  Is the comment wrong?
> 
> Anyway, how about:
> 
> ```
> std::swap(apint_words[0], apint_words[7]);
> std::swap(apint_words[1], apint_words[6]);
> std::swap(apint_words[2], apint_words[5]);
> std::swap(apint_words[3], apint_words[4]);
> ```
Yes the comment is wrong. I need to update it.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57213/new/

https://reviews.llvm.org/D57213



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


[Lldb-commits] [PATCH] D56904: [NativePDB] Process virtual bases in the correct order

2019-01-28 Thread Zachary Turner via Phabricator via lldb-commits
zturner added a comment.

The above suggestion is admittedly minor, but since it's both a minor 
performance improvement **and** a minor readability/maintainability 
improvement, I think it's probably worth doing.




Comment at: lit/SymbolFile/NativePDB/tag-types.cpp:5
 // Test that we can display tag types.
 // RUN: %build --compiler=clang-cl --nodefaultlib -o %t.exe -- %s 
 // RUN: env LLDB_USE_NATIVE_PDB_READER=1 %lldb -f %t.exe -s \

aleksandr.urakov wrote:
> Clang gives me an error about char16_t, char32_t etc., but if I use MSVC 
> here, then the test compiles ok.
Usually this means clang cannot find your CRT headers.  Can you run with 
-verbose?  That should give you some insight into the environment we are 
running clang with, and might be a clue why it can't find the headers.



Comment at: source/Plugins/SymbolFile/NativePDB/UdtRecordCompleter.cpp:54
+llvm::codeview::TypeIndex ti, llvm::codeview::MemberAccess access,
+bool is_virtual, uint64_t vtable_idx) {
   PdbTypeSymId type_id(ti);

Then, change this function to not pass `is_virtual`, only pass 
`Optional`.  



Comment at: source/Plugins/SymbolFile/NativePDB/UdtRecordCompleter.cpp:60-63
   std::unique_ptr base_spec =
   m_ast_builder.clang().CreateBaseClassSpecifier(
-  qt.getAsOpaquePtr(), TranslateMemberAccess(access), false,
+  qt.getAsOpaquePtr(), TranslateMemberAccess(access), is_virtual,
   udt_cvt.kind() == LF_CLASS);

`vtable_idx.hasValue();`



Comment at: source/Plugins/SymbolFile/NativePDB/UdtRecordCompleter.cpp:68-71
+  if (is_virtual)
+m_vbases[vtable_idx] = std::move(base_spec);
+  else
+m_bases.push_back(std::move(base_spec));

`m_bases.push_back(std::make_pair(vtable_idx.getValueOr(0), 
std::move(base_spec)));`



Comment at: source/Plugins/SymbolFile/NativePDB/UdtRecordCompleter.cpp:188
 void UdtRecordCompleter::complete() {
+  // Flush all virtual bases using the correct order.
+  for (auto &pair : m_vbases)

```
using vt = std::pair>>;
std::stable_sort(m_bases, [](const vt &base1, const vt &base2) {
  return base1.first < base2.first;
  });
```



Comment at: source/Plugins/SymbolFile/NativePDB/UdtRecordCompleter.h:52
   std::vector> m_bases;
+  std::map> m_vbases;
   ClangASTImporter::LayoutInfo m_layout;

I actually think it would be slightly better to use a `vector>` here.  
The reason is that a) it will probably be slightly more efficient, because # of 
vbases is usually quite small (often just 1) and the overhead of a map is a net 
performance loss for small numbers of items.  b) that people are often confused 
when seeing `map` instead of `DenseMap` and it might cause someone in the 
future to think they can change this to a `DenseMap` with no behavioral 
difference, even though the reason for using a map here is that it must be 
sorted.

How about just having this:

```
std::vector>> 
m_bases;
```

Comments on how to change the implementation below.


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56904/new/

https://reviews.llvm.org/D56904



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


[Lldb-commits] [PATCH] D56904: [NativePDB] Process virtual bases in the correct order

2019-01-28 Thread Zachary Turner via Phabricator via lldb-commits
zturner added a comment.

Sorry, due to the way Phabricator re-orders feedback across files when sending 
the email notification, if you're reading my comments in email you have to read 
the previous email from the bottom up.


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56904/new/

https://reviews.llvm.org/D56904



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


[Lldb-commits] [lldb] r352417 - Remove unimplemented function

2019-01-28 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Mon Jan 28 11:38:08 2019
New Revision: 352417

URL: http://llvm.org/viewvc/llvm-project?rev=352417&view=rev
Log:
Remove unimplemented function

Looks like this was an unintended sideeffect of r124250.

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

Modified:
lldb/trunk/source/Symbol/Type.cpp

Modified: lldb/trunk/source/Symbol/Type.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Type.cpp?rev=352417&r1=352416&r2=352417&view=diff
==
--- lldb/trunk/source/Symbol/Type.cpp (original)
+++ lldb/trunk/source/Symbol/Type.cpp Mon Jan 28 11:38:08 2019
@@ -147,12 +147,6 @@ Type::Type(const Type &rhs)
   m_byte_size_has_value(rhs.m_byte_size_has_value), m_decl(rhs.m_decl),
   m_compiler_type(rhs.m_compiler_type), m_flags(rhs.m_flags) {}
 
-const Type &Type::operator=(const Type &rhs) {
-  if (this != &rhs) {
-  }
-  return *this;
-}
-
 void Type::GetDescription(Stream *s, lldb::DescriptionLevel level,
   bool show_name) {
   *s << "id = " << (const UserID &)*this;


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


[Lldb-commits] [PATCH] D57272: Remove unimplemented function

2019-01-28 Thread Phabricator via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rLLDB352417: Remove unimplemented function (authored by 
adrian, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D57272?vs=183669&id=183926#toc

Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57272/new/

https://reviews.llvm.org/D57272

Files:
  source/Symbol/Type.cpp


Index: source/Symbol/Type.cpp
===
--- source/Symbol/Type.cpp
+++ source/Symbol/Type.cpp
@@ -147,12 +147,6 @@
   m_byte_size_has_value(rhs.m_byte_size_has_value), m_decl(rhs.m_decl),
   m_compiler_type(rhs.m_compiler_type), m_flags(rhs.m_flags) {}
 
-const Type &Type::operator=(const Type &rhs) {
-  if (this != &rhs) {
-  }
-  return *this;
-}
-
 void Type::GetDescription(Stream *s, lldb::DescriptionLevel level,
   bool show_name) {
   *s << "id = " << (const UserID &)*this;


Index: source/Symbol/Type.cpp
===
--- source/Symbol/Type.cpp
+++ source/Symbol/Type.cpp
@@ -147,12 +147,6 @@
   m_byte_size_has_value(rhs.m_byte_size_has_value), m_decl(rhs.m_decl),
   m_compiler_type(rhs.m_compiler_type), m_flags(rhs.m_flags) {}
 
-const Type &Type::operator=(const Type &rhs) {
-  if (this != &rhs) {
-  }
-  return *this;
-}
-
 void Type::GetDescription(Stream *s, lldb::DescriptionLevel level,
   bool show_name) {
   *s << "id = " << (const UserID &)*this;
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r352434 - Revert "Make Type::GetByteSize optional (NFC)"

2019-01-28 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Mon Jan 28 13:44:35 2019
New Revision: 352434

URL: http://llvm.org/viewvc/llvm-project?rev=352434&view=rev
Log:
Revert "Make Type::GetByteSize optional (NFC)"

This reverts commit r352394 because it broke three windows-specific tests.

Modified:
lldb/trunk/include/lldb/Symbol/Type.h
lldb/trunk/source/Core/ValueObjectMemory.cpp
lldb/trunk/source/Expression/Materializer.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
lldb/trunk/source/Symbol/Type.cpp

Modified: lldb/trunk/include/lldb/Symbol/Type.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/Type.h?rev=352434&r1=352433&r2=352434&view=diff
==
--- lldb/trunk/include/lldb/Symbol/Type.h (original)
+++ lldb/trunk/include/lldb/Symbol/Type.h Mon Jan 28 13:44:35 2019
@@ -95,7 +95,7 @@ public:
   } ResolveState;
 
   Type(lldb::user_id_t uid, SymbolFile *symbol_file, const ConstString &name,
-   llvm::Optional byte_size, SymbolContextScope *context,
+   uint64_t byte_size, SymbolContextScope *context,
lldb::user_id_t encoding_uid, EncodingDataType encoding_uid_type,
const Declaration &decl, const CompilerType &compiler_qual_type,
ResolveState compiler_type_resolve_state);
@@ -127,7 +127,7 @@ public:
 
   const ConstString &GetName();
 
-  llvm::Optional GetByteSize();
+  uint64_t GetByteSize();
 
   uint32_t GetNumChildren(bool omit_empty_base_classes);
 
@@ -217,8 +217,7 @@ protected:
   Type *m_encoding_type;
   lldb::user_id_t m_encoding_uid;
   EncodingDataType m_encoding_uid_type;
-  uint64_t m_byte_size : 63;
-  uint64_t m_byte_size_has_value : 1;
+  uint64_t m_byte_size;
   Declaration m_decl;
   CompilerType m_compiler_type;
 

Modified: lldb/trunk/source/Core/ValueObjectMemory.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectMemory.cpp?rev=352434&r1=352433&r2=352434&view=diff
==
--- lldb/trunk/source/Core/ValueObjectMemory.cpp (original)
+++ lldb/trunk/source/Core/ValueObjectMemory.cpp Mon Jan 28 13:44:35 2019
@@ -136,8 +136,10 @@ size_t ValueObjectMemory::CalculateNumCh
 
 uint64_t ValueObjectMemory::GetByteSize() {
   if (m_type_sp)
-return m_type_sp->GetByteSize().getValueOr(0);
-  return m_compiler_type.GetByteSize(nullptr).getValueOr(0);
+return m_type_sp->GetByteSize();
+  if (llvm::Optional size = m_compiler_type.GetByteSize(nullptr))
+return *size;
+  return 0;
 }
 
 lldb::ValueType ValueObjectMemory::GetValueType() const {

Modified: lldb/trunk/source/Expression/Materializer.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/Materializer.cpp?rev=352434&r1=352433&r2=352434&view=diff
==
--- lldb/trunk/source/Expression/Materializer.cpp (original)
+++ lldb/trunk/source/Expression/Materializer.cpp Mon Jan 28 13:44:35 2019
@@ -537,8 +537,7 @@ public:
 "size of variable %s (%" PRIu64
 ") is larger than the ValueObject's size (%" PRIu64 ")",
 m_variable_sp->GetName().AsCString(),
-m_variable_sp->GetType()->GetByteSize().getValueOr(0),
-data.GetByteSize());
+m_variable_sp->GetType()->GetByteSize(), data.GetByteSize());
   }
   return;
 }

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp?rev=352434&r1=352433&r2=352434&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp 
(original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp Mon Jan 
28 13:44:35 2019
@@ -264,7 +264,7 @@ TypeSP DWARFASTParserClang::ParseTypeFro
   const char *mangled_name_cstr = NULL;
   ConstString type_name_const_str;
   Type::ResolveState resolve_state = Type::eResolveStateUnresolved;
-  llvm::Optional byte_size;
+  uint64_t byte_size = 0;
   Declaration decl;
 
   Type::EncodingDataType encoding_data_type = Type::eEncodingIsUID;
@@ -386,7 +386,7 @@ TypeSP DWARFASTParserClang::ParseTypeFro
 case DW_TAG_base_type:
   resolve_state = Type::eResolveStateFull;
   clang_type = m_ast.GetBuiltinTypeForDWARFEncodingAndBitSize(
-  type_name_cstr, encoding, byte_size.getValueOr(0) * 8);
+  type_name_cstr, encoding, byte_size * 8);
   break;
 
 case DW_TAG_pointer_type:
@@ -535,6 +535,7 @@ TypeSP DWARFASTParserClang::ParseTypeFro
   case DW_TAG_class_type: {
 // Set a bit that lets us know that we are currently parsing this
 dwa

[Lldb-commits] [PATCH] D57273: Make Type::GetByteSize optional

2019-01-28 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl added a comment.

Pavel, I may need you help. I reverted the commit because it broke three 
PDB-related tests (SymbolFilePDBTests, func-symbols, and typedefs) that need 
more than just lld in order to run. The fix is probably trivial. We only need 
to set a breakpoint in `Type.cpp:119` and every time a type with size 0 is 
passed in look at the frame we're coming from and make sure that that 
llvm::None is passed in instead of 0, similar to the changes in 
`DWARFASTParserClang.cpp`.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57273/new/

https://reviews.llvm.org/D57273



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


[Lldb-commits] [PATCH] D57330: Adjust documentation for git migration.

2019-01-28 Thread Shoaib Meenai via Phabricator via lldb-commits
smeenai accepted this revision.
smeenai added a comment.
This revision is now accepted and ready to land.

The amount of duplicated and out-of-date documentation makes me sad, but this 
is an awesome effort to clean that up.




Comment at: 
lldb/packages/Python/lldbsuite/test/functionalities/command_source/TestCommandSource.py:4
-
-See also http://llvm.org/viewvc/llvm-project?view=rev&revision=109673.
 """

Would you want to link to the corresponding GitHub commit?



Comment at: 
lldb/packages/Python/lldbsuite/test/lang/objc/objc-optimized/TestObjcOptimized.py:4
 
-http://llvm.org/viewvc/llvm-project?rev=126973&view=rev
 Fixed a bug in the expression parser where the 'this'

Same here.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57330/new/

https://reviews.llvm.org/D57330



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


[Lldb-commits] [PATCH] D54617: [Reproducers] Add file provider

2019-01-28 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere updated this revision to Diff 183968.
JDevlieghere marked 4 inline comments as done.
JDevlieghere added a comment.

- Feedback pavel


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D54617/new/

https://reviews.llvm.org/D54617

Files:
  include/lldb/Host/FileSystem.h
  include/lldb/Utility/FileCollector.h
  include/lldb/Utility/Reproducer.h
  lit/Reproducer/Inputs/FileCapture.in
  lit/Reproducer/Inputs/FileReplay.in
  lit/Reproducer/TestFileRepro.test
  lit/Reproducer/TestGDBRemoteRepro.test
  source/Host/common/FileSystem.cpp
  source/Host/macosx/objcxx/Host.mm
  source/Initialization/SystemInitializerCommon.cpp
  source/Utility/CMakeLists.txt
  source/Utility/FileCollector.cpp
  source/Utility/Reproducer.cpp
  unittests/Utility/CMakeLists.txt
  unittests/Utility/FileCollectorTest.cpp

Index: unittests/Utility/FileCollectorTest.cpp
===
--- /dev/null
+++ unittests/Utility/FileCollectorTest.cpp
@@ -0,0 +1,177 @@
+//===-- FileCollectorTest.cpp ---*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+
+#include "lldb/Utility/FileCollector.h"
+#include "lldb/Utility/FileSpec.h"
+
+#include "llvm/Support/FileSystem.h"
+
+using namespace llvm;
+using namespace lldb_private;
+
+namespace {
+class TestingFileCollector : public FileCollector {
+public:
+  using FileCollector::FileCollector;
+  using FileCollector::m_root;
+  using FileCollector::m_seen;
+  using FileCollector::m_symlink_map;
+  using FileCollector::m_vfs_writer;
+
+  bool HasSeen(FileSpec fs) {
+return m_seen.find(fs.GetPath()) != m_seen.end();
+  }
+};
+
+struct ScopedDir {
+  SmallString<128> Path;
+  ScopedDir(const Twine &Name, bool Unique = false) {
+std::error_code EC;
+if (Unique) {
+  EC = llvm::sys::fs::createUniqueDirectory(Name, Path);
+} else {
+  Path = Name.str();
+  EC = llvm::sys::fs::create_directory(Twine(Path));
+}
+if (EC)
+  Path = "";
+EXPECT_FALSE(EC);
+  }
+  ~ScopedDir() {
+if (Path != "") {
+  EXPECT_FALSE(llvm::sys::fs::remove_directories(Path.str()));
+}
+  }
+  operator StringRef() { return Path.str(); }
+};
+
+struct ScopedLink {
+  SmallString<128> Path;
+  ScopedLink(const Twine &To, const Twine &From) {
+Path = From.str();
+std::error_code EC = sys::fs::create_link(To, From);
+if (EC)
+  Path = "";
+EXPECT_FALSE(EC);
+  }
+  ~ScopedLink() {
+if (Path != "") {
+  EXPECT_FALSE(llvm::sys::fs::remove(Path.str()));
+}
+  }
+  operator StringRef() { return Path.str(); }
+};
+
+struct ScopedFile {
+  SmallString<128> Path;
+  ScopedFile(const Twine &Name) {
+std::error_code EC;
+EC = llvm::sys::fs::createUniqueFile(Name, Path);
+if (EC)
+  Path = "";
+EXPECT_FALSE(EC);
+  }
+  ~ScopedFile() {
+if (Path != "") {
+  EXPECT_FALSE(llvm::sys::fs::remove(Path.str()));
+}
+  }
+  operator StringRef() { return Path.str(); }
+};
+} // end anonymous namespace
+
+TEST(FileCollectorTest, AddFile) {
+  ScopedDir root("add_file_root", true);
+  FileSpec root_fs(root.Path);
+  TestingFileCollector file_collector(root_fs);
+
+  file_collector.AddFile(FileSpec("/path/to/a"));
+  file_collector.AddFile(FileSpec("/path/to/b"));
+  file_collector.AddFile(FileSpec("/path/to/c"));
+
+  // Make sure the root is correct.
+  EXPECT_EQ(file_collector.m_root, root_fs);
+
+  // Make sure we've seen all the added files.
+  EXPECT_TRUE(file_collector.HasSeen(FileSpec("/path/to/a")));
+  EXPECT_TRUE(file_collector.HasSeen(FileSpec("/path/to/b")));
+  EXPECT_TRUE(file_collector.HasSeen(FileSpec("/path/to/c")));
+
+  // Make sure we've only seen the added files.
+  EXPECT_FALSE(file_collector.HasSeen(FileSpec("/path/to/d")));
+}
+
+TEST(FileCollectorTest, CopyFiles) {
+  ScopedDir root("copy_files_root", true);
+  ScopedFile a("aaa");
+  ScopedFile b("bbb");
+  ScopedFile c("ccc");
+
+  // Create file collector and add files.
+  FileSpec root_fs(root.Path);
+  TestingFileCollector file_collector(root_fs);
+  file_collector.AddFile(a.Path);
+  file_collector.AddFile(b.Path);
+  file_collector.AddFile(c.Path);
+
+  // Make sure we can copy the files.
+  std::error_code ec = file_collector.CopyFiles(true);
+  EXPECT_FALSE(ec);
+
+  // Now add a bogus file and make sure we error out.
+  file_collector.AddFile("/some/bogus/file");
+  ec = file_collector.CopyFiles(true);
+  EXPECT_TRUE(ec);
+
+  // However, if stop_on_error is true the copy should still succeed.
+  ec = file_collector.CopyFiles(false);
+  EXPECT_FALSE(ec);
+}
+
+TEST(FileCollectorTest, Symlinks) {
+  // Root where the original files live.
+  ScopedDir file_ro

[Lldb-commits] [PATCH] D57363: Fix handling of CreateTemplateParameterList when there is an empty pack

2019-01-28 Thread Shafik Yaghmour via Phabricator via lldb-commits
shafik created this revision.
shafik added reviewers: aprantl, jingham, teemperor, martong.
Herald added a subscriber: rnkovacs.
Herald added a reviewer: serge-sans-paille.

When we are creating a ClassTemplateSpecializationDecl in 
ParseTypeFromDWARF(...) we are not handling the case where variadic pack is 
empty in the specialization. This patch handles that case and adds a test to 
prevent future regressions.


https://reviews.llvm.org/D57363

Files:
  packages/Python/lldbsuite/test/expression_command/radar_47565290/Makefile
  
packages/Python/lldbsuite/test/expression_command/radar_47565290/TestClassTemplateSpecializationParametersHandling.py
  packages/Python/lldbsuite/test/expression_command/radar_47565290/main.cpp
  source/Symbol/ClangASTContext.cpp

Index: source/Symbol/ClangASTContext.cpp
===
--- source/Symbol/ClangASTContext.cpp
+++ source/Symbol/ClangASTContext.cpp
@@ -1549,25 +1549,31 @@
 }
   }
 
-  if (template_param_infos.packed_args &&
-  template_param_infos.packed_args->args.size()) {
+  if (template_param_infos.packed_args) {
 IdentifierInfo *identifier_info = nullptr;
 if (template_param_infos.pack_name && template_param_infos.pack_name[0])
   identifier_info = &ast->Idents.get(template_param_infos.pack_name);
 const bool parameter_pack_true = true;
-if (IsValueParam(template_param_infos.packed_args->args[0])) {
-  template_param_decls.push_back(NonTypeTemplateParmDecl::Create(
-  *ast, decl_context,
-  SourceLocation(), SourceLocation(), depth, num_template_params,
-  identifier_info,
-  template_param_infos.packed_args->args[0].getIntegralType(),
-  parameter_pack_true, nullptr));
-} else {
+
+if (template_param_infos.packed_args->args.size()) {
+
+  if (IsValueParam(template_param_infos.packed_args->args[0])) {
+template_param_decls.push_back(NonTypeTemplateParmDecl::Create(
+*ast, decl_context, SourceLocation(), SourceLocation(), depth,
+num_template_params, identifier_info,
+template_param_infos.packed_args->args[0].getIntegralType(),
+parameter_pack_true, nullptr));
+  } else {
+template_param_decls.push_back(TemplateTypeParmDecl::Create(
+*ast, decl_context, SourceLocation(), SourceLocation(), depth,
+num_template_params, identifier_info, is_typename,
+parameter_pack_true));
+  }
+} else if (identifier_info) {
   template_param_decls.push_back(TemplateTypeParmDecl::Create(
-  *ast, decl_context,
-  SourceLocation(), SourceLocation(), depth, num_template_params,
-  identifier_info,
-  is_typename, parameter_pack_true));
+  *ast, decl_context, SourceLocation(), SourceLocation(), depth,
+  num_template_params, identifier_info, is_typename,
+  parameter_pack_true));
 }
   }
   clang::Expr *const requires_clause = nullptr; // TODO: Concepts
Index: packages/Python/lldbsuite/test/expression_command/radar_47565290/main.cpp
===
--- /dev/null
+++ packages/Python/lldbsuite/test/expression_command/radar_47565290/main.cpp
@@ -0,0 +1,26 @@
+template 
+class A {
+
+};
+
+class BB;
+
+template <>
+class A {
+
+};
+
+class Value{};
+
+class BB final : public Value,
+ public A {
+public:
+int foo() { return 1;}
+};
+
+
+int main() {
+  BB b;
+
+  return b.foo() - 1; // break here
+}
Index: packages/Python/lldbsuite/test/expression_command/radar_47565290/TestClassTemplateSpecializationParametersHandling.py
===
--- /dev/null
+++ packages/Python/lldbsuite/test/expression_command/radar_47565290/TestClassTemplateSpecializationParametersHandling.py
@@ -0,0 +1,26 @@
+"""
+Test Expression Parser code gen for ClassTemplateSpecializationDecl. This is a fix for rdar://problem/47564499
+"""
+
+from __future__ import print_function
+
+
+import os
+import time
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+class TestClassTemplateSpecializationParametersHandling(TestBase):
+
+mydir = TestBase.compute_mydir(__file__)
+
+def test_with_run_command(self):
+"""Test that that file and class static variables display correctly."""
+self.build()
+
+(self.target, self.process, _, bkpt) = lldbutil.run_to_source_breakpoint(self, '// break here',
+lldb.SBFileSpec("main.cpp", False))
+
+self.expect("expr -u 0 -- b.foo()", substrs=['$0 = 1'])
Index: packages/Python/lldbsuite/test/expression_command/radar_47565290/Makefile
===
--- /dev/null
+++ packages/Python/lldbsuite/test/expression_command/radar_47565290/Makefile
@@ -0,0 +1,5 @@
+LEVEL = ../../make
+

[Lldb-commits] [PATCH] D57363: Fix handling of CreateTemplateParameterList when there is an empty pack

2019-01-28 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl added inline comments.



Comment at: 
packages/Python/lldbsuite/test/expression_command/radar_47565290/TestClassTemplateSpecializationParametersHandling.py:9
+import os
+import time
+import lldb

I don't think these are used



Comment at: 
packages/Python/lldbsuite/test/expression_command/radar_47565290/TestClassTemplateSpecializationParametersHandling.py:19
+
+def test_with_run_command(self):
+"""Test that that file and class static variables display correctly."""

test_class_template_specialization ?



Comment at: 
packages/Python/lldbsuite/test/expression_command/radar_47565290/TestClassTemplateSpecializationParametersHandling.py:20
+def test_with_run_command(self):
+"""Test that that file and class static variables display correctly."""
+self.build()

This needs to be updated, too.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57363/new/

https://reviews.llvm.org/D57363



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


[Lldb-commits] [PATCH] D57363: Fix handling of CreateTemplateParameterList when there is an empty pack

2019-01-28 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl added inline comments.



Comment at: 
packages/Python/lldbsuite/test/expression_command/radar_47565290/Makefile:1
+LEVEL = ../../make
+

Could you give the directory a more descriptive name instead of 
`radar_47565290`? It's fine to mention a rdar:// link in the commit message, 
but for most people radar numbers are completely opaque.



Comment at: 
packages/Python/lldbsuite/test/expression_command/radar_47565290/TestClassTemplateSpecializationParametersHandling.py:2
+"""
+Test Expression Parser code gen for ClassTemplateSpecializationDecl. This is a 
fix for rdar://problem/47564499
+"""

Same here, mentioning the radar in the commit message should be sufficient. 
This forces us to write better/more complete comments, too :-)



Comment at: source/Symbol/ClangASTContext.cpp:1562
+template_param_decls.push_back(NonTypeTemplateParmDecl::Create(
+*ast, decl_context, SourceLocation(), SourceLocation(), depth,
+num_template_params, identifier_info,

does this get more or less readable if we replace `SourceLocation()` with `{}`?



Comment at: source/Symbol/ClangASTContext.cpp:1572
+  }
+} else if (identifier_info) {
   template_param_decls.push_back(TemplateTypeParmDecl::Create(

Looks like this is the same code as above. Could this be organized differently 
to avoid duplicating the code? (I didn't look whether these are all different 
constructors, so maybe this is already as good as it gets)


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57363/new/

https://reviews.llvm.org/D57363



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


[Lldb-commits] [PATCH] D57363: Fix handling of CreateTemplateParameterList when there is an empty pack

2019-01-28 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl added inline comments.



Comment at: 
packages/Python/lldbsuite/test/expression_command/radar_47565290/TestClassTemplateSpecializationParametersHandling.py:23
+
+(self.target, self.process, _, bkpt) = 
lldbutil.run_to_source_breakpoint(self, '// break here',
+lldb.SBFileSpec("main.cpp", False))

FYI, Python allows you to write this as `self.target, self.process, _, bkpt =` 
without the parentheses, too.
Since you aren't any of the return values, you could just call the function and 
ignore the return value.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57363/new/

https://reviews.llvm.org/D57363



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


[Lldb-commits] [PATCH] D57363: Fix handling of CreateTemplateParameterList when there is an empty pack

2019-01-28 Thread Davide Italiano via Phabricator via lldb-commits
davide added inline comments.



Comment at: 
packages/Python/lldbsuite/test/expression_command/radar_47565290/TestClassTemplateSpecializationParametersHandling.py:5-6
+
+from __future__ import print_function
+
+

I think this is not needed.



Comment at: source/Symbol/ClangASTContext.cpp:1572
+  }
+} else if (identifier_info) {
   template_param_decls.push_back(TemplateTypeParmDecl::Create(

aprantl wrote:
> Looks like this is the same code as above. Could this be organized 
> differently to avoid duplicating the code? (I didn't look whether these are 
> all different constructors, so maybe this is already as good as it gets)
Why this code block became conditional of `if (identifier_info)` ?
I understand the size check above, but can you elaborate on the need for this?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57363/new/

https://reviews.llvm.org/D57363



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


[Lldb-commits] [PATCH] D57330: Adjust documentation for git migration.

2019-01-28 Thread Mehdi AMINI via Phabricator via lldb-commits
mehdi_amini added a comment.

LGTM, but for one comment that requires a fix I believe (lld on Windows)




Comment at: libcxx/docs/BuildingLibcxx.rst:47
-   * ``cd build``
-   * ``cmake -G  [options] ``
 

So nice to see these steps going away :)



Comment at: libcxx/docs/BuildingLibcxx.rst:57
   $ cd where-you-want-libcxx-to-live
-  $ # Check out llvm, libc++ and libc++abi.
-  $ ``svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm``
-  $ ``svn co http://llvm.org/svn/llvm-project/libcxx/trunk libcxx``
-  $ ``svn co http://llvm.org/svn/llvm-project/libcxxabi/trunk libcxxabi``
+  $ # Check out the sources (includes everything, but we'll only use libcxx)
+  $ ``git clone https://github.com/llvm/llvm-project.git``

Wonder if it is worth mentioning somewhere how to sparse-checkout?



Comment at: libcxxabi/www/index.html:86
   mkdir build && cd build
-  cmake .. # on linux you may need to prefix with CC=clang 
CXX=clang++
+  cmake -DLLVM_ENABLE_PROJECTS=libcxxabi ../llvm # on linux you may 
need to prefix with CC=clang CXX=clang++
   make

Do you now if prefixing with CC is equivalent to -DCMAKE_C_COMPILER?



Comment at: lld/docs/getting_started.rst:71
+ $ cd llvm-project/build (out of source build required)
+ $ cmake -G "Visual Studio 11" ../llvm
 

Missing -DLLVM_ENABLE_PROJECTS=lld here I believe


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57330/new/

https://reviews.llvm.org/D57330



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