Re: [clang-tools-extra] r304977 - [clang-tidy] New checker to replace dynamic exception specifications

2017-06-09 Thread don hinton via cfe-commits
Thanks Alex...

On Fri, Jun 9, 2017 at 1:02 AM, Alexander Kornienko via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

> Fixes committed in r305024 and r305057.
>
> On Fri, Jun 9, 2017 at 12:07 AM, Alexander Kornienko 
> wrote:
>
>> It looks like the buildbots have exceptions turned off by default, so the
>> tests need to use `-fexceptions` explicitly. Testing a fix...
>>
>> On Thu, Jun 8, 2017 at 11:26 PM, Galina Kistanova 
>> wrote:
>>
>>> Hello Alexander,
>>>
>>> Couple of our builders do not like this commit:
>>>
>>> Failing Tests:
>>>
>>> Clang Tools :: clang-tidy/modernize-use-noexcept-opt.cpp
>>> Clang Tools :: clang-tidy/modernize-use-noexcept.cpp
>>>
>>> http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei
>>> -ps4-ubuntu-fast/builds/12431
>>> http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei
>>> -ps4-windows10pro-fast
>>>
>>> Please have a look at this?
>>>
>>> Thanks
>>>
>>> Galina
>>>
>>> On Thu, Jun 8, 2017 at 7:04 AM, Alexander Kornienko via cfe-commits <
>>> cfe-commits@lists.llvm.org> wrote:
>>>
 Author: alexfh
 Date: Thu Jun  8 09:04:16 2017
 New Revision: 304977

 URL: http://llvm.org/viewvc/llvm-project?rev=304977&view=rev
 Log:
 [clang-tidy] New checker to replace dynamic exception specifications

 Summary:
 New checker to replace dynamic exception
 specifications

 This is an alternative to D18575 which relied on reparsing the decl to
 find the location of dynamic exception specifications, but couldn't
 deal with preprocessor conditionals correctly without reparsing the
 entire file.

 This approach uses D20428 to find dynamic exception specification
 locations and handles all cases correctly.

 Reviewers: aaron.ballman, alexfh

 Reviewed By: aaron.ballman, alexfh

 Subscribers: xazax.hun, mgehre, malcolm.parsons, mgorny, JDevlieghere,
 cfe-commits, Eugene.Zelenko, etienneb

 Patch by Don Hinton!

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

 Added:
 clang-tools-extra/trunk/clang-tidy/modernize/UseNoexceptCheck.cpp
 clang-tools-extra/trunk/clang-tidy/modernize/UseNoexceptCheck.h
 clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-use
 -noexcept.rst
 clang-tools-extra/trunk/test/clang-tidy/modernize-use-noexce
 pt-macro.cpp
 clang-tools-extra/trunk/test/clang-tidy/modernize-use-noexce
 pt-opt.cpp
 clang-tools-extra/trunk/test/clang-tidy/modernize-use-noexcept.cpp
 Modified:
 clang-tools-extra/trunk/clang-tidy/modernize/CMakeLists.txt
 clang-tools-extra/trunk/clang-tidy/modernize/ModernizeTidyMo
 dule.cpp
 clang-tools-extra/trunk/docs/ReleaseNotes.rst
 clang-tools-extra/trunk/docs/clang-tidy/checks/list.rst

 Modified: clang-tools-extra/trunk/clang-tidy/modernize/CMakeLists.txt
 URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/
 clang-tidy/modernize/CMakeLists.txt?rev=304977&r1=304976&r2=
 304977&view=diff
 
 ==
 --- clang-tools-extra/trunk/clang-tidy/modernize/CMakeLists.txt
 (original)
 +++ clang-tools-extra/trunk/clang-tidy/modernize/CMakeLists.txt Thu
 Jun  8 09:04:16 2017
 @@ -22,6 +22,7 @@ add_clang_library(clangTidyModernizeModu
UseEmplaceCheck.cpp
UseEqualsDefaultCheck.cpp
UseEqualsDeleteCheck.cpp
 +  UseNoexceptCheck.cpp
UseNullptrCheck.cpp
UseOverrideCheck.cpp
UseTransparentFunctorsCheck.cpp

 Modified: clang-tools-extra/trunk/clang-tidy/modernize/ModernizeTidyMo
 dule.cpp
 URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/
 clang-tidy/modernize/ModernizeTidyModule.cpp?rev=304977&r1=3
 04976&r2=304977&view=diff
 
 ==
 --- clang-tools-extra/trunk/clang-tidy/modernize/ModernizeTidyModule.cpp
 (original)
 +++ clang-tools-extra/trunk/clang-tidy/modernize/ModernizeTidyModule.cpp
 Thu Jun  8 09:04:16 2017
 @@ -28,6 +28,7 @@
  #include "UseEmplaceCheck.h"
  #include "UseEqualsDefaultCheck.h"
  #include "UseEqualsDeleteCheck.h"
 +#include "UseNoexceptCheck.h"
  #include "UseNullptrCheck.h"
  #include "UseOverrideCheck.h"
  #include "UseTransparentFunctorsCheck.h"
 @@ -69,6 +70,7 @@ public:
  CheckFactories.registerCheck("modern
 ize-use-equals-default");
  CheckFactories.registerCheck(
  "modernize-use-equals-delete");
 +CheckFactories.registerCheck("modernize-us
 e-noexcept");
  CheckFactories.registerCheck("modernize-us
 e-nullptr");
  CheckFactories.registerCheck("modernize-u
 se-override");
  CheckFactories.registerCheck(

 Added: clang-tools-extra/trunk/clang-tidy/mod

Re: [PATCH] D17143: [Sema] PR25156 Crash when parsing dtor call on incomplete type

2017-06-11 Thread don hinton via cfe-commits
On Sat, Jun 10, 2017 at 8:55 PM John McCall via Phabricator <
revi...@reviews.llvm.org> wrote:

> rjmccall accepted this revision.
> rjmccall added a comment.
> This revision is now accepted and ready to land.
>
> Thanks, looks great.


Great, thanks.

>
>
> If you're going to be submitting multiple patches, you should really ask
> for commit access; it's not an arduous process.


Sure, I'll look into it this week.

In the meantime, would you mind commiting this one for me?

Thanks again...
don


>
>
> https://reviews.llvm.org/D17143
>
>
>
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r320751 - [debuginfo] Remove temporary FIXME.

2017-12-14 Thread Don Hinton via cfe-commits
Author: dhinton
Date: Thu Dec 14 14:12:46 2017
New Revision: 320751

URL: http://llvm.org/viewvc/llvm-project?rev=320751&view=rev
Log:
[debuginfo] Remove temporary FIXME.

Summary:
Now that r320495, "[debuginfo-tests] Support moving
debuginfo-tests to llvm/projects," has landed, remove temporary FIXME
that supported the old mechanism.

Reviewers: zturner, aprantl

Reviewed By: aprantl

Subscribers: JDevlieghere, cfe-commits

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

Modified:
cfe/trunk/test/lit.cfg.py

Modified: cfe/trunk/test/lit.cfg.py
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/lit.cfg.py?rev=320751&r1=320750&r2=320751&view=diff
==
--- cfe/trunk/test/lit.cfg.py (original)
+++ cfe/trunk/test/lit.cfg.py Thu Dec 14 14:12:46 2017
@@ -31,7 +31,7 @@ config.suffixes = ['.c', '.cpp', '.cppm'
 # excludes: A list of directories to exclude from the testsuite. The 'Inputs'
 # subdirectories contain auxiliary inputs for various tests in their parent
 # directories.
-config.excludes = ['Inputs', 'CMakeLists.txt', 'README.txt', 'LICENSE.txt']
+config.excludes = ['Inputs', 'CMakeLists.txt', 'README.txt', 'LICENSE.txt', 
'debuginfo-tests']
 
 # test_source_root: The root path where tests are located.
 config.test_source_root = os.path.dirname(__file__)
@@ -62,16 +62,6 @@ tools = [
 'clang-func-mapping'), unresolved='ignore'),
 ]
 
-# FIXME: This logic can be removed once all buildbots have moved
-# debuginfo-test from clang/test to llvm/projects or monorepo.
-if os.path.exists(os.path.join(config.test_source_root, 'debuginfo-tests')):
-  if os.path.isfile(
-  os.path.join(config.test_source_root, 'debuginfo-tests', 'lit.cfg.py')):
-config.excludes.append('debuginfo-tests')
-  else:
-tools.append(ToolSubst('%test_debuginfo', command=os.path.join(
-  config.llvm_src_root, 'utils', 'test_debuginfo.pl')))
-
 if config.clang_examples:
 tools.append('clang-interpreter')
 


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


[libcxx] r321435 - [libcxx] Suppress unused warning on apple.

2017-12-24 Thread Don Hinton via cfe-commits
Author: dhinton
Date: Sun Dec 24 21:33:42 2017
New Revision: 321435

URL: http://llvm.org/viewvc/llvm-project?rev=321435&view=rev
Log:
[libcxx] Suppress unused warning on apple.

Summary:
This warning is already suppressed on non-apple platforms, so
this change just suppresses it on apple as well.

Reviewers: EricWF, lichray

Reviewed By: lichray

Subscribers: cfe-commits

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

Modified:
libcxx/trunk/src/experimental/filesystem/operations.cpp

Modified: libcxx/trunk/src/experimental/filesystem/operations.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/experimental/filesystem/operations.cpp?rev=321435&r1=321434&r2=321435&view=diff
==
--- libcxx/trunk/src/experimental/filesystem/operations.cpp (original)
+++ libcxx/trunk/src/experimental/filesystem/operations.cpp Sun Dec 24 21:33:42 
2017
@@ -512,6 +512,7 @@ using StatT =  struct stat;
 
 #if defined(__APPLE__)
 TimeSpec extract_mtime(StatT const& st) { return st.st_mtimespec; }
+__attribute__((unused)) // Suppress warning
 TimeSpec extract_atime(StatT const& st) { return st.st_atimespec; }
 #else
 TimeSpec extract_mtime(StatT const& st) { return st.st_mtim; }


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


Re: [libunwind] r321440 - [libunwind] Avoid using C++ headers.

2017-12-25 Thread Don Hinton via cfe-commits
Hi:

This change breaks in a local debug build, e.g.,:

/Users/dhinton/projects/llvm_project/libunwind/src/DwarfParser.hpp:559:28:
error: no member named 'numeric_limits' in namespace 'std'
  assert(length < std::numeric_limits::max() && "pointer
overflow");
  ~^

thanks...
don

On Mon, Dec 25, 2017 at 5:06 AM, whitequark via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

> Author: whitequark
> Date: Mon Dec 25 05:06:09 2017
> New Revision: 321440
>
> URL: http://llvm.org/viewvc/llvm-project?rev=321440&view=rev
> Log:
> [libunwind] Avoid using C++ headers.
>
> This is useful for building libunwind on libcxx-free systems.
>
> Modified:
> libunwind/trunk/src/DwarfParser.hpp
>
> Modified: libunwind/trunk/src/DwarfParser.hpp
> URL: http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/
> DwarfParser.hpp?rev=321440&r1=321439&r2=321440&view=diff
> 
> ==
> --- libunwind/trunk/src/DwarfParser.hpp (original)
> +++ libunwind/trunk/src/DwarfParser.hpp Mon Dec 25 05:06:09 2017
> @@ -17,7 +17,7 @@
>  #include 
>  #include 
>  #include 
> -#include 
> +#include 
>
>  #include "libunwind.h"
>  #include "dwarf2.h"
>
>
> ___
> cfe-commits mailing list
> cfe-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [libunwind] r321440 - [libunwind] Avoid using C++ headers.

2017-12-25 Thread Don Hinton via cfe-commits
On Mon, Dec 25, 2017 at 11:09 AM, whitequark 
wrote:

> On 2017-12-25 19:04, Don Hinton wrote:
>
>> Hi:
>>
>> This change breaks in a local debug build, e.g.,:
>>
>> /Users/dhinton/projects/llvm_project/libunwind/src/DwarfPars
>> er.hpp:559:28:
>> error: no member named 'numeric_limits' in namespace 'std'
>>   assert(length < std::numeric_limits::max() && "pointer
>> overflow");
>>   ~^
>>
>
> Sorry, I missed this. Any idea on reformulating the assert in a way
> that does not require libcxx headers? Not having them significantly
> simplifies bare-metal builds...
>

Well, assuming pint_t is some unsigned integer type, the max can be found
like this:

  pint_t max_pint_t = ~0;

So, that could be used in a pinch.


>
>
>> thanks...
>> don
>>
>> On Mon, Dec 25, 2017 at 5:06 AM, whitequark via cfe-commits
>>  wrote:
>>
>> Author: whitequark
>>> Date: Mon Dec 25 05:06:09 2017
>>> New Revision: 321440
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=321440&view=rev [1]
>>> Log:
>>> [libunwind] Avoid using C++ headers.
>>>
>>> This is useful for building libunwind on libcxx-free systems.
>>>
>>> Modified:
>>> libunwind/trunk/src/DwarfParser.hpp
>>>
>>> Modified: libunwind/trunk/src/DwarfParser.hpp
>>> URL:
>>>
>>> http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/Dwar
>> fParser.hpp?rev=321440&r1=321439&r2=321440&view=diff
>>
>>> [2]
>>>
>>> 
>> ==
>>
>>> --- libunwind/trunk/src/DwarfParser.hpp (original)
>>> +++ libunwind/trunk/src/DwarfParser.hpp Mon Dec 25 05:06:09 2017
>>> @@ -17,7 +17,7 @@
>>> #include 
>>> #include 
>>> #include 
>>> -#include 
>>> +#include 
>>>
>>> #include "libunwind.h"
>>> #include "dwarf2.h"
>>>
>>> ___
>>> cfe-commits mailing list
>>> cfe-commits@lists.llvm.org
>>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits [3]
>>>
>>
>>
>>
>> Links:
>> --
>> [1] http://llvm.org/viewvc/llvm-project?rev=321440&view=rev
>> [2]
>> http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/Dwar
>> fParser.hpp?rev=321440&r1=321439&r2=321440&view=diff
>> [3] http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>>
>
> --
> whitequark
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [libunwind] r321440 - [libunwind] Avoid using C++ headers.

2017-12-25 Thread Don Hinton via cfe-commits
Here's the patch I applied locally.

hth...
don


diff --git a/src/DwarfParser.hpp b/src/DwarfParser.hpp
index 518101e..ac4f1c4 100644
--- a/src/DwarfParser.hpp
+++ b/src/DwarfParser.hpp
@@ -540,7 +540,7 @@ bool CFI_Parser::parseInstructions(A &addressSpace,
pint_t instructions,
   results->cfaRegister = 0;
   results->cfaExpression = (int64_t)p;
   length = addressSpace.getULEB128(p, instructionsEnd);
-  assert(length < std::numeric_limits::max() && "pointer
overflow");
+  assert(length < static_cast(~0) && "pointer overflow");
   p += static_cast(length);
   _LIBUNWIND_TRACE_DWARF("DW_CFA_def_cfa_expression(expression=0x%"
PRIx64
  ", length=%" PRIu64 ")\n",
@@ -556,7 +556,7 @@ bool CFI_Parser::parseInstructions(A &addressSpace,
pint_t instructions,
   results->savedRegisters[reg].location = kRegisterAtExpression;
   results->savedRegisters[reg].value = (int64_t)p;
   length = addressSpace.getULEB128(p, instructionsEnd);
-  assert(length < std::numeric_limits::max() && "pointer
overflow");
+  assert(length < static_cast(~0) && "pointer overflow");
   p += static_cast(length);
   _LIBUNWIND_TRACE_DWARF("DW_CFA_expression(reg=%" PRIu64 ", "
  "expression=0x%" PRIx64 ", "
@@ -642,7 +642,7 @@ bool CFI_Parser::parseInstructions(A &addressSpace,
pint_t instructions,
   results->savedRegisters[reg].location = kRegisterIsExpression;
   results->savedRegisters[reg].value = (int64_t)p;
   length = addressSpace.getULEB128(p, instructionsEnd);
-  assert(length < std::numeric_limits::max() && "pointer
overflow");
+  assert(length < static_cast(~0) && "pointer overflow");
   p += static_cast(length);
   _LIBUNWIND_TRACE_DWARF("DW_CFA_val_expression(reg=%" PRIu64 ", "
  "expression=0x%" PRIx64 ", length=%" PRIu64
")\n",

On Mon, Dec 25, 2017 at 11:26 AM, Don Hinton  wrote:

>
> On Mon, Dec 25, 2017 at 11:09 AM, whitequark 
> wrote:
>
>> On 2017-12-25 19:04, Don Hinton wrote:
>>
>>> Hi:
>>>
>>> This change breaks in a local debug build, e.g.,:
>>>
>>> /Users/dhinton/projects/llvm_project/libunwind/src/DwarfPars
>>> er.hpp:559:28:
>>> error: no member named 'numeric_limits' in namespace 'std'
>>>   assert(length < std::numeric_limits::max() && "pointer
>>> overflow");
>>>   ~^
>>>
>>
>> Sorry, I missed this. Any idea on reformulating the assert in a way
>> that does not require libcxx headers? Not having them significantly
>> simplifies bare-metal builds...
>>
>
> Well, assuming pint_t is some unsigned integer type, the max can be found
> like this:
>
>   pint_t max_pint_t = ~0;
>
> So, that could be used in a pinch.
>
>
>>
>>
>>> thanks...
>>> don
>>>
>>> On Mon, Dec 25, 2017 at 5:06 AM, whitequark via cfe-commits
>>>  wrote:
>>>
>>> Author: whitequark
 Date: Mon Dec 25 05:06:09 2017
 New Revision: 321440

 URL: http://llvm.org/viewvc/llvm-project?rev=321440&view=rev [1]
 Log:
 [libunwind] Avoid using C++ headers.

 This is useful for building libunwind on libcxx-free systems.

 Modified:
 libunwind/trunk/src/DwarfParser.hpp

 Modified: libunwind/trunk/src/DwarfParser.hpp
 URL:

 http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/Dwar
>>> fParser.hpp?rev=321440&r1=321439&r2=321440&view=diff
>>>
 [2]

 
>>> ==
>>>
 --- libunwind/trunk/src/DwarfParser.hpp (original)
 +++ libunwind/trunk/src/DwarfParser.hpp Mon Dec 25 05:06:09 2017
 @@ -17,7 +17,7 @@
 #include 
 #include 
 #include 
 -#include 
 +#include 

 #include "libunwind.h"
 #include "dwarf2.h"

 ___
 cfe-commits mailing list
 cfe-commits@lists.llvm.org
 http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits [3]

>>>
>>>
>>>
>>> Links:
>>> --
>>> [1] http://llvm.org/viewvc/llvm-project?rev=321440&view=rev
>>> [2]
>>> http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/Dwar
>>> fParser.hpp?rev=321440&r1=321439&r2=321440&view=diff
>>> [3] http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>>>
>>
>> --
>> whitequark
>>
>
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [libunwind] r321440 - [libunwind] Avoid using C++ headers.

2017-12-25 Thread Don Hinton via cfe-commits
While beauty is in the eye of the beholder, I'm not sure introducing a new
template function in a header that's only used in that header is a good
idea.  Every file that includes DwarfParser.hpp is going to get that
template function -- and someone may try to use it someday.

However, if you did want to do that, you should handle signed types as
well, which pint_max_value doesn't do.  It should also assert for
non-integral types.

On Mon, Dec 25, 2017 at 12:06 PM, whitequark 
wrote:

> On 2017-12-25 19:43, Don Hinton wrote:
>
>> Here's the patch I applied locally.
>>
>> hth...
>> don
>> [snip]
>>
>
> I've committed a slightly beautified version of the patch (below)
> as r321446. Cheers!
>
> From 8a4760bafc1123f09438587ee5432eabdec3d33d Mon Sep 17 00:00:00 2001
> From: whitequark 
> Date: Mon, 25 Dec 2017 20:03:40 +
> Subject: [PATCH] [libunwind] Unbreak debug builds after r321440.
>
> ---
>  src/DwarfParser.hpp | 11 +++
>  1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/src/DwarfParser.hpp b/src/DwarfParser.hpp
> index 518101e..645ac21 100644
> --- a/src/DwarfParser.hpp
> +++ b/src/DwarfParser.hpp
> @@ -17,7 +17,6 @@
>  #include 
>  #include 
>  #include 
> -#include 
>
>  #include "libunwind.h"
>  #include "dwarf2.h"
> @@ -26,6 +25,10 @@
>
>  namespace libunwind {
>
> +// Avoid relying on C++ headers.
> +template 
> +static constexpr T pint_max_value() { return ~0; }
> +
>  /// CFI_Parser does basic parsing of a CFI (Call Frame Information)
> records.
>  /// See DWARF Spec for details:
>  ///http://refspecs.linuxbase.org/LSB_3.1.0/LSB-Core-generic/LSB
> -Core-generic/ehframechpt.html
> @@ -540,7 +543,7 @@ bool CFI_Parser::parseInstructions(A
> &addressSpace, pint_t instructions,
>results->cfaRegister = 0;
>results->cfaExpression = (int64_t)p;
>length = addressSpace.getULEB128(p, instructionsEnd);
> -  assert(length < std::numeric_limits::max() && "pointer
> overflow");
> +  assert(length < pint_max_value() && "pointer overflow");
>p += static_cast(length);
>_LIBUNWIND_TRACE_DWARF("DW_CFA_def_cfa_expression(expression=0x%"
> PRIx64
>   ", length=%" PRIu64 ")\n",
> @@ -556,7 +559,7 @@ bool CFI_Parser::parseInstructions(A
> &addressSpace, pint_t instructions,
>results->savedRegisters[reg].location = kRegisterAtExpression;
>results->savedRegisters[reg].value = (int64_t)p;
>length = addressSpace.getULEB128(p, instructionsEnd);
> -  assert(length < std::numeric_limits::max() && "pointer
> overflow");
> +  assert(length < pint_max_value() && "pointer overflow");
>p += static_cast(length);
>_LIBUNWIND_TRACE_DWARF("DW_CFA_expression(reg=%" PRIu64 ", "
>   "expression=0x%" PRIx64 ", "
> @@ -642,7 +645,7 @@ bool CFI_Parser::parseInstructions(A
> &addressSpace, pint_t instructions,
>results->savedRegisters[reg].location = kRegisterIsExpression;
>results->savedRegisters[reg].value = (int64_t)p;
>length = addressSpace.getULEB128(p, instructionsEnd);
> -  assert(length < std::numeric_limits::max() && "pointer
> overflow");
> +  assert(length < pint_max_value() && "pointer overflow");
>p += static_cast(length);
>_LIBUNWIND_TRACE_DWARF("DW_CFA_val_expression(reg=%" PRIu64 ", "
>   "expression=0x%" PRIx64 ", length=%" PRIu64
> ")\n",
> --
> 2.11.0
>
>
>> On Mon, Dec 25, 2017 at 11:26 AM, Don Hinton 
>> wrote:
>>
>> On Mon, Dec 25, 2017 at 11:09 AM, whitequark
>>>  wrote:
>>> On 2017-12-25 19:04, Don Hinton wrote:
>>> Hi:
>>>
>>> This change breaks in a local debug build, e.g.,:
>>>
>>>
>>> /Users/dhinton/projects/llvm_project/libunwind/src/DwarfPars
>> er.hpp:559:28:
>>
>>> error: no member named 'numeric_limits' in namespace 'std'
>>> assert(length < std::numeric_limits::max() && "pointer
>>> overflow");
>>> ~^
>>>
>>> Sorry, I missed this. Any idea on reformulating the assert in a way
>>> that does not require libcxx headers? Not having them significantly
>>> simplifies bare-metal builds...
>>>
>>
>> Well, assuming pint_t is some unsigned integer type, the max can be
>> found like this:
>>
>>   pint_t max_pint_t = ~0;
>>
>> So, that could be used in a pinch.
>>
>> thanks...
>>> don
>>>
>>> On Mon, Dec 25, 2017 at 5:06 AM, whitequark via cfe-commits
>>>  wrote:
>>>
>>> Author: whitequark
>>> Date: Mon Dec 25 05:06:09 2017
>>> New Revision: 321440
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=321440&view=rev [1]
>>> [1]
>>> Log:
>>> [libunwind] Avoid using C++ headers.
>>>
>>> This is useful for building libunwind on libcxx-free systems.
>>>
>>> Modified:
>>> libunwind/trunk/src/DwarfParser.hpp
>>>
>>> Modified: libunwind/trunk/src/DwarfParser.hpp
>>> URL:
>>>
>>>
>>> http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/Dwar
>> fParser.hpp?rev=321440&r1=321439&r2=321440&view=diff
>>
>>> [2]
>>> [2]
>>>
>>>
>>> ===

Re: [libunwind] r321440 - [libunwind] Avoid using C++ headers.

2017-12-25 Thread Don Hinton via cfe-commits
On Mon, Dec 25, 2017 at 12:43 PM, whitequark 
wrote:

> On 2017-12-25 20:32, Don Hinton wrote:
>
>> While beauty is in the eye of the beholder, I'm not sure introducing a
>> new template function in a header that's only used in that header is a
>> good idea.  Every file that includes DwarfParser.hpp is going to get
>> that template function -- and someone may try to use it someday.
>>
>
> That header is a header private to the libunwind implementation,
> and the template function is confined to `namespace libunwind`.


Smaller universe, but still the same issue.


>


>
> However, if you did want to do that, you should handle signed types as
>> well, which pint_max_value doesn't do.
>>
>
> `pint_t` is an unsigned type in libunwind, the signed counterpart is
> `sint_t`


The point is that a template can take any type.  Once you introduce it, it
can be used by anyone with any type.


> .
>
> It should also assert for non-integral types.
>>
>
> True, but I do not know enough C++ magic to implement that. AIUI
> std::numeric_limits implements this by specializing a template for every
> integral type, which is not something I will do here. Of course
> there's a standard template for checking whether a type is integral,
> but that also lives in libcxx.
>

Why not just use static_cast(~0) and avoid all these issues?

You might have a point that this doesn't apply in your case, but it's a
good habit to get into.


>
>
>> On Mon, Dec 25, 2017 at 12:06 PM, whitequark
>>  wrote:
>>
>> On 2017-12-25 19:43, Don Hinton wrote:
>>>
>>> Here's the patch I applied locally.

 hth...
 don
 [snip]

>>>
>>> I've committed a slightly beautified version of the patch (below)
>>> as r321446. Cheers!
>>>
>>> From 8a4760bafc1123f09438587ee5432eabdec3d33d Mon Sep 17 00:00:00
>>> 2001
>>> From: whitequark 
>>> Date: Mon, 25 Dec 2017 20:03:40 +
>>> Subject: [PATCH] [libunwind] Unbreak debug builds after r321440.
>>>
>>> ---
>>> src/DwarfParser.hpp | 11 +++
>>> 1 file changed, 7 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/src/DwarfParser.hpp b/src/DwarfParser.hpp
>>> index 518101e..645ac21 100644
>>> --- a/src/DwarfParser.hpp
>>> +++ b/src/DwarfParser.hpp
>>> @@ -17,7 +17,6 @@
>>> #include 
>>> #include 
>>> #include 
>>> -#include 
>>>
>>> #include "libunwind.h"
>>> #include "dwarf2.h"
>>> @@ -26,6 +25,10 @@
>>>
>>> namespace libunwind {
>>>
>>> +// Avoid relying on C++ headers.
>>> +template 
>>> +static constexpr T pint_max_value() { return ~0; }
>>> +
>>> /// CFI_Parser does basic parsing of a CFI (Call Frame Information)
>>> records.
>>> /// See DWARF Spec for details:
>>> ///
>>>
>>> http://refspecs.linuxbase.org/LSB_3.1.0/LSB-Core-generic/LSB
>> -Core-generic/ehframechpt.html
>>
>>> [1]
>>>
>>> @@ -540,7 +543,7 @@ bool CFI_Parser::parseInstructions(A
>>> &addressSpace, pint_t instructions,
>>> results->cfaRegister = 0;
>>> results->cfaExpression = (int64_t)p;
>>> length = addressSpace.getULEB128(p, instructionsEnd);
>>> -  assert(length < std::numeric_limits::max() &&
>>> "pointer overflow");
>>> +  assert(length < pint_max_value() && "pointer
>>> overflow");
>>> p += static_cast(length);
>>>
>>> _LIBUNWIND_TRACE_DWARF("DW_CFA_def_cfa_expression(expression=0x%"
>>> PRIx64
>>> ", length=%" PRIu64 ")\n",
>>> @@ -556,7 +559,7 @@ bool CFI_Parser::parseInstructions(A
>>> &addressSpace, pint_t instructions,
>>> results->savedRegisters[reg].location =
>>> kRegisterAtExpression;
>>> results->savedRegisters[reg].value = (int64_t)p;
>>> length = addressSpace.getULEB128(p, instructionsEnd);
>>> -  assert(length < std::numeric_limits::max() &&
>>> "pointer overflow");
>>> +  assert(length < pint_max_value() && "pointer
>>> overflow");
>>> p += static_cast(length);
>>> _LIBUNWIND_TRACE_DWARF("DW_CFA_expression(reg=%" PRIu64 ", "
>>> "expression=0x%" PRIx64 ", "
>>> @@ -642,7 +645,7 @@ bool CFI_Parser::parseInstructions(A
>>> &addressSpace, pint_t instructions,
>>> results->savedRegisters[reg].location =
>>> kRegisterIsExpression;
>>> results->savedRegisters[reg].value = (int64_t)p;
>>> length = addressSpace.getULEB128(p, instructionsEnd);
>>> -  assert(length < std::numeric_limits::max() &&
>>> "pointer overflow");
>>> +  assert(length < pint_max_value() && "pointer
>>> overflow");
>>> p += static_cast(length);
>>> _LIBUNWIND_TRACE_DWARF("DW_CFA_val_expression(reg=%" PRIu64
>>> ", "
>>> "expression=0x%" PRIx64 ", length=%"
>>> PRIu64 ")\n",
>>> --
>>> 2.11.0
>>>
>>> On Mon, Dec 25, 2017 at 11:26 AM, Don Hinton 
>>> wrote:
>>>
>>> On Mon, Dec 25, 2017 at 11:09 AM, whitequark
>>>  wrote:
>>> On 2017-12-25 19:04, Don Hinton wrote:
>>> Hi:
>>>
>>> This change breaks in a local debug build, e.g.,:
>>>
>>>
>>> /Users/dhinton/projects/llvm_project/libunwind/src/DwarfPars
>> er.hpp:559:28:
>>
>>> error: no member named 'numeric_limits' in namespace 'std'
>>> assert(length < std::numeric_limits::max() && "pointer
>>> overflow");
>>> ~^
>>>
>>> Sorry, I missed this. Any idea on reformulat

Re: [libunwind] r321440 - [libunwind] Avoid using C++ headers.

2017-12-25 Thread Don Hinton via cfe-commits
On Mon, Dec 25, 2017 at 1:10 PM, whitequark 
wrote:

> On 2017-12-25 20:54, Don Hinton wrote:
>
>> On Mon, Dec 25, 2017 at 12:43 PM, whitequark
>>  wrote:
>>
>>> On 2017-12-25 20:32, Don Hinton wrote:
>>>
 It should also assert for non-integral types.

>>>
>>> True, but I do not know enough C++ magic to implement that. AIUI
>>> std::numeric_limits implements this by specializing a template for
>>> every
>>> integral type, which is not something I will do here. Of course
>>> there's a standard template for checking whether a type is integral,
>>> but that also lives in libcxx.
>>>
>>
>> Why not just use static_cast(~0) and avoid all these issues?
>>
>
> r321448. Thanks for the review!
>

LGTM, thanks...


>
>
>> You might have a point that this doesn't apply in your case, but it's
>> a good habit to get into.
>>
>> On Mon, Dec 25, 2017 at 12:06 PM, whitequark
>>>  wrote:
>>>
>>> On 2017-12-25 19:43, Don Hinton wrote:
>>>
>>> Here's the patch I applied locally.
>>>
>>> hth...
>>> don
>>> [snip]
>>>
>>> I've committed a slightly beautified version of the patch (below)
>>> as r321446. Cheers!
>>>
>>> From 8a4760bafc1123f09438587ee5432eabdec3d33d Mon Sep 17 00:00:00
>>> 2001
>>> From: whitequark 
>>> Date: Mon, 25 Dec 2017 20:03:40 +
>>> Subject: [PATCH] [libunwind] Unbreak debug builds after r321440.
>>>
>>> ---
>>> src/DwarfParser.hpp | 11 +++
>>> 1 file changed, 7 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/src/DwarfParser.hpp b/src/DwarfParser.hpp
>>> index 518101e..645ac21 100644
>>> --- a/src/DwarfParser.hpp
>>> +++ b/src/DwarfParser.hpp
>>> @@ -17,7 +17,6 @@
>>> #include 
>>> #include 
>>> #include 
>>> -#include 
>>>
>>> #include "libunwind.h"
>>> #include "dwarf2.h"
>>> @@ -26,6 +25,10 @@
>>>
>>> namespace libunwind {
>>>
>>> +// Avoid relying on C++ headers.
>>> +template 
>>> +static constexpr T pint_max_value() { return ~0; }
>>> +
>>> /// CFI_Parser does basic parsing of a CFI (Call Frame Information)
>>> records.
>>> /// See DWARF Spec for details:
>>> ///
>>>
>>
>> http://refspecs.linuxbase.org/LSB_3.1.0/LSB-Core-generic/LSB
>> -Core-generic/ehframechpt.html
>> [5]
>>
>>
>> [1]
>>>
>>> @@ -540,7 +543,7 @@ bool CFI_Parser::parseInstructions(A
>>> &addressSpace, pint_t instructions,
>>> results->cfaRegister = 0;
>>> results->cfaExpression = (int64_t)p;
>>> length = addressSpace.getULEB128(p, instructionsEnd);
>>> -  assert(length < std::numeric_limits::max() &&
>>> "pointer overflow");
>>> +  assert(length < pint_max_value() && "pointer
>>> overflow");
>>> p += static_cast(length);
>>>
>>> _LIBUNWIND_TRACE_DWARF("DW_CFA_def_cfa_expression(expression=0x%"
>>> PRIx64
>>> ", length=%" PRIu64 ")\n",
>>> @@ -556,7 +559,7 @@ bool CFI_Parser::parseInstructions(A
>>> &addressSpace, pint_t instructions,
>>> results->savedRegisters[reg].location =
>>> kRegisterAtExpression;
>>> results->savedRegisters[reg].value = (int64_t)p;
>>> length = addressSpace.getULEB128(p, instructionsEnd);
>>> -  assert(length < std::numeric_limits::max() &&
>>> "pointer overflow");
>>> +  assert(length < pint_max_value() && "pointer
>>> overflow");
>>> p += static_cast(length);
>>> _LIBUNWIND_TRACE_DWARF("DW_CFA_expression(reg=%" PRIu64 ", "
>>> "expression=0x%" PRIx64 ", "
>>> @@ -642,7 +645,7 @@ bool CFI_Parser::parseInstructions(A
>>> &addressSpace, pint_t instructions,
>>> results->savedRegisters[reg].location =
>>> kRegisterIsExpression;
>>> results->savedRegisters[reg].value = (int64_t)p;
>>> length = addressSpace.getULEB128(p, instructionsEnd);
>>> -  assert(length < std::numeric_limits::max() &&
>>> "pointer overflow");
>>> +  assert(length < pint_max_value() && "pointer
>>> overflow");
>>> p += static_cast(length);
>>> _LIBUNWIND_TRACE_DWARF("DW_CFA_val_expression(reg=%" PRIu64
>>> ", "
>>> "expression=0x%" PRIx64 ", length=%"
>>> PRIu64 ")\n",
>>> --
>>> 2.11.0
>>>
>>> On Mon, Dec 25, 2017 at 11:26 AM, Don Hinton 
>>> wrote:
>>>
>>> On Mon, Dec 25, 2017 at 11:09 AM, whitequark
>>>  wrote:
>>> On 2017-12-25 19:04, Don Hinton wrote:
>>> Hi:
>>>
>>> This change breaks in a local debug build, e.g.,:
>>>
>>  /Users/dhinton/projects/llvm_project/libunwind/src/DwarfPar
>> ser.hpp:559:28:
>>
>> error: no member named 'numeric_limits' in namespace 'std'
>>> assert(length < std::numeric_limits::max() && "pointer
>>> overflow");
>>> ~^
>>>
>>> Sorry, I missed this. Any idea on reformulating the assert in a way
>>> that does not require libcxx headers? Not having them significantly
>>> simplifies bare-metal builds...
>>>
>>> Well, assuming pint_t is some unsigned integer type, the max can be
>>> found like this:
>>>
>>> pint_t max_pint_t = ~0;
>>>
>>> So, that could be used in a pinch.
>>>
>>> thanks...
>>> don
>>>
>>> On Mon, Dec 25, 2017 at 5:06 AM, whitequark via cfe-commits
>>>  wrote:
>>>
>>> Author: whitequark
>>> Date: Mon Dec 25 05:06:09 2017
>>> New Revision: 321440
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=321440&view=rev [1]
>>> [2] [1]
>>> [1]
>>> Log:
>>>

r322147 - [cmake] Delete redundant install command for clang-refactor.

2018-01-09 Thread Don Hinton via cfe-commits
Author: dhinton
Date: Tue Jan  9 17:00:28 2018
New Revision: 322147

URL: http://llvm.org/viewvc/llvm-project?rev=322147&view=rev
Log:
[cmake] Delete redundant install command for clang-refactor.

Summary: Install targets for clang tools are controlled by
CLANG_BUILD_TOOLS, and when OFF, cmake issues the following warning:

WARNING: Target "clang-refactor" has EXCLUDE_FROM_ALL set and will not
be built by default but an install rule has been provided for it.
CMake does not define behavior for this case.

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

Modified:
cfe/trunk/tools/clang-refactor/CMakeLists.txt

Modified: cfe/trunk/tools/clang-refactor/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-refactor/CMakeLists.txt?rev=322147&r1=322146&r2=322147&view=diff
==
--- cfe/trunk/tools/clang-refactor/CMakeLists.txt (original)
+++ cfe/trunk/tools/clang-refactor/CMakeLists.txt Tue Jan  9 17:00:28 2018
@@ -20,5 +20,3 @@ target_link_libraries(clang-refactor
   clangToolingCore
   clangToolingRefactor
   )
-
-install(TARGETS clang-refactor RUNTIME DESTINATION bin)


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


Re: r311065 - Further refactoring of the constant emitter. NFC.

2019-03-18 Thread Don Hinton via cfe-commits
It looks like this change introduced a small bug;  Specifically, the
following cast test:

-  if (auto PT = dyn_cast(DestTy)) {
...
+  // If we're producing a pointer, this is easy.
+  if (auto destPtrTy = cast(destTy)) {

Since the cast can fail, shouldn't you prefer dyn_cast<>(), which can
return nullptr, over cast<>(), which will assert?


On Wed, Aug 16, 2017 at 11:04 PM John McCall via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

> Author: rjmccall
> Date: Wed Aug 16 22:03:55 2017
> New Revision: 311065
>
> URL: http://llvm.org/viewvc/llvm-project?rev=311065&view=rev
> Log:
> Further refactoring of the constant emitter.  NFC.
>
> Modified:
> cfe/trunk/lib/CodeGen/CGExprConstant.cpp
>
> Modified: cfe/trunk/lib/CodeGen/CGExprConstant.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprConstant.cpp?rev=311065&r1=311064&r2=311065&view=diff
>
> ==
> --- cfe/trunk/lib/CodeGen/CGExprConstant.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CGExprConstant.cpp Wed Aug 16 22:03:55 2017
> @@ -1044,120 +1044,6 @@ public:
>llvm::Type *ConvertType(QualType T) {
>  return CGM.getTypes().ConvertType(T);
>}
> -
> -public:
> -  ConstantAddress EmitLValue(APValue::LValueBase LVBase) {
> -if (const ValueDecl *Decl = LVBase.dyn_cast()) {
> -  if (Decl->hasAttr())
> -return CGM.GetWeakRefReference(Decl);
> -  if (const FunctionDecl *FD = dyn_cast(Decl))
> -return ConstantAddress(CGM.GetAddrOfFunction(FD),
> CharUnits::One());
> -  if (const VarDecl* VD = dyn_cast(Decl)) {
> -// We can never refer to a variable with local storage.
> -if (!VD->hasLocalStorage()) {
> -  CharUnits Align = CGM.getContext().getDeclAlign(VD);
> -  if (VD->isFileVarDecl() || VD->hasExternalStorage())
> -return ConstantAddress(CGM.GetAddrOfGlobalVar(VD), Align);
> -  else if (VD->isLocalVarDecl()) {
> -auto Ptr = CGM.getOrCreateStaticVarDecl(
> -*VD, CGM.getLLVMLinkageVarDefinition(VD,
> /*isConstant=*/false));
> -return ConstantAddress(Ptr, Align);
> -  }
> -}
> -  }
> -  return ConstantAddress::invalid();
> -}
> -
> -Expr *E = const_cast(LVBase.get());
> -switch (E->getStmtClass()) {
> -default: break;
> -case Expr::CompoundLiteralExprClass:
> -  return tryEmitGlobalCompoundLiteral(CGM, Emitter.CGF,
> -  cast(E));
> -case Expr::StringLiteralClass:
> -  return
> CGM.GetAddrOfConstantStringFromLiteral(cast(E));
> -case Expr::ObjCEncodeExprClass:
> -  return
> CGM.GetAddrOfConstantStringFromObjCEncode(cast(E));
> -case Expr::ObjCStringLiteralClass: {
> -  ObjCStringLiteral* SL = cast(E);
> -  ConstantAddress C =
> -  CGM.getObjCRuntime().GenerateConstantString(SL->getString());
> -  return C.getElementBitCast(ConvertType(E->getType()));
> -}
> -case Expr::PredefinedExprClass: {
> -  unsigned Type = cast(E)->getIdentType();
> -  if (auto CGF = Emitter.CGF) {
> -LValue Res = CGF->EmitPredefinedLValue(cast(E));
> -return cast(Res.getAddress());
> -  } else if (Type == PredefinedExpr::PrettyFunction) {
> -return CGM.GetAddrOfConstantCString("top level", ".tmp");
> -  }
> -
> -  return CGM.GetAddrOfConstantCString("", ".tmp");
> -}
> -case Expr::AddrLabelExprClass: {
> -  assert(Emitter.CGF &&
> - "Invalid address of label expression outside function.");
> -  llvm::Constant *Ptr =
> -Emitter.CGF->GetAddrOfLabel(cast(E)->getLabel());
> -  Ptr = llvm::ConstantExpr::getBitCast(Ptr,
> ConvertType(E->getType()));
> -  return ConstantAddress(Ptr, CharUnits::One());
> -}
> -case Expr::CallExprClass: {
> -  CallExpr* CE = cast(E);
> -  unsigned builtin = CE->getBuiltinCallee();
> -  if (builtin !=
> -Builtin::BI__builtin___CFStringMakeConstantString &&
> -  builtin !=
> -Builtin::BI__builtin___NSStringMakeConstantString)
> -break;
> -  const Expr *Arg = CE->getArg(0)->IgnoreParenCasts();
> -  const StringLiteral *Literal = cast(Arg);
> -  if (builtin ==
> -Builtin::BI__builtin___NSStringMakeConstantString) {
> -return CGM.getObjCRuntime().GenerateConstantString(Literal);
> -  }
> -  // FIXME: need to deal with UCN conversion issues.
> -  return CGM.GetAddrOfConstantCFString(Literal);
> -}
> -case Expr::BlockExprClass: {
> -  StringRef FunctionName;
> -  if (auto CGF = Emitter.CGF)
> -FunctionName = CGF->CurFn->getName();
> -  else
> -FunctionName = "global";
> -
> -  // This is not really an l-value.
> -  llvm::Constant *Ptr =
> -CGM.GetAddrOfGlobalBlock(cast(E), FunctionName);
> -  return ConstantAddress(Ptr, CGM.getPointerAlign());
> -}
> -

Re: r311065 - Further refactoring of the constant emitter. NFC.

2019-03-18 Thread Don Hinton via cfe-commits
Hi John:

I found this investigating the cast assert noted here:
http://lists.llvm.org/pipermail/cfe-dev/2019-March/061685.html

I subsequently did quick grep and found a number of cases in clang+llvm
(didn't find any in other projects) .  I'm happy to fix these in mass,
i.e., s/cast/dyn_cast/, but as you mentioned, some might require additional
refactoring, e.g., removal of the conditional.

In any case, here's what I've found -- perhaps a new llvm clang-tidy
checker would be useful:

$ find ./clang ./llvm -type f \( -name "*.h" -o -name "*.cpp" \) -exec grep
-Hn "if *(auto.* *= *cast *<" \{\} \;
./clang/lib/Sema/SemaOpenMP.cpp:10904:  else if (auto *DRD =
cast(D))
./clang/lib/CodeGen/CGExprConstant.cpp:1701:  if (auto destPtrTy =
cast(destTy)) {
./clang/lib/CodeGen/MicrosoftCXXABI.cpp:738:  if (auto *Fn =
cast(Throw.getCallee()))
./clang/lib/AST/ASTImporter.cpp:8463:  if (auto *FromDC =
cast(From)) {
./clang/lib/AST/DeclBase.cpp:1182:if (auto *Def =
cast(this)->getDefinition())
./clang/lib/AST/DeclBase.cpp:1187:if (auto *Def =
cast(this)->getDefinition())
./llvm/tools/llvm-objdump/llvm-objdump.cpp:802:  if (auto *Elf64BEObj =
cast(Obj))
./llvm/tools/llvm-objdump/llvm-objdump.cpp:846:  else if (auto *Elf64BEObj
= cast(Obj))
./llvm/lib/Target/X86/AsmParser/X86Operand.h:102:if (auto Imm =
cast(Val)->getValue())
./llvm/lib/Transforms/IPO/CalledValuePropagation.cpp:139:  } else if
(auto *F = cast(Key.getPointer()))
./llvm/lib/Transforms/Coroutines/CoroEarly.cpp:183:if (auto *CII =
cast(&I)) {

thanks...
don

On Mon, Mar 18, 2019 at 12:07 PM John McCall  wrote:

> On 18 Mar 2019, at 14:39, Don Hinton wrote:
> > It looks like this change introduced a small bug;  Specifically, the
> > following cast test:
> >
> > -  if (auto PT = dyn_cast(DestTy)) {
> > ...
> > +  // If we're producing a pointer, this is easy.
> > +  if (auto destPtrTy = cast(destTy)) {
> >
> > Since the cast can fail, shouldn't you prefer dyn_cast<>(), which can
> > return nullptr, over cast<>(), which will assert?
>
> Yes, although if it hasn't caused a problem in the last year and a half,
> maybe we should just change the code to be non-conditional.
>
> John.
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r356441 - Refactor cast<>'s in if conditionals, which can only assert on failure.

2019-03-18 Thread Don Hinton via cfe-commits
Author: dhinton
Date: Mon Mar 18 23:14:14 2019
New Revision: 356441

URL: http://llvm.org/viewvc/llvm-project?rev=356441&view=rev
Log:
Refactor cast<>'s in if conditionals, which can only assert on failure.

Summary:
This patch refactors several instances of cast<> used in if
conditionals.  Since cast<> asserts on failure, the else branch can
never be taken.

In some cases, the fix is to replace cast<> with dyn_cast<>.  While
others required the removal of the conditional and some minor
refactoring.

A discussion can be seen here: 
http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20190318/265044.html

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

Modified:
cfe/trunk/lib/AST/ASTImporter.cpp
cfe/trunk/lib/AST/DeclBase.cpp
cfe/trunk/lib/CodeGen/CGExprConstant.cpp
cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp
cfe/trunk/lib/Sema/SemaOpenMP.cpp

Modified: cfe/trunk/lib/AST/ASTImporter.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTImporter.cpp?rev=356441&r1=356440&r2=356441&view=diff
==
--- cfe/trunk/lib/AST/ASTImporter.cpp (original)
+++ cfe/trunk/lib/AST/ASTImporter.cpp Mon Mar 18 23:14:14 2019
@@ -8460,44 +8460,41 @@ Error ASTImporter::ImportDefinition_New(
   if (!To)
 return llvm::make_error();
 
-  if (auto *FromDC = cast(From)) {
-ASTNodeImporter Importer(*this);
+  auto *FromDC = cast(From);
+  ASTNodeImporter Importer(*this);
 
-if (auto *ToRecord = dyn_cast(To)) {
-  if (!ToRecord->getDefinition()) {
-return Importer.ImportDefinition(
-cast(FromDC), ToRecord,
-ASTNodeImporter::IDK_Everything);
-  }
+  if (auto *ToRecord = dyn_cast(To)) {
+if (!ToRecord->getDefinition()) {
+  return Importer.ImportDefinition(
+  cast(FromDC), ToRecord,
+  ASTNodeImporter::IDK_Everything);
 }
+  }
 
-if (auto *ToEnum = dyn_cast(To)) {
-  if (!ToEnum->getDefinition()) {
-return Importer.ImportDefinition(
-cast(FromDC), ToEnum, ASTNodeImporter::IDK_Everything);
-  }
+  if (auto *ToEnum = dyn_cast(To)) {
+if (!ToEnum->getDefinition()) {
+  return Importer.ImportDefinition(
+  cast(FromDC), ToEnum, ASTNodeImporter::IDK_Everything);
 }
+  }
 
-if (auto *ToIFace = dyn_cast(To)) {
-  if (!ToIFace->getDefinition()) {
-return Importer.ImportDefinition(
-cast(FromDC), ToIFace,
-ASTNodeImporter::IDK_Everything);
-  }
+  if (auto *ToIFace = dyn_cast(To)) {
+if (!ToIFace->getDefinition()) {
+  return Importer.ImportDefinition(
+  cast(FromDC), ToIFace,
+  ASTNodeImporter::IDK_Everything);
 }
+  }
 
-if (auto *ToProto = dyn_cast(To)) {
-  if (!ToProto->getDefinition()) {
-return Importer.ImportDefinition(
-cast(FromDC), ToProto,
-ASTNodeImporter::IDK_Everything);
-  }
+  if (auto *ToProto = dyn_cast(To)) {
+if (!ToProto->getDefinition()) {
+  return Importer.ImportDefinition(
+  cast(FromDC), ToProto,
+  ASTNodeImporter::IDK_Everything);
 }
-
-return Importer.ImportDeclContext(FromDC, true);
   }
 
-  return Error::success();
+  return Importer.ImportDeclContext(FromDC, true);
 }
 
 void ASTImporter::ImportDefinition(Decl *From) {

Modified: cfe/trunk/lib/AST/DeclBase.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclBase.cpp?rev=356441&r1=356440&r2=356441&view=diff
==
--- cfe/trunk/lib/AST/DeclBase.cpp (original)
+++ cfe/trunk/lib/AST/DeclBase.cpp Mon Mar 18 23:14:14 2019
@@ -1179,13 +1179,15 @@ DeclContext *DeclContext::getPrimaryCont
 return this;
 
   case Decl::ObjCInterface:
-if (auto *Def = cast(this)->getDefinition())
-  return Def;
+if (auto *OID = dyn_cast(this))
+  if (auto *Def = OID->getDefinition())
+return Def;
 return this;
 
   case Decl::ObjCProtocol:
-if (auto *Def = cast(this)->getDefinition())
-  return Def;
+if (auto *OPD = dyn_cast(this))
+  if (auto *Def = OPD->getDefinition())
+return Def;
 return this;
 
   case Decl::ObjCCategory:

Modified: cfe/trunk/lib/CodeGen/CGExprConstant.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprConstant.cpp?rev=356441&r1=356440&r2=356441&view=diff
==
--- cfe/trunk/lib/CodeGen/CGExprConstant.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprConstant.cpp Mon Mar 18 23:14:14 2019
@@ -1698,31 +1698,20 @@ ConstantLValueEmitter::tryEmitAbsolute(l
   auto offset = getOffset();
 
   // If we're producing a pointer, this is easy.
-  if (auto destPtrTy = cast(destTy)) {
-if (Value.isNullPointer()) {
-  // FIXME: integer offsets from non-zero null pointers.
-  return CGM.getNullPointer(destPtrTy, DestType);
-}
-
-// Con

r358337 - [CommandLineParser] Add DefaultOption flag

2019-04-13 Thread Don Hinton via cfe-commits
Author: dhinton
Date: Sat Apr 13 09:55:28 2019
New Revision: 358337

URL: http://llvm.org/viewvc/llvm-project?rev=358337&view=rev
Log:
[CommandLineParser] Add DefaultOption flag

Summary: Add DefaultOption flag to CommandLineParser which provides a
default option or alias, but allows users to override it for some
other purpose as needed.

Also, add `-h` as a default alias to `-help`, which can be seamlessly
overridden by applications like llvm-objdump and llvm-readobj which
use `-h` as an alias for other options.

Reviewers: alexfh, klimek

Reviewed By: klimek

Subscribers: MaskRay, mehdi_amini, inglorion, dexonsmith, hiraditya, 
llvm-commits, jhenderson, arphaman, cfe-commits

Tags: #clang, #llvm

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

Modified:
cfe/trunk/lib/Tooling/CommonOptionsParser.cpp

Modified: cfe/trunk/lib/Tooling/CommonOptionsParser.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Tooling/CommonOptionsParser.cpp?rev=358337&r1=358336&r2=358337&view=diff
==
--- cfe/trunk/lib/Tooling/CommonOptionsParser.cpp (original)
+++ cfe/trunk/lib/Tooling/CommonOptionsParser.cpp Sat Apr 13 09:55:28 2019
@@ -83,8 +83,6 @@ std::vector ArgumentsAdj
 llvm::Error CommonOptionsParser::init(
 int &argc, const char **argv, cl::OptionCategory &Category,
 llvm::cl::NumOccurrencesFlag OccurrencesFlag, const char *Overview) {
-  static cl::opt Help("h", cl::desc("Alias for -help"), cl::Hidden,
-cl::sub(*cl::AllSubCommands));
 
   static cl::opt BuildPath("p", cl::desc("Build path"),
 cl::Optional, cl::cat(Category),


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


r358428 - [CommandLineParser] Add DefaultOption flag

2019-04-15 Thread Don Hinton via cfe-commits
Author: dhinton
Date: Mon Apr 15 10:18:10 2019
New Revision: 358428

URL: http://llvm.org/viewvc/llvm-project?rev=358428&view=rev
Log:
[CommandLineParser] Add DefaultOption flag

Summary: Add DefaultOption flag to CommandLineParser which provides a
default option or alias, but allows users to override it for some
other purpose as needed.

Also, add `-h` as a default alias to `-help`, which can be seamlessly
overridden by applications like llvm-objdump and llvm-readobj which
use `-h` as an alias for other options.

(relanding after revert, r358414)
Added DefaultOptions.clear() to reset().

Reviewers: alexfh, klimek

Reviewed By: klimek

Subscribers: kristina, MaskRay, mehdi_amini, inglorion, dexonsmith, hiraditya, 
llvm-commits, jhenderson, arphaman, cfe-commits

Tags: #clang, #llvm

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

Modified:
cfe/trunk/lib/Tooling/CommonOptionsParser.cpp

Modified: cfe/trunk/lib/Tooling/CommonOptionsParser.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Tooling/CommonOptionsParser.cpp?rev=358428&r1=358427&r2=358428&view=diff
==
--- cfe/trunk/lib/Tooling/CommonOptionsParser.cpp (original)
+++ cfe/trunk/lib/Tooling/CommonOptionsParser.cpp Mon Apr 15 10:18:10 2019
@@ -83,8 +83,6 @@ std::vector ArgumentsAdj
 llvm::Error CommonOptionsParser::init(
 int &argc, const char **argv, cl::OptionCategory &Category,
 llvm::cl::NumOccurrencesFlag OccurrencesFlag, const char *Overview) {
-  static cl::opt Help("h", cl::desc("Alias for -help"), cl::Hidden,
-cl::sub(*cl::AllSubCommands));
 
   static cl::opt BuildPath("p", cl::desc("Build path"),
 cl::Optional, cl::cat(Category),


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


[clang-tools-extra] r359142 - [clang-tidy] Add new checker: llvm-prefer-isa-or-dyn-cast-in-conditionals

2019-04-24 Thread Don Hinton via cfe-commits
Author: dhinton
Date: Wed Apr 24 14:25:57 2019
New Revision: 359142

URL: http://llvm.org/viewvc/llvm-project?rev=359142&view=rev
Log:
[clang-tidy] Add new checker: llvm-prefer-isa-or-dyn-cast-in-conditionals

Summary:
Looks at conditionals and finds cases of ``cast<>``, which will
assert rather than return a null pointer, and ``dyn_cast<>`` where
the return value is not captured. Additionally, finds cases that
match the pattern ``var.foo() && isa(var.foo())``, where the
method is called twice and could be expensive.

.. code-block:: c++

  // Finds cases like these:
  if (auto x = cast(y)) <...>
  if (cast(y)) <...>

  // But not cases like these:
  if (auto f = cast(y)->foo()) <...>
  if (cast(y)->foo()) <...>

Reviewers: alexfh, rjmccall, hokein, aaron.ballman, JonasToth

Reviewed By: aaron.ballman

Subscribers: xbolva00, Eugene.Zelenko, mgorny, xazax.hun, cfe-commits

Tags: #clang-tools-extra, #clang

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

Added:

clang-tools-extra/trunk/clang-tidy/llvm/PreferIsaOrDynCastInConditionalsCheck.cpp

clang-tools-extra/trunk/clang-tidy/llvm/PreferIsaOrDynCastInConditionalsCheck.h

clang-tools-extra/trunk/docs/clang-tidy/checks/llvm-prefer-isa-or-dyn-cast-in-conditionals.rst

clang-tools-extra/trunk/test/clang-tidy/llvm-prefer-isa-or-dyn-cast-in-conditionals.cpp
Modified:
clang-tools-extra/trunk/clang-tidy/llvm/CMakeLists.txt
clang-tools-extra/trunk/clang-tidy/llvm/LLVMTidyModule.cpp
clang-tools-extra/trunk/docs/ReleaseNotes.rst
clang-tools-extra/trunk/docs/clang-tidy/checks/list.rst

Modified: clang-tools-extra/trunk/clang-tidy/llvm/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/llvm/CMakeLists.txt?rev=359142&r1=359141&r2=359142&view=diff
==
--- clang-tools-extra/trunk/clang-tidy/llvm/CMakeLists.txt (original)
+++ clang-tools-extra/trunk/clang-tidy/llvm/CMakeLists.txt Wed Apr 24 14:25:57 
2019
@@ -4,6 +4,7 @@ add_clang_library(clangTidyLLVMModule
   HeaderGuardCheck.cpp
   IncludeOrderCheck.cpp
   LLVMTidyModule.cpp
+  PreferIsaOrDynCastInConditionalsCheck.cpp
   TwineLocalCheck.cpp
 
   LINK_LIBS

Modified: clang-tools-extra/trunk/clang-tidy/llvm/LLVMTidyModule.cpp
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/llvm/LLVMTidyModule.cpp?rev=359142&r1=359141&r2=359142&view=diff
==
--- clang-tools-extra/trunk/clang-tidy/llvm/LLVMTidyModule.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/llvm/LLVMTidyModule.cpp Wed Apr 24 
14:25:57 2019
@@ -12,6 +12,7 @@
 #include "../readability/NamespaceCommentCheck.h"
 #include "HeaderGuardCheck.h"
 #include "IncludeOrderCheck.h"
+#include "PreferIsaOrDynCastInConditionalsCheck.h"
 #include "TwineLocalCheck.h"
 
 namespace clang {
@@ -25,6 +26,8 @@ public:
 CheckFactories.registerCheck("llvm-include-order");
 CheckFactories.registerCheck(
 "llvm-namespace-comment");
+CheckFactories.registerCheck(
+"llvm-prefer-isa-or-dyn-cast-in-conditionals");
 CheckFactories.registerCheck("llvm-twine-local");
   }
 };

Added: 
clang-tools-extra/trunk/clang-tidy/llvm/PreferIsaOrDynCastInConditionalsCheck.cpp
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/llvm/PreferIsaOrDynCastInConditionalsCheck.cpp?rev=359142&view=auto
==
--- 
clang-tools-extra/trunk/clang-tidy/llvm/PreferIsaOrDynCastInConditionalsCheck.cpp
 (added)
+++ 
clang-tools-extra/trunk/clang-tidy/llvm/PreferIsaOrDynCastInConditionalsCheck.cpp
 Wed Apr 24 14:25:57 2019
@@ -0,0 +1,135 @@
+//===--- PreferIsaOrDynCastInConditionalsCheck.cpp - clang-tidy
+//-===//
+//
+// 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 "PreferIsaOrDynCastInConditionalsCheck.h"
+#include "clang/AST/ASTContext.h"
+#include "clang/ASTMatchers/ASTMatchFinder.h"
+
+using namespace clang::ast_matchers;
+
+namespace clang {
+namespace ast_matchers {
+AST_MATCHER(Expr, isMacroID) { return Node.getExprLoc().isMacroID(); }
+} // namespace ast_matchers
+
+namespace tidy {
+namespace llvm {
+
+void PreferIsaOrDynCastInConditionalsCheck::registerMatchers(
+MatchFinder *Finder) {
+  if (!getLangOpts().CPlusPlus)
+return;
+
+  auto Condition = hasCondition(implicitCastExpr(has(
+  callExpr(
+  allOf(unless(isMacroID()), unless(cxxMemberCallExpr()),
+anyOf(callee(namedDecl(hasName("cast"))),
+  
callee(namedDecl(hasName("dyn_cast")).bind("dyn_cast")
+  .bind("call";
+
+  auto Any = anyO

r359909 - [CommandLine] Change help output to prefix long options with `--` instead of `-`. NFC . Part 3 of 5

2019-05-03 Thread Don Hinton via cfe-commits
Author: dhinton
Date: Fri May  3 10:47:29 2019
New Revision: 359909

URL: http://llvm.org/viewvc/llvm-project?rev=359909&view=rev
Log:
[CommandLine] Change help output to prefix long options with `--` instead of 
`-`. NFC . Part 3 of 5

Summary:
By default, `parseCommandLineOptions()` will accept either a
`-` or `--` prefix for long options -- options with names longer than
a single character.

While this change does not affect behavior, it will be helpful with a
subsequent change that requires long options use the `--` prefix.

Reviewers: rnk, thopre

Reviewed By: thopre

Subscribers: thopre, cfe-commits, hiraditya, llvm-commits

Tags: #llvm, #clang

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

Modified:
cfe/trunk/test/Driver/clang-offload-bundler.c

Modified: cfe/trunk/test/Driver/clang-offload-bundler.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/clang-offload-bundler.c?rev=359909&r1=359908&r2=359909&view=diff
==
--- cfe/trunk/test/Driver/clang-offload-bundler.c (original)
+++ cfe/trunk/test/Driver/clang-offload-bundler.c Fri May  3 10:47:29 2019
@@ -74,10 +74,10 @@
 // CK-ERR6: error: invalid file type specified.
 
 // RUN: not clang-offload-bundler 2>&1 | FileCheck %s --check-prefix CK-ERR7
-// CK-ERR7-DAG: clang-offload-bundler: for the -type option: must be specified 
at least once!
-// CK-ERR7-DAG: clang-offload-bundler: for the -inputs option: must be 
specified at least once!
-// CK-ERR7-DAG: clang-offload-bundler: for the -outputs option: must be 
specified at least once!
-// CK-ERR7-DAG: clang-offload-bundler: for the -targets option: must be 
specified at least once!
+// CK-ERR7-DAG: clang-offload-bundler: for the --type option: must be 
specified at least once!
+// CK-ERR7-DAG: clang-offload-bundler: for the --inputs option: must be 
specified at least once!
+// CK-ERR7-DAG: clang-offload-bundler: for the --outputs option: must be 
specified at least once!
+// CK-ERR7-DAG: clang-offload-bundler: for the --targets option: must be 
specified at least once!
 
 // RUN: not clang-offload-bundler -type=i 
-targets=hxst-powerpcxxle-ibm-linux-gnu,openxp-pxxerpc64le-ibm-linux-gnu,xpenmp-x86_xx-pc-linux-gnu
 -inputs=%t.i,%t.tgt1,%t.tgt2 -outputs=%t.bundle.i 2>&1 | FileCheck %s 
--check-prefix CK-ERR8
 // CK-ERR8: error: invalid target 'hxst-powerpcxxle-ibm-linux-gnu', unknown 
offloading kind 'hxst', unknown target triple 'powerpcxxle-ibm-linux-gnu'.


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


r362328 - [test] Fix plugin tests

2019-06-02 Thread Don Hinton via cfe-commits
Author: dhinton
Date: Sun Jun  2 08:53:43 2019
New Revision: 362328

URL: http://llvm.org/viewvc/llvm-project?rev=362328&view=rev
Log:
[test] Fix plugin tests

Recommit of r361790 that was temporarily reverted in r361793 due to bot 
breakage.

Summary:
The following changes were required to fix these tests:

1) Change LLVM_ENABLE_PLUGINS to an option and move it to
   llvm/CMakeLists.txt with an appropriate default -- which matches
   the original default behavior.

2) Move the plugins directory from clang/test/Analysis
   clang/lib/Analysis.  It's not enough to add an exclude to the
   lit.local.cfg file because add_lit_testsuites recurses the tree and
   automatically adds the appropriate `check-` targets, which don't
   make sense for the plugins because they aren't tests and don't
   have `RUN` statements.

   Here's a list of the `clang-check-anlysis*` targets with this
   change:

```
  $ ninja -t targets all| sed -n "s/.*\/\(check[^:]*\):.*/\1/p" | sort -u | 
grep clang-analysis
  check-clang-analysis
  check-clang-analysis-checkers
  check-clang-analysis-copypaste
  check-clang-analysis-diagnostics
  check-clang-analysis-engine
  check-clang-analysis-exploration_order
  check-clang-analysis-html_diagnostics
  check-clang-analysis-html_diagnostics-relevant_lines
  check-clang-analysis-inlining
  check-clang-analysis-objc
  check-clang-analysis-unified-sources
  check-clang-analysis-z3
```

3) Simplify the logic and only include the subdirectories under
   clang/lib/Analysis/plugins if LLVM_ENABLE_PLUGINS is set.

Reviewed By: NoQ

Tags: #clang, #llvm

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

Added:
cfe/trunk/lib/Analysis/plugins/
cfe/trunk/lib/Analysis/plugins/CMakeLists.txt
cfe/trunk/lib/Analysis/plugins/CheckerDependencyHandling/
cfe/trunk/lib/Analysis/plugins/CheckerDependencyHandling/CMakeLists.txt

cfe/trunk/lib/Analysis/plugins/CheckerDependencyHandling/CheckerDependencyHandling.cpp

cfe/trunk/lib/Analysis/plugins/CheckerDependencyHandling/CheckerDependencyHandlingAnalyzerPlugin.exports
cfe/trunk/lib/Analysis/plugins/CheckerOptionHandling/
cfe/trunk/lib/Analysis/plugins/CheckerOptionHandling/CMakeLists.txt

cfe/trunk/lib/Analysis/plugins/CheckerOptionHandling/CheckerOptionHandling.cpp

cfe/trunk/lib/Analysis/plugins/CheckerOptionHandling/CheckerOptionHandlingAnalyzerPlugin.exports
cfe/trunk/lib/Analysis/plugins/SampleAnalyzer/
cfe/trunk/lib/Analysis/plugins/SampleAnalyzer/CMakeLists.txt
cfe/trunk/lib/Analysis/plugins/SampleAnalyzer/MainCallChecker.cpp
cfe/trunk/lib/Analysis/plugins/SampleAnalyzer/SampleAnalyzerPlugin.exports
Removed:
cfe/trunk/test/Analysis/plugins/
Modified:
cfe/trunk/lib/Analysis/CMakeLists.txt
cfe/trunk/test/Analysis/lit.local.cfg
cfe/trunk/test/CMakeLists.txt

Modified: cfe/trunk/lib/Analysis/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CMakeLists.txt?rev=362328&r1=362327&r2=362328&view=diff
==
--- cfe/trunk/lib/Analysis/CMakeLists.txt (original)
+++ cfe/trunk/lib/Analysis/CMakeLists.txt Sun Jun  2 08:53:43 2019
@@ -34,3 +34,5 @@ add_clang_library(clangAnalysis
   clangBasic
   clangLex
   )
+
+add_subdirectory(plugins)

Added: cfe/trunk/lib/Analysis/plugins/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/plugins/CMakeLists.txt?rev=362328&view=auto
==
--- cfe/trunk/lib/Analysis/plugins/CMakeLists.txt (added)
+++ cfe/trunk/lib/Analysis/plugins/CMakeLists.txt Sun Jun  2 08:53:43 2019
@@ -0,0 +1,5 @@
+if(LLVM_ENABLE_PLUGINS)
+  add_subdirectory(SampleAnalyzer)
+  add_subdirectory(CheckerDependencyHandling)
+  add_subdirectory(CheckerOptionHandling)
+endif()

Added: cfe/trunk/lib/Analysis/plugins/CheckerDependencyHandling/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/plugins/CheckerDependencyHandling/CMakeLists.txt?rev=362328&view=auto
==
--- cfe/trunk/lib/Analysis/plugins/CheckerDependencyHandling/CMakeLists.txt 
(added)
+++ cfe/trunk/lib/Analysis/plugins/CheckerDependencyHandling/CMakeLists.txt Sun 
Jun  2 08:53:43 2019
@@ -0,0 +1,10 @@
+set(LLVM_EXPORTED_SYMBOL_FILE 
${CMAKE_CURRENT_SOURCE_DIR}/CheckerDependencyHandlingAnalyzerPlugin.exports)
+add_llvm_library(CheckerDependencyHandlingAnalyzerPlugin MODULE 
CheckerDependencyHandling.cpp PLUGIN_TOOL clang)
+
+target_link_libraries(CheckerDependencyHandlingAnalyzerPlugin PRIVATE
+  clangAnalysis
+  clangAST
+  clangStaticAnalyzerCore
+  clangStaticAnalyzerFrontend
+  LLVMSupport
+  )

Added: 
cfe/trunk/lib/Analysis/plugins/CheckerDependencyHandling/CheckerDependencyHandling.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/plugins/CheckerDependencyHandling/CheckerDependencyHandling.cpp?rev=362328&vi

r362334 - Fix bug in r362328 -- append to dependency list instead of overwrite it.

2019-06-02 Thread Don Hinton via cfe-commits
Author: dhinton
Date: Sun Jun  2 10:56:26 2019
New Revision: 362334

URL: http://llvm.org/viewvc/llvm-project?rev=362334&view=rev
Log:
Fix bug in r362328 -- append to dependency list instead of overwrite it.

Modified:
cfe/trunk/test/CMakeLists.txt

Modified: cfe/trunk/test/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CMakeLists.txt?rev=362334&r1=362333&r2=362334&view=diff
==
--- cfe/trunk/test/CMakeLists.txt (original)
+++ cfe/trunk/test/CMakeLists.txt Sun Jun  2 10:56:26 2019
@@ -121,7 +121,7 @@ endif()
 
 if (CLANG_ENABLE_STATIC_ANALYZER)
   if (LLVM_ENABLE_PLUGINS)
-set(CLANG_TEST_DEPS
+list(APPEND CLANG_TEST_DEPS
   SampleAnalyzerPlugin
   CheckerDependencyHandlingAnalyzerPlugin
   CheckerOptionHandlingAnalyzerPlugin


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


r362555 - [Analysis] Only build Analysis plugins when CLANG_ENABLE_STATIC_ANALYZER is enabled.

2019-06-04 Thread Don Hinton via cfe-commits
Author: dhinton
Date: Tue Jun  4 15:07:40 2019
New Revision: 362555

URL: http://llvm.org/viewvc/llvm-project?rev=362555&view=rev
Log:
[Analysis] Only build Analysis plugins when CLANG_ENABLE_STATIC_ANALYZER is 
enabled.

Fixes bug introduced in r362328.

Thanks to Nathan Chancellor for reporting this!

Modified:
cfe/trunk/lib/Analysis/plugins/CMakeLists.txt

Modified: cfe/trunk/lib/Analysis/plugins/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/plugins/CMakeLists.txt?rev=362555&r1=362554&r2=362555&view=diff
==
--- cfe/trunk/lib/Analysis/plugins/CMakeLists.txt (original)
+++ cfe/trunk/lib/Analysis/plugins/CMakeLists.txt Tue Jun  4 15:07:40 2019
@@ -1,4 +1,4 @@
-if(LLVM_ENABLE_PLUGINS)
+if(CLANG_ENABLE_STATIC_ANALYZER AND LLVM_ENABLE_PLUGINS)
   add_subdirectory(SampleAnalyzer)
   add_subdirectory(CheckerDependencyHandling)
   add_subdirectory(CheckerOptionHandling)


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


r363298 - [lit] Disable test on darwin when building shared libs.

2019-06-13 Thread Don Hinton via cfe-commits
Author: dhinton
Date: Thu Jun 13 12:08:49 2019
New Revision: 363298

URL: http://llvm.org/viewvc/llvm-project?rev=363298&view=rev
Log:
[lit] Disable test on darwin when building shared libs.

Summary:
This test fails to link shared libraries because tries to run
a copied version of clang-check to see if the mock version of libcxx
in the same directory can be loaded dynamically.  Since the test is
specifically designed not to look in the default just-built lib
directory, it must be disabled when building with
BUILD_SHARED_LIBS=ON.

Currently only disabling it on Darwin and basing it on the
enable_shared flag.

Reviewed By: ilya-biryukov

Tags: #clang, #llvm

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

Modified:
cfe/trunk/test/Tooling/clang-check-mac-libcxx-fixed-compilation-db.cpp

Modified: cfe/trunk/test/Tooling/clang-check-mac-libcxx-fixed-compilation-db.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Tooling/clang-check-mac-libcxx-fixed-compilation-db.cpp?rev=363298&r1=363297&r2=363298&view=diff
==
--- cfe/trunk/test/Tooling/clang-check-mac-libcxx-fixed-compilation-db.cpp 
(original)
+++ cfe/trunk/test/Tooling/clang-check-mac-libcxx-fixed-compilation-db.cpp Thu 
Jun 13 12:08:49 2019
@@ -16,5 +16,7 @@
 //
 // ^ -ccc-install-dir passed to unbreak tests on *BSD where
 //   getMainExecutable() relies on real argv[0] being passed
+//
+// UNSUPPORTED: enable_shared
 #include 
 vector v;


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


r363502 - Recommit r363298 "[lit] Disable test on darwin when building shared libs."

2019-06-15 Thread Don Hinton via cfe-commits
Author: dhinton
Date: Sat Jun 15 13:09:54 2019
New Revision: 363502

URL: http://llvm.org/viewvc/llvm-project?rev=363502&view=rev
Log:
Recommit r363298 "[lit] Disable test on darwin when building shared libs."

Was reverted in r363379 due to build breakage.

Thanks to Nico Weber for reverting the original and suggesting the
fix.

Please see https://reviews.llvm.org/D61697

Modified:
cfe/trunk/test/Tooling/clang-check-mac-libcxx-fixed-compilation-db.cpp
cfe/trunk/test/lit.cfg.py

Modified: cfe/trunk/test/Tooling/clang-check-mac-libcxx-fixed-compilation-db.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Tooling/clang-check-mac-libcxx-fixed-compilation-db.cpp?rev=363502&r1=363501&r2=363502&view=diff
==
--- cfe/trunk/test/Tooling/clang-check-mac-libcxx-fixed-compilation-db.cpp 
(original)
+++ cfe/trunk/test/Tooling/clang-check-mac-libcxx-fixed-compilation-db.cpp Sat 
Jun 15 13:09:54 2019
@@ -16,5 +16,7 @@
 //
 // ^ -ccc-install-dir passed to unbreak tests on *BSD where
 //   getMainExecutable() relies on real argv[0] being passed
+//
+// UNSUPPORTED: enable_shared
 #include 
 vector v;

Modified: cfe/trunk/test/lit.cfg.py
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/lit.cfg.py?rev=363502&r1=363501&r2=363502&view=diff
==
--- cfe/trunk/test/lit.cfg.py (original)
+++ cfe/trunk/test/lit.cfg.py Sat Jun 15 13:09:54 2019
@@ -183,3 +183,6 @@ if macOSSDKVersion is not None:
 
 if os.path.exists('/etc/gentoo-release'):
 config.available_features.add('gentoo')
+
+if config.enable_shared:
+config.available_features.add("enable_shared")


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


[clang-tools-extra] r363504 - Fix gcc-05.4 bot failures caused by in r363481 "[clangd] Index API and implementations for relations"

2019-06-15 Thread Don Hinton via cfe-commits
Author: dhinton
Date: Sat Jun 15 18:09:41 2019
New Revision: 363504

URL: http://llvm.org/viewvc/llvm-project?rev=363504&view=rev
Log:
Fix gcc-05.4 bot failures caused by in r363481 "[clangd] Index API and 
implementations for relations"

Use std::make_tuple instead of initializer list to make gcc-5.4 happy.

See https://reviews.llvm.org/D62839 for details.

Modified:
clang-tools-extra/trunk/clangd/index/FileIndex.cpp

Modified: clang-tools-extra/trunk/clangd/index/FileIndex.cpp
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/index/FileIndex.cpp?rev=363504&r1=363503&r2=363504&view=diff
==
--- clang-tools-extra/trunk/clangd/index/FileIndex.cpp (original)
+++ clang-tools-extra/trunk/clangd/index/FileIndex.cpp Sat Jun 15 18:09:41 2019
@@ -72,7 +72,8 @@ static SlabTuple indexSymbols(ASTContext
"  relations slab: {7} relations, {8} bytes",
FileName, IsIndexMainAST, Syms.size(), Syms.bytes(), Refs.size(),
Refs.numRefs(), Refs.bytes(), Relations.size(), Relations.bytes());
-  return {std::move(Syms), std::move(Refs), std::move(Relations)};
+  return std::make_tuple(std::move(Syms), std::move(Refs),
+ std::move(Relations));
 }
 
 SlabTuple indexMainDecls(ParsedAST &AST) {


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


[clang-tools-extra] r363518 - [docs] Fix a few problems with clang-tool docs to get the bots green again.

2019-06-16 Thread Don Hinton via cfe-commits
Author: dhinton
Date: Sun Jun 16 10:57:37 2019
New Revision: 363518

URL: http://llvm.org/viewvc/llvm-project?rev=363518&view=rev
Log:
[docs] Fix a few problems with clang-tool docs to get the bots green again.

Modified:
clang-tools-extra/trunk/docs/ReleaseNotes.rst
clang-tools-extra/trunk/docs/clang-tidy/checks/android-cloexec-pipe.rst

Modified: clang-tools-extra/trunk/docs/ReleaseNotes.rst
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/ReleaseNotes.rst?rev=363518&r1=363517&r2=363518&view=diff
==
--- clang-tools-extra/trunk/docs/ReleaseNotes.rst (original)
+++ clang-tools-extra/trunk/docs/ReleaseNotes.rst Sun Jun 16 10:57:37 2019
@@ -192,11 +192,12 @@ Improvements to clang-tidy
   Rewrites function signatures to use a trailing return type.
 
 - The :doc:`misc-throw-by-value-catch-by-reference
-  ` now supports
+  ` now supports
   `WarnOnLargeObject` and `MaxSize` options to warn on any large trivial
   object caught by value.
 
-- Added `UseAssignment` option to :doc:`cppcoreguidelines-pro-type-member-init`
+- Added `UseAssignment` option to :doc:`cppcoreguidelines-pro-type-member-init
+  `
 
   If set to true, the check will provide fix-its with literal initializers
   (``int i = 0;``) instead of curly braces (``int i{};``).

Modified: 
clang-tools-extra/trunk/docs/clang-tidy/checks/android-cloexec-pipe.rst
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/clang-tidy/checks/android-cloexec-pipe.rst?rev=363518&r1=363517&r2=363518&view=diff
==
--- clang-tools-extra/trunk/docs/clang-tidy/checks/android-cloexec-pipe.rst 
(original)
+++ clang-tools-extra/trunk/docs/clang-tidy/checks/android-cloexec-pipe.rst Sun 
Jun 16 10:57:37 2019
@@ -17,4 +17,5 @@ Examples:
 Suggested replacement:
 
 .. code-block:: c++
+
   pipe2(pipefd, O_CLOEXEC);


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


[clang-tools-extra] r363520 - [docs] Fix another bot warning by adding a blank line to separate the `option::` command from the text below.

2019-06-16 Thread Don Hinton via cfe-commits
Author: dhinton
Date: Sun Jun 16 11:41:31 2019
New Revision: 363520

URL: http://llvm.org/viewvc/llvm-project?rev=363520&view=rev
Log:
[docs] Fix another bot warning by adding a blank line to separate the 
`option::` command from the text below.

Modified:

clang-tools-extra/trunk/docs/clang-tidy/checks/cppcoreguidelines-pro-type-member-init.rst

Modified: 
clang-tools-extra/trunk/docs/clang-tidy/checks/cppcoreguidelines-pro-type-member-init.rst
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/clang-tidy/checks/cppcoreguidelines-pro-type-member-init.rst?rev=363520&r1=363519&r2=363520&view=diff
==
--- 
clang-tools-extra/trunk/docs/clang-tidy/checks/cppcoreguidelines-pro-type-member-init.rst
 (original)
+++ 
clang-tools-extra/trunk/docs/clang-tidy/checks/cppcoreguidelines-pro-type-member-init.rst
 Sun Jun 16 11:41:31 2019
@@ -34,6 +34,7 @@ Options
be important to not initialize fixed-size array members. Default is `0`.
 
 .. option:: UseAssignment
+
If set to non-zero, the check will provide fix-its with literal initializers
\( ``int i = 0;`` \) instead of curly braces \( ``int i{};`` \).
 


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


r363521 - [docs] Fix another bot error by setting highlight language of objc code-block to objc instead of c++.

2019-06-16 Thread Don Hinton via cfe-commits
Author: dhinton
Date: Sun Jun 16 12:15:04 2019
New Revision: 363521

URL: http://llvm.org/viewvc/llvm-project?rev=363521&view=rev
Log:
[docs] Fix another bot error by setting highlight language of objc code-block 
to objc instead of c++.

Modified:
cfe/trunk/docs/ReleaseNotes.rst

Modified: cfe/trunk/docs/ReleaseNotes.rst
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/ReleaseNotes.rst?rev=363521&r1=363520&r2=363521&view=diff
==
--- cfe/trunk/docs/ReleaseNotes.rst (original)
+++ cfe/trunk/docs/ReleaseNotes.rst Sun Jun 16 12:15:04 2019
@@ -127,7 +127,7 @@ Objective-C Language Changes in Clang
 
 - Fixed encoding of ObjC pointer types that are pointers to typedefs.
 
-.. code-block:: c++
+.. code-block:: objc
 
   typedef NSArray MyArray;
 


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


Re: [PATCH] D62445: [test] Fix plugin tests

2019-08-04 Thread Don Hinton via cfe-commits
Just saw this.  I'll take a look, and thanks for pointing it out...

On Fri, Aug 2, 2019 at 6:24 PM Artem Dergachev via Phabricator <
revi...@reviews.llvm.org> wrote:

> NoQ added a comment.
>
> Ugh, there seems to be one more forgotten buildbot with plugins problems:
> http://green.lab.llvm.org/green/job/clang-stage2-cmake-RgSan/6406/consoleText
>
>   FAIL: Clang :: Analysis/checker-plugins.c (467 of 14955)
>    TEST 'Clang :: Analysis/checker-plugins.c' FAILED
> 
>   Script:
>   --
>   : 'RUN: at line 3';
>  
> /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/bin/clang
> -cc1 -internal-isystem
> /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/lib/clang/9.0.0/include
> -nostdsysteminc -analyze -analyzer-constraints=range -verify
> /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/llvm/tools/clang/test/Analysis/checker-plugins.c
>   -load
> /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/./lib/SampleAnalyzerPlugin.dylib
>   -analyzer-checker='example.MainCallChecker'
>   : 'RUN: at line 15';
>  
> /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/bin/clang
> -cc1 -internal-isystem
> /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/lib/clang/9.0.0/include
> -nostdsysteminc -analyze -analyzer-constraints=range
> /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/llvm/tools/clang/test/Analysis/checker-plugins.c
>   -load
> /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/./lib/CheckerDependencyHandlingAnalyzerPlugin.dylib
>  -analyzer-checker=example.DependendentChecker
> -analyzer-list-enabled-checkers2>&1 |
> /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/bin/FileCheck
> /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/llvm/tools/clang/test/Analysis/checker-plugins.c
> -check-prefix=CHECK-IMPLICITLY-ENABLED
>   : 'RUN: at line 24';
>  
> /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/bin/clang
> -cc1 -internal-isystem
> /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/lib/clang/9.0.0/include
> -nostdsysteminc -analyze -analyzer-constraints=range
> /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/llvm/tools/clang/test/Analysis/checker-plugins.c
>   -load
> /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/./lib/CheckerDependencyHandlingAnalyzerPlugin.dylib
>  -analyzer-checker=example.DependendentChecker
> -analyzer-disable-checker=example.Dependency
> -analyzer-list-enabled-checkers2>&1 |
> /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/bin/FileCheck
> /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/llvm/tools/clang/test/Analysis/checker-plugins.c
> -check-prefix=CHECK-IMPLICITLY-DISABLED
>   : 'RUN: at line 34';
>  
> /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/bin/clang
> -cc1 -internal-isystem
> /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/lib/clang/9.0.0/include
> -nostdsysteminc -analyze -analyzer-constraints=range
> /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/llvm/tools/clang/test/Analysis/checker-plugins.c
>   -load
> /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/./lib/CheckerOptionHandlingAnalyzerPlugin.dylib
>  -analyzer-checker=example.MyChecker2>&1 |
> /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/bin/FileCheck
> /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/llvm/tools/clang/test/Analysis/checker-plugins.c
> -check-prefix=CHECK-CHECKER-OPTION-OUTPUT
>   : 'RUN: at line 41';
>  
> /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/bin/clang
> -cc1 -internal-isystem
> /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/lib/clang/9.0.0/include
> -nostdsysteminc -analyze -analyzer-constraints=range
> /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/llvm/tools/clang/test/Analysis/checker-plugins.c
>   -load
> /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/./lib/CheckerOptionHandlingAnalyzerPlugin.dylib
>  -analyzer-checker=example.MyChecker-analyzer-config
> example.MyChecker:ExampleOption=true2>&1 |
> /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/bin/FileCheck
> /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/llvm/tools/clang/test/Analysis/checker-plugins.c
> -check-prefix=CHECK-CHECKER-OPTION-OUTPUT-TRUE
>   : 'RUN: at line 49';
>  
> /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/bin/clang
> -cc1 -internal-isystem
> /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/lib/clang/9.0.0/include
> -nostdsysteminc -analyze -analyzer-constraints=range
> /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/llvm/t

r365675 - Recommit "[CommandLine] Remove OptionCategory and SubCommand caches from the Option class."

2019-07-10 Thread Don Hinton via cfe-commits
Author: dhinton
Date: Wed Jul 10 10:57:05 2019
New Revision: 365675

URL: http://llvm.org/viewvc/llvm-project?rev=365675&view=rev
Log:
Recommit "[CommandLine] Remove OptionCategory and SubCommand caches from the 
Option class."

Previously reverted in 364141 due to buildbot breakage, and fixed here
by making GeneralCategory global a ManagedStatic.

Summary:
This change processes `OptionCategory`s and `SubCommand`s as they
are seen instead of caching them in the Option class and processing
them later.  Doing so simplifies the work needed to be done by the Global
parser and significantly reduces the size of the Option class to a mere 64
bytes.

Removing  the `OptionCategory` cache saved 24 bytes, and removing
the `SubCommand` cache saved an additional 48 bytes, for a total of a
72 byte reduction.

Reviewed By: serge-sans-paille

Tags: #llvm, #clang

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

Modified:
cfe/trunk/tools/clang-refactor/ClangRefactor.cpp

Modified: cfe/trunk/tools/clang-refactor/ClangRefactor.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-refactor/ClangRefactor.cpp?rev=365675&r1=365674&r2=365675&view=diff
==
--- cfe/trunk/tools/clang-refactor/ClangRefactor.cpp (original)
+++ cfe/trunk/tools/clang-refactor/ClangRefactor.cpp Wed Jul 10 10:57:05 2019
@@ -38,11 +38,9 @@ namespace opts {
 static cl::OptionCategory CommonRefactorOptions("Refactoring options");
 
 static cl::opt Verbose("v", cl::desc("Use verbose output"),
- cl::cat(cl::GeneralCategory),
  cl::sub(*cl::AllSubCommands));
 
 static cl::opt Inplace("i", cl::desc("Inplace edit s"),
- cl::cat(cl::GeneralCategory),
  cl::sub(*cl::AllSubCommands));
 
 } // end namespace opts
@@ -611,7 +609,7 @@ int main(int argc, const char **argv) {
   ClangRefactorTool RefactorTool;
 
   CommonOptionsParser Options(
-  argc, argv, cl::GeneralCategory, cl::ZeroOrMore,
+  argc, argv, *cl::GeneralCategory, cl::ZeroOrMore,
   "Clang-based refactoring tool for C, C++ and Objective-C");
 
   if (auto Err = RefactorTool.Init()) {


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


[clang-tools-extra] r365675 - Recommit "[CommandLine] Remove OptionCategory and SubCommand caches from the Option class."

2019-07-10 Thread Don Hinton via cfe-commits
Author: dhinton
Date: Wed Jul 10 10:57:05 2019
New Revision: 365675

URL: http://llvm.org/viewvc/llvm-project?rev=365675&view=rev
Log:
Recommit "[CommandLine] Remove OptionCategory and SubCommand caches from the 
Option class."

Previously reverted in 364141 due to buildbot breakage, and fixed here
by making GeneralCategory global a ManagedStatic.

Summary:
This change processes `OptionCategory`s and `SubCommand`s as they
are seen instead of caching them in the Option class and processing
them later.  Doing so simplifies the work needed to be done by the Global
parser and significantly reduces the size of the Option class to a mere 64
bytes.

Removing  the `OptionCategory` cache saved 24 bytes, and removing
the `SubCommand` cache saved an additional 48 bytes, for a total of a
72 byte reduction.

Reviewed By: serge-sans-paille

Tags: #llvm, #clang

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

Modified:
clang-tools-extra/trunk/clangd/index/dex/dexp/Dexp.cpp
clang-tools-extra/trunk/clangd/indexer/IndexerMain.cpp

Modified: clang-tools-extra/trunk/clangd/index/dex/dexp/Dexp.cpp
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/index/dex/dexp/Dexp.cpp?rev=365675&r1=365674&r2=365675&view=diff
==
--- clang-tools-extra/trunk/clangd/index/dex/dexp/Dexp.cpp (original)
+++ clang-tools-extra/trunk/clangd/index/dex/dexp/Dexp.cpp Wed Jul 10 10:57:05 
2019
@@ -77,7 +77,7 @@ class Command {
   // By resetting the parser options, we lost the standard -help flag.
   llvm::cl::opt> Help{
   "help", llvm::cl::desc("Display available options"),
-  llvm::cl::ValueDisallowed, llvm::cl::cat(llvm::cl::GeneralCategory)};
+  llvm::cl::ValueDisallowed};
   virtual void run() = 0;
 
 protected:

Modified: clang-tools-extra/trunk/clangd/indexer/IndexerMain.cpp
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/indexer/IndexerMain.cpp?rev=365675&r1=365674&r2=365675&view=diff
==
--- clang-tools-extra/trunk/clangd/indexer/IndexerMain.cpp (original)
+++ clang-tools-extra/trunk/clangd/indexer/IndexerMain.cpp Wed Jul 10 10:57:05 
2019
@@ -110,7 +110,7 @@ int main(int argc, const char **argv) {
   )";
 
   auto Executor = clang::tooling::createExecutorFromCommandLineArgs(
-  argc, argv, llvm::cl::GeneralCategory, Overview);
+  argc, argv, *llvm::cl::GeneralCategory, Overview);
 
   if (!Executor) {
 llvm::errs() << llvm::toString(Executor.takeError()) << "\n";


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


[clang-tools-extra] r360450 - [clang-tidy] Change the namespace for llvm checkers from 'llvm' to 'llvm_check'

2019-05-10 Thread Don Hinton via cfe-commits
Author: dhinton
Date: Fri May 10 11:27:09 2019
New Revision: 360450

URL: http://llvm.org/viewvc/llvm-project?rev=360450&view=rev
Log:
[clang-tidy] Change the namespace for llvm checkers from 'llvm' to 'llvm_check'

Summary:
Change the namespace for llvm checkers from 'llvm' to
'llvm_check', and modify add_new_check.py and rename_check.py to
support the new namespace. Checker, file, and directory names remain
unchanged.

Used new version of rename_check.py to make the change in existing
llvm checkers, but had to fix LLVMTidyModule.cpp and
LLVMModuleTest.cpp by hand.

The changes made by rename_check.py are idempotent, so if accidentally
run multiple times, it won't do anything.

Reviewed By: aaron.ballman

Tags: #clang, #clang-tools-extra

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

Modified:
clang-tools-extra/trunk/clang-tidy/add_new_check.py
clang-tools-extra/trunk/clang-tidy/llvm/HeaderGuardCheck.cpp
clang-tools-extra/trunk/clang-tidy/llvm/HeaderGuardCheck.h
clang-tools-extra/trunk/clang-tidy/llvm/IncludeOrderCheck.cpp
clang-tools-extra/trunk/clang-tidy/llvm/IncludeOrderCheck.h
clang-tools-extra/trunk/clang-tidy/llvm/LLVMTidyModule.cpp

clang-tools-extra/trunk/clang-tidy/llvm/PreferIsaOrDynCastInConditionalsCheck.cpp

clang-tools-extra/trunk/clang-tidy/llvm/PreferIsaOrDynCastInConditionalsCheck.h
clang-tools-extra/trunk/clang-tidy/llvm/TwineLocalCheck.cpp
clang-tools-extra/trunk/clang-tidy/llvm/TwineLocalCheck.h
clang-tools-extra/trunk/clang-tidy/rename_check.py
clang-tools-extra/trunk/unittests/clang-tidy/LLVMModuleTest.cpp

Modified: clang-tools-extra/trunk/clang-tidy/add_new_check.py
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/add_new_check.py?rev=360450&r1=360449&r2=360450&view=diff
==
--- clang-tools-extra/trunk/clang-tidy/add_new_check.py (original)
+++ clang-tools-extra/trunk/clang-tidy/add_new_check.py Fri May 10 11:27:09 2019
@@ -46,7 +46,7 @@ def adapt_cmake(module_path, check_name_
 
 
 # Adds a header for the new check.
-def write_header(module_path, module, check_name, check_name_camel):
+def write_header(module_path, module, namespace, check_name, check_name_camel):
   check_name_dashes = module + '-' + check_name
   filename = os.path.join(module_path, check_name_camel) + '.h'
   print('Creating %s...' % filename)
@@ -73,7 +73,7 @@ def write_header(module_path, module, ch
 
 namespace clang {
 namespace tidy {
-namespace %(module)s {
+namespace %(namespace)s {
 
 /// FIXME: Write a short description.
 ///
@@ -87,7 +87,7 @@ public:
   void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
 };
 
-} // namespace %(module)s
+} // namespace %(namespace)s
 } // namespace tidy
 } // namespace clang
 
@@ -95,11 +95,12 @@ public:
 """ % {'header_guard': header_guard,
'check_name': check_name_camel,
'check_name_dashes': check_name_dashes,
-   'module': module})
+   'module': module,
+   'namespace': namespace})
 
 
 # Adds the implementation of the new check.
-def write_implementation(module_path, module, check_name_camel):
+def write_implementation(module_path, module, namespace, check_name_camel):
   filename = os.path.join(module_path, check_name_camel) + '.cpp'
   print('Creating %s...' % filename)
   with open(filename, 'w') as f:
@@ -124,7 +125,7 @@ using namespace clang::ast_matchers;
 
 namespace clang {
 namespace tidy {
-namespace %(module)s {
+namespace %(namespace)s {
 
 void %(check_name)s::registerMatchers(MatchFinder *Finder) {
   // FIXME: Add matchers.
@@ -142,11 +143,12 @@ void %(check_name)s::check(const MatchFi
   << FixItHint::CreateInsertion(MatchedDecl->getLocation(), "awesome_");
 }
 
-} // namespace %(module)s
+} // namespace %(namespace)s
 } // namespace tidy
 } // namespace clang
 """ % {'check_name': check_name_camel,
-   'module': module})
+   'module': module,
+   'namespace': namespace})
 
 
 # Modifies the module to include the new check.
@@ -375,8 +377,15 @@ def main():
 
   if not adapt_cmake(module_path, check_name_camel):
 return
-  write_header(module_path, module, check_name, check_name_camel)
-  write_implementation(module_path, module, check_name_camel)
+
+  # Map module names to namespace names that don't conflict with widely used 
top-level namespaces.
+  if module == 'llvm':
+namespace = module + '_check'
+  else:
+namespace = module
+
+  write_header(module_path, module, namespace, check_name, check_name_camel)
+  write_implementation(module_path, module, namespace, check_name_camel)
   adapt_module(module_path, module, check_name, check_name_camel)
   add_release_notes(module_path, module, check_name)
   test_extension = language_to_extension.get(args.language)

Modified: clang-tools-extra/trunk/clang-tidy/llvm/HeaderGuardCheck.cpp
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/llvm/H

[clang-tools-extra] r360785 - [clang-tidy] modernize-loop-convert: impl const cast iter

2019-05-15 Thread Don Hinton via cfe-commits
Author: dhinton
Date: Wed May 15 09:58:58 2019
New Revision: 360785

URL: http://llvm.org/viewvc/llvm-project?rev=360785&view=rev
Log:
[clang-tidy] modernize-loop-convert: impl const cast iter

Summary:
modernize-loop-convert was not detecting implicit casts to
const_iterator as convertible to range-based loops:

std::vector vec{1,2,3,4}
for(std::vector::const_iterator i = vec.begin();
i != vec.end();
++i) { }

Thanks to Don Hinton for advice.

As well, this change adds a note for this check's applicability to code
targeting OpenMP prior to version 5 as this check will continue breaking
compilation with `-fopenmp`. Thanks to Roman Lebedev for pointing this
out.

Fixes PR#35082

Reviewed By: hintonda

Tags: #clang-tools-extra, #clang

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

Modified:
clang-tools-extra/trunk/clang-tidy/modernize/LoopConvertCheck.cpp
clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-loop-convert.rst
clang-tools-extra/trunk/docs/clang-tidy/index.rst
clang-tools-extra/trunk/test/clang-tidy/modernize-loop-convert-basic.cpp
clang-tools-extra/trunk/test/clang-tidy/modernize-loop-convert-extra.cpp

Modified: clang-tools-extra/trunk/clang-tidy/modernize/LoopConvertCheck.cpp
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/modernize/LoopConvertCheck.cpp?rev=360785&r1=360784&r2=360785&view=diff
==
--- clang-tools-extra/trunk/clang-tidy/modernize/LoopConvertCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/modernize/LoopConvertCheck.cpp Wed May 
15 09:58:58 2019
@@ -791,11 +791,6 @@ bool LoopConvertCheck::isConvertible(AST
   CanonicalBeginType->getPointeeType(),
   CanonicalInitVarType->getPointeeType()))
 return false;
-} else if (!Context->hasSameType(CanonicalInitVarType,
- CanonicalBeginType)) {
-  // Check for qualified types to avoid conversions from non-const to const
-  // iterator types.
-  return false;
 }
   } else if (FixerKind == LFK_PseudoArray) {
 // This call is required to obtain the container.

Modified: 
clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-loop-convert.rst
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-loop-convert.rst?rev=360785&r1=360784&r2=360785&view=diff
==
--- clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-loop-convert.rst 
(original)
+++ clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-loop-convert.rst 
Wed May 15 09:58:58 2019
@@ -253,3 +253,15 @@ below ends up being performed at the `sa
   flag = true;
 }
   }
+
+OpenMP
+^^
+
+As range-based for loops are only available since OpenMP 5, this check should
+not been used on code with a compatibility requirements of OpenMP prior to
+version 5. It is **intentional** that this check does not make any attempts to
+exclude incorrect diagnostics on OpenMP for loops prior to OpenMP 5.
+
+To prevent this check to be applied (and to break) OpenMP for loops but still 
be
+applied to non-OpenMP for loops the usage of ``NOLINT`` (see
+:ref:`clang-tidy-nolint`) on the specific for loops is recommended.

Modified: clang-tools-extra/trunk/docs/clang-tidy/index.rst
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/clang-tidy/index.rst?rev=360785&r1=360784&r2=360785&view=diff
==
--- clang-tools-extra/trunk/docs/clang-tidy/index.rst (original)
+++ clang-tools-extra/trunk/docs/clang-tidy/index.rst Wed May 15 09:58:58 2019
@@ -258,6 +258,8 @@ An overview of all the command-line opti
   value:   'some value'
   ...
 
+.. _clang-tidy-nolint:
+
 Suppressing Undesired Diagnostics
 =
 

Modified: 
clang-tools-extra/trunk/test/clang-tidy/modernize-loop-convert-basic.cpp
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/modernize-loop-convert-basic.cpp?rev=360785&r1=360784&r2=360785&view=diff
==
--- clang-tools-extra/trunk/test/clang-tidy/modernize-loop-convert-basic.cpp 
(original)
+++ clang-tools-extra/trunk/test/clang-tidy/modernize-loop-convert-basic.cpp 
Wed May 15 09:58:58 2019
@@ -369,7 +369,7 @@ void f() {
 // CHECK-FIXES: for (auto Val_int_ptr : Val_int_ptrs)
   }
 
-  // This container uses an iterator where the derefence type is a typedef of
+  // This container uses an iterator where the dereference type is a typedef of
   // a reference type. Make sure non-const auto & is still used. A failure here
   // means canonical types aren't being tested.
   {
@@ -431,19 +431,22 @@ void different_type() {
   // CHECK-FIXES: for (auto P : *Ps)
   // C

Re: [clang-tools-extra] r360785 - [clang-tidy] modernize-loop-convert: impl const cast iter

2019-05-15 Thread Don Hinton via cfe-commits
Just wanted to note that this patch was contributed by Torbjörn Klatt, and
I failed to add the following line to the commit message:

Patch by Torbjörn Klatt!

Sorry about that Torbjörn.

On Wed, May 15, 2019 at 9:56 AM Don Hinton via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

> Author: dhinton
> Date: Wed May 15 09:58:58 2019
> New Revision: 360785
>
> URL: http://llvm.org/viewvc/llvm-project?rev=360785&view=rev
> Log:
> [clang-tidy] modernize-loop-convert: impl const cast iter
>
> Summary:
> modernize-loop-convert was not detecting implicit casts to
> const_iterator as convertible to range-based loops:
>
> std::vector vec{1,2,3,4}
> for(std::vector::const_iterator i = vec.begin();
> i != vec.end();
> ++i) { }
>
> Thanks to Don Hinton for advice.
>
> As well, this change adds a note for this check's applicability to code
> targeting OpenMP prior to version 5 as this check will continue breaking
> compilation with `-fopenmp`. Thanks to Roman Lebedev for pointing this
> out.
>
> Fixes PR#35082
>
> Reviewed By: hintonda
>
> Tags: #clang-tools-extra, #clang
>
> Differential Revision: https://reviews.llvm.org/D61827
>
> Modified:
> clang-tools-extra/trunk/clang-tidy/modernize/LoopConvertCheck.cpp
>
> clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-loop-convert.rst
> clang-tools-extra/trunk/docs/clang-tidy/index.rst
>
> clang-tools-extra/trunk/test/clang-tidy/modernize-loop-convert-basic.cpp
>
> clang-tools-extra/trunk/test/clang-tidy/modernize-loop-convert-extra.cpp
>
> Modified: clang-tools-extra/trunk/clang-tidy/modernize/LoopConvertCheck.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/modernize/LoopConvertCheck.cpp?rev=360785&r1=360784&r2=360785&view=diff
>
> ==
> --- clang-tools-extra/trunk/clang-tidy/modernize/LoopConvertCheck.cpp
> (original)
> +++ clang-tools-extra/trunk/clang-tidy/modernize/LoopConvertCheck.cpp Wed
> May 15 09:58:58 2019
> @@ -791,11 +791,6 @@ bool LoopConvertCheck::isConvertible(AST
>CanonicalBeginType->getPointeeType(),
>CanonicalInitVarType->getPointeeType()))
>  return false;
> -} else if (!Context->hasSameType(CanonicalInitVarType,
> - CanonicalBeginType)) {
> -  // Check for qualified types to avoid conversions from non-const to
> const
> -  // iterator types.
> -  return false;
>  }
>} else if (FixerKind == LFK_PseudoArray) {
>  // This call is required to obtain the container.
>
> Modified:
> clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-loop-convert.rst
> URL:
> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-loop-convert.rst?rev=360785&r1=360784&r2=360785&view=diff
>
> ==
> ---
> clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-loop-convert.rst
> (original)
> +++
> clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-loop-convert.rst
> Wed May 15 09:58:58 2019
> @@ -253,3 +253,15 @@ below ends up being performed at the `sa
>flag = true;
>  }
>}
> +
> +OpenMP
> +^^
> +
> +As range-based for loops are only available since OpenMP 5, this check
> should
> +not been used on code with a compatibility requirements of OpenMP prior to
> +version 5. It is **intentional** that this check does not make any
> attempts to
> +exclude incorrect diagnostics on OpenMP for loops prior to OpenMP 5.
> +
> +To prevent this check to be applied (and to break) OpenMP for loops but
> still be
> +applied to non-OpenMP for loops the usage of ``NOLINT`` (see
> +:ref:`clang-tidy-nolint`) on the specific for loops is recommended.
>
> Modified: clang-tools-extra/trunk/docs/clang-tidy/index.rst
> URL:
> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/clang-tidy/index.rst?rev=360785&r1=360784&r2=360785&view=diff
>
> ==
> --- clang-tools-extra/trunk/docs/clang-tidy/index.rst (original)
> +++ clang-tools-extra/trunk/docs/clang-tidy/index.rst Wed May 15 09:58:58
> 2019
> @@ -258,6 +258,8 @@ An overview of all the command-line opti
>value:   'some value'
>...
>
> +.. _clang-tidy-nolint:
> +
>  Suppressing Undesired Diagnostics
>  =
>
>
> Modified:
> clang-tools-extra/trunk/test/clang-tidy/modernize-loop-convert-basic.cpp
> URL

[clang-tools-extra] r360787 - Revert [clang-tidy] modernize-loop-convert: impl const cast iter

2019-05-15 Thread Don Hinton via cfe-commits
Author: dhinton
Date: Wed May 15 10:36:54 2019
New Revision: 360787

URL: http://llvm.org/viewvc/llvm-project?rev=360787&view=rev
Log:
Revert [clang-tidy] modernize-loop-convert: impl const cast iter

This reverts r360785 (git commit 42d28be802fe5beab18bc1a27f89894c0a290d44)

Modified:
clang-tools-extra/trunk/clang-tidy/modernize/LoopConvertCheck.cpp
clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-loop-convert.rst
clang-tools-extra/trunk/docs/clang-tidy/index.rst
clang-tools-extra/trunk/test/clang-tidy/modernize-loop-convert-basic.cpp
clang-tools-extra/trunk/test/clang-tidy/modernize-loop-convert-extra.cpp

Modified: clang-tools-extra/trunk/clang-tidy/modernize/LoopConvertCheck.cpp
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/modernize/LoopConvertCheck.cpp?rev=360787&r1=360786&r2=360787&view=diff
==
--- clang-tools-extra/trunk/clang-tidy/modernize/LoopConvertCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/modernize/LoopConvertCheck.cpp Wed May 
15 10:36:54 2019
@@ -791,6 +791,11 @@ bool LoopConvertCheck::isConvertible(AST
   CanonicalBeginType->getPointeeType(),
   CanonicalInitVarType->getPointeeType()))
 return false;
+} else if (!Context->hasSameType(CanonicalInitVarType,
+ CanonicalBeginType)) {
+  // Check for qualified types to avoid conversions from non-const to const
+  // iterator types.
+  return false;
 }
   } else if (FixerKind == LFK_PseudoArray) {
 // This call is required to obtain the container.

Modified: 
clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-loop-convert.rst
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-loop-convert.rst?rev=360787&r1=360786&r2=360787&view=diff
==
--- clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-loop-convert.rst 
(original)
+++ clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-loop-convert.rst 
Wed May 15 10:36:54 2019
@@ -253,15 +253,3 @@ below ends up being performed at the `sa
   flag = true;
 }
   }
-
-OpenMP
-^^
-
-As range-based for loops are only available since OpenMP 5, this check should
-not been used on code with a compatibility requirements of OpenMP prior to
-version 5. It is **intentional** that this check does not make any attempts to
-exclude incorrect diagnostics on OpenMP for loops prior to OpenMP 5.
-
-To prevent this check to be applied (and to break) OpenMP for loops but still 
be
-applied to non-OpenMP for loops the usage of ``NOLINT`` (see
-:ref:`clang-tidy-nolint`) on the specific for loops is recommended.

Modified: clang-tools-extra/trunk/docs/clang-tidy/index.rst
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/clang-tidy/index.rst?rev=360787&r1=360786&r2=360787&view=diff
==
--- clang-tools-extra/trunk/docs/clang-tidy/index.rst (original)
+++ clang-tools-extra/trunk/docs/clang-tidy/index.rst Wed May 15 10:36:54 2019
@@ -258,8 +258,6 @@ An overview of all the command-line opti
   value:   'some value'
   ...
 
-.. _clang-tidy-nolint:
-
 Suppressing Undesired Diagnostics
 =
 

Modified: 
clang-tools-extra/trunk/test/clang-tidy/modernize-loop-convert-basic.cpp
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/modernize-loop-convert-basic.cpp?rev=360787&r1=360786&r2=360787&view=diff
==
--- clang-tools-extra/trunk/test/clang-tidy/modernize-loop-convert-basic.cpp 
(original)
+++ clang-tools-extra/trunk/test/clang-tidy/modernize-loop-convert-basic.cpp 
Wed May 15 10:36:54 2019
@@ -369,7 +369,7 @@ void f() {
 // CHECK-FIXES: for (auto Val_int_ptr : Val_int_ptrs)
   }
 
-  // This container uses an iterator where the dereference type is a typedef of
+  // This container uses an iterator where the derefence type is a typedef of
   // a reference type. Make sure non-const auto & is still used. A failure here
   // means canonical types aren't being tested.
   {
@@ -431,22 +431,19 @@ void different_type() {
   // CHECK-FIXES: for (auto P : *Ps)
   // CHECK-FIXES-NEXT: printf("s has value %d\n", P.X);
 
+  // V.begin() returns a user-defined type 'iterator' which, since it's
+  // different from const_iterator, disqualifies these loops from
+  // transformation.
   dependent V;
   for (dependent::const_iterator It = V.begin(), E = V.end();
It != E; ++It) {
 printf("Fibonacci number is %d\n", *It);
   }
-  // CHECK-MESSAGES: :[[@LINE-4]]:3: warning: use range-based for loop instead
-  // CHECK-FIXES: for (int It : V)
-  // CHECK-FIXES-NEXT: printf("Fibonacci number is %d\n", It)

[clang-tools-extra] r360788 - [clang-tidy] Recommit r360785 "modernize-loop-convert: impl const cast iter" with correct attribution

2019-05-15 Thread Don Hinton via cfe-commits
Author: dhinton
Date: Wed May 15 10:47:51 2019
New Revision: 360788

URL: http://llvm.org/viewvc/llvm-project?rev=360788&view=rev
Log:
[clang-tidy] Recommit r360785 "modernize-loop-convert: impl const cast iter" 
with correct attribution

Summary:
modernize-loop-convert was not detecting implicit casts to
const_iterator as convertible to range-based loops:

std::vector vec{1,2,3,4}
for(std::vector::const_iterator i = vec.begin();
i != vec.end();
++i) { }

Thanks to Don Hinton for advice.

As well, this change adds a note for this check's applicability to code
targeting OpenMP prior version 5 as this check will continue breaking
compilation with `-fopenmp`. Thanks to Roman Lebedev for pointing this
out.

Fixes PR#35082

Patch by Torbjörn Klatt!

Reviewed By: hintonda

Tags: #clang-tools-extra, #clang

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

Modified:
clang-tools-extra/trunk/clang-tidy/modernize/LoopConvertCheck.cpp
clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-loop-convert.rst
clang-tools-extra/trunk/docs/clang-tidy/index.rst
clang-tools-extra/trunk/test/clang-tidy/modernize-loop-convert-basic.cpp
clang-tools-extra/trunk/test/clang-tidy/modernize-loop-convert-extra.cpp

Modified: clang-tools-extra/trunk/clang-tidy/modernize/LoopConvertCheck.cpp
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/modernize/LoopConvertCheck.cpp?rev=360788&r1=360787&r2=360788&view=diff
==
--- clang-tools-extra/trunk/clang-tidy/modernize/LoopConvertCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/modernize/LoopConvertCheck.cpp Wed May 
15 10:47:51 2019
@@ -791,11 +791,6 @@ bool LoopConvertCheck::isConvertible(AST
   CanonicalBeginType->getPointeeType(),
   CanonicalInitVarType->getPointeeType()))
 return false;
-} else if (!Context->hasSameType(CanonicalInitVarType,
- CanonicalBeginType)) {
-  // Check for qualified types to avoid conversions from non-const to const
-  // iterator types.
-  return false;
 }
   } else if (FixerKind == LFK_PseudoArray) {
 // This call is required to obtain the container.

Modified: 
clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-loop-convert.rst
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-loop-convert.rst?rev=360788&r1=360787&r2=360788&view=diff
==
--- clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-loop-convert.rst 
(original)
+++ clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-loop-convert.rst 
Wed May 15 10:47:51 2019
@@ -253,3 +253,15 @@ below ends up being performed at the `sa
   flag = true;
 }
   }
+
+OpenMP
+^^
+
+As range-based for loops are only available since OpenMP 5, this check should
+not been used on code with a compatibility requirements of OpenMP prior to
+version 5. It is **intentional** that this check does not make any attempts to
+exclude incorrect diagnostics on OpenMP for loops prior to OpenMP 5.
+
+To prevent this check to be applied (and to break) OpenMP for loops but still 
be
+applied to non-OpenMP for loops the usage of ``NOLINT`` (see
+:ref:`clang-tidy-nolint`) on the specific for loops is recommended.

Modified: clang-tools-extra/trunk/docs/clang-tidy/index.rst
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/clang-tidy/index.rst?rev=360788&r1=360787&r2=360788&view=diff
==
--- clang-tools-extra/trunk/docs/clang-tidy/index.rst (original)
+++ clang-tools-extra/trunk/docs/clang-tidy/index.rst Wed May 15 10:47:51 2019
@@ -258,6 +258,8 @@ An overview of all the command-line opti
   value:   'some value'
   ...
 
+.. _clang-tidy-nolint:
+
 Suppressing Undesired Diagnostics
 =
 

Modified: 
clang-tools-extra/trunk/test/clang-tidy/modernize-loop-convert-basic.cpp
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/modernize-loop-convert-basic.cpp?rev=360788&r1=360787&r2=360788&view=diff
==
--- clang-tools-extra/trunk/test/clang-tidy/modernize-loop-convert-basic.cpp 
(original)
+++ clang-tools-extra/trunk/test/clang-tidy/modernize-loop-convert-basic.cpp 
Wed May 15 10:47:51 2019
@@ -369,7 +369,7 @@ void f() {
 // CHECK-FIXES: for (auto Val_int_ptr : Val_int_ptrs)
   }
 
-  // This container uses an iterator where the derefence type is a typedef of
+  // This container uses an iterator where the dereference type is a typedef of
   // a reference type. Make sure non-const auto & is still used. A failure here
   // means canonical types aren't being tested.
   {
@@ -431,19 +431,22 @@ v

r361343 - [Docs] Increase Doxygen cache size

2019-05-21 Thread Don Hinton via cfe-commits
Author: dhinton
Date: Tue May 21 17:56:42 2019
New Revision: 361343

URL: http://llvm.org/viewvc/llvm-project?rev=361343&view=rev
Log:
[Docs] Increase Doxygen cache size

Summary:
When building Doxygen docs for llvm and clang, it helpfully prints a warning at
the end noting that the `LOOKUP_CACHE_SIZE` value was too small to keep all
symbols in memory.

By increasing to the size it recommends, Doxygen builds have greatly improved
performance. On my machine, time to run `doxygen-llvm` changes from 34 minutes
to 22 minutes, which is a decent amount of time saved by changing a single
number.

Reviewed By: hintonda

Patch by J. Ryan Stinnett!

Tags: #clang, #llvm

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

Modified:
cfe/trunk/docs/doxygen.cfg.in

Modified: cfe/trunk/docs/doxygen.cfg.in
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/doxygen.cfg.in?rev=361343&r1=361342&r2=361343&view=diff
==
--- cfe/trunk/docs/doxygen.cfg.in (original)
+++ cfe/trunk/docs/doxygen.cfg.in Tue May 21 17:56:42 2019
@@ -384,7 +384,7 @@ TYPEDEF_HIDES_STRUCT   = NO
 # the optimal cache size from a speed point of view.
 # Minimum value: 0, maximum value: 9, default value: 0.
 
-LOOKUP_CACHE_SIZE  = 2
+LOOKUP_CACHE_SIZE  = 3
 
 #---
 # Build related configuration options


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


[clang-tools-extra] r361344 - [clang-tidy] remove default header-filter for run-clang-tidy

2019-05-21 Thread Don Hinton via cfe-commits
Author: dhinton
Date: Tue May 21 18:01:11 2019
New Revision: 361344

URL: http://llvm.org/viewvc/llvm-project?rev=361344&view=rev
Log:
[clang-tidy] remove default header-filter for run-clang-tidy

Summary:
run-clang-tidy.py was enforcing '-header-filter' parameter with an
unfortunate default value when none was given. Thus, leading to
overwritten clang-tidy configuration (e.g. from .clang-tidy).

This change removes the default value for '-header-filter' resulting in
the default behaviour of clang-tidy itself.

Fixes PR#41426

Reviewed By: hintonda

Patch by Torbjörn Klatt!

Tags: #clang-tools-extra, #clang

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

Modified:
clang-tools-extra/trunk/clang-tidy/tool/run-clang-tidy.py

Modified: clang-tools-extra/trunk/clang-tidy/tool/run-clang-tidy.py
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/tool/run-clang-tidy.py?rev=361344&r1=361343&r2=361344&view=diff
==
--- clang-tools-extra/trunk/clang-tidy/tool/run-clang-tidy.py (original)
+++ clang-tools-extra/trunk/clang-tidy/tool/run-clang-tidy.py Tue May 21 
18:01:11 2019
@@ -84,9 +84,6 @@ def get_tidy_invocation(f, clang_tidy_bi
   start = [clang_tidy_binary]
   if header_filter is not None:
 start.append('-header-filter=' + header_filter)
-  else:
-# Show warnings in all in-project headers by default.
-start.append('-header-filter=^' + build_path + '/.*')
   if checks:
 start.append('-checks=' + checks)
   if tmpdir is not None:


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


r361663 - [cmake] Remove old unused version of FindZ3.cmake from clang [NFC]

2019-05-24 Thread Don Hinton via cfe-commits
Author: dhinton
Date: Fri May 24 12:21:21 2019
New Revision: 361663

URL: http://llvm.org/viewvc/llvm-project?rev=361663&view=rev
Log:
[cmake] Remove old unused version of FindZ3.cmake from clang [NFC]

Summary: This file was moved to llvm in D54978, r356929, but the old
file was never removed.

Reviewed By: beanz

Tags: #clang

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

Removed:
cfe/trunk/cmake/modules/FindZ3.cmake

Removed: cfe/trunk/cmake/modules/FindZ3.cmake
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/cmake/modules/FindZ3.cmake?rev=361662&view=auto
==
(empty)


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


Re: r361340 - [Analysis] Link library dependencies to Analysis plugins

2019-05-25 Thread Don Hinton via cfe-commits
I've submitted a patch to fix this, https://reviews.llvm.org/D62445.

Without it, non of the bots can build/test any plugins.

On Fri, May 24, 2019 at 5:47 PM Akira Hatanaka via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

> I reverted the patch in r361685 to make the bot green again.
>
> > On May 23, 2019, at 5:22 PM, Akira Hatanaka  wrote:
> >
> > Hi Petr,
> >
> > This seems to have caused Analysis/checker-plugins.c to fail. Can you
> investigate it or revert your commit?
> >
> >
> http://green.lab.llvm.org/green/job/clang-stage2-cmake-RgSan/6381/consoleFull#-5275661368254eaf0-7326-4999-85b0-388101f2d404
> >
> >> On May 21, 2019, at 5:47 PM, Petr Hosek via cfe-commits <
> cfe-commits@lists.llvm.org> wrote:
> >>
> >> Author: phosek
> >> Date: Tue May 21 17:47:37 2019
> >> New Revision: 361340
> >>
> >> URL: http://llvm.org/viewvc/llvm-project?rev=361340&view=rev
> >> Log:
> >> [Analysis] Link library dependencies to Analysis plugins
> >>
> >> These are needed to avoid undefined symbols which aren't satisfied
> >> by Clang itself.
> >>
> >> Differential Revision: https://reviews.llvm.org/D62174
> >>
> >> Modified:
> >>
>  cfe/trunk/test/Analysis/plugins/CheckerDependencyHandling/CMakeLists.txt
> >>   cfe/trunk/test/Analysis/plugins/CheckerOptionHandling/CMakeLists.txt
> >>   cfe/trunk/test/Analysis/plugins/SampleAnalyzer/CMakeLists.txt
> >>
> >> Modified:
> cfe/trunk/test/Analysis/plugins/CheckerDependencyHandling/CMakeLists.txt
> >> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/plugins/CheckerDependencyHandling/CMakeLists.txt?rev=361340&r1=361339&r2=361340&view=diff
> >>
> ==
> >> ---
> cfe/trunk/test/Analysis/plugins/CheckerDependencyHandling/CMakeLists.txt
> (original)
> >> +++
> cfe/trunk/test/Analysis/plugins/CheckerDependencyHandling/CMakeLists.txt
> Tue May 21 17:47:37 2019
> >> @@ -1,11 +1,12 @@
> >> set(LLVM_EXPORTED_SYMBOL_FILE
> ${CMAKE_CURRENT_SOURCE_DIR}/CheckerDependencyHandlingAnalyzerPlugin.exports)
> >> add_llvm_library(CheckerDependencyHandlingAnalyzerPlugin MODULE
> CheckerDependencyHandling.cpp PLUGIN_TOOL clang)
> >>
> >> -if(LLVM_ENABLE_PLUGINS AND (WIN32 OR CYGWIN))
> >> +if(LLVM_ENABLE_PLUGINS)
> >>  target_link_libraries(CheckerDependencyHandlingAnalyzerPlugin PRIVATE
> >>clangAnalysis
> >>clangAST
> >>clangStaticAnalyzerCore
> >> +clangStaticAnalyzerFrontend
> >>LLVMSupport
> >>)
> >> endif()
> >>
> >> Modified:
> cfe/trunk/test/Analysis/plugins/CheckerOptionHandling/CMakeLists.txt
> >> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/plugins/CheckerOptionHandling/CMakeLists.txt?rev=361340&r1=361339&r2=361340&view=diff
> >>
> ==
> >> ---
> cfe/trunk/test/Analysis/plugins/CheckerOptionHandling/CMakeLists.txt
> (original)
> >> +++
> cfe/trunk/test/Analysis/plugins/CheckerOptionHandling/CMakeLists.txt Tue
> May 21 17:47:37 2019
> >> @@ -1,11 +1,12 @@
> >> set(LLVM_EXPORTED_SYMBOL_FILE
> ${CMAKE_CURRENT_SOURCE_DIR}/CheckerOptionHandlingAnalyzerPlugin.exports)
> >> add_llvm_library(CheckerOptionHandlingAnalyzerPlugin MODULE
> CheckerOptionHandling.cpp PLUGIN_TOOL clang)
> >>
> >> -if(LLVM_ENABLE_PLUGINS AND (WIN32 OR CYGWIN))
> >> +if(LLVM_ENABLE_PLUGINS)
> >>  target_link_libraries(CheckerOptionHandlingAnalyzerPlugin PRIVATE
> >>clangAnalysis
> >>clangAST
> >>clangStaticAnalyzerCore
> >> +clangStaticAnalyzerFrontend
> >>LLVMSupport
> >>)
> >> endif()
> >>
> >> Modified: cfe/trunk/test/Analysis/plugins/SampleAnalyzer/CMakeLists.txt
> >> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/plugins/SampleAnalyzer/CMakeLists.txt?rev=361340&r1=361339&r2=361340&view=diff
> >>
> ==
> >> --- cfe/trunk/test/Analysis/plugins/SampleAnalyzer/CMakeLists.txt
> (original)
> >> +++ cfe/trunk/test/Analysis/plugins/SampleAnalyzer/CMakeLists.txt Tue
> May 21 17:47:37 2019
> >> @@ -1,11 +1,12 @@
> >> set(LLVM_EXPORTED_SYMBOL_FILE
> ${CMAKE_CURRENT_SOURCE_DIR}/SampleAnalyzerPlugin.exports)
> >> add_llvm_library(SampleAnalyzerPlugin MODULE MainCallChecker.cpp
> PLUGIN_TOOL clang)
> >>
> >> -if(LLVM_ENABLE_PLUGINS AND (WIN32 OR CYGWIN))
> >> +if(LLVM_ENABLE_PLUGINS)
> >>  target_link_libraries(SampleAnalyzerPlugin PRIVATE
> >>clangAnalysis
> >>clangAST
> >>clangStaticAnalyzerCore
> >> +clangStaticAnalyzerFrontend
> >>LLVMSupport
> >>)
> >> endif()
> >>
> >>
> >> ___
> >> cfe-commits mailing list
> >> cfe-commits@lists.llvm.org
> >> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
> >
>
> ___
> cfe-commits mailing list
> cfe-commits@lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
___
cf

r361790 - [test] Fix plugin tests

2019-05-27 Thread Don Hinton via cfe-commits
Author: dhinton
Date: Mon May 27 23:26:58 2019
New Revision: 361790

URL: http://llvm.org/viewvc/llvm-project?rev=361790&view=rev
Log:
[test] Fix plugin tests

Summary:
The following changes were required to fix these tests:

1) Change LLVM_ENABLE_PLUGINS to an option and move it to
   llvm/CMakeLists.txt with an appropriate default -- which matches
   the original default behavior.

2) Move the plugins directory from clang/test/Analysis
   clang/lib/Analysis.  It's not enough to add an exclude to the
   lit.local.cfg file because add_lit_testsuites recurses the tree and
   automatically adds the appropriate `check-` targets, which don't
   make sense for the plugins because they aren't tests and don't
   have `RUN` statements.

   Here's a list of the `clang-check-anlysis*` targets with this
   change:

```
  $ ninja -t targets all| sed -n "s/.*\/\(check[^:]*\):.*/\1/p" | sort -u | 
grep clang-analysis
  check-clang-analysis
  check-clang-analysis-checkers
  check-clang-analysis-copypaste
  check-clang-analysis-diagnostics
  check-clang-analysis-engine
  check-clang-analysis-exploration_order
  check-clang-analysis-html_diagnostics
  check-clang-analysis-html_diagnostics-relevant_lines
  check-clang-analysis-inlining
  check-clang-analysis-objc
  check-clang-analysis-unified-sources
  check-clang-analysis-z3
```

3) Simplify the logic and only include the subdirectories under
   clang/lib/Analysis/plugins if LLVM_ENABLE_PLUGINS is set.

Reviewed By: NoQ

Tags: #clang, #llvm

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

Added:
cfe/trunk/lib/Analysis/plugins/
cfe/trunk/lib/Analysis/plugins/CMakeLists.txt
cfe/trunk/lib/Analysis/plugins/CheckerDependencyHandling/
cfe/trunk/lib/Analysis/plugins/CheckerDependencyHandling/CMakeLists.txt

cfe/trunk/lib/Analysis/plugins/CheckerDependencyHandling/CheckerDependencyHandling.cpp

cfe/trunk/lib/Analysis/plugins/CheckerDependencyHandling/CheckerDependencyHandlingAnalyzerPlugin.exports
cfe/trunk/lib/Analysis/plugins/CheckerOptionHandling/
cfe/trunk/lib/Analysis/plugins/CheckerOptionHandling/CMakeLists.txt

cfe/trunk/lib/Analysis/plugins/CheckerOptionHandling/CheckerOptionHandling.cpp

cfe/trunk/lib/Analysis/plugins/CheckerOptionHandling/CheckerOptionHandlingAnalyzerPlugin.exports
cfe/trunk/lib/Analysis/plugins/SampleAnalyzer/
cfe/trunk/lib/Analysis/plugins/SampleAnalyzer/CMakeLists.txt
cfe/trunk/lib/Analysis/plugins/SampleAnalyzer/MainCallChecker.cpp
cfe/trunk/lib/Analysis/plugins/SampleAnalyzer/SampleAnalyzerPlugin.exports
Removed:
cfe/trunk/test/Analysis/plugins/
Modified:
cfe/trunk/lib/Analysis/CMakeLists.txt
cfe/trunk/test/Analysis/lit.local.cfg
cfe/trunk/test/CMakeLists.txt

Modified: cfe/trunk/lib/Analysis/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CMakeLists.txt?rev=361790&r1=361789&r2=361790&view=diff
==
--- cfe/trunk/lib/Analysis/CMakeLists.txt (original)
+++ cfe/trunk/lib/Analysis/CMakeLists.txt Mon May 27 23:26:58 2019
@@ -34,3 +34,5 @@ add_clang_library(clangAnalysis
   clangBasic
   clangLex
   )
+
+add_subdirectory(plugins)

Added: cfe/trunk/lib/Analysis/plugins/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/plugins/CMakeLists.txt?rev=361790&view=auto
==
--- cfe/trunk/lib/Analysis/plugins/CMakeLists.txt (added)
+++ cfe/trunk/lib/Analysis/plugins/CMakeLists.txt Mon May 27 23:26:58 2019
@@ -0,0 +1,5 @@
+if(LLVM_ENABLE_PLUGINS)
+  add_subdirectory(SampleAnalyzer)
+  add_subdirectory(CheckerDependencyHandling)
+  add_subdirectory(CheckerOptionHandling)
+endif()

Added: cfe/trunk/lib/Analysis/plugins/CheckerDependencyHandling/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/plugins/CheckerDependencyHandling/CMakeLists.txt?rev=361790&view=auto
==
--- cfe/trunk/lib/Analysis/plugins/CheckerDependencyHandling/CMakeLists.txt 
(added)
+++ cfe/trunk/lib/Analysis/plugins/CheckerDependencyHandling/CMakeLists.txt Mon 
May 27 23:26:58 2019
@@ -0,0 +1,10 @@
+set(LLVM_EXPORTED_SYMBOL_FILE 
${CMAKE_CURRENT_SOURCE_DIR}/CheckerDependencyHandlingAnalyzerPlugin.exports)
+add_llvm_library(CheckerDependencyHandlingAnalyzerPlugin MODULE 
CheckerDependencyHandling.cpp PLUGIN_TOOL clang)
+
+target_link_libraries(CheckerDependencyHandlingAnalyzerPlugin PRIVATE
+  clangAnalysis
+  clangAST
+  clangStaticAnalyzerCore
+  clangStaticAnalyzerFrontend
+  LLVMSupport
+  )

Added: 
cfe/trunk/lib/Analysis/plugins/CheckerDependencyHandling/CheckerDependencyHandling.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/plugins/CheckerDependencyHandling/CheckerDependencyHandling.cpp?rev=361790&view=auto

r361793 - Revert [test] Fix plugin tests

2019-05-27 Thread Don Hinton via cfe-commits
Author: dhinton
Date: Mon May 27 23:38:16 2019
New Revision: 361793

URL: http://llvm.org/viewvc/llvm-project?rev=361793&view=rev
Log:
Revert [test] Fix plugin tests

This reverts r361790 (git commit fe5eaab2b5b4523886bd63aebcfea8cfce586fa1)

It's causing buildbot breakage, so reverting while I investigate.

Added:
cfe/trunk/test/Analysis/plugins/
cfe/trunk/test/Analysis/plugins/CMakeLists.txt
cfe/trunk/test/Analysis/plugins/CheckerDependencyHandling/
cfe/trunk/test/Analysis/plugins/CheckerDependencyHandling/CMakeLists.txt

cfe/trunk/test/Analysis/plugins/CheckerDependencyHandling/CheckerDependencyHandling.cpp

cfe/trunk/test/Analysis/plugins/CheckerDependencyHandling/CheckerDependencyHandlingAnalyzerPlugin.exports
cfe/trunk/test/Analysis/plugins/CheckerOptionHandling/
cfe/trunk/test/Analysis/plugins/CheckerOptionHandling/CMakeLists.txt

cfe/trunk/test/Analysis/plugins/CheckerOptionHandling/CheckerOptionHandling.cpp

cfe/trunk/test/Analysis/plugins/CheckerOptionHandling/CheckerOptionHandlingAnalyzerPlugin.exports
cfe/trunk/test/Analysis/plugins/SampleAnalyzer/
cfe/trunk/test/Analysis/plugins/SampleAnalyzer/CMakeLists.txt
cfe/trunk/test/Analysis/plugins/SampleAnalyzer/MainCallChecker.cpp
cfe/trunk/test/Analysis/plugins/SampleAnalyzer/SampleAnalyzerPlugin.exports
Removed:
cfe/trunk/lib/Analysis/plugins/
Modified:
cfe/trunk/lib/Analysis/CMakeLists.txt
cfe/trunk/test/Analysis/lit.local.cfg
cfe/trunk/test/CMakeLists.txt

Modified: cfe/trunk/lib/Analysis/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CMakeLists.txt?rev=361793&r1=361792&r2=361793&view=diff
==
--- cfe/trunk/lib/Analysis/CMakeLists.txt (original)
+++ cfe/trunk/lib/Analysis/CMakeLists.txt Mon May 27 23:38:16 2019
@@ -34,5 +34,3 @@ add_clang_library(clangAnalysis
   clangBasic
   clangLex
   )
-
-add_subdirectory(plugins)

Modified: cfe/trunk/test/Analysis/lit.local.cfg
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/lit.local.cfg?rev=361793&r1=361792&r2=361793&view=diff
==
--- cfe/trunk/test/Analysis/lit.local.cfg (original)
+++ cfe/trunk/test/Analysis/lit.local.cfg Mon May 27 23:38:16 2019
@@ -18,5 +18,7 @@ config.substitutions.append(('%diff_plis
 config.substitutions.append(('%diff_sarif',
 '''diff -U1 -w -I ".*file:.*%basename_t" -I '"version":' -I 
"2\.0\.0\-csd\.[0-9]*\.beta\."'''))
 
+config.excludes.add('plugins')
+
 if not config.root.clang_staticanalyzer:
 config.unsupported = True

Added: cfe/trunk/test/Analysis/plugins/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/plugins/CMakeLists.txt?rev=361793&view=auto
==
--- cfe/trunk/test/Analysis/plugins/CMakeLists.txt (added)
+++ cfe/trunk/test/Analysis/plugins/CMakeLists.txt Mon May 27 23:38:16 2019
@@ -0,0 +1,12 @@
+add_subdirectory(SampleAnalyzer)
+add_subdirectory(CheckerDependencyHandling)
+add_subdirectory(CheckerOptionHandling)
+
+set(CLANG_ANALYZER_PLUGIN_DEPS
+  SampleAnalyzerPlugin
+  CheckerDependencyHandlingAnalyzerPlugin
+  CheckerOptionHandlingAnalyzerPlugin
+  )
+
+add_custom_target(clang-analyzer-plugin
+  DEPENDS ${CLANG_ANALYZER_PLUGIN_DEPS})

Added: cfe/trunk/test/Analysis/plugins/CheckerDependencyHandling/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/plugins/CheckerDependencyHandling/CMakeLists.txt?rev=361793&view=auto
==
--- cfe/trunk/test/Analysis/plugins/CheckerDependencyHandling/CMakeLists.txt 
(added)
+++ cfe/trunk/test/Analysis/plugins/CheckerDependencyHandling/CMakeLists.txt 
Mon May 27 23:38:16 2019
@@ -0,0 +1,11 @@
+set(LLVM_EXPORTED_SYMBOL_FILE 
${CMAKE_CURRENT_SOURCE_DIR}/CheckerDependencyHandlingAnalyzerPlugin.exports)
+add_llvm_library(CheckerDependencyHandlingAnalyzerPlugin MODULE 
CheckerDependencyHandling.cpp PLUGIN_TOOL clang)
+
+if(LLVM_ENABLE_PLUGINS AND (WIN32 OR CYGWIN))
+  target_link_libraries(CheckerDependencyHandlingAnalyzerPlugin PRIVATE
+clangAnalysis
+clangAST
+clangStaticAnalyzerCore
+LLVMSupport
+)
+endif()

Added: 
cfe/trunk/test/Analysis/plugins/CheckerDependencyHandling/CheckerDependencyHandling.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/plugins/CheckerDependencyHandling/CheckerDependencyHandling.cpp?rev=361793&view=auto
==
--- 
cfe/trunk/test/Analysis/plugins/CheckerDependencyHandling/CheckerDependencyHandling.cpp
 (added)
+++ 
cfe/trunk/test/Analysis/plugins/CheckerDependencyHandling/CheckerDependencyHandling.cpp
 Mon May 27 23:38:16 2019
@@ -0,0 +1,28 @@
+#include "clang/StaticAnalyzer/Core/BugReporter/BugType.h"
+#include "

r320494 - [debuginfo-tests] Add support for moving debuginfo-tests from clang/test to llvm/projects or monorepo.

2017-12-12 Thread Don Hinton via cfe-commits
Author: dhinton
Date: Tue Dec 12 08:48:35 2017
New Revision: 320494

URL: http://llvm.org/viewvc/llvm-project?rev=320494&view=rev
Log:
[debuginfo-tests] Add support for moving debuginfo-tests from clang/test to 
llvm/projects or monorepo.

Summary:
The new version of debuginfo-tests will have it's own
lit.cfg.py file which is incompatible with the one in clang/test.
This change supports both the old and new versions, and can be used
until the bots actually move debuginfo-tests to either clang/test or
the monorepo.

This is a prerequisite for D40971.

Reviewers: zturner, aprantl

Subscribers: mgorny, JDevlieghere, llvm-commits, cfe-commits

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

Modified:
cfe/trunk/test/CMakeLists.txt
cfe/trunk/test/lit.cfg.py

Modified: cfe/trunk/test/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CMakeLists.txt?rev=320494&r1=320493&r2=320494&view=diff
==
--- cfe/trunk/test/CMakeLists.txt (original)
+++ cfe/trunk/test/CMakeLists.txt Tue Dec 12 08:48:35 2017
@@ -131,3 +131,12 @@ add_lit_testsuites(CLANG ${CMAKE_CURRENT
 add_custom_target(clang-test)
 add_dependencies(clang-test check-clang)
 set_target_properties(clang-test PROPERTIES FOLDER "Clang tests")
+
+# FIXME: This logic can be removed once all buildbots have moved
+# debuginfo-test from clang/test to llvm/projects or monorepo.
+if(EXISTS debuginfo-tests)
+  message(WARNING "Including debuginfo-tests in clang/test is deprecated.  
Move to llvm/projects or use monorepo.")
+  if(EXISTS debuginfo-tests/CMakeLists.txt)
+add_subdirectory(debuginfo-tests)
+  endif()
+endif()

Modified: cfe/trunk/test/lit.cfg.py
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/lit.cfg.py?rev=320494&r1=320493&r2=320494&view=diff
==
--- cfe/trunk/test/lit.cfg.py (original)
+++ cfe/trunk/test/lit.cfg.py Tue Dec 12 08:48:35 2017
@@ -58,12 +58,20 @@ tool_dirs = [config.clang_tools_dir, con
 
 tools = [
 'c-index-test', 'clang-check', 'clang-diff', 'clang-format', 'opt',
-ToolSubst('%test_debuginfo', command=os.path.join(
-config.llvm_src_root, 'utils', 'test_debuginfo.pl')),
 ToolSubst('%clang_func_map', command=FindTool(
 'clang-func-mapping'), unresolved='ignore'),
 ]
 
+# FIXME: This logic can be removed once all buildbots have moved
+# debuginfo-test from clang/test to llvm/projects or monorepo.
+if os.path.exists(os.path.join(config.test_source_root, 'debuginfo-tests')):
+  if os.path.isfile(
+  os.path.join(config.test_source_root, 'debuginfo-tests', 'lit.cfg.py')):
+config.excludes.append('debuginfo-tests')
+  else:
+tools.append(ToolSubst('%test_debuginfo', command=os.path.join(
+  config.llvm_src_root, 'utils', 'test_debuginfo.pl')))
+
 if config.clang_examples:
 tools.append('clang-interpreter')
 


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


r320519 - [cmake] Follow-up to rL320494.

2017-12-12 Thread Don Hinton via cfe-commits
Author: dhinton
Date: Tue Dec 12 11:47:40 2017
New Revision: 320519

URL: http://llvm.org/viewvc/llvm-project?rev=320519&view=rev
Log:
[cmake] Follow-up to rL320494.

EXISTS requires full paths.

Modified:
cfe/trunk/test/CMakeLists.txt

Modified: cfe/trunk/test/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CMakeLists.txt?rev=320519&r1=320518&r2=320519&view=diff
==
--- cfe/trunk/test/CMakeLists.txt (original)
+++ cfe/trunk/test/CMakeLists.txt Tue Dec 12 11:47:40 2017
@@ -134,9 +134,9 @@ set_target_properties(clang-test PROPERT
 
 # FIXME: This logic can be removed once all buildbots have moved
 # debuginfo-test from clang/test to llvm/projects or monorepo.
-if(EXISTS debuginfo-tests)
+if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/debuginfo-tests)
   message(WARNING "Including debuginfo-tests in clang/test is deprecated.  
Move to llvm/projects or use monorepo.")
-  if(EXISTS debuginfo-tests/CMakeLists.txt)
+  if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/debuginfo-tests/CMakeLists.txt)
 add_subdirectory(debuginfo-tests)
   endif()
 endif()


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


r309955 - [diagtool] Add ability to pass in the id and return the name for a

2017-08-03 Thread Don Hinton via cfe-commits
Author: dhinton
Date: Thu Aug  3 09:13:13 2017
New Revision: 309955

URL: http://llvm.org/viewvc/llvm-project?rev=309955&view=rev
Log:
[diagtool] Add ability to pass in the id and return the name for a
particular diagnostic.

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

Modified:
cfe/trunk/test/Misc/find-diagnostic-id.c
cfe/trunk/tools/diagtool/FindDiagnosticID.cpp

Modified: cfe/trunk/test/Misc/find-diagnostic-id.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Misc/find-diagnostic-id.c?rev=309955&r1=309954&r2=309955&view=diff
==
--- cfe/trunk/test/Misc/find-diagnostic-id.c (original)
+++ cfe/trunk/test/Misc/find-diagnostic-id.c Thu Aug  3 09:13:13 2017
@@ -1,5 +1,7 @@
-// RUN: diagtool find-diagnostic-id warn_unused_variable | FileCheck %s
+// RUN: diagtool find-diagnostic-id warn_unused_variable > %t; FileCheck %s < 
%t
+// RUN: cat %t | xargs diagtool find-diagnostic-id | FileCheck %s 
--check-prefix=INVERSE
 // RUN: not diagtool find-diagnostic-id warn_unused_vars 2>&1 | FileCheck 
--check-prefix=ERROR %s
 
 // CHECK: {{^[0-9]+$}}
+// INVERSE: warn_unused_variable
 // ERROR: error: invalid diagnostic 'warn_unused_vars'

Modified: cfe/trunk/tools/diagtool/FindDiagnosticID.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/diagtool/FindDiagnosticID.cpp?rev=309955&r1=309954&r2=309955&view=diff
==
--- cfe/trunk/tools/diagtool/FindDiagnosticID.cpp (original)
+++ cfe/trunk/tools/diagtool/FindDiagnosticID.cpp Thu Aug  3 09:13:13 2017
@@ -18,6 +18,15 @@ DEF_DIAGTOOL("find-diagnostic-id", "Prin
 using namespace clang;
 using namespace diagtool;
 
+static StringRef getNameFromID(StringRef Name) {
+  int DiagID;
+  if(!Name.getAsInteger(0, DiagID)) {
+const DiagnosticRecord &Diag = getDiagnosticForID(DiagID);
+return Diag.getName();
+  }
+  return StringRef();
+}
+
 static Optional
 findDiagnostic(ArrayRef Diagnostics, StringRef Name) {
   for (const auto &Diag : Diagnostics) {
@@ -38,7 +47,7 @@ int FindDiagnosticID::run(unsigned int a
   llvm::cl::Required, llvm::cl::cat(FindDiagnosticIDOptions));
 
   std::vector Args;
-  Args.push_back("find-diagnostic-id");
+  Args.push_back("diagtool find-diagnostic-id");
   for (const char *A : llvm::makeArrayRef(argv, argc))
 Args.push_back(A);
 
@@ -50,6 +59,13 @@ int FindDiagnosticID::run(unsigned int a
   Optional Diag =
   findDiagnostic(AllDiagnostics, DiagnosticName);
   if (!Diag) {
+// Name to id failed, so try id to name.
+auto Name = getNameFromID(DiagnosticName);
+if (!Name.empty()) {
+  OS << Name << '\n';
+  return 0;
+}
+
 llvm::errs() << "error: invalid diagnostic '" << DiagnosticName << "'\n";
 return 1;
   }


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


Re: [PATCH] D36347: New lldb python module for adding diagnostic breakpoints

2017-10-26 Thread Don Hinton via cfe-commits
On Thu, Oct 26, 2017 at 3:00 PM, Greg Clayton via Phabricator <
revi...@reviews.llvm.org> wrote:

> clayborg added a comment.
>
> Each lldb.SBValue has accessors for the stuff in an execution context:
>
> ``
>
>   lldb::SBTarget GetTarget();
>   lldb::SBProcess GetProcess();
>   lldb::SBThread GetThread();
>   lldb::SBFrame GetFrame();
>
>   You could keep a global map of process ID to diagtool if you want?
>
>   What are you thinking of using this for?
>

Part of the rational for using exe_ctx was to allow debugging multiple
targets as the same time, but if these use different versions of clang, the
diagtool map won't match.

I'll try moving it from the function __dict__ to the exe_ctx and see if
that works.

thanks...


>
>
> https://reviews.llvm.org/D36347
>
>
>
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D36347: New lldb python module for adding diagnostic breakpoints

2017-10-26 Thread Don Hinton via cfe-commits
On Thu, Oct 26, 2017 at 2:48 PM, Zachary Turner  wrote:

> Seems fine, it would be nice if the workflow could be improved a little
> bit so that all you have to do is say `clangdiag break
> —error=“-Wcovered-switch”` or something . I think that gives the most
> intuitive usage for people, even it’s a bit harder to implement.
>

The idea was to break on actual diagnostics emitted, but if you want to
break on diagnostic usage, i.e., when it was checked but not emitted, I
suppose that's possible as well.  diagtool doesn't produce a mapping for
this, but it could be added -- assuming tablegen produced enough info in
the .inc files to support it.  I added the feature I'm using here a few
months ago, which was an extension to what Alex added earlier.


>
> I also think user shouldn’t really have to concern themselves with
> diagtool, it should all just be magic. I get why it’s easier to do this
> way, but from the users perspective, having the commands map as closely as
> possible to the thing the person wants to do and hiding implementation
> details is a big win from a usability standpoint.
>

For the normal use case, i.e., clang/llvm developers that build both
together, it will just work by magic, i.e., you just run enable/disable.
The only problem is when you build out-of-tree.  If you can suggest a way
to find the correct location by examining the executable, I'd be happy to
add it.


>
> We can iterate on it later though
>

I'm happy to keep hacking on it -- got plenty of time on my hands right
now...  And I get to learn more about lldb...


> On Thu, Oct 26, 2017 at 2:38 PM Don Hinton via Phabricator <
> revi...@reviews.llvm.org> wrote:
>
>> hintonda updated this revision to Diff 120492.
>> hintonda added a comment.
>>
>> - Remove debugging print statement, and enhance help message.
>>
>>
>> https://reviews.llvm.org/D36347
>>
>> Files:
>>   utils/clangdiag.py
>>
>>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D36347: New lldb python module for adding diagnostic breakpoints

2017-10-26 Thread Don Hinton via cfe-commits
On Thu, Oct 26, 2017 at 5:44 PM, Zachary Turner  wrote:

>
>
> On Thu, Oct 26, 2017 at 3:18 PM Don Hinton  wrote:
>
>> On Thu, Oct 26, 2017 at 2:48 PM, Zachary Turner 
>> wrote:
>>
>>> Seems fine, it would be nice if the workflow could be improved a little
>>> bit so that all you have to do is say `clangdiag break
>>> —error=“-Wcovered-switch”` or something . I think that gives the most
>>> intuitive usage for people, even it’s a bit harder to implement.
>>>
>>
>> The idea was to break on actual diagnostics emitted, but if you want to
>> break on diagnostic usage, i.e., when it was checked but not emitted, I
>> suppose that's possible as well.  diagtool doesn't produce a mapping for
>> this, but it could be added -- assuming tablegen produced enough info in
>> the .inc files to support it.  I added the feature I'm using here a few
>> months ago, which was an extension to what Alex added earlier.
>>
>
> That was my idea too.  But still, wouldn't it be possible to say
> `clangdiag break --error="-Wcovered-switch"` and then have it break only
> when the -Wcovered-switch diagnostic is *emitted*?
>

Please give it a try, e.g., here are a few I tried:

clangdiag enable covered-switch-default
clangdiag enable c++11-compat

You can't pass the "-W" part since argparse thinks it's an option (can
probably fix that if it's a problem), and you must provide the entire
name.  You can get the available names from diagtool, e.g.:

diagtool list-warnings

Please let me know what you think, and thanks for suggesting it.



>
> The reason I keep using this syntax though is because clang developers
> always think in terms of the warning names.  If you want to find out why a
> warning is being emitted amidst a spew of other warnings and errors, you
> really want to be able to specify the name of the warning.
>
> Don't get me wrong though, I do think this is a nice feature, I'm just
> thinking of ways to make it more compelling by looking at it from the clang
> developer's perspective and how they will most likely want to use it.
>
> Also, I still think it should go in lldb, not in clang.  That's kind of
> exactly what the lldb/examples folder is for.
>
> That said, lgtm, but I'm still interested to see if the workflow can be
> streamlined down the line.  Perhaps after it gets checked in you can make a
> PSA on cfe-dev@ and mention that you want people to try it out and offer
> feedback ;-)
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r316773 - New lldb python module for managing diagnostic breakpoints

2017-10-27 Thread Don Hinton via cfe-commits
Author: dhinton
Date: Fri Oct 27 10:02:33 2017
New Revision: 316773

URL: http://llvm.org/viewvc/llvm-project?rev=316773&view=rev
Log:
New lldb python module for managing diagnostic breakpoints

Summary:
Can be used to set breakpoints for either the diagnostics actually
emitted for the current compilation, a particular DiagID, or all
DiagIDs for a particular warning.

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

Added:
cfe/trunk/utils/clangdiag.py   (with props)

Added: cfe/trunk/utils/clangdiag.py
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/clangdiag.py?rev=316773&view=auto
==
--- cfe/trunk/utils/clangdiag.py (added)
+++ cfe/trunk/utils/clangdiag.py Fri Oct 27 10:02:33 2017
@@ -0,0 +1,192 @@
+#!/usr/bin/python
+
+#--
+# Be sure to add the python path that points to the LLDB shared library.
+#
+# # To use this in the embedded python interpreter using "lldb" just
+# import it with the full path using the "command script import"
+# command
+#   (lldb) command script import /path/to/clandiag.py
+#--
+
+import lldb
+import argparse
+import commands
+import shlex
+import os
+import re
+import subprocess
+
+class MyParser(argparse.ArgumentParser):
+def format_help(self):
+return ''' Commands for managing clang diagnostic breakpoints
+
+Syntax: clangdiag enable [|]
+clangdiag disable
+clangdiag diagtool [|reset]
+
+The following subcommands are supported:
+
+  enable   -- Enable clang diagnostic breakpoints.
+  disable  -- Disable all clang diagnostic breakpoints.
+  diagtool -- Return, set, or reset diagtool path.
+
+This command sets breakpoints in clang, and clang based tools, that
+emit diagnostics.  When a diagnostic is emitted, and clangdiag is
+enabled, it will use the appropriate diagtool application to determine
+the name of the DiagID, and set breakpoints in all locations that
+'diag::name' appears in the source.  Since the new breakpoints are set
+after they are encountered, users will need to launch the executable a
+second time in order to hit the new breakpoints.
+
+For in-tree builds, the diagtool application, used to map DiagID's to
+names, is found automatically in the same directory as the target
+executable.  However, out-or-tree builds must use the 'diagtool'
+subcommand to set the appropriate path for diagtool in the clang debug
+bin directory.  Since this mapping is created at build-time, it's
+important for users to use the same version that was generated when
+clang was compiled, or else the id's won't match.
+
+Notes:
+- Substrings can be passed for both  and .
+- If  is passed, only enable the DiagID(s) for that warning.
+- If  is passed, only enable that DiagID.
+- Rerunning enable clears existing breakpoints.
+- diagtool is used in breakpoint callbacks, so it can be changed
+  without the need to rerun enable.
+- Adding this to your ~.lldbinit file makes clangdiag available at startup:
+  "command script import /path/to/clangdiag.py"
+
+'''
+
+def create_diag_options():
+parser = MyParser(prog='clangdiag')
+subparsers = parser.add_subparsers(
+title='subcommands',
+dest='subcommands',
+metavar='')
+disable_parser = subparsers.add_parser('disable')
+enable_parser = subparsers.add_parser('enable')
+enable_parser.add_argument('id', nargs='?')
+diagtool_parser = subparsers.add_parser('diagtool')
+diagtool_parser.add_argument('path', nargs='?')
+return parser
+
+def getDiagtool(target, diagtool = None):
+id = target.GetProcess().GetProcessID()
+if 'diagtool' not in getDiagtool.__dict__:
+getDiagtool.diagtool = {}
+if diagtool:
+if diagtool == 'reset':
+getDiagtool.diagtool[id] = None
+elif os.path.exists(diagtool):
+getDiagtool.diagtool[id] = diagtool
+else:
+print('clangdiag: %s not found.' % diagtool)
+if not id in getDiagtool.diagtool or not getDiagtool.diagtool[id]:
+getDiagtool.diagtool[id] = None
+exe = target.GetExecutable()
+if not exe.Exists():
+print('clangdiag: Target (%s) not set.' % exe.GetFilename())
+else:
+diagtool = os.path.join(exe.GetDirectory(), 'diagtool')
+if os.path.exists(diagtool):
+getDiagtool.diagtool[id] = diagtool
+else:
+print('clangdiag: diagtool not found along side %s' % exe)
+
+return getDiagtool.diagtool[id]
+
+def setDiagBreakpoint(frame, bp_loc, dict):
+id = frame.FindVariable("DiagID").GetValue()
+if id is None:
+print('clangdiag: id is None')
+return False
+
+# Don't need to test this time, since we did that in enable.
+target = frame.GetThread().GetProcess().GetTarget()
+diagtool = get

Re: [libcxx] r313643 - Resubmit "Fix llvm-lit script generation in libcxx."

2017-11-16 Thread Don Hinton via cfe-commits
Hi Zachery:

I'm seeing a breakage when cross-compiling and including libcxx in the
runtimes directory.

The problem is that `include(AddLLVM)`, guarded by LIBCXX_INCLUDE_TESTS, comes
after your change to call `configure_lit_site_cfg`.

I've fixed this locally by adding `include(AddLLVM)`  to the top of
libcxx/test/CMakeLists.txt, but don't believe this is the correct fix.

Could you take a look?

thanks...
don

On Tue, Sep 19, 2017 at 10:19 AM, Zachary Turner via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

> Author: zturner
> Date: Tue Sep 19 10:19:10 2017
> New Revision: 313643
>
> URL: http://llvm.org/viewvc/llvm-project?rev=313643&view=rev
> Log:
> Resubmit "Fix llvm-lit script generation in libcxx."
>
> After speaking with the libcxx owners, they agreed that this is
> a bug in the bot that needs to be fixed by the bot owners, and
> the CMake changes are correct.
>
> Modified:
> libcxx/trunk/CMakeLists.txt
> libcxx/trunk/cmake/Modules/HandleOutOfTreeLLVM.cmake
> libcxx/trunk/test/CMakeLists.txt
>
> Modified: libcxx/trunk/CMakeLists.txt
> URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/
> CMakeLists.txt?rev=313643&r1=313642&r2=313643&view=diff
> 
> ==
> --- libcxx/trunk/CMakeLists.txt (original)
> +++ libcxx/trunk/CMakeLists.txt Tue Sep 19 10:19:10 2017
> @@ -653,6 +653,7 @@ endif()
>  #
>  # However, since some submission systems strip test/ subdirectories,
> check for
>  # it before adding it.
> +
>  if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/test")
>add_subdirectory(test)
>  endif()
> @@ -660,6 +661,15 @@ if (LIBCXX_INCLUDE_TESTS)
>add_subdirectory(lib/abi)
>  endif()
>
> +if (LIBCXX_STANDALONE_BUILD AND EXISTS "${LLVM_MAIN_SRC_DIR}/utils/
> llvm-lit")
> +  # Make sure the llvm-lit script is generated into the bin directory,
> and do
> +  # it after adding all tests, since the generated script will only work
> +  # correctly discovered tests against test locations from the source
> tree that
> +  # have already been discovered.
> +  add_subdirectory(${LLVM_MAIN_SRC_DIR}/utils/llvm-lit
> +   ${CMAKE_CURRENT_BINARY_DIR}/llvm-lit)
> +endif()
> +
>  if (LIBCXX_INCLUDE_DOCS)
>add_subdirectory(docs)
>  endif()
>
> Modified: libcxx/trunk/cmake/Modules/HandleOutOfTreeLLVM.cmake
> URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/cmake/
> Modules/HandleOutOfTreeLLVM.cmake?rev=313643&r1=313642&r2=313643&view=diff
> 
> ==
> --- libcxx/trunk/cmake/Modules/HandleOutOfTreeLLVM.cmake (original)
> +++ libcxx/trunk/cmake/Modules/HandleOutOfTreeLLVM.cmake Tue Sep 19
> 10:19:10 2017
> @@ -106,6 +106,11 @@ macro(configure_out_of_tree_llvm)
>  set(LLVM_ENABLE_SPHINX OFF)
>endif()
>
> +  # In a standalone build, we don't have llvm to automatically generate
> the
> +  # llvm-lit script for us.  So we need to provide an explicit directory
> that
> +  # the configurator should write the script into.
> +  set(LLVM_LIT_OUTPUT_DIR "${libcxx_BINARY_DIR}/bin")
> +
># Required LIT Configuration --
> --
># Define the default arguments to use with 'lit', and an option for the
> user
># to override.
>
> Modified: libcxx/trunk/test/CMakeLists.txt
> URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/
> CMakeLists.txt?rev=313643&r1=313642&r2=313643&view=diff
> 
> ==
> --- libcxx/trunk/test/CMakeLists.txt (original)
> +++ libcxx/trunk/test/CMakeLists.txt Tue Sep 19 10:19:10 2017
> @@ -49,10 +49,9 @@ set(LIBCXX_EXECUTOR "None" CACHE STRING
>
>  set(AUTO_GEN_COMMENT "## Autogenerated by libcxx configuration.\n# Do not
> edit!")
>
> -configure_file(
> +configure_lit_site_cfg(
>${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
> -  ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
> -  @ONLY)
> +  ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg)
>
>  set(LIBCXX_TEST_DEPS "")
>
>
>
> ___
> cfe-commits mailing list
> cfe-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: r318722 - Re-revert "Refactor debuginfo-tests."

2017-11-20 Thread Don Hinton via cfe-commits
On Mon, Nov 20, 2017 at 5:20 PM, Zachary Turner via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

> Author: zturner
> Date: Mon Nov 20 17:20:28 2017
> New Revision: 318722
>
> URL: http://llvm.org/viewvc/llvm-project?rev=318722&view=rev
> Log:
> Re-revert "Refactor debuginfo-tests."
>
> This is still breaking greendragon.
>
> At this point I give up until someone can fix the greendragon
> bots, and I will probably abandon this effort in favor of using
> a private github repository.
>
> Modified:
> cfe/trunk/test/CMakeLists.txt
> cfe/trunk/test/lit.cfg.py
>
> Modified: cfe/trunk/test/CMakeLists.txt
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/
> CMakeLists.txt?rev=318722&r1=318721&r2=318722&view=diff
> 
> ==
> --- cfe/trunk/test/CMakeLists.txt (original)
> +++ cfe/trunk/test/CMakeLists.txt Mon Nov 20 17:20:28 2017
> @@ -88,14 +88,6 @@ set(CLANG_TEST_PARAMS
>clang_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
>)
>
> -if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/debuginfo-tests/CMakeLists.txt")
> -  # This is a hack to keep existing build build infrastructure working
> while we
> -  # can migrate to the new standard workflow of checking out
> debuginfo-tests into
> -  # llvm/projects or using it in a mono-repo
> -  set(DEBUGINFO_TESTS_EXCLUDE_FROM_ALL ON)
> -  add_subdirectory(debuginfo-tests)
> -endif()
> -
>

I think this is your problem.  Essentially, you are adding the tests twice,
once by recursing tree (this is the original behavior and picks up all the
tests in the new test subdir), and once explicitly by including the
debuginfo-tests subdirectory, which has a CMakeLists.txt file that adds the
tests again.


>  if( NOT CLANG_BUILT_STANDALONE )
>list(APPEND CLANG_TEST_DEPS
>  llvm-config
>
> Modified: cfe/trunk/test/lit.cfg.py
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/lit.
> cfg.py?rev=318722&r1=318721&r2=318722&view=diff
> 
> ==
> --- cfe/trunk/test/lit.cfg.py (original)
> +++ cfe/trunk/test/lit.cfg.py Mon Nov 20 17:20:28 2017
> @@ -58,6 +58,8 @@ tool_dirs = [config.clang_tools_dir, con
>
>  tools = [
>  'c-index-test', 'clang-check', 'clang-diff', 'clang-format', 'opt',
> +ToolSubst('%test_debuginfo', command=os.path.join(
> +config.llvm_src_root, 'utils', 'test_debuginfo.pl')),
>  ToolSubst('%clang_func_map', command=FindTool(
>  'clang-func-mapping'), unresolved='ignore'),
>  ]
>
>
> ___
> cfe-commits mailing list
> cfe-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [libcxx] r294127 - filesystem: fix n4100 conformance for `temp_directory_path`

2017-02-05 Thread don hinton via cfe-commits
Minor nit:  your diff is much bigger than it should have been due to
whitespace changes.

On Sun, Feb 5, 2017 at 9:21 AM, Saleem Abdulrasool via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

> Author: compnerd
> Date: Sun Feb  5 11:21:52 2017
> New Revision: 294127
>
> URL: http://llvm.org/viewvc/llvm-project?rev=294127&view=rev
> Log:
> filesystem: fix n4100 conformance for `temp_directory_path`
>
> N4100 states that an error shall be reported if
> `!exists(p) || !is_directory(p)`.  We were missing the first half of the
> conditional.  Invert the error and normal code paths to make the code
> easier to follow.
>
> Modified:
> libcxx/trunk/src/experimental/filesystem/operations.cpp
> libcxx/trunk/test/std/experimental/filesystem/fs.op.
> funcs/fs.op.temp_dir_path/temp_directory_path.pass.cpp
>
> Modified: libcxx/trunk/src/experimental/filesystem/operations.cpp
> URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/
> experimental/filesystem/operations.cpp?rev=294127&r1=
> 294126&r2=294127&view=diff
> 
> ==
> --- libcxx/trunk/src/experimental/filesystem/operations.cpp (original)
> +++ libcxx/trunk/src/experimental/filesystem/operations.cpp Sun Feb  5
> 11:21:52 2017
> @@ -886,23 +886,28 @@ path __system_complete(const path& p, st
>  return absolute(p, current_path());
>  }
>
> -path __temp_directory_path(std::error_code *ec) {
> -const char* env_paths[] = {"TMPDIR", "TMP", "TEMP", "TEMPDIR"};
> -const char* ret = nullptr;
> -for (auto & ep : env_paths)  {
> -if ((ret = std::getenv(ep)))
> -break;
> -}
> -path p(ret ? ret : "/tmp");
> -std::error_code m_ec;
> -if (is_directory(p, m_ec)) {
> -if (ec) ec->clear();
> -return p;
> -}
> +path __temp_directory_path(std::error_code* ec) {
> +  const char* env_paths[] = {"TMPDIR", "TMP", "TEMP", "TEMPDIR"};
> +  const char* ret = nullptr;
> +
> +  for (auto& ep : env_paths)
> +if ((ret = std::getenv(ep)))
> +  break;
> +  if (ret == nullptr)
> +ret = "/tmp";
> +
> +  path p(ret);
> +  std::error_code m_ec;
> +  if (!exists(p, m_ec) || !is_directory(p, m_ec)) {
>  if (!m_ec || m_ec == make_error_code(errc::no_such_
> file_or_directory))
> -m_ec = make_error_code(errc::not_a_directory);
> +  m_ec = make_error_code(errc::not_a_directory);
>  set_or_throw(m_ec, ec, "temp_directory_path");
>  return {};
> +  }
> +
> +  if (ec)
> +ec->clear();
> +  return p;
>  }
>
>  // An absolute path is composed according to the table in
> [fs.op.absolute].
>
> Modified: libcxx/trunk/test/std/experimental/filesystem/fs.op.
> funcs/fs.op.temp_dir_path/temp_directory_path.pass.cpp
> URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/
> experimental/filesystem/fs.op.funcs/fs.op.temp_dir_path/
> temp_directory_path.pass.cpp?rev=294127&r1=294126&r2=294127&view=diff
> 
> ==
> --- libcxx/trunk/test/std/experimental/filesystem/fs.op.
> funcs/fs.op.temp_dir_path/temp_directory_path.pass.cpp (original)
> +++ libcxx/trunk/test/std/experimental/filesystem/fs.op.
> funcs/fs.op.temp_dir_path/temp_directory_path.pass.cpp Sun Feb  5
> 11:21:52 2017
> @@ -97,6 +97,14 @@ TEST_CASE(basic_tests)
>  TEST_CHECK(ec == std::make_error_code(std::
> errc::permission_denied));
>  TEST_CHECK(ret == "");
>
> +// Set the env variable to point to a non-existent dir
> +PutEnv(TC.name, TC.p / "does_not_exist");
> +ec = GetTestEC();
> +ret = temp_directory_path(ec);
> +TEST_CHECK(ec != GetTestEC());
> +TEST_CHECK(ec);
> +TEST_CHECK(ret == "");
> +
>  // Finally erase this env variable
>  UnsetEnv(TC.name);
>  }
>
>
> ___
> cfe-commits mailing list
> cfe-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r306782 - Test Commit

2017-06-29 Thread Don Hinton via cfe-commits
Author: dhinton
Date: Thu Jun 29 19:57:34 2017
New Revision: 306782

URL: http://llvm.org/viewvc/llvm-project?rev=306782&view=rev
Log:
Test Commit

Modified:
cfe/trunk/README.txt

Modified: cfe/trunk/README.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/README.txt?rev=306782&r1=306781&r2=306782&view=diff
==
--- cfe/trunk/README.txt (original)
+++ cfe/trunk/README.txt Thu Jun 29 19:57:34 2017
@@ -24,3 +24,4 @@ on the Clang development mailing list:
 
 If you find a bug in Clang, please file it in the LLVM bug tracker:
   http://llvm.org/bugs/
+


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


r306783 - Remove test commit.

2017-06-29 Thread Don Hinton via cfe-commits
Author: dhinton
Date: Thu Jun 29 20:03:28 2017
New Revision: 306783

URL: http://llvm.org/viewvc/llvm-project?rev=306783&view=rev
Log:
Remove test commit.

Modified:
cfe/trunk/README.txt

Modified: cfe/trunk/README.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/README.txt?rev=306783&r1=306782&r2=306783&view=diff
==
--- cfe/trunk/README.txt (original)
+++ cfe/trunk/README.txt Thu Jun 29 20:03:28 2017
@@ -24,4 +24,3 @@ on the Clang development mailing list:
 
 If you find a bug in Clang, please file it in the LLVM bug tracker:
   http://llvm.org/bugs/
-


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


[libcxxabi] r322870 - [cmake] [libcxxabi] Don't print warning when tests are disabled.

2018-01-18 Thread Don Hinton via cfe-commits
Author: dhinton
Date: Thu Jan 18 10:29:36 2018
New Revision: 322870

URL: http://llvm.org/viewvc/llvm-project?rev=322870&view=rev
Log:
[cmake] [libcxxabi] Don't print warning when tests are disabled.

Summary:
Don't print, possibly erroneous, warning if
LIBCXXABI_INCLUDE_TESTS is false.

This patch fixes a problem introduced in r291367.

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

Modified:
libcxxabi/trunk/CMakeLists.txt

Modified: libcxxabi/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/CMakeLists.txt?rev=322870&r1=322869&r2=322870&view=diff
==
--- libcxxabi/trunk/CMakeLists.txt (original)
+++ libcxxabi/trunk/CMakeLists.txt Thu Jan 18 10:29:36 2018
@@ -440,18 +440,21 @@ endif()
 # soname, etc...
 add_subdirectory(src)
 
-if (NOT LIBCXXABI_INCLUDE_TESTS OR (LIBCXXABI_STANDALONE_BUILD AND NOT 
LIBCXXABI_ENABLE_SHARED))
-  # We can't reasonably test the system C++ library with a static libc++abi.
-  # We either need to be able to replace libc++abi at run time (with a shared
-  # libc++abi), or we need to be able to replace the C++ runtime (with a non-
-  # standalone build).
-  message(WARNING "The libc++abi tests aren't valid when libc++abi is built "
-  "standalone (i.e. outside of llvm/projects/libcxxabi ) and "
-  "is built without a shared library.  Either build a shared "
-  "library, build libc++abi at the same time as you build "
-  "libc++, or do without testing.  No check target will be "
-  "available!")
-else()
-  add_subdirectory(test)
-  add_subdirectory(fuzz)
+if (LIBCXXABI_INCLUDE_TESTS)
+  if (LIBCXXABI_STANDALONE_BUILD AND NOT LIBCXXABI_ENABLE_SHARED)
+# We can't reasonably test the system C++ library with a static
+# libc++abi.  We either need to be able to replace libc++abi at
+# run time (with a shared libc++abi), or we need to be able to
+# replace the C++ runtime (with a non- standalone build).
+message(WARNING "The libc++abi tests aren't valid when libc++abi "
+"is built standalone (i.e. outside of "
+"llvm/projects/libcxxabi ) and is built without "
+"a shared library.  Either build a shared "
+"library, build libc++abi at the same time as "
+"you build libc++, or do without testing.  No "
+"check target will be available!")
+  else()
+add_subdirectory(test)
+add_subdirectory(fuzz)
+  endif()
 endif()


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


r322977 - [cmake] Also pass CMAKE_ASM_COMPILER_ID to next stage when bootstrapping

2018-01-19 Thread Don Hinton via cfe-commits
Author: dhinton
Date: Fri Jan 19 10:31:12 2018
New Revision: 322977

URL: http://llvm.org/viewvc/llvm-project?rev=322977&view=rev
Log:
[cmake] Also pass CMAKE_ASM_COMPILER_ID to next stage when bootstrapping

Summary:
When setting CMAKE_ASM_COMPILER=clang, we also need to set
CMAKE_ASM_COMPILER_ID=Clang.

This is needed because cmake won't set CMAKE_ASM_COMPILER_ID if
CMAKE_ASM_COMPILER is already set.

Without CMAKE_ASM_COMPILER_ID, cmake can't set
CMAKE_ASM_COMPILER_OPTIONS_TARGET either, which means
CMAKE_ASM_COMPILER_TARGET is ignored, causing cross compiling to fail,
i.e., `--target=${CMAKE_ASM_COMPILER_TARGET}` isn't passed.

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

Modified:
cfe/trunk/CMakeLists.txt

Modified: cfe/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/CMakeLists.txt?rev=322977&r1=322976&r2=322977&view=diff
==
--- cfe/trunk/CMakeLists.txt (original)
+++ cfe/trunk/CMakeLists.txt Fri Jan 19 10:31:12 2018
@@ -624,7 +624,8 @@ if (CLANG_ENABLE_BOOTSTRAP)
   set(COMPILER_OPTIONS
 -DCMAKE_CXX_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/${CXX_COMPILER}
 -DCMAKE_C_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/${C_COMPILER}
--DCMAKE_ASM_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/${C_COMPILER})
+-DCMAKE_ASM_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/${C_COMPILER}
+-DCMAKE_ASM_COMPILER_ID=Clang)
 
   if(BOOTSTRAP_LLVM_BUILD_INSTRUMENTED)
 add_dependencies(clang-bootstrap-deps llvm-profdata)


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


[libunwind] r323141 - [cmake] [libunwind] Fix find_path() problems when cross compiling

2018-01-22 Thread Don Hinton via cfe-commits
Author: dhinton
Date: Mon Jan 22 11:15:06 2018
New Revision: 323141

URL: http://llvm.org/viewvc/llvm-project?rev=323141&view=rev
Log:
[cmake] [libunwind] Fix find_path() problems when cross compiling

When CMAKE_SYSROOT or CMAKE_FIND_ROOT_PATH is set, cmake
recommends setting CMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY
globally which means find_path() always prepends CMAKE_SYSROOT or
CMAKE_FIND_ROOT_PATH to all paths used in the search.

However, this find_path() invocation is looking for a path in the
libcxx project on the host system, not the target system,
which can be done by passing NO_CMAKE_FIND_ROOT_PATH.

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

Modified:
libunwind/trunk/CMakeLists.txt

Modified: libunwind/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/trunk/CMakeLists.txt?rev=323141&r1=323140&r2=323141&view=diff
==
--- libunwind/trunk/CMakeLists.txt (original)
+++ libunwind/trunk/CMakeLists.txt Mon Jan 22 11:15:06 2018
@@ -329,7 +329,8 @@ find_path(
   PATHS ${LLVM_MAIN_SRC_DIR}/projects/libcxx/include
 ${LLVM_MAIN_SRC_DIR}/runtimes/libcxx/include
   NO_DEFAULT_PATH
-)
+  NO_CMAKE_FIND_ROOT_PATH
+  )
 if ((NOT LIBUNWIND_STANDALONE_BUILD OR HAVE_LIBCXX) AND
 IS_DIRECTORY "${LIBUNWIND_LIBCXX_INCLUDES_INTERNAL}")
   set(LIBUNWIND_CXX_INCLUDE_PATHS_DEFAULT 
"${LIBUNWIND_LIBCXX_INCLUDES_INTERNAL}")


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


[libcxx] r323143 - [cmake] [libcxx] Fix find_path() problems when cross compiling.

2018-01-22 Thread Don Hinton via cfe-commits
Author: dhinton
Date: Mon Jan 22 11:26:38 2018
New Revision: 323143

URL: http://llvm.org/viewvc/llvm-project?rev=323143&view=rev
Log:
[cmake] [libcxx] Fix find_path() problems when cross compiling.

When CMAKE_SYSROOT or CMAKE_FIND_ROOT_PATH is set, cmake
recommends setting CMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY
globally which means find_path() always prepends CMAKE_SYSROOT or
CMAKE_FIND_ROOT_PATH to all paths used in the search.

However, this find_path() invocation is looking for a path in the
libcxxabi project on the host system, not the target system,
which can be done by passing NO_CMAKE_FIND_ROOT_PATH.

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

Modified:
libcxx/trunk/CMakeLists.txt

Modified: libcxx/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/CMakeLists.txt?rev=323143&r1=323142&r2=323143&view=diff
==
--- libcxx/trunk/CMakeLists.txt (original)
+++ libcxx/trunk/CMakeLists.txt Mon Jan 22 11:26:38 2018
@@ -123,6 +123,7 @@ if (LIBCXX_CXX_ABI STREQUAL "default")
   ${LLVM_MAIN_SRC_DIR}/runtimes/libcxxabi/include
   ${LLVM_MAIN_SRC_DIR}/../libcxxabi/include
 NO_DEFAULT_PATH
+NO_CMAKE_FIND_ROOT_PATH
   )
   if (LIBCXX_TARGETING_MSVC)
 # FIXME: Figure out how to configure the ABI library on Windows.


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


[libcxxabi] r323145 - [cmake] [libcxxabi] Fix find_path() problems when cross compiling

2018-01-22 Thread Don Hinton via cfe-commits
Author: dhinton
Date: Mon Jan 22 11:41:05 2018
New Revision: 323145

URL: http://llvm.org/viewvc/llvm-project?rev=323145&view=rev
Log:
[cmake] [libcxxabi] Fix find_path() problems when cross compiling

When CMAKE_SYSROOT or CMAKE_FIND_ROOT_PATH is set, cmake
recommends setting CMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY
globally which means find_path() always prepends CMAKE_SYSROOT or
CMAKE_FIND_ROOT_PATH to all paths used in the search.

However, these find_path() invocations are looking for paths in
the libcxx and libunwind projects on the host system, not the
target system, which can be done by passing
NO_CMAKE_FIND_ROOT_PATH.

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

Modified:
libcxxabi/trunk/CMakeLists.txt

Modified: libcxxabi/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/CMakeLists.txt?rev=323145&r1=323144&r2=323145&view=diff
==
--- libcxxabi/trunk/CMakeLists.txt (original)
+++ libcxxabi/trunk/CMakeLists.txt Mon Jan 22 11:41:05 2018
@@ -115,6 +115,7 @@ find_path(
 ${CMAKE_BINARY_DIR}/${LIBCXXABI_LIBCXX_INCLUDES}
 ${LIBCXXABI_LIBCXX_INCLUDE_DIRS}
 ${LLVM_INCLUDE_DIR}/c++/v1
+  NO_CMAKE_FIND_ROOT_PATH
   )
 
 set(LIBCXXABI_LIBCXX_INCLUDES "${LIBCXXABI_LIBCXX_INCLUDES}" CACHE PATH
@@ -127,6 +128,7 @@ find_path(
 ${LIBCXXABI_LIBCXX_INCLUDES}/../
 ${LIBCXXABI_LIBCXX_SRC_DIRS}
   NO_DEFAULT_PATH
+  NO_CMAKE_FIND_ROOT_PATH
   )
 
 if (LIBCXXABI_LIBCXX_PATH STREQUAL "LIBCXXABI_LIBCXX_PATH-NOTFOUND")
@@ -425,6 +427,7 @@ if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_
   ${LLVM_MAIN_SRC_DIR}/projects/libunwind/include
   ${LLVM_MAIN_SRC_DIR}/runtimes/libunwind/include
 NO_DEFAULT_PATH
+NO_CMAKE_FIND_ROOT_PATH
   )
 
   if (LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL STREQUAL 
"LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL-NOTFOUND")


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


[libcxx] r323171 - [cmake] Always respect existing CMAKE_REQUIRED_FLAGS when adding additional ones.

2018-01-22 Thread Don Hinton via cfe-commits
Author: dhinton
Date: Mon Jan 22 19:30:23 2018
New Revision: 323171

URL: http://llvm.org/viewvc/llvm-project?rev=323171&view=rev
Log:
[cmake] Always respect existing CMAKE_REQUIRED_FLAGS when adding additional 
ones.

* Previously part of https://reviews.llvm.org/D41622.

Modified:
libcxx/trunk/cmake/Modules/CheckLibcxxAtomic.cmake

Modified: libcxx/trunk/cmake/Modules/CheckLibcxxAtomic.cmake
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/cmake/Modules/CheckLibcxxAtomic.cmake?rev=323171&r1=323170&r2=323171&view=diff
==
--- libcxx/trunk/cmake/Modules/CheckLibcxxAtomic.cmake (original)
+++ libcxx/trunk/cmake/Modules/CheckLibcxxAtomic.cmake Mon Jan 22 19:30:23 2018
@@ -9,7 +9,7 @@ INCLUDE(CheckCXXSourceCompiles)
 
 function(check_cxx_atomics varname)
   set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
-  set(CMAKE_REQUIRED_FLAGS "-nodefaultlibs -std=c++11 -nostdinc++ -isystem 
${LIBCXX_SOURCE_DIR}/include")
+  set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -nodefaultlibs -std=c++11 
-nostdinc++ -isystem ${LIBCXX_SOURCE_DIR}/include")
   if (${LIBCXX_GCC_TOOLCHAIN})
 set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} 
--gcc-toolchain=${LIBCXX_GCC_TOOLCHAIN}")
   endif()


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


Please subscribe "rUNW libunwind" to cfe-commits.

2018-01-23 Thread Don Hinton via cfe-commits
Currently, herald doesn't subscribe libunwind to any group.  Should it be
added to cfe-commits?

  https://reviews.llvm.org/H268
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: Please subscribe "rUNW libunwind" to cfe-commits.

2018-01-25 Thread Don Hinton via cfe-commits
Thanks Ben...

On Thu, Jan 25, 2018 at 9:53 AM, Ben Hamilton 
wrote:

> Ah, I see from http://bcain-llvm.readthedocs.io/projects/
> libunwind/en/latest/ that libunwind review discussion does take place on
> cfe-commits.
>
> Added. Sorry about not doing that earlier!
>
> Ben
>
> On Thu, Jan 25, 2018 at 8:37 AM Ben Hamilton 
> wrote:
>
>> Great question. Is there an existing separate list for libunwind?
>>
>> If libunwind discussion already happens on cfe-commits, then I'll make
>> reviews for libunwind subscribe that list.
>>
>> On Tue, Jan 23, 2018, 21:40 Don Hinton  wrote:
>>
>>> Currently, herald doesn't subscribe libunwind to any group.  Should it
>>> be added to cfe-commits?
>>>
>>>   https://reviews.llvm.org/H268
>>>
>>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxx] r323453 - [cmake] [libcxx] Call llvm_setup_rpath() when adding shared libraries.

2018-01-25 Thread Don Hinton via cfe-commits
Author: dhinton
Date: Thu Jan 25 10:13:26 2018
New Revision: 323453

URL: http://llvm.org/viewvc/llvm-project?rev=323453&view=rev
Log:
[cmake] [libcxx] Call llvm_setup_rpath() when adding shared libraries.

Clang and llvm already use llvm_setup_rpath(), so this change will
help standarize rpath usage across all projects.

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

Modified:
libcxx/trunk/lib/CMakeLists.txt

Modified: libcxx/trunk/lib/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/lib/CMakeLists.txt?rev=323453&r1=323452&r2=323453&view=diff
==
--- libcxx/trunk/lib/CMakeLists.txt (original)
+++ libcxx/trunk/lib/CMakeLists.txt Thu Jan 25 10:13:26 2018
@@ -222,6 +222,7 @@ set(LIBCXX_TARGETS)
 # Build the shared library.
 if (LIBCXX_ENABLE_SHARED)
   add_library(cxx_shared SHARED $)
+  llvm_setup_rpath(cxx_shared)
   target_link_libraries(cxx_shared ${LIBCXX_LIBRARIES})
   set_target_properties(cxx_shared
 PROPERTIES


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


[libcxxabi] r323455 - [cmake] [libcxxabi] Call llvm_setup_rpath() when adding shared libraries.

2018-01-25 Thread Don Hinton via cfe-commits
Author: dhinton
Date: Thu Jan 25 10:43:18 2018
New Revision: 323455

URL: http://llvm.org/viewvc/llvm-project?rev=323455&view=rev
Log:
[cmake] [libcxxabi] Call llvm_setup_rpath() when adding shared libraries.

Clang and llvm already use llvm_setup_rpath(), so this change will
help standarize rpath usage across all projects.

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

Modified:
libcxxabi/trunk/src/CMakeLists.txt

Modified: libcxxabi/trunk/src/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/CMakeLists.txt?rev=323455&r1=323454&r2=323455&view=diff
==
--- libcxxabi/trunk/src/CMakeLists.txt (original)
+++ libcxxabi/trunk/src/CMakeLists.txt Thu Jan 25 10:43:18 2018
@@ -127,6 +127,7 @@ set(LIBCXXABI_TARGETS)
 # Build the shared library.
 if (LIBCXXABI_ENABLE_SHARED)
   add_library(cxxabi_shared SHARED $)
+  llvm_setup_rpath(cxxabi_shared)
   target_link_libraries(cxxabi_shared ${LIBCXXABI_LIBRARIES})
   set_target_properties(cxxabi_shared
 PROPERTIES


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


Re: Please subscribe "rUNW libunwind" to cfe-commits.

2018-01-25 Thread Don Hinton via cfe-commits
Btw, I'm seeing other inconsistencies, e.g., I just committed
https://reviews.llvm.org/D42460 and herald ended up adding both cfe-commits
and llvm-commits to subscribers.

When I created it, I left subscribers blank, so herald added cfe-commits --
which seems to be correct.
Then, when I committed it, herald added llvm-commits -- which doesn't seem
correct.



On Thu, Jan 25, 2018 at 10:04 AM, Don Hinton  wrote:

> Thanks Ben...
>
> On Thu, Jan 25, 2018 at 9:53 AM, Ben Hamilton 
> wrote:
>
>> Ah, I see from http://bcain-llvm.readthedocs.io/projects/libunwind/en/
>> latest/ that libunwind review discussion does take place on cfe-commits.
>>
>> Added. Sorry about not doing that earlier!
>>
>> Ben
>>
>> On Thu, Jan 25, 2018 at 8:37 AM Ben Hamilton 
>> wrote:
>>
>>> Great question. Is there an existing separate list for libunwind?
>>>
>>> If libunwind discussion already happens on cfe-commits, then I'll make
>>> reviews for libunwind subscribe that list.
>>>
>>> On Tue, Jan 23, 2018, 21:40 Don Hinton  wrote:
>>>
 Currently, herald doesn't subscribe libunwind to any group.  Should it
 be added to cfe-commits?

   https://reviews.llvm.org/H268

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


[libcxxabi] r323458 - Revert [libcxxabi] r323455 - [cmake] [libcxxabi] Call llvm_setup_rpath() when adding shared libraries.

2018-01-25 Thread Don Hinton via cfe-commits
Author: dhinton
Date: Thu Jan 25 11:18:51 2018
New Revision: 323458

URL: http://llvm.org/viewvc/llvm-project?rev=323458&view=rev
Log:
Revert [libcxxabi] r323455 - [cmake] [libcxxabi] Call llvm_setup_rpath() when 
adding shared libraries.

Shoaib Meenai pointed out this will break standalone builds can be built 
without llvm.

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

Modified:
libcxxabi/trunk/src/CMakeLists.txt

Modified: libcxxabi/trunk/src/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/CMakeLists.txt?rev=323458&r1=323457&r2=323458&view=diff
==
--- libcxxabi/trunk/src/CMakeLists.txt (original)
+++ libcxxabi/trunk/src/CMakeLists.txt Thu Jan 25 11:18:51 2018
@@ -127,7 +127,6 @@ set(LIBCXXABI_TARGETS)
 # Build the shared library.
 if (LIBCXXABI_ENABLE_SHARED)
   add_library(cxxabi_shared SHARED $)
-  llvm_setup_rpath(cxxabi_shared)
   target_link_libraries(cxxabi_shared ${LIBCXXABI_LIBRARIES})
   set_target_properties(cxxabi_shared
 PROPERTIES


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


[libcxx] r323459 - Revert [libcxx] r323453 - [cmake] [libcxx] Call llvm_setup_rpath() when adding shared libraries.

2018-01-25 Thread Don Hinton via cfe-commits
Author: dhinton
Date: Thu Jan 25 11:22:23 2018
New Revision: 323459

URL: http://llvm.org/viewvc/llvm-project?rev=323459&view=rev
Log:
Revert [libcxx] r323453 - [cmake] [libcxx] Call llvm_setup_rpath() when adding 
shared libraries.

Shoaib Meenai pointed out this will break standalone builds when built without 
llvm.

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

Modified:
libcxx/trunk/lib/CMakeLists.txt

Modified: libcxx/trunk/lib/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/lib/CMakeLists.txt?rev=323459&r1=323458&r2=323459&view=diff
==
--- libcxx/trunk/lib/CMakeLists.txt (original)
+++ libcxx/trunk/lib/CMakeLists.txt Thu Jan 25 11:22:23 2018
@@ -222,7 +222,6 @@ set(LIBCXX_TARGETS)
 # Build the shared library.
 if (LIBCXX_ENABLE_SHARED)
   add_library(cxx_shared SHARED $)
-  llvm_setup_rpath(cxx_shared)
   target_link_libraries(cxx_shared ${LIBCXX_LIBRARIES})
   set_target_properties(cxx_shared
 PROPERTIES


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


Re: Please subscribe "rUNW libunwind" to cfe-commits.

2018-01-25 Thread Don Hinton via cfe-commits
Ah, I think that's the issue.

local:/Users/dhinton/projects/llvm_project/libcxxabi $ cat .arcconfig
{
  "repository.callsign" : "CXXA",
  "conduit_uri" : "https://reviews.llvm.org/";
}

So, it should set repository to CXXA, not LLVM.



On Thu, Jan 25, 2018 at 11:25 AM, Ben Hamilton 
wrote:

> Yes, that's currently a submit time feature built in to Phabricator which
> i believe we'll have to fix upstream.
>
> Because both the top level LLVM SVN report and the sub repos see the same
> files, Phabricator automatically subscribes both lists to the commits.
>
> I wasn't able to find an easy way to disable this feature. If you can find
> one, please let me know! (I was punting in hopes the migration to git would
> happen first.)
>
> On Thu, Jan 25, 2018 at 11:01 AM Don Hinton  wrote:
>
>> Btw, I'm seeing other inconsistencies, e.g., I just committed
>> https://reviews.llvm.org/D42460 and herald ended up adding both
>> cfe-commits and llvm-commits to subscribers.
>>
>> When I created it, I left subscribers blank, so herald added cfe-commits
>> -- which seems to be correct.
>> Then, when I committed it, herald added llvm-commits -- which doesn't
>> seem correct.
>>
>>
>>
>> On Thu, Jan 25, 2018 at 10:04 AM, Don Hinton  wrote:
>>
>>> Thanks Ben...
>>>
>>> On Thu, Jan 25, 2018 at 9:53 AM, Ben Hamilton 
>>> wrote:
>>>
 Ah, I see from http://bcain-llvm.readthedocs.io/projects/
 libunwind/en/latest/ that libunwind review discussion does take place
 on cfe-commits.

 Added. Sorry about not doing that earlier!

 Ben

 On Thu, Jan 25, 2018 at 8:37 AM Ben Hamilton 
 wrote:

> Great question. Is there an existing separate list for libunwind?
>
> If libunwind discussion already happens on cfe-commits, then I'll make
> reviews for libunwind subscribe that list.
>
> On Tue, Jan 23, 2018, 21:40 Don Hinton  wrote:
>
>> Currently, herald doesn't subscribe libunwind to any group.  Should
>> it be added to cfe-commits?
>>
>>   https://reviews.llvm.org/H268
>>
>
>>>
>>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [libcxx] r323453 - [cmake] [libcxx] Call llvm_setup_rpath() when adding shared libraries.

2018-01-25 Thread Don Hinton via cfe-commits
On Thu, Jan 25, 2018 at 12:29 PM, Duncan P. N. Exon Smith <
dexonsm...@apple.com> wrote:

> I don't really understand why, but our bots seemed to survive this:
> http://lab.llvm.org:8080/green/view/Libcxx/job/libcxx_master_cmake/2137/
>
> Console output is here:
> http://lab.llvm.org:8080/green/view/Libcxx/job/libcxx_
> master_cmake/2137/consoleFull
>
> That doesn't necessarily mean it's safe.  Does anyone know why this might
> have "worked"?
>

I'm not an expert, but llvm installs all of these cmake modules along side
llvm-config, so if you find llvm-config, you find these modules.

So, unless I'm missing something, it looks like AddLLVM.cmake is always
available.


>
> On Jan 25, 2018, at 11:02, Shoaib Meenai  wrote:
>
> This is going to break building libc++ standalone (i.e. without any LLVM
> repository or even its CMake modules), right? Some upstream users care a
> lot about that use case (CC beanz and Duncan).
>
> *From: *cfe-commits  on behalf of Don
> Hinton via cfe-commits 
> *Reply-To: *Don Hinton 
> *Date: *Thursday, January 25, 2018 at 10:15 AM
> *To: *"cfe-commits@lists.llvm.org" 
> *Subject: *[libcxx] r323453 - [cmake] [libcxx] Call llvm_setup_rpath()
> when adding shared libraries.
>
> Author: dhinton
> Date: Thu Jan 25 10:13:26 2018
> New Revision: 323453
>
> URL: https://urldefense.proofpoint.com/v2/url?u=http-
> 3A__llvm.org_viewvc_llvm-2Dproject-3Frev-3D323453-26view-3Drev&d=DwIGaQ&c=
> 5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=
> zwvSmk9ZIfMARYg3JvYvNuA0Iz-PEq3H2i_ICF6vsR8&s=
> LDCu89byjNdZWoCIYHGHaPr3IamIdHLF0JwbnYE92vM&e=
> Log:
> [cmake] [libcxx] Call llvm_setup_rpath() when adding shared libraries.
>
> Clang and llvm already use llvm_setup_rpath(), so this change will
> help standarize rpath usage across all projects.
>
> Differential Revision: https://urldefense.proofpoint.com/v2/url?u=https-
> 3A__reviews.llvm.org_D42459&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=
> o3kDXzdBUE3ljQXKeTWOMw&m=zwvSmk9ZIfMARYg3JvYvNuA0Iz-
> PEq3H2i_ICF6vsR8&s=YCR-YJBua5p-4IK05GjHoZUU7aN8UJAFzL2xaz7byyw&e=
>
> Modified:
> libcxx/trunk/lib/CMakeLists.txt
>
> Modified: libcxx/trunk/lib/CMakeLists.txt
> URL: https://urldefense.proofpoint.com/v2/url?u=http-
> 3A__llvm.org_viewvc_llvm-2Dproject_libcxx_trunk_lib_
> CMakeLists.txt-3Frev-3D323453-26r1-3D323452-26r2-3D323453-
> 26view-3Ddiff&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=
> o3kDXzdBUE3ljQXKeTWOMw&m=zwvSmk9ZIfMARYg3JvYvNuA0Iz-PEq3H2i_ICF6vsR8&s=
> Rd7xc2GWS8oyDcm0QshNPTqM3BglPY5_aHMIuCRUt1s&e=
> 
> ==
> --- libcxx/trunk/lib/CMakeLists.txt (original)
> +++ libcxx/trunk/lib/CMakeLists.txt Thu Jan 25 10:13:26 2018
> @@ -222,6 +222,7 @@ set(LIBCXX_TARGETS)
> # Build the shared library.
> if (LIBCXX_ENABLE_SHARED)
>add_library(cxx_shared SHARED $)
> +  llvm_setup_rpath(cxx_shared)
>target_link_libraries(cxx_shared ${LIBCXX_LIBRARIES})
>set_target_properties(cxx_shared
>  PROPERTIES
>
>
> ___
> cfe-commits mailing list
> cfe-commits@lists.llvm.org
> https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.
> llvm.org_cgi-2Dbin_mailman_listinfo_cfe-2Dcommits&d=DwIGaQ&c=
> 5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=
> zwvSmk9ZIfMARYg3JvYvNuA0Iz-PEq3H2i_ICF6vsR8&s=
> TPt8bk99XfmUCdi7MBxyguYV6hJg3PsXFCTXyDfGms8&e=
>
>
>
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [libcxx] r323453 - [cmake] [libcxx] Call llvm_setup_rpath() when adding shared libraries.

2018-01-25 Thread Don Hinton via cfe-commits
On Thu, Jan 25, 2018 at 12:54 PM, Chris Bieneman  wrote:

> Historically we have supported building libcxx without llvm-config
> available on the system.
>
> In all likelihood the bots didn't fail because the bots do have
> llvm-config because we usually require an llvm build or source checkout in
> order to build and run the tests since tests depend on lit and gtest.
>

Ah, okay, but if the bots don't test/enforce this, does it make sense to
continue to support building without llvm-config?

I don't want to break upstream users, but the alternative is to duplicate
this logic across multiple sub-projects.  (see
http://lists.llvm.org/pipermail/llvm-dev/2018-January/120707.html for a
related rpath issue).



>
>
> -Chris
>
>
> On Jan 25, 2018, at 12:51 PM, Don Hinton  wrote:
>
> On Thu, Jan 25, 2018 at 12:29 PM, Duncan P. N. Exon Smith <
> dexonsm...@apple.com> wrote:
>
>> I don't really understand why, but our bots seemed to survive this:
>> http://lab.llvm.org:8080/green/view/Libcxx/job/libcxx_master_cmake/2137/
>>
>> Console output is here:
>> http://lab.llvm.org:8080/green/view/Libcxx/job/libcxx_master
>> _cmake/2137/consoleFull
>>
>> That doesn't necessarily mean it's safe.  Does anyone know why this might
>> have "worked"?
>>
>
> I'm not an expert, but llvm installs all of these cmake modules along side
> llvm-config, so if you find llvm-config, you find these modules.
>
> So, unless I'm missing something, it looks like AddLLVM.cmake is always
> available.
>
>
>>
>> On Jan 25, 2018, at 11:02, Shoaib Meenai  wrote:
>>
>> This is going to break building libc++ standalone (i.e. without any LLVM
>> repository or even its CMake modules), right? Some upstream users care a
>> lot about that use case (CC beanz and Duncan).
>>
>> *From: *cfe-commits  on behalf of
>> Don Hinton via cfe-commits 
>> *Reply-To: *Don Hinton 
>> *Date: *Thursday, January 25, 2018 at 10:15 AM
>> *To: *"cfe-commits@lists.llvm.org" 
>> *Subject: *[libcxx] r323453 - [cmake] [libcxx] Call llvm_setup_rpath()
>> when adding shared libraries.
>>
>> Author: dhinton
>> Date: Thu Jan 25 10:13:26 2018
>> New Revision: 323453
>>
>> URL: https://urldefense.proofpoint.com/v2/url?u=http-3A__
>> llvm.org_viewvc_llvm-2Dproject-3Frev-3D323453-26view-3Drev&
>> d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&
>> m=zwvSmk9ZIfMARYg3JvYvNuA0Iz-PEq3H2i_ICF6vsR8&s=LDCu89byjNdZ
>> WoCIYHGHaPr3IamIdHLF0JwbnYE92vM&e=
>> Log:
>> [cmake] [libcxx] Call llvm_setup_rpath() when adding shared libraries.
>>
>> Clang and llvm already use llvm_setup_rpath(), so this change will
>> help standarize rpath usage across all projects.
>>
>> Differential Revision: https://urldefense.proofpoint.com/v2/url?u=https-3
>> A__reviews.llvm.org_D42459&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw
>> &r=o3kDXzdBUE3ljQXKeTWOMw&m=zwvSmk9ZIfMARYg3JvYvNuA0Iz-PEq3H
>> 2i_ICF6vsR8&s=YCR-YJBua5p-4IK05GjHoZUU7aN8UJAFzL2xaz7byyw&e=
>>
>> Modified:
>> libcxx/trunk/lib/CMakeLists.txt
>>
>> Modified: libcxx/trunk/lib/CMakeLists.txt
>> URL: https://urldefense.proofpoint.com/v2/url?u=http-3A__
>> llvm.org_viewvc_llvm-2Dproject_libcxx_trunk_lib_CMakeLists.
>> txt-3Frev-3D323453-26r1-3D323452-26r2-3D323453-26view-
>> 3Ddiff&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKe
>> TWOMw&m=zwvSmk9ZIfMARYg3JvYvNuA0Iz-PEq3H2i_ICF6vsR8&s=Rd7xc2
>> GWS8oyDcm0QshNPTqM3BglPY5_aHMIuCRUt1s&e=
>> 
>> ==
>> --- libcxx/trunk/lib/CMakeLists.txt (original)
>> +++ libcxx/trunk/lib/CMakeLists.txt Thu Jan 25 10:13:26 2018
>> @@ -222,6 +222,7 @@ set(LIBCXX_TARGETS)
>> # Build the shared library.
>> if (LIBCXX_ENABLE_SHARED)
>>add_library(cxx_shared SHARED $)
>> +  llvm_setup_rpath(cxx_shared)
>>target_link_libraries(cxx_shared ${LIBCXX_LIBRARIES})
>>set_target_properties(cxx_shared
>>  PROPERTIES
>>
>>
>> ___
>> cfe-commits mailing list
>> cfe-commits@lists.llvm.org
>> https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.ll
>> vm.org_cgi-2Dbin_mailman_listinfo_cfe-2Dcommits&d=DwIGaQ&c=5
>> VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=zwvSmk9ZIfM
>> ARYg3JvYvNuA0Iz-PEq3H2i_ICF6vsR8&s=TPt8bk99XfmUCdi7MBx
>> yguYV6hJg3PsXFCTXyDfGms8&e=
>>
>>
>>
>>
>
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [libcxx] r323453 - [cmake] [libcxx] Call llvm_setup_rpath() when adding shared libraries.

2018-01-25 Thread Don Hinton via cfe-commits
On Thu, Jan 25, 2018 at 4:21 PM, Duncan P. N. Exon Smith <
dexonsm...@apple.com> wrote:

>
>
> On Jan 25, 2018, at 16:18, Duncan P. N. Exon Smith via cfe-commits <
> cfe-commits@lists.llvm.org> wrote:
>
>
>
> On Jan 25, 2018, at 13:07, Don Hinton  wrote:
>
> On Thu, Jan 25, 2018 at 12:54 PM, Chris Bieneman  wrote:
>
>> Historically we have supported building libcxx without llvm-config
>> available on the system.
>>
>> In all likelihood the bots didn't fail because the bots do have
>> llvm-config because we usually require an llvm build or source checkout in
>> order to build and run the tests since tests depend on lit and gtest.
>>
>
> Ah, okay, but if the bots don't test/enforce this, does it make sense to
> continue to support building without llvm-config?
>
>
> I didn't realize we didn't have a bot enforcing this.  I just made one:
> http://lab.llvm.org:8080/green/view/Libcxx/job/libcxx_
> master_cmake_standalone
>
> I don't want to break upstream users, but the alternative is to duplicate
> this logic across multiple sub-projects.  (see http://lists.llvm.org/
> pipermail/llvm-dev/2018-January/120707.html for a related rpath issue).
>
>
> It's temporary though.  In the brave new world on GitHub with monorepo,
> the runtime libraries will be able to access a shared set of CMake
> configuration scripts.
>
>
> Note that there's other stuff duplicated in the runtime libraries, such as
> preprocessor definitions (LLVM_... => __LIBCXX_...), that we'll never
> really be able to collapse.
>

Great, I've changed it to this:

+  if(LLVM_FOUND)
+llvm_setup_rpath(cxx_shared)
+  endif()

Which should work for both cases.  Is that okay?


>
>
>
>
>>
>>
>> -Chris
>>
>>
>> On Jan 25, 2018, at 12:51 PM, Don Hinton  wrote:
>>
>> On Thu, Jan 25, 2018 at 12:29 PM, Duncan P. N. Exon Smith <
>> dexonsm...@apple.com> wrote:
>>
>>> I don't really understand why, but our bots seemed to survive this:
>>> http://lab.llvm.org:8080/green/view/Libcxx/job/libcxx_master_cmake/2137/
>>>
>>> Console output is here:
>>> http://lab.llvm.org:8080/green/view/Libcxx/job/libcxx_master
>>> _cmake/2137/consoleFull
>>>
>>> That doesn't necessarily mean it's safe.  Does anyone know why this
>>> might have "worked"?
>>>
>>
>> I'm not an expert, but llvm installs all of these cmake modules along
>> side llvm-config, so if you find llvm-config, you find these modules.
>>
>> So, unless I'm missing something, it looks like AddLLVM.cmake is always
>> available.
>>
>>
>>>
>>> On Jan 25, 2018, at 11:02, Shoaib Meenai  wrote:
>>>
>>> This is going to break building libc++ standalone (i.e. without any LLVM
>>> repository or even its CMake modules), right? Some upstream users care a
>>> lot about that use case (CC beanz and Duncan).
>>>
>>> *From: *cfe-commits  on behalf of
>>> Don Hinton via cfe-commits 
>>> *Reply-To: *Don Hinton 
>>> *Date: *Thursday, January 25, 2018 at 10:15 AM
>>> *To: *"cfe-commits@lists.llvm.org" 
>>> *Subject: *[libcxx] r323453 - [cmake] [libcxx] Call llvm_setup_rpath()
>>> when adding shared libraries.
>>>
>>> Author: dhinton
>>> Date: Thu Jan 25 10:13:26 2018
>>> New Revision: 323453
>>>
>>> URL: https://urldefense.proofpoint.com/v2/url?u=http-3A__llv
>>> m.org_viewvc_llvm-2Dproject-3Frev-3D323453-26view-3Drev&d=
>>> DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=
>>> zwvSmk9ZIfMARYg3JvYvNuA0Iz-PEq3H2i_ICF6vsR8&s=LDCu89byjNdZWo
>>> CIYHGHaPr3IamIdHLF0JwbnYE92vM&e=
>>> Log:
>>> [cmake] [libcxx] Call llvm_setup_rpath() when adding shared libraries.
>>>
>>> Clang and llvm already use llvm_setup_rpath(), so this change will
>>> help standarize rpath usage across all projects.
>>>
>>> Differential Revision: https://urldefense.p
>>> roofpoint.com/v2/url?u=https-3A__reviews.llvm.org_D42459&d=D
>>> wIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=zw
>>> vSmk9ZIfMARYg3JvYvNuA0Iz-PEq3H2i_ICF6vsR8&s=YCR-YJBua5p-4IK0
>>> 5GjHoZUU7aN8UJAFzL2xaz7byyw&e=
>>>
>>> Modified:
>>> libcxx/trunk/lib/CMakeLists.txt
>>>
>>> Modified: libcxx/trunk/lib/CMakeLists.txt
>>> URL: https://urldefense.proofpoint.com/v2/url?u=http-3A__llv
>>> m.org_viewv

[libcxx] r323492 - Reland: [cmake] [libcxx] Call llvm_setup_rpath() when adding shared libraries.

2018-01-25 Thread Don Hinton via cfe-commits
Author: dhinton
Date: Thu Jan 25 17:34:51 2018
New Revision: 323492

URL: http://llvm.org/viewvc/llvm-project?rev=323492&view=rev
Log:
Reland: [cmake] [libcxx] Call llvm_setup_rpath() when adding shared libraries.

Clang and llvm already use llvm_setup_rpath(), so this change will
help standarize rpath usage across all projects.

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

Modified:
libcxx/trunk/lib/CMakeLists.txt

Modified: libcxx/trunk/lib/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/lib/CMakeLists.txt?rev=323492&r1=323491&r2=323492&view=diff
==
--- libcxx/trunk/lib/CMakeLists.txt (original)
+++ libcxx/trunk/lib/CMakeLists.txt Thu Jan 25 17:34:51 2018
@@ -222,6 +222,9 @@ set(LIBCXX_TARGETS)
 # Build the shared library.
 if (LIBCXX_ENABLE_SHARED)
   add_library(cxx_shared SHARED $)
+  if(LLVM_FOUND)
+llvm_setup_rpath(cxx_shared)
+  endif()
   target_link_libraries(cxx_shared ${LIBCXX_LIBRARIES})
   set_target_properties(cxx_shared
 PROPERTIES


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


[libcxxabi] r323495 - Reland:

2018-01-25 Thread Don Hinton via cfe-commits
Author: dhinton
Date: Thu Jan 25 19:41:58 2018
New Revision: 323495

URL: http://llvm.org/viewvc/llvm-project?rev=323495&view=rev
Log:
Reland:
[cmake] [libcxxabi] Call llvm_setup_rpath() when adding shared libraries.

Clang and llvm already use llvm_setup_rpath(), so this change will
help standarize rpath usage across all projects.

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

Modified:
libcxxabi/trunk/src/CMakeLists.txt

Modified: libcxxabi/trunk/src/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/CMakeLists.txt?rev=323495&r1=323494&r2=323495&view=diff
==
--- libcxxabi/trunk/src/CMakeLists.txt (original)
+++ libcxxabi/trunk/src/CMakeLists.txt Thu Jan 25 19:41:58 2018
@@ -127,6 +127,9 @@ set(LIBCXXABI_TARGETS)
 # Build the shared library.
 if (LIBCXXABI_ENABLE_SHARED)
   add_library(cxxabi_shared SHARED $)
+  if(LLVM_FOUND)
+llvm_setup_rpath(cxxabi_shared)
+  endif()
   target_link_libraries(cxxabi_shared ${LIBCXXABI_LIBRARIES})
   set_target_properties(cxxabi_shared
 PROPERTIES


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


[libunwind] r323496 - [cmake] [libunwind] Call llvm_setup_rpath() when adding shared libraries.

2018-01-25 Thread Don Hinton via cfe-commits
Author: dhinton
Date: Thu Jan 25 20:01:50 2018
New Revision: 323496

URL: http://llvm.org/viewvc/llvm-project?rev=323496&view=rev
Log:
[cmake] [libunwind] Call llvm_setup_rpath() when adding shared libraries.

Clang and llvm already use llvm_setup_rpath(), so this change will
help standarize rpath usage across all projects.

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

Modified:
libunwind/trunk/src/CMakeLists.txt

Modified: libunwind/trunk/src/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/CMakeLists.txt?rev=323496&r1=323495&r2=323496&view=diff
==
--- libunwind/trunk/src/CMakeLists.txt (original)
+++ libunwind/trunk/src/CMakeLists.txt Thu Jan 25 20:01:50 2018
@@ -108,6 +108,9 @@ set(LIBUNWIND_TARGETS)
 # Build the shared library.
 if (LIBUNWIND_ENABLE_SHARED)
   add_library(unwind_shared SHARED $)
+  if(LLVM_FOUND)
+llvm_setup_rpath(unwind_shared)
+  endif()
   target_link_libraries(unwind_shared ${libraries})
   set_target_properties(unwind_shared
 PROPERTIES


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


Re: [libcxx] r323453 - [cmake] [libcxx] Call llvm_setup_rpath() when adding shared libraries.

2018-01-26 Thread Don Hinton via cfe-commits
On Thu, Jan 25, 2018 at 5:20 PM, Duncan P. N. Exon Smith <
dexonsm...@apple.com> wrote:

>
>
> On Jan 25, 2018, at 17:09, Don Hinton  wrote:
>
>
>
> On Thu, Jan 25, 2018 at 4:21 PM, Duncan P. N. Exon Smith <
> dexonsm...@apple.com> wrote:
>
>>
>>
>> On Jan 25, 2018, at 16:18, Duncan P. N. Exon Smith via cfe-commits <
>> cfe-commits@lists.llvm.org> wrote:
>>
>>
>>
>> On Jan 25, 2018, at 13:07, Don Hinton  wrote:
>>
>> On Thu, Jan 25, 2018 at 12:54 PM, Chris Bieneman  wrote:
>>
>>> Historically we have supported building libcxx without llvm-config
>>> available on the system.
>>>
>>> In all likelihood the bots didn't fail because the bots do have
>>> llvm-config because we usually require an llvm build or source checkout in
>>> order to build and run the tests since tests depend on lit and gtest.
>>>
>>
>> Ah, okay, but if the bots don't test/enforce this, does it make sense to
>> continue to support building without llvm-config?
>>
>>
>> I didn't realize we didn't have a bot enforcing this.  I just made one:
>> http://lab.llvm.org:8080/green/view/Libcxx/job/libcxx_master
>> _cmake_standalone
>>
>> I don't want to break upstream users, but the alternative is to duplicate
>> this logic across multiple sub-projects.  (see http://lists.llvm.org/pip
>> ermail/llvm-dev/2018-January/120707.html for a related rpath issue).
>>
>>
>> It's temporary though.  In the brave new world on GitHub with monorepo,
>> the runtime libraries will be able to access a shared set of CMake
>> configuration scripts.
>>
>>
>> Note that there's other stuff duplicated in the runtime libraries, such
>> as preprocessor definitions (LLVM_... => __LIBCXX_...), that we'll never
>> really be able to collapse.
>>
>
> Great, I've changed it to this:
>
> +  if(LLVM_FOUND)
> +llvm_setup_rpath(cxx_shared)
> +  endif()
>
> Which should work for both cases.  Is that okay?
>
>
> SGTM.
>

Turns out LLVM_FOUND doesn't cover all cases, i.e., it's only set by libcxx
and libcxxabi when doing out-of-tree builds.  A better solution is to check
if the command is actually available:

-  if(LLVM_FOUND)
+  if(COMMAND llvm_setup_rpath)
 llvm_setup_rpath(cxx_shared)
   endif()


>
>
>
>>
>>
>>
>>
>>>
>>>
>>> -Chris
>>>
>>>
>>> On Jan 25, 2018, at 12:51 PM, Don Hinton  wrote:
>>>
>>> On Thu, Jan 25, 2018 at 12:29 PM, Duncan P. N. Exon Smith <
>>> dexonsm...@apple.com> wrote:
>>>
>>>> I don't really understand why, but our bots seemed to survive this:
>>>> http://lab.llvm.org:8080/green/view/Libcxx/job/libcxx_master
>>>> _cmake/2137/
>>>>
>>>> Console output is here:
>>>> http://lab.llvm.org:8080/green/view/Libcxx/job/libcxx_master
>>>> _cmake/2137/consoleFull
>>>>
>>>> That doesn't necessarily mean it's safe.  Does anyone know why this
>>>> might have "worked"?
>>>>
>>>
>>> I'm not an expert, but llvm installs all of these cmake modules along
>>> side llvm-config, so if you find llvm-config, you find these modules.
>>>
>>> So, unless I'm missing something, it looks like AddLLVM.cmake is always
>>> available.
>>>
>>>
>>>>
>>>> On Jan 25, 2018, at 11:02, Shoaib Meenai  wrote:
>>>>
>>>> This is going to break building libc++ standalone (i.e. without any
>>>> LLVM repository or even its CMake modules), right? Some upstream users care
>>>> a lot about that use case (CC beanz and Duncan).
>>>>
>>>> *From: *cfe-commits  on behalf of
>>>> Don Hinton via cfe-commits 
>>>> *Reply-To: *Don Hinton 
>>>> *Date: *Thursday, January 25, 2018 at 10:15 AM
>>>> *To: *"cfe-commits@lists.llvm.org" 
>>>> *Subject: *[libcxx] r323453 - [cmake] [libcxx] Call llvm_setup_rpath()
>>>> when adding shared libraries.
>>>>
>>>> Author: dhinton
>>>> Date: Thu Jan 25 10:13:26 2018
>>>> New Revision: 323453
>>>>
>>>> URL: https://urldefense.proofpoint.com/v2/url?u=http-3A__llv
>>>> m.org_viewvc_llvm-2Dproject-3Frev-3D323453-26view-3Drev&d=Dw
>>>> IGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=zwv
>>>> Sm

[libcxx] r323599 - LLVM_FOUND isn't always set, so just test if llvm_setup_rpath() is

2018-01-27 Thread Don Hinton via cfe-commits
Author: dhinton
Date: Sat Jan 27 10:55:30 2018
New Revision: 323599

URL: http://llvm.org/viewvc/llvm-project?rev=323599&view=rev
Log:
LLVM_FOUND isn't always set, so just test if llvm_setup_rpath() is
available instead.

Modified:
libcxx/trunk/lib/CMakeLists.txt

Modified: libcxx/trunk/lib/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/lib/CMakeLists.txt?rev=323599&r1=323598&r2=323599&view=diff
==
--- libcxx/trunk/lib/CMakeLists.txt (original)
+++ libcxx/trunk/lib/CMakeLists.txt Sat Jan 27 10:55:30 2018
@@ -222,7 +222,7 @@ set(LIBCXX_TARGETS)
 # Build the shared library.
 if (LIBCXX_ENABLE_SHARED)
   add_library(cxx_shared SHARED $)
-  if(LLVM_FOUND)
+  if(COMMAND llvm_setup_rpath)
 llvm_setup_rpath(cxx_shared)
   endif()
   target_link_libraries(cxx_shared ${LIBCXX_LIBRARIES})


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


[libcxxabi] r323600 - [cmake] [libcxxabi] LLVM_FOUND isn't always set, so just test if

2018-01-27 Thread Don Hinton via cfe-commits
Author: dhinton
Date: Sat Jan 27 11:18:04 2018
New Revision: 323600

URL: http://llvm.org/viewvc/llvm-project?rev=323600&view=rev
Log:
[cmake] [libcxxabi] LLVM_FOUND isn't always set, so just test if
llvm_setup_rpath() is available instead.

Modified:
libcxxabi/trunk/src/CMakeLists.txt

Modified: libcxxabi/trunk/src/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/CMakeLists.txt?rev=323600&r1=323599&r2=323600&view=diff
==
--- libcxxabi/trunk/src/CMakeLists.txt (original)
+++ libcxxabi/trunk/src/CMakeLists.txt Sat Jan 27 11:18:04 2018
@@ -127,7 +127,7 @@ set(LIBCXXABI_TARGETS)
 # Build the shared library.
 if (LIBCXXABI_ENABLE_SHARED)
   add_library(cxxabi_shared SHARED $)
-  if(LLVM_FOUND)
+  if(COMMAND llvm_setup_rpath)
 llvm_setup_rpath(cxxabi_shared)
   endif()
   target_link_libraries(cxxabi_shared ${LIBCXXABI_LIBRARIES})


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


[libunwind] r323601 - [cmake] [libunwind] LLVM_FOUND isn't always set, so just test if

2018-01-27 Thread Don Hinton via cfe-commits
Author: dhinton
Date: Sat Jan 27 11:31:44 2018
New Revision: 323601

URL: http://llvm.org/viewvc/llvm-project?rev=323601&view=rev
Log:
[cmake] [libunwind] LLVM_FOUND isn't always set, so just test if
llvm_setup_rpath() is available instead.

Modified:
libunwind/trunk/src/CMakeLists.txt

Modified: libunwind/trunk/src/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/CMakeLists.txt?rev=323601&r1=323600&r2=323601&view=diff
==
--- libunwind/trunk/src/CMakeLists.txt (original)
+++ libunwind/trunk/src/CMakeLists.txt Sat Jan 27 11:31:44 2018
@@ -108,7 +108,7 @@ set(LIBUNWIND_TARGETS)
 # Build the shared library.
 if (LIBUNWIND_ENABLE_SHARED)
   add_library(unwind_shared SHARED $)
-  if(LLVM_FOUND)
+  if(COMMAND llvm_setup_rpath)
 llvm_setup_rpath(unwind_shared)
   endif()
   target_link_libraries(unwind_shared ${libraries})


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


Re: [PATCH] D12646: Add libc++ header path for DarwinClang builds

2015-09-08 Thread don hinton via cfe-commits
hintonda added a comment.

In http://reviews.llvm.org/D12646#241308, @kubabrecka wrote:

> In what scenario exactly are you seeing an issue?  If it's a just-built clang 
> that can't find C++ headers, then you should just build the libcxx project 
> alongside.


clang++ defaults to -stdlib=libc++ for newer versions of MacOS (see 
ToolChains.cpp:902), but since there isn't a way to pass corresponding include 
path via cmake, clang++ doesn't work out of the box, i.e., it only checks 
/usr/include/c++/v1, not the path relative to the version of clang used to 
build it.

I first noticed it when I tried to run the version of clang-tidy I'd just built 
and found I had to pass the path for it to find iostream.

> This is just a default location of Xcode.app and it's wrong to hardcode it, 
> because the user can install Xcode to different locations (or have multiple 
> installations). Even letting CMake find the path will be wrong, because the 
> location of Xcode is a user's choice.


Yes, but if you allow the user to pass the include path via cmake, how could 
that be wrong?  This is equivalent to passing GCC_INSTALL_PREFIX so clang can 
find the gcc headers for libstdc++.

The user can always override it if they want to use a different version, but 
right now, overriding the location is the only way to make it work.  If we're 
not going to generate a working version using libc++, perhaps we shouldn't 
override -stdlib=libc++ unless the appropriate headers can't be found.


http://reviews.llvm.org/D12646



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


Re: [PATCH] D12646: Add libc++ header path for DarwinClang builds

2015-09-08 Thread don hinton via cfe-commits
hintonda added a comment.

> I think it works if you a) check out libcxx into llvm/projects/libcxx b) run 
> `make install` and c) run the binary from your install directory.


Yes, that works.  But why shouldn't users be able to use the installed version?

Also, if you want to force users to either build libc++ or have the headers 
installed in /usr/include/c++/v1, then cmake should fail if neither is the case.


http://reviews.llvm.org/D12646



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


Re: [PATCH] D12646: Add libc++ header path for DarwinClang builds

2015-09-08 Thread don hinton via cfe-commits
hintonda added a comment.

In http://reviews.llvm.org/D12646#241493, @bob.wilson wrote:

> On Darwin platforms, the libc++ headers are expected to be installed 
> alongside clang. If you're not doing that, then you're building it wrong. 
> Adding more fallback options for finding the headers just makes things worse, 
> because instead of a clear failure, you're more likely to get something that 
> works but behaves badly in a subtle way (e.g., due to using really old libc++ 
> headers).
>
> I don't think this is the right thing to do.


Okay, I'm comfortable with this solution.  I'll work up a diff that makes cmake 
fail if libc++ isn't included in the build.


http://reviews.llvm.org/D12646



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


Re: [PATCH] D12549: Remove unused variable

2015-09-13 Thread don hinton via cfe-commits
hintonda added a comment.

I don't have commit access, so could you commit it for me?

thanks...
don


http://reviews.llvm.org/D12549



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


Re: [PATCH] D12549: Remove unused variable

2015-09-13 Thread don hinton via cfe-commits
hintonda added a comment.

Looks like Manuel cleaned it up along with another change on the 8th, r247018.

thanks again...


http://reviews.llvm.org/D12549



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


[PATCH] D12967: fix comments

2015-09-18 Thread don hinton via cfe-commits
hintonda created this revision.
hintonda added a reviewer: alexfh.
hintonda added a subscriber: cfe-commits.
Herald added a subscriber: klimek.

Fix example comments.

http://reviews.llvm.org/D12967

Files:
  include/clang/Tooling/CommonOptionsParser.h

Index: include/clang/Tooling/CommonOptionsParser.h
===
--- include/clang/Tooling/CommonOptionsParser.h
+++ include/clang/Tooling/CommonOptionsParser.h
@@ -42,6 +42,7 @@
 /// \code
 /// #include "clang/Frontend/FrontendActions.h"
 /// #include "clang/Tooling/CommonOptionsParser.h"
+/// #include "clang/Tooling/Tooling.h"
 /// #include "llvm/Support/CommandLine.h"
 ///
 /// using namespace clang::tooling;
@@ -56,8 +57,8 @@
 /// int main(int argc, const char **argv) {
 ///   CommonOptionsParser OptionsParser(argc, argv, MyToolCategory);
 ///   ClangTool Tool(OptionsParser.getCompilations(),
-///  OptionsParser.getSourcePathListi());
-///   return Tool.run(newFrontendActionFactory());
+///  OptionsParser.getSourcePathList());
+///   return Tool.run(newFrontendActionFactory().get());
 /// }
 /// \endcode
 class CommonOptionsParser {


Index: include/clang/Tooling/CommonOptionsParser.h
===
--- include/clang/Tooling/CommonOptionsParser.h
+++ include/clang/Tooling/CommonOptionsParser.h
@@ -42,6 +42,7 @@
 /// \code
 /// #include "clang/Frontend/FrontendActions.h"
 /// #include "clang/Tooling/CommonOptionsParser.h"
+/// #include "clang/Tooling/Tooling.h"
 /// #include "llvm/Support/CommandLine.h"
 ///
 /// using namespace clang::tooling;
@@ -56,8 +57,8 @@
 /// int main(int argc, const char **argv) {
 ///   CommonOptionsParser OptionsParser(argc, argv, MyToolCategory);
 ///   ClangTool Tool(OptionsParser.getCompilations(),
-///  OptionsParser.getSourcePathListi());
-///   return Tool.run(newFrontendActionFactory());
+///  OptionsParser.getSourcePathList());
+///   return Tool.run(newFrontendActionFactory().get());
 /// }
 /// \endcode
 class CommonOptionsParser {
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D12967: fix comments

2015-09-19 Thread don hinton via cfe-commits
hintonda added a comment.

Yes, please.  thanks...


http://reviews.llvm.org/D12967



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


[PATCH] D13229: Add -Wc, option

2015-09-28 Thread don hinton via cfe-commits
hintonda created this revision.
hintonda added a subscriber: cfe-commits.

Add -Wc, option (similar to -Wl,) to go along with -Xclang.  This 
makes it easier to pass multiple options to cc1.

http://reviews.llvm.org/D13229

Files:
  include/clang/Driver/Options.td
  lib/Driver/Tools.cpp

Index: lib/Driver/Tools.cpp
===
--- lib/Driver/Tools.cpp
+++ lib/Driver/Tools.cpp
@@ -5080,9 +5080,9 @@
 A->claim();
   }
 
-  // Forward -Xclang arguments to -cc1, and -mllvm arguments to the LLVM option
-  // parser.
-  Args.AddAllArgValues(CmdArgs, options::OPT_Xclang);
+  // Forward -Xclang, and -Wc, arguments to -cc1, and -mllvm arguments to the
+  // LLVM option parser.
+  Args.AddAllArgValues(CmdArgs, options::OPT_Xclang, options::OPT_Wc_COMMA);
   for (const Arg *A : Args.filtered(options::OPT_mllvm)) {
 A->claim();
 
Index: include/clang/Driver/Options.td
===
--- include/clang/Driver/Options.td
+++ include/clang/Driver/Options.td
@@ -298,6 +298,9 @@
 def Wdeprecated : Flag<["-"], "Wdeprecated">, Group, 
Flags<[CC1Option]>;
 def Wno_deprecated : Flag<["-"], "Wno-deprecated">, Group, 
Flags<[CC1Option]>;
 def Wextra : Flag<["-"], "Wextra">, Group, Flags<[CC1Option]>;
+def Wc_COMMA : CommaJoined<["-"], "Wc,">, Flags<[DriverOption, CoreOption]>,
+  HelpText<"Pass the comma separated arguments in  to the clang 
compiler">,
+  MetaVarName<"">;
 def Wl_COMMA : CommaJoined<["-"], "Wl,">, Flags<[LinkerInput, RenderAsInput]>,
   HelpText<"Pass the comma separated arguments in  to the linker">,
   MetaVarName<"">;


Index: lib/Driver/Tools.cpp
===
--- lib/Driver/Tools.cpp
+++ lib/Driver/Tools.cpp
@@ -5080,9 +5080,9 @@
 A->claim();
   }
 
-  // Forward -Xclang arguments to -cc1, and -mllvm arguments to the LLVM option
-  // parser.
-  Args.AddAllArgValues(CmdArgs, options::OPT_Xclang);
+  // Forward -Xclang, and -Wc, arguments to -cc1, and -mllvm arguments to the
+  // LLVM option parser.
+  Args.AddAllArgValues(CmdArgs, options::OPT_Xclang, options::OPT_Wc_COMMA);
   for (const Arg *A : Args.filtered(options::OPT_mllvm)) {
 A->claim();
 
Index: include/clang/Driver/Options.td
===
--- include/clang/Driver/Options.td
+++ include/clang/Driver/Options.td
@@ -298,6 +298,9 @@
 def Wdeprecated : Flag<["-"], "Wdeprecated">, Group, Flags<[CC1Option]>;
 def Wno_deprecated : Flag<["-"], "Wno-deprecated">, Group, Flags<[CC1Option]>;
 def Wextra : Flag<["-"], "Wextra">, Group, Flags<[CC1Option]>;
+def Wc_COMMA : CommaJoined<["-"], "Wc,">, Flags<[DriverOption, CoreOption]>,
+  HelpText<"Pass the comma separated arguments in  to the clang compiler">,
+  MetaVarName<"">;
 def Wl_COMMA : CommaJoined<["-"], "Wl,">, Flags<[LinkerInput, RenderAsInput]>,
   HelpText<"Pass the comma separated arguments in  to the linker">,
   MetaVarName<"">;
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D13229: Add -Wc, option

2015-09-28 Thread don hinton via cfe-commits
Hi Joerg:

This change would allow users to pass multiple options, or options with
arguments, to cc1 without having to use -Xclang multiple times.

Recently, the -load option was added, at least partly, because passing
-Xclang multiple times was cumbersome. (I like that change btw)

Had -Wc, been available, perhaps that wouldn't have been that much of an
issue.

But I'll defer to your better judgement on this -- I certainly wouldn't
advocate an explosion of new options.

Thanks for concidering it...
Don
On Sep 28, 2015 6:13 PM, "Joerg Sonnenberger" 
wrote:

> On Mon, Sep 28, 2015 at 09:54:53PM +, don hinton via cfe-commits wrote:
> > Add -Wc, option (similar to -Wl,) to go along with -Xclang.
> > This makes it easier to pass multiple options to cc1.
>
> How is this better than -mllvm and -Xclang? There is no precendence case
> for
> this with GCC really and I don't see a good reason for wanting this,
> frankly.
>
> Joerg
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D13229: Add -Wc, option

2015-09-28 Thread don hinton via cfe-commits
hintonda added a comment.

Here are a few examples from existing tests showing how this option could be 
used:

  -Xclang -analyzer-max-loop -Xclang 34

becomes:

  -Wc,-analyzer-max-loop,34
  
  -Xclang -analyzer-checker=debug.ConfigDumper -Xclang -analyzer-max-loop 
-Xclang 34

becomes:

  -Wc,-analyzer-checker,debug.ConfigDumper,-analyzer-max-loop,34
  
  -Xclang -analyzer-config -Xclang path-diagnostics-alternate=true -Xclang 
-analyzer-output=plist

becomes:

  -Wc,-analyzer-config,path-diagnostics-alternate=true,-analyzer-output=plist
  
  -Xclang -internal-isystem -Xclang /tmp/

becomes:

  -Wc,-internal-isystem,/tmp/
  
  -Xclang -internal-externc-isystem -Xclang /tmp

becomes:

  -Wc,-internal-externc-isystem,/tmp
  
  -Xclang -main-file-name -Xclang foo.c

becomes:

  -Wc,-main-file-name,foo.c
  
  -Xclang -include-pch -Xclang %t.pch

becomes:

  -Wc,-include-pch,%t.pch
  
  -Xclang -fdisable-module-hash -Xclang -detailed-preprocessing-record -Xclang 
-verify

becomes:

  -Wc,-fdisable-module-hash,-detailed-preprocessing-record,-verify


http://reviews.llvm.org/D13229



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


Re: [PATCH] D13229: Add -Wc, option

2015-09-28 Thread don hinton via cfe-commits
hintonda added a comment.

Mainly aesthetic.  It was the only one of the group, -Xassembler, -Xlinker, 
-Xpreprocessor, and -Xclang, that didn't have a corresponding comma separated 
option, so I figured it might be a good addition.


http://reviews.llvm.org/D13229



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


[PATCH] D13453: Always generate cmake config files

2015-10-05 Thread don hinton via cfe-commits
hintonda created this revision.
hintonda added a reviewer: chapuni.
hintonda added a subscriber: cfe-commits.

Always generate and install cmake config files.

Currently, cmake config files are only generated and installed when 
CLANG_BUILD_STANDALONE set, which means config file will not be generated or 
installed when clang is built with llvm.  This change removes that restriction.

http://reviews.llvm.org/D13453

Files:
  CMakeLists.txt

Index: CMakeLists.txt
===
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -550,30 +550,28 @@
 set(CLANG_ORDER_FILE "" CACHE FILEPATH
   "Order file to use when compiling clang in order to improve startup time.")
 
-if (CLANG_BUILT_STANDALONE)
-  # Generate a list of CMake library targets so that other CMake projects can
-  # link against them. LLVM calls its version of this file LLVMExports.cmake, 
but
-  # the usual CMake convention seems to be ${Project}Targets.cmake.
-  set(CLANG_INSTALL_PACKAGE_DIR share/clang/cmake)
-  set(clang_cmake_builddir "${CMAKE_BINARY_DIR}/${CLANG_INSTALL_PACKAGE_DIR}")
-  get_property(CLANG_EXPORTS GLOBAL PROPERTY CLANG_EXPORTS)
-  export(TARGETS ${CLANG_EXPORTS} FILE 
${clang_cmake_builddir}/ClangTargets.cmake)
-
-  # Install a /share/clang/cmake/ClangConfig.cmake file so that
-  # find_package(Clang) works. Install the target list with it.
-  install(EXPORT ClangTargets DESTINATION ${CLANG_INSTALL_PACKAGE_DIR})
-
-  install(FILES
-${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/ClangConfig.cmake
-DESTINATION share/clang/cmake)
-
-  # Also copy ClangConfig.cmake to the build directory so that dependent 
projects
-  # can build against a build directory of Clang more easily.
-  configure_file(
-${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/ClangConfig.cmake
-${CLANG_BINARY_DIR}/share/clang/cmake/ClangConfig.cmake
-COPYONLY)
-endif ()
+# Generate a list of CMake library targets so that other CMake projects can
+# link against them. LLVM calls its version of this file LLVMExports.cmake, but
+# the usual CMake convention seems to be ${Project}Targets.cmake.
+set(CLANG_INSTALL_PACKAGE_DIR share/clang/cmake)
+set(clang_cmake_builddir "${CMAKE_BINARY_DIR}/${CLANG_INSTALL_PACKAGE_DIR}")
+get_property(CLANG_EXPORTS GLOBAL PROPERTY CLANG_EXPORTS)
+export(TARGETS ${CLANG_EXPORTS} FILE 
${clang_cmake_builddir}/ClangTargets.cmake)
+
+# Install a /share/clang/cmake/ClangConfig.cmake file so that
+# find_package(Clang) works. Install the target list with it.
+install(EXPORT ClangTargets DESTINATION ${CLANG_INSTALL_PACKAGE_DIR})
+
+install(FILES
+  ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/ClangConfig.cmake
+  DESTINATION share/clang/cmake)
+
+# Also copy ClangConfig.cmake to the build directory so that dependent projects
+# can build against a build directory of Clang more easily.
+configure_file(
+  ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/ClangConfig.cmake
+  ${CLANG_BINARY_DIR}/share/clang/cmake/ClangConfig.cmake
+  COPYONLY)
 
 if (CLANG_ENABLE_BOOTSTRAP)
   include(ExternalProject)


Index: CMakeLists.txt
===
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -550,30 +550,28 @@
 set(CLANG_ORDER_FILE "" CACHE FILEPATH
   "Order file to use when compiling clang in order to improve startup time.")
 
-if (CLANG_BUILT_STANDALONE)
-  # Generate a list of CMake library targets so that other CMake projects can
-  # link against them. LLVM calls its version of this file LLVMExports.cmake, but
-  # the usual CMake convention seems to be ${Project}Targets.cmake.
-  set(CLANG_INSTALL_PACKAGE_DIR share/clang/cmake)
-  set(clang_cmake_builddir "${CMAKE_BINARY_DIR}/${CLANG_INSTALL_PACKAGE_DIR}")
-  get_property(CLANG_EXPORTS GLOBAL PROPERTY CLANG_EXPORTS)
-  export(TARGETS ${CLANG_EXPORTS} FILE ${clang_cmake_builddir}/ClangTargets.cmake)
-
-  # Install a /share/clang/cmake/ClangConfig.cmake file so that
-  # find_package(Clang) works. Install the target list with it.
-  install(EXPORT ClangTargets DESTINATION ${CLANG_INSTALL_PACKAGE_DIR})
-
-  install(FILES
-${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/ClangConfig.cmake
-DESTINATION share/clang/cmake)
-
-  # Also copy ClangConfig.cmake to the build directory so that dependent projects
-  # can build against a build directory of Clang more easily.
-  configure_file(
-${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/ClangConfig.cmake
-${CLANG_BINARY_DIR}/share/clang/cmake/ClangConfig.cmake
-COPYONLY)
-endif ()
+# Generate a list of CMake library targets so that other CMake projects can
+# link against them. LLVM calls its version of this file LLVMExports.cmake, but
+# the usual CMake convention seems to be ${Project}Targets.cmake.
+set(CLANG_INSTALL_PACKAGE_DIR share/clang/cmake)
+set(clang_cmake_builddir "${CMAKE_BINARY_DIR}/${CLANG_INSTALL_PACKAGE_DIR}")
+get_property(CLANG_EXPORTS GLOBAL PROPERTY CLANG_EXPORTS)
+export(TARGETS ${CLANG_EXPORTS} FILE ${clang_cmake_builddir}/ClangTarge

Re: [PATCH] D12473: [clang-tidy] Add old style function check

2015-08-30 Thread don hinton via cfe-commits
gcc has -Wstrict-prototypes which will catch this, but clang doesn't
implement it.

however, both gcc and clang have -Wmissing-prototypes which should catch
these if users enable it.


On Sun, Aug 30, 2015 at 5:32 PM, Aaron Ballman via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

> On Sun, Aug 30, 2015 at 4:53 PM, Piotr Dziwinski 
> wrote:
> > @Aaron: Yes, I'm aware of that. I wanted to show that my check does not
> take
> > this into account.
> >
> > In C++ this code is equivalent, so I think nothing should be reported,
> > unless we really want to get rid of that void, but I suppose this other
> > check does it already.
>
> I think that in C++, it would make sense for this to be reported as a
> consistency issue. For instance, the declaration without void could be
> in a header while the definition is in a source file.
>
> > And when it comes to C, in well-formed C code, we should never see those
> two
> > definitions of allright() and allright(void), as they are declarations of
> > different functions. If I try to add empty bodies {} to define them, this
> > example won't even compile.
>
> Correct, but it also strikes me as weird that your test case is a .c
> file and there are no diagnostics triggered helping the user to
> understand that these are declaring different things. It's not until
> you add the definition that you get a diagnostic. This shouldn't be a
> clang-tidy diagnostic, but a frontend diagnostic. I'm not suggesting
> you have to do that work, either. Merely commenting that 1) they're
> different in C, 2) C++ programmer may be unaware of those differences,
> 3) this can cause real bugs, and 4) we currently fail to help the user
> in a meaningful way.
>
> http://coliru.stacked-crooked.com/a/59ba90b4d3ec5828
>
> ~Aaron
>
> >
> > So anyway, I still don't understand the problem here, unless somebody
> > explains it in clearer terms.
> >
> > Best regards,
> > Piotr Dziwinski
> >
> >
> > On 2015-08-30 22:43, Aaron Ballman wrote:
> >>
> >> On Sun, Aug 30, 2015 at 4:39 PM, Piotr Dziwinski via cfe-commits
> >>  wrote:
> >>>
> >>> piotrdz added a comment.
> >>>
> >>> @Eugene: I don't understand, what does declaring function with "void"
> >>> argument have in common with this review? I only check here variable
> >>> declarations inside functions.
> >>>
> >>> Maybe you meant my other review for inconsistent declaration parameter
> >>> names? If so, this is how it behaves currently:
> >>>
> >>>$ cat test.c
> >>>void allright();
> >>>void allright(void);
> >>>
> >>>void notallright(int a);
> >>>void notallright(int b);
> >>>
> >>>$ clang-tidy
> >>> -checks='-*,readability-inconsistent-declaration-parameter-name'
> test.c --
> >>> -std=c11
> >>>1 warning generated.
> >>>/work/clang-trunk/test.c:4:6: warning: function 'notallright' has
> >>> other declaration with different parameter name(s)
> >>> [readability-inconsistent-declaration-parameter-name]
> >>>void notallright(int a);
> >>> ^
> >>>/work/clang-trunk/test.c:5:6: note: other declaration seen here
> >>>void notallright(int b);
> >>>
> >>> So I see no reason to add specific checks for functions with "void"
> >>> parameter, unless you see something wrong with this behavior?
> >>
> >> In C, void allright(); is a function accepting a variable number of
> >> arguments, and void alright(void); is a function accepting no
> >> arguments. In C++, they are both functions accepting no arguments.
> >>
> >> ~Aaron
> >
> >
> ___
> cfe-commits mailing list
> cfe-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D12646: Add libc++ header path for DarwinClang builds

2015-09-04 Thread don hinton via cfe-commits
hintonda created this revision.
hintonda added a reviewer: rsmith.
hintonda added a subscriber: cfe-commits.

Current behavior doesn't add c++ header path if libc++ wasn't installed via 
macports in /usr.  This change will try to locate c++ headers from various 
locations, including in tree, via macports, sysroot, and default Xcode location 
-- which is how my configuration finds it.

This probably needs a bit of work, especially wrt other configurations, so 
feedback would be appreciated..

http://reviews.llvm.org/D12646

Files:
  lib/Driver/ToolChains.cpp
  lib/Driver/ToolChains.h

Index: lib/Driver/ToolChains.h
===
--- lib/Driver/ToolChains.h
+++ lib/Driver/ToolChains.h
@@ -475,6 +475,9 @@
 
   void AddLinkARCArgs(const llvm::opt::ArgList &Args,
   llvm::opt::ArgStringList &CmdArgs) const override;
+
+  void AddClangCXXStdlibIncludeArgs(const llvm::opt::ArgList &DriverArgs,
+llvm::opt::ArgStringList &CC1Args) const 
override;
   /// }
 
 private:
Index: lib/Driver/ToolChains.cpp
===
--- lib/Driver/ToolChains.cpp
+++ lib/Driver/ToolChains.cpp
@@ -264,6 +264,43 @@
   CmdArgs.push_back(Args.MakeArgString(P));
 }
 
+void DarwinClang::AddClangCXXStdlibIncludeArgs(const llvm::opt::ArgList 
&DriverArgs,
+   llvm::opt::ArgStringList 
&CC1Args) const {
+  if (DriverArgs.hasArg(options::OPT_nostdlibinc) ||
+  DriverArgs.hasArg(options::OPT_nostdincxx))
+return;
+
+  DriverArgs.AddAllArgs(CC1Args, options::OPT_stdlib_EQ);
+
+  // Check if libc++ has been enabled and provide its include paths if so.
+  if (GetCXXStdlibType(DriverArgs) == ToolChain::CST_Libcxx) {
+const std::string LibCXXIncludePathCandidates[] = {
+// The primary location is within the Clang installation.
+// FIXME: We shouldn't hard code 'v1' here to make Clang future proof 
to
+// newer ABI versions.
+getDriver().Dir + "/../include/c++/v1",
+
+// Try sysroot, e.g., DEFAULT_SYSROOT, if set
+getDriver().SysRoot + "/usr/include/c++/v1",
+
+// libc++ was installed via macports
+"/usr/include/c++/v1",
+
+// libc++ was installed as part of Xcode
+
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1"
+};
+for (const auto &IncludePath : LibCXXIncludePathCandidates) {
+  if (!llvm::sys::fs::exists(IncludePath))
+continue;
+  // Add the first candidate that exists.
+  addSystemInclude(DriverArgs, CC1Args, IncludePath);
+  break;
+}
+return;
+  }
+}
+
+
 void MachO::AddLinkRuntimeLib(const ArgList &Args, ArgStringList &CmdArgs,
   StringRef DarwinLibName, bool AlwaysLink,
   bool IsEmbedded, bool AddRPath) const {


Index: lib/Driver/ToolChains.h
===
--- lib/Driver/ToolChains.h
+++ lib/Driver/ToolChains.h
@@ -475,6 +475,9 @@
 
   void AddLinkARCArgs(const llvm::opt::ArgList &Args,
   llvm::opt::ArgStringList &CmdArgs) const override;
+
+  void AddClangCXXStdlibIncludeArgs(const llvm::opt::ArgList &DriverArgs,
+llvm::opt::ArgStringList &CC1Args) const override;
   /// }
 
 private:
Index: lib/Driver/ToolChains.cpp
===
--- lib/Driver/ToolChains.cpp
+++ lib/Driver/ToolChains.cpp
@@ -264,6 +264,43 @@
   CmdArgs.push_back(Args.MakeArgString(P));
 }
 
+void DarwinClang::AddClangCXXStdlibIncludeArgs(const llvm::opt::ArgList &DriverArgs,
+   llvm::opt::ArgStringList &CC1Args) const {
+  if (DriverArgs.hasArg(options::OPT_nostdlibinc) ||
+  DriverArgs.hasArg(options::OPT_nostdincxx))
+return;
+
+  DriverArgs.AddAllArgs(CC1Args, options::OPT_stdlib_EQ);
+
+  // Check if libc++ has been enabled and provide its include paths if so.
+  if (GetCXXStdlibType(DriverArgs) == ToolChain::CST_Libcxx) {
+const std::string LibCXXIncludePathCandidates[] = {
+// The primary location is within the Clang installation.
+// FIXME: We shouldn't hard code 'v1' here to make Clang future proof to
+// newer ABI versions.
+getDriver().Dir + "/../include/c++/v1",
+
+// Try sysroot, e.g., DEFAULT_SYSROOT, if set
+getDriver().SysRoot + "/usr/include/c++/v1",
+
+// libc++ was installed via macports
+"/usr/include/c++/v1",
+
+// libc++ was installed as part of Xcode
+"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1"
+};
+for (const auto &IncludePath : LibCXXIncludePathCandidates) {
+  if (!llvm::sys::fs::exists(IncludePath))
+continue;
+  // Add the first

Re: [PATCH] D12646: Add libc++ header path for DarwinClang builds

2015-09-07 Thread don hinton via cfe-commits
hintonda updated this revision to Diff 34175.
hintonda removed reviewers: thakis, EricWF, kubabrecka.
hintonda added a comment.

Removed redundant code from InitHeaderSearch.cpp, it's handled more cleanly in 
AddClangCXXStdlibIncludeArgs.

Also, newer versions of OSX add libc++ as the default.  Perhaps this could be 
done in cmake, as well as passing the default path to the c++ include directory 
used by the version of clang used to compile clang.  This directory can be 
found by running xcrun -f clang and munging the path, e.g.,

  LIBCXX_INCLUDE_DIR=$(dirname $(dirname $(xcrun -f clang))..)/include/c++/v1


http://reviews.llvm.org/D12646

Files:
  lib/Driver/ToolChains.cpp
  lib/Driver/ToolChains.h
  lib/Frontend/InitHeaderSearch.cpp

Index: lib/Frontend/InitHeaderSearch.cpp
===
--- lib/Frontend/InitHeaderSearch.cpp
+++ lib/Frontend/InitHeaderSearch.cpp
@@ -437,22 +437,6 @@
   if (Lang.CPlusPlus && HSOpts.UseStandardCXXIncludes &&
   HSOpts.UseStandardSystemIncludes) {
 if (HSOpts.UseLibcxx) {
-  if (triple.isOSDarwin()) {
-// On Darwin, libc++ may be installed alongside the compiler in
-// include/c++/v1.
-if (!HSOpts.ResourceDir.empty()) {
-  // Remove version from foo/lib/clang/version
-  StringRef NoVer = llvm::sys::path::parent_path(HSOpts.ResourceDir);
-  // Remove clang from foo/lib/clang
-  StringRef Lib = llvm::sys::path::parent_path(NoVer);
-  // Remove lib from foo/lib
-  SmallString<128> P = llvm::sys::path::parent_path(Lib);
-
-  // Get foo/include/c++/v1
-  llvm::sys::path::append(P, "include", "c++", "v1");
-  AddUnmappedPath(P, CXXSystem, false);
-}
-  }
   // On Solaris, include the support directory for things like xlocale and
   // fudged system headers.
   if (triple.getOS() == llvm::Triple::Solaris) 
Index: lib/Driver/ToolChains.h
===
--- lib/Driver/ToolChains.h
+++ lib/Driver/ToolChains.h
@@ -475,6 +475,9 @@
 
   void AddLinkARCArgs(const llvm::opt::ArgList &Args,
   llvm::opt::ArgStringList &CmdArgs) const override;
+
+  void AddClangCXXStdlibIncludeArgs(const llvm::opt::ArgList &DriverArgs,
+llvm::opt::ArgStringList &CC1Args) const 
override;
   /// }
 
 private:
Index: lib/Driver/ToolChains.cpp
===
--- lib/Driver/ToolChains.cpp
+++ lib/Driver/ToolChains.cpp
@@ -264,6 +264,50 @@
   CmdArgs.push_back(Args.MakeArgString(P));
 }
 
+void DarwinClang::AddClangCXXStdlibIncludeArgs(
+const llvm::opt::ArgList &DriverArgs,
+llvm::opt::ArgStringList &CC1Args) const {
+  if (DriverArgs.hasArg(options::OPT_nostdlibinc) ||
+  DriverArgs.hasArg(options::OPT_nostdincxx))
+return;
+
+  DriverArgs.AddAllArgs(CC1Args, options::OPT_stdlib_EQ);
+
+  // Check if libc++ has been enabled and provide its include paths if so.
+  if (GetCXXStdlibType(DriverArgs) == ToolChain::CST_Libcxx) {
+const std::string LibCXXIncludePathCandidates[] = {
+  // The primary location is within the Clang installation.
+  // FIXME: We shouldn't hard code 'v1' here to make Clang future proof to
+  // newer ABI versions.
+  getDriver().Dir + "/../include/c++/v1",
+
+  // Try sysroot, e.g., DEFAULT_SYSROOT, if set
+  getDriver().SysRoot + "/usr/include/c++/v1",
+
+  // libc++ was installed via macports
+  "/usr/include/c++/v1",
+
+  // FIXME: We should really let cmake find this path, e.g.,
+  // assuming we were compiled with clang:
+  // LIBCXX_INCLUDE_DIR=$(dirname $(dirname $(xcrun -f 
clang))..)/include/c++/v1
+  // libc++ installed along side clang
+  "/Applications/Xcode.app/Contents/Developer/Toolchains/"
+  "XcodeDefault.xctoolchain/usr/include/c++/v1"
+};
+for (const auto &IncludePath : LibCXXIncludePathCandidates) {
+  if (!llvm::sys::fs::exists(IncludePath))
+continue;
+  // Add the first candidate that exists.
+  addSystemInclude(DriverArgs, CC1Args, IncludePath);
+  break;
+}
+  } else {
+// FIXME: The libstdc++ include paths are currently added in
+// InitHeaderSearch::AddDefaultCPlusPlusIncludePaths().
+// Should they be moved here?
+  }
+}
+
 void MachO::AddLinkRuntimeLib(const ArgList &Args, ArgStringList &CmdArgs,
   StringRef DarwinLibName, bool AlwaysLink,
   bool IsEmbedded, bool AddRPath) const {


Index: lib/Frontend/InitHeaderSearch.cpp
===
--- lib/Frontend/InitHeaderSearch.cpp
+++ lib/Frontend/InitHeaderSearch.cpp
@@ -437,22 +437,6 @@
   if (Lang.CPlusPlus && HSOpts.UseStandardCXXIncludes &&
   HSOpts.UseStandardSystemIncludes) {
 if (HSOpts.UseLibcxx) {
-  if (triple.isOSDarwi

Re: [PATCH] D12646: Add libc++ header path for DarwinClang builds

2015-09-07 Thread don hinton via cfe-commits
Not sure why arc removed some reviewers when I added the latest diff, but
I've added them back.

Sorry for the noise...

On Mon, Sep 7, 2015 at 8:36 PM, don hinton  wrote:

> hintonda updated this revision to Diff 34175.
> hintonda removed reviewers: thakis, EricWF, kubabrecka.
> hintonda added a comment.
>
> Removed redundant code from InitHeaderSearch.cpp, it's handled more
> cleanly in AddClangCXXStdlibIncludeArgs.
>
> Also, newer versions of OSX add libc++ as the default.  Perhaps this could
> be done in cmake, as well as passing the default path to the c++ include
> directory used by the version of clang used to compile clang.  This
> directory can be found by running xcrun -f clang and munging the path, e.g.,
>
>   LIBCXX_INCLUDE_DIR=$(dirname $(dirname $(xcrun -f
> clang))..)/include/c++/v1
>
>
> http://reviews.llvm.org/D12646
>
> Files:
>   lib/Driver/ToolChains.cpp
>   lib/Driver/ToolChains.h
>   lib/Frontend/InitHeaderSearch.cpp
>
> Index: lib/Frontend/InitHeaderSearch.cpp
> ===
> --- lib/Frontend/InitHeaderSearch.cpp
> +++ lib/Frontend/InitHeaderSearch.cpp
> @@ -437,22 +437,6 @@
>if (Lang.CPlusPlus && HSOpts.UseStandardCXXIncludes &&
>HSOpts.UseStandardSystemIncludes) {
>  if (HSOpts.UseLibcxx) {
> -  if (triple.isOSDarwin()) {
> -// On Darwin, libc++ may be installed alongside the compiler in
> -// include/c++/v1.
> -if (!HSOpts.ResourceDir.empty()) {
> -  // Remove version from foo/lib/clang/version
> -  StringRef NoVer =
> llvm::sys::path::parent_path(HSOpts.ResourceDir);
> -  // Remove clang from foo/lib/clang
> -  StringRef Lib = llvm::sys::path::parent_path(NoVer);
> -  // Remove lib from foo/lib
> -  SmallString<128> P = llvm::sys::path::parent_path(Lib);
> -
> -  // Get foo/include/c++/v1
> -  llvm::sys::path::append(P, "include", "c++", "v1");
> -  AddUnmappedPath(P, CXXSystem, false);
> -}
> -  }
>// On Solaris, include the support directory for things like
> xlocale and
>// fudged system headers.
>if (triple.getOS() == llvm::Triple::Solaris)
> Index: lib/Driver/ToolChains.h
> ===
> --- lib/Driver/ToolChains.h
> +++ lib/Driver/ToolChains.h
> @@ -475,6 +475,9 @@
>
>void AddLinkARCArgs(const llvm::opt::ArgList &Args,
>llvm::opt::ArgStringList &CmdArgs) const override;
> +
> +  void AddClangCXXStdlibIncludeArgs(const llvm::opt::ArgList &DriverArgs,
> +llvm::opt::ArgStringList &CC1Args)
> const override;
>/// }
>
>  private:
> Index: lib/Driver/ToolChains.cpp
> ===
> --- lib/Driver/ToolChains.cpp
> +++ lib/Driver/ToolChains.cpp
> @@ -264,6 +264,50 @@
>CmdArgs.push_back(Args.MakeArgString(P));
>  }
>
> +void DarwinClang::AddClangCXXStdlibIncludeArgs(
> +const llvm::opt::ArgList &DriverArgs,
> +llvm::opt::ArgStringList &CC1Args) const {
> +  if (DriverArgs.hasArg(options::OPT_nostdlibinc) ||
> +  DriverArgs.hasArg(options::OPT_nostdincxx))
> +return;
> +
> +  DriverArgs.AddAllArgs(CC1Args, options::OPT_stdlib_EQ);
> +
> +  // Check if libc++ has been enabled and provide its include paths if so.
> +  if (GetCXXStdlibType(DriverArgs) == ToolChain::CST_Libcxx) {
> +const std::string LibCXXIncludePathCandidates[] = {
> +  // The primary location is within the Clang installation.
> +  // FIXME: We shouldn't hard code 'v1' here to make Clang future
> proof to
> +  // newer ABI versions.
> +  getDriver().Dir + "/../include/c++/v1",
> +
> +  // Try sysroot, e.g., DEFAULT_SYSROOT, if set
> +  getDriver().SysRoot + "/usr/include/c++/v1",
> +
> +  // libc++ was installed via macports
> +  "/usr/include/c++/v1",
> +
> +  // FIXME: We should really let cmake find this path, e.g.,
> +  // assuming we were compiled with clang:
> +  // LIBCXX_INCLUDE_DIR=$(dirname $(dirname $(xcrun -f
> clang))..)/include/c++/v1
> +  // libc++ installed along side clang
> +  "/Applications/Xcode.app/Contents/Developer/Toolchains/"
> +  "XcodeDefault.xctoolchain/usr/include/c++/v1"
> +};
> +for (const auto &IncludePath : LibCXXIncludePathCandidates) {
> +  if (!llvm::sys::fs::exists(IncludePath))
> +continue;
> +  // Add the first candidate that exists.
> +  addSystemInclude(DriverArgs, CC1Args, IncludePath);
> +  break;
> +}
> +  } else {
> +// FIXME: The libstdc++ include paths are currently added in
> +// InitHeaderSearch::AddDefaultCPlusPlusIncludePaths().
> +// Should they be moved here?
> +  }
> +}
> +
>  void MachO::AddLinkRuntimeLib(const ArgList &Args, ArgStringList &CmdArgs,
>StringRef DarwinLibName, bool AlwaysLink,
>bool

Re: [PATCH] D13453: Always generate cmake config files

2015-10-08 Thread don hinton via cfe-commits
hintonda added a comment.

Installed cmake 2.8.12 and was able to reproduce error.

I'll look into it, but I'm tempted to only support newer versions of cmake, and 
let older versions maintain current behavior.


http://reviews.llvm.org/D13453



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


Re: [PATCH] D13453: Always generate cmake config files

2015-10-08 Thread don hinton via cfe-commits
hintonda updated this revision to Diff 36889.
hintonda added a comment.

- add back check for standalone and add cmake version


http://reviews.llvm.org/D13453

Files:
  CMakeLists.txt

Index: CMakeLists.txt
===
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -550,7 +550,7 @@
 set(CLANG_ORDER_FILE "" CACHE FILEPATH
   "Order file to use when compiling clang in order to improve startup time.")
 
-if (CLANG_BUILT_STANDALONE)
+if (CLANG_BUILT_STANDALONE OR CMAKE_VERSION VERSION_GREATER 3)
   # Generate a list of CMake library targets so that other CMake projects can
   # link against them. LLVM calls its version of this file LLVMExports.cmake, 
but
   # the usual CMake convention seems to be ${Project}Targets.cmake.


Index: CMakeLists.txt
===
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -550,7 +550,7 @@
 set(CLANG_ORDER_FILE "" CACHE FILEPATH
   "Order file to use when compiling clang in order to improve startup time.")
 
-if (CLANG_BUILT_STANDALONE)
+if (CLANG_BUILT_STANDALONE OR CMAKE_VERSION VERSION_GREATER 3)
   # Generate a list of CMake library targets so that other CMake projects can
   # link against them. LLVM calls its version of this file LLVMExports.cmake, but
   # the usual CMake convention seems to be ${Project}Targets.cmake.
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D13453: Always generate cmake config files

2015-10-08 Thread don hinton via cfe-commits
hintonda updated this revision to Diff 36916.
hintonda added a comment.

Add support for cmake version 3, i.e., 3.0.0...


http://reviews.llvm.org/D13453

Files:
  CMakeLists.txt

Index: CMakeLists.txt
===
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -550,7 +550,8 @@
 set(CLANG_ORDER_FILE "" CACHE FILEPATH
   "Order file to use when compiling clang in order to improve startup time.")
 
-if (CLANG_BUILT_STANDALONE)
+if (CLANG_BUILT_STANDALONE OR CMAKE_VERSION VERSION_EQUAL 3 OR
+CMAKE_VERSION VERSION_GREATER 3)
   # Generate a list of CMake library targets so that other CMake projects can
   # link against them. LLVM calls its version of this file LLVMExports.cmake, 
but
   # the usual CMake convention seems to be ${Project}Targets.cmake.


Index: CMakeLists.txt
===
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -550,7 +550,8 @@
 set(CLANG_ORDER_FILE "" CACHE FILEPATH
   "Order file to use when compiling clang in order to improve startup time.")
 
-if (CLANG_BUILT_STANDALONE)
+if (CLANG_BUILT_STANDALONE OR CMAKE_VERSION VERSION_EQUAL 3 OR
+CMAKE_VERSION VERSION_GREATER 3)
   # Generate a list of CMake library targets so that other CMake projects can
   # link against them. LLVM calls its version of this file LLVMExports.cmake, but
   # the usual CMake convention seems to be ${Project}Targets.cmake.
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D13453: Always generate cmake config files

2015-10-08 Thread don hinton via cfe-commits
hintonda added a comment.

Btw, I don't have commit access, so if you are happy with this change, could 
you commit it for me?


http://reviews.llvm.org/D13453



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


[PATCH] D13622: Add call to find_package to load LLVM dependencies

2015-10-10 Thread don hinton via cfe-commits
hintonda created this revision.
hintonda added a reviewer: chapuni.
hintonda added a subscriber: cfe-commits.

ClangConfig requires LLVMConfig, so add find_package call in ClangConfig so 
find_package(clang REQUIRED CONFIG) will just work.  This makes it easier for 
cmake based projects to use clang, e.g., tools using ClangTooling.

http://reviews.llvm.org/D13622

Files:
  cmake/modules/ClangConfig.cmake

Index: cmake/modules/ClangConfig.cmake
===
--- cmake/modules/ClangConfig.cmake
+++ cmake/modules/ClangConfig.cmake
@@ -4,5 +4,7 @@
 # uses LLVM's. When it does, we should move this file to ClangConfig.cmake.in
 # and call configure_file() on it.
 
+find_package(LLVM REQUIRED CONFIG)
+
 # Provide all our library targets to users.
 include("${CMAKE_CURRENT_LIST_DIR}/ClangTargets.cmake")


Index: cmake/modules/ClangConfig.cmake
===
--- cmake/modules/ClangConfig.cmake
+++ cmake/modules/ClangConfig.cmake
@@ -4,5 +4,7 @@
 # uses LLVM's. When it does, we should move this file to ClangConfig.cmake.in
 # and call configure_file() on it.
 
+find_package(LLVM REQUIRED CONFIG)
+
 # Provide all our library targets to users.
 include("${CMAKE_CURRENT_LIST_DIR}/ClangTargets.cmake")
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D16946: Add link to llvm git documentation, and recommend always building libcxx on OSX

2016-02-06 Thread don hinton via cfe-commits
hintonda created this revision.
hintonda added a reviewer: mclow.lists.
hintonda added a subscriber: cfe-commits.

http://reviews.llvm.org/D16946

Files:
  www/get_started.html

Index: www/get_started.html
===
--- www/get_started.html
+++ www/get_started.html
@@ -31,7 +31,7 @@
 On Unix-like Systems
 
 If you would like to check out and build Clang, the current procedure is as
-follows:
+follows (instructions for using git can be found http://llvm.org/docs/GettingStarted.html#git-mirror";>here):
 
 
   Get the required tools.
@@ -76,7 +76,7 @@
 cd ../..
   
   
-  Checkout libcxx: (only required to build and run Compiler-RT tests on OS 
X, optional otherwise)
+  Checkout libcxx: (recommended for OS X, and required to build and run 
Compiler-RT tests on OS X, optional otherwise)
   
 cd llvm/projects
 svn co http://llvm.org/svn/llvm-project/libcxx/trunk


Index: www/get_started.html
===
--- www/get_started.html
+++ www/get_started.html
@@ -31,7 +31,7 @@
 On Unix-like Systems
 
 If you would like to check out and build Clang, the current procedure is as
-follows:
+follows (instructions for using git can be found http://llvm.org/docs/GettingStarted.html#git-mirror";>here):
 
 
   Get the required tools.
@@ -76,7 +76,7 @@
 cd ../..
   
   
-  Checkout libcxx: (only required to build and run Compiler-RT tests on OS X, optional otherwise)
+  Checkout libcxx: (recommended for OS X, and required to build and run Compiler-RT tests on OS X, optional otherwise)
   
 cd llvm/projects
 svn co http://llvm.org/svn/llvm-project/libcxx/trunk
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D16964: Make sure the projects subdirectory doesn't contain the clang or clang-tools-extra projects

2016-02-07 Thread don hinton via cfe-commits
hintonda created this revision.
hintonda added reviewers: beanz, mclow.lists.
hintonda added a subscriber: cfe-commits.

A common error for new users it to checkout subprojects, like clang or 
clang-tools-extra, into the wrong subdirectory.  This change helps prevent 
this, since the resulting build would otherwise be unusable.

http://reviews.llvm.org/D16964

Files:
  projects/CMakeLists.txt

Index: projects/CMakeLists.txt
===
--- projects/CMakeLists.txt
+++ projects/CMakeLists.txt
@@ -4,6 +4,14 @@
 file(GLOB entries *)
 foreach(entry ${entries})
   if(IS_DIRECTORY ${entry} AND EXISTS ${entry}/CMakeLists.txt)
+# Do not allow tools like clang or clang-tools-extra in the projects 
directory
+if(${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/clang)
+  message(FATAL_ERROR "clang must be placed under llvm/tools, not 
llvm/projects")
+endif()
+if((${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/extra) OR
+   (${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/clang-tools-extra))
+  message(FATAL_ERROR "clang-tools-extra (extra) must be placed under 
llvm/tools/clang/tools, not llvm/projects")
+endif()
 if((NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/compiler-rt) AND
(NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/dragonegg) AND
(NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/libcxx) AND


Index: projects/CMakeLists.txt
===
--- projects/CMakeLists.txt
+++ projects/CMakeLists.txt
@@ -4,6 +4,14 @@
 file(GLOB entries *)
 foreach(entry ${entries})
   if(IS_DIRECTORY ${entry} AND EXISTS ${entry}/CMakeLists.txt)
+# Do not allow tools like clang or clang-tools-extra in the projects directory
+if(${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/clang)
+  message(FATAL_ERROR "clang must be placed under llvm/tools, not llvm/projects")
+endif()
+if((${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/extra) OR
+   (${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/clang-tools-extra))
+  message(FATAL_ERROR "clang-tools-extra (extra) must be placed under llvm/tools/clang/tools, not llvm/projects")
+endif()
 if((NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/compiler-rt) AND
(NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/dragonegg) AND
(NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/libcxx) AND
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


  1   2   3   >