Re: [PATCH] D13853: clang-format: Treat --sort-includes that #include and #import mean the same thing.

2015-10-18 Thread Nico Weber via cfe-commits
thakis added inline comments.


Comment at: lib/Format/Format.cpp:1735
@@ -1734,3 +1734,3 @@
   llvm::Regex IncludeRegex(
-  R"(^[\t\ ]*#[\t\ ]*include[^"<]*(["<][^">]*[">]))");
+  R"(^[\t\ ]*#[\t\ ]*(import|include)[^"<]*(["<][^">]*[">]))");
   SmallVector Matches;

llvm's Regex class doesn't support non-capturing groups (`(?:foo|bar)`) as far 
as I can tell, so I changed Matches[1] to Matches[2] below.


http://reviews.llvm.org/D13853



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


[PATCH] D13853: clang-format: Treat --sort-includes that #include and #import mean the same thing.

2015-10-18 Thread Nico Weber via cfe-commits
thakis created this revision.
thakis added a reviewer: djasper.
thakis added a subscriber: cfe-commits.
Herald added a subscriber: klimek.

clang accepts both #include and #import for includes (the latter having an 
implicit header guard). Let clang-format interleave both types if 
--sort-includes is passed. #import is used frequently in Objective-C code.

http://reviews.llvm.org/D13853

Files:
  lib/Format/Format.cpp
  unittests/Format/SortIncludesTest.cpp

Index: unittests/Format/SortIncludesTest.cpp
===
--- unittests/Format/SortIncludesTest.cpp
+++ unittests/Format/SortIncludesTest.cpp
@@ -40,6 +40,16 @@
  "#include \"b.h\"\n"));
 }
 
+TEST_F(SortIncludesTest, MixIncludeAndImport) {
+  EXPECT_EQ("#include \"a.h\"\n"
+"#import \"b.h\"\n"
+"#include \"c.h\"\n",
+sort("#include \"a.h\"\n"
+ "#include \"c.h\"\n"
+ "#import \"b.h\"\n"));
+}
+
+
 TEST_F(SortIncludesTest, FixTrailingComments) {
   EXPECT_EQ("#include \"a.h\"  // comment\n"
 "#include \"bb.h\" // comment\n"
Index: lib/Format/Format.cpp
===
--- lib/Format/Format.cpp
+++ lib/Format/Format.cpp
@@ -1732,7 +1732,7 @@
   unsigned Prev = 0;
   unsigned SearchFrom = 0;
   llvm::Regex IncludeRegex(
-  R"(^[\t\ ]*#[\t\ ]*include[^"<]*(["<][^">]*[">]))");
+  R"(^[\t\ ]*#[\t\ ]*(import|include)[^"<]*(["<][^">]*[">]))");
   SmallVector Matches;
   SmallVector IncludesInBlock;
 
@@ -1762,20 +1762,21 @@
 Code.substr(Prev, (Pos != StringRef::npos ? Pos : Code.size()) - Prev);
 if (!Line.endswith("\\")) {
   if (IncludeRegex.match(Line, )) {
+StringRef IncludeName = Matches[2];
 unsigned Category;
-if (LookForMainHeader && !Matches[1].startswith("<")) {
+if (LookForMainHeader && !IncludeName.startswith("<")) {
   Category = 0;
 } else {
   Category = UINT_MAX;
   for (unsigned i = 0, e = CategoryRegexs.size(); i != e; ++i) {
-if (CategoryRegexs[i].match(Matches[1])) {
+if (CategoryRegexs[i].match(IncludeName)) {
   Category = Style.IncludeCategories[i].Priority;
   break;
 }
   }
 }
 LookForMainHeader = false;
-IncludesInBlock.push_back({Matches[1], Line, Prev, Category});
+IncludesInBlock.push_back({IncludeName, Line, Prev, Category});
   } else if (!IncludesInBlock.empty()) {
 sortIncludes(Style, IncludesInBlock, Ranges, FileName, Replaces);
 IncludesInBlock.clear();


Index: unittests/Format/SortIncludesTest.cpp
===
--- unittests/Format/SortIncludesTest.cpp
+++ unittests/Format/SortIncludesTest.cpp
@@ -40,6 +40,16 @@
  "#include \"b.h\"\n"));
 }
 
+TEST_F(SortIncludesTest, MixIncludeAndImport) {
+  EXPECT_EQ("#include \"a.h\"\n"
+"#import \"b.h\"\n"
+"#include \"c.h\"\n",
+sort("#include \"a.h\"\n"
+ "#include \"c.h\"\n"
+ "#import \"b.h\"\n"));
+}
+
+
 TEST_F(SortIncludesTest, FixTrailingComments) {
   EXPECT_EQ("#include \"a.h\"  // comment\n"
 "#include \"bb.h\" // comment\n"
Index: lib/Format/Format.cpp
===
--- lib/Format/Format.cpp
+++ lib/Format/Format.cpp
@@ -1732,7 +1732,7 @@
   unsigned Prev = 0;
   unsigned SearchFrom = 0;
   llvm::Regex IncludeRegex(
-  R"(^[\t\ ]*#[\t\ ]*include[^"<]*(["<][^">]*[">]))");
+  R"(^[\t\ ]*#[\t\ ]*(import|include)[^"<]*(["<][^">]*[">]))");
   SmallVector Matches;
   SmallVector IncludesInBlock;
 
@@ -1762,20 +1762,21 @@
 Code.substr(Prev, (Pos != StringRef::npos ? Pos : Code.size()) - Prev);
 if (!Line.endswith("\\")) {
   if (IncludeRegex.match(Line, )) {
+StringRef IncludeName = Matches[2];
 unsigned Category;
-if (LookForMainHeader && !Matches[1].startswith("<")) {
+if (LookForMainHeader && !IncludeName.startswith("<")) {
   Category = 0;
 } else {
   Category = UINT_MAX;
   for (unsigned i = 0, e = CategoryRegexs.size(); i != e; ++i) {
-if (CategoryRegexs[i].match(Matches[1])) {
+if (CategoryRegexs[i].match(IncludeName)) {
   Category = Style.IncludeCategories[i].Priority;
   break;
 }
   }
 }
 LookForMainHeader = false;
-IncludesInBlock.push_back({Matches[1], Line, Prev, Category});
+IncludesInBlock.push_back({IncludeName, Line, Prev, Category});
   } else if (!IncludesInBlock.empty()) {
 sortIncludes(Style, IncludesInBlock, Ranges, FileName, Replaces);
 IncludesInBlock.clear();

Re: r250473 - Add an error when calling a builtin that requires features that don't

2015-10-18 Thread Justin Bogner via cfe-commits
Eric Christopher  writes:
> I'm reasonably certain you forgot to rebuild or ran make test in the wrong
> directory.

You're right, I did something funny there. Sorry for the noise.

> Two reasons:
>
> a) This is pretty much my first patch. I mean, identical and I tried that.
> b) I actually tried this one and got:
>
> Testing Time: 217.41s
> 
> Failing Tests (68):
> Clang :: CodeGen/3dnow-builtins.c
> Clang :: CodeGen/adc-builtins.c
> Clang :: CodeGen/adx-builtins.c
> Clang :: CodeGen/attr-target-x86-mmx.c
> Clang :: CodeGen/avx-builtins.c
> Clang :: CodeGen/avx-cmp-builtins.c
> Clang :: CodeGen/avx-shuffle-builtins.c
> Clang :: CodeGen/avx2-builtins.c
> Clang :: CodeGen/avx512bw-builtins.c
> Clang :: CodeGen/avx512cdintrin.c
> Clang :: CodeGen/avx512dq-builtins.c
> Clang :: CodeGen/avx512er-builtins.c
> Clang :: CodeGen/avx512f-builtins.c
> Clang :: CodeGen/avx512vl-builtins.c
> Clang :: CodeGen/avx512vlbw-builtins.c
> Clang :: CodeGen/avx512vldq-builtins.c
> Clang :: CodeGen/bmi-builtins.c
> Clang :: CodeGen/bmi2-builtins.c
> Clang :: CodeGen/builtins-x86.c
> Clang :: CodeGen/f16c-builtins.c
> Clang :: CodeGen/fma-builtins.c
> Clang :: CodeGen/fma4-builtins.c
> Clang :: CodeGen/fsgsbase-builtins.c
> Clang :: CodeGen/lzcnt-builtins.c
> Clang :: CodeGen/mmx-builtins.c
> Clang :: CodeGen/mmx-inline-asm.c
> Clang :: CodeGen/mmx-shift-with-immediate.c
> Clang :: CodeGen/ms-intrinsics.c
> Clang :: CodeGen/ms-mm-align.c
> Clang :: CodeGen/palignr.c
> Clang :: CodeGen/pclmul-builtins.c
> Clang :: CodeGen/popcnt-builtins.c
> Clang :: CodeGen/prefetchw-builtins.c
> Clang :: CodeGen/rdrand-builtins.c
> Clang :: CodeGen/rtm-builtins.c
> Clang :: CodeGen/sha-builtins.c
> Clang :: CodeGen/sse-builtins-dbg.c
> Clang :: CodeGen/sse-builtins.c
> Clang :: CodeGen/sse.c
> Clang :: CodeGen/sse3-builtins.c
> Clang :: CodeGen/sse41-builtins.c
> Clang :: CodeGen/sse42-builtins.c
> Clang :: CodeGen/sse4a-builtins.c
> Clang :: CodeGen/ssse3-builtins.c
> Clang :: CodeGen/target-builtin-error-2.c
> Clang :: CodeGen/target-builtin-error.c
> Clang :: CodeGen/target-builtin-noerror.c
> Clang :: CodeGen/tbm-builtins.c
> Clang :: CodeGen/vector.c
> Clang :: CodeGen/x86_32-xsave.c
> Clang :: CodeGen/x86_64-xsave.c
> Clang :: CodeGen/xop-builtins.c
> Clang :: CodeGenCXX/mangle-ms-vector-types.cpp
> Clang :: Headers/c89.c
> Clang :: Headers/ms-intrin.cpp
> Clang :: Headers/pmmintrin.c
> Clang :: Headers/wmmintrin.c
> Clang :: Headers/x86-intrinsics-headers.c
> Clang :: Headers/x86intrin-2.c
> Clang :: Headers/x86intrin.c
> Clang :: Headers/xmmintrin.c
> Clang :: Integration/carbon.c
> Clang :: Integration/cocoa-pch.m
> Clang :: Integration/cocoa.m
> Clang :: Modules/compiler_builtins.m
> Clang :: Sema/builtins-x86.c
> Clang :: Sema/warn-shadow-intrinsics.c
> Clang :: Sema/x86-builtin-palignr.c
>
>   Expected Passes: 8545
>   Expected Failures  : 15
>   Unsupported Tests  : 15
>   Unexpected Failures: 68
>
> with lots of failures that look like:
>
> In file included from
> /Users/echristo/builds/build-llvm/Debug+Asserts/bin/../lib/clang/3.8.0/include/immintrin.h:143:
> /Users/echristo/builds/build-llvm/Debug+Asserts/bin/../lib/clang/3.8.0/include/shaintrin.h:40:19:
> error: '__builtin_ia32_sha1nexte' needs target feature sha
>   return (__m128i)__builtin_ia32_sha1nexte((__v4si)__X, (__v4si)__Y);
>   ^
>
> for files that include more headers than they need (think x86intrin.h being
> the only header included), but not calling any of the functions and so not
> using a command line option that enables every feature for the x86 target.
>
> -eric
>
> On Sat, Oct 17, 2015 at 2:11 AM Justin Bogner  wrote:
>
>> Eric Christopher  writes:
>> > Can't be. We don't know we're going to make the call until we code gen.
>> :)
>>
>> Okay... but then why don't any tests fail with the attached? It looks
>> like it does the right thing in a very cursory test, as well.
>>
>>
>> > On Fri, Oct 16, 2015, 7:50 PM Justin Bogner 
>> wrote:
>> >
>> >> Eric Christopher via cfe-commits  writes:
>> >> > Author: echristo
>> >> > Date: Thu Oct 15 18:47:11 2015
>> >> > New Revision: 250473
>> >> >
>> >> > URL: http://llvm.org/viewvc/llvm-project?rev=250473=rev
>> >> > Log:
>> >> > Add an error when calling a builtin that requires features that don't
>> >> > match the feature set of the function that they're being called from.
>> >> >
>> >> > This ensures that we can effectively diagnose some[1] code that would
>> >> > instead ICE in the backend with a failure to select message.
>> >> >
>> >> > Example:
>> >> >
>> >> > __m128d foo(__m128d a, __m128d b) {

r250665 - CodeGen: simplify TargetOptions setup

2015-10-18 Thread Saleem Abdulrasool via cfe-commits
Author: compnerd
Date: Sun Oct 18 15:24:53 2015
New Revision: 250665

URL: http://llvm.org/viewvc/llvm-project?rev=250665=rev
Log:
CodeGen: simplify TargetOptions setup

Do direct assignment of boolean values and regroup.  Use StringSwitch instead of
custom cases.  NFC.

Modified:
cfe/trunk/lib/CodeGen/BackendUtil.cpp

Modified: cfe/trunk/lib/CodeGen/BackendUtil.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/BackendUtil.cpp?rev=250665=250664=250665=diff
==
--- cfe/trunk/lib/CodeGen/BackendUtil.cpp (original)
+++ cfe/trunk/lib/CodeGen/BackendUtil.cpp Sun Oct 18 15:24:53 2015
@@ -488,24 +488,16 @@ TargetMachine *EmitAssemblyHelper::Creat
   .Case("posix", llvm::ThreadModel::POSIX)
   .Case("single", llvm::ThreadModel::Single);
 
-  if (CodeGenOpts.DisableIntegratedAS)
-Options.DisableIntegratedAS = true;
-
-  if (CodeGenOpts.CompressDebugSections)
-Options.CompressDebugSections = true;
-
-  if (CodeGenOpts.UseInitArray)
-Options.UseInitArray = true;
-
   // Set float ABI type.
-  if (CodeGenOpts.FloatABI == "soft" || CodeGenOpts.FloatABI == "softfp")
-Options.FloatABIType = llvm::FloatABI::Soft;
-  else if (CodeGenOpts.FloatABI == "hard")
-Options.FloatABIType = llvm::FloatABI::Hard;
-  else {
-assert(CodeGenOpts.FloatABI.empty() && "Invalid float abi!");
-Options.FloatABIType = llvm::FloatABI::Default;
-  }
+  assert((CodeGenOpts.FloatABI == "soft" || CodeGenOpts.FloatABI == "softfp" ||
+  CodeGenOpts.FloatABI == "hard" || CodeGenOpts.FloatABI.empty()) &&
+ "Invalid Floating Point ABI!");
+  Options.FloatABIType =
+  llvm::StringSwitch(CodeGenOpts.FloatABI)
+  .Case("soft", llvm::FloatABI::Soft)
+  .Case("softfp", llvm::FloatABI::Soft)
+  .Case("hard", llvm::FloatABI::Hard)
+  .Default(llvm::FloatABI::Default);
 
   // Set FP fusion mode.
   switch (CodeGenOpts.getFPContractMode()) {
@@ -520,6 +512,9 @@ TargetMachine *EmitAssemblyHelper::Creat
 break;
   }
 
+  Options.UseInitArray = CodeGenOpts.UseInitArray;
+  Options.DisableIntegratedAS = CodeGenOpts.DisableIntegratedAS;
+  Options.CompressDebugSections = CodeGenOpts.CompressDebugSections;
   Options.LessPreciseFPMADOption = CodeGenOpts.LessPreciseFPMAD;
   Options.NoInfsFPMath = CodeGenOpts.NoInfsFPMath;
   Options.NoNaNsFPMath = CodeGenOpts.NoNaNsFPMath;


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


r250671 - Update list of languages advertised in OVERVIEW: A tool to format C/C++/Java/JavaScript/Objective-C/Protobuf code.

2015-10-18 Thread Nico Weber via cfe-commits
Author: nico
Date: Sun Oct 18 20:03:19 2015
New Revision: 250671

URL: http://llvm.org/viewvc/llvm-project?rev=250671=rev
Log:
Update list of languages advertised in OVERVIEW: A tool to format 
C/C++/Java/JavaScript/Objective-C/Protobuf code.

If no arguments are specified, it formats the code from standard input
and writes the result to the standard output.
If s are given, it reformats the files. If -i is specified
together with s, the files are edited in-place. Otherwise, the
result is written to the standard output.

USAGE: clang-format [options] [ ...]

OPTIONS:
  -assume-filename= - When reading from stdin, clang-format assumes this
  filename to look for a style config file (with
  -style=file) and to determine the language.
  -cursor=- The position of the cursor when invoking
  clang-format from an editor integration
  -dump-config  - Dump configuration options to stdout and exit.
  Can be used with -style option.
  -fallback-style=  - The name of the predefined style used as a
  fallback in case clang-format is invoked with
  -style=file, but can not find the .clang-format
  file to use.
  Use -fallback-style=none to skip formatting.
  -help - Display available options (-help-hidden for more)
  -i- Inplace edit s, if specified.
  -length=- Format a range of this length (in bytes).
  Multiple ranges can be formatted by specifying
  several -offset and -length pairs.
  When only a single -offset is specified without
  -length, clang-format will format up to the end
  of the file.
  Can only be used with one input file.
  -lines=   - : - format a range of
  lines (both 1-based).
  Multiple ranges can be formatted by specifying
  several -lines arguments.
  Can't be used with -offset and -length.
  Can only be used with one input file.
  -offset=- Format a range starting at this byte offset.
  Multiple ranges can be formatted by specifying
  several -offset and -length pairs.
  Can only be used with one input file.
  -output-replacements-xml  - Output replacements as XML.
  -sort-includes- Sort touched include lines
  -style=   - Coding style, currently supports:
LLVM, Google, Chromium, Mozilla, WebKit.
  Use -style=file to load style configuration from
  .clang-format file located in one of the parent
  directories of the source file (or current
  directory for stdin).
  Use -style="{key: value, ...}" to set specific
  parameters, e.g.:
-style="{BasedOnStyle: llvm, IndentWidth: 8}"
  -version  - Display the version of this program output.

Modified:
cfe/trunk/tools/clang-format/ClangFormat.cpp

Modified: cfe/trunk/tools/clang-format/ClangFormat.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-format/ClangFormat.cpp?rev=250671=250670=250671=diff
==
--- cfe/trunk/tools/clang-format/ClangFormat.cpp (original)
+++ cfe/trunk/tools/clang-format/ClangFormat.cpp Sun Oct 18 20:03:19 2015
@@ -324,7 +324,7 @@ int main(int argc, const char **argv) {
   cl::SetVersionPrinter(PrintVersion);
   cl::ParseCommandLineOptions(
   argc, argv,
-  "A tool to format C/C++/Obj-C code.\n\n"
+  "A tool to format C/C++/Java/JavaScript/Objective-C/Protobuf code.\n\n"
   "If no arguments are specified, it formats the code from standard 
input\n"
   "and writes the result to the standard output.\n"
   "If s are given, it reformats the files. If -i is specified\n"


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


Re: r250473 - Add an error when calling a builtin that requires features that don't

2015-10-18 Thread Eric Christopher via cfe-commits
No worries! :)

On Sun, Oct 18, 2015, 5:42 PM Justin Bogner  wrote:

> Eric Christopher  writes:
> > I'm reasonably certain you forgot to rebuild or ran make test in the
> wrong
> > directory.
>
> You're right, I did something funny there. Sorry for the noise.
>
> > Two reasons:
> >
> > a) This is pretty much my first patch. I mean, identical and I tried
> that.
> > b) I actually tried this one and got:
> >
> > Testing Time: 217.41s
> > 
> > Failing Tests (68):
> > Clang :: CodeGen/3dnow-builtins.c
> > Clang :: CodeGen/adc-builtins.c
> > Clang :: CodeGen/adx-builtins.c
> > Clang :: CodeGen/attr-target-x86-mmx.c
> > Clang :: CodeGen/avx-builtins.c
> > Clang :: CodeGen/avx-cmp-builtins.c
> > Clang :: CodeGen/avx-shuffle-builtins.c
> > Clang :: CodeGen/avx2-builtins.c
> > Clang :: CodeGen/avx512bw-builtins.c
> > Clang :: CodeGen/avx512cdintrin.c
> > Clang :: CodeGen/avx512dq-builtins.c
> > Clang :: CodeGen/avx512er-builtins.c
> > Clang :: CodeGen/avx512f-builtins.c
> > Clang :: CodeGen/avx512vl-builtins.c
> > Clang :: CodeGen/avx512vlbw-builtins.c
> > Clang :: CodeGen/avx512vldq-builtins.c
> > Clang :: CodeGen/bmi-builtins.c
> > Clang :: CodeGen/bmi2-builtins.c
> > Clang :: CodeGen/builtins-x86.c
> > Clang :: CodeGen/f16c-builtins.c
> > Clang :: CodeGen/fma-builtins.c
> > Clang :: CodeGen/fma4-builtins.c
> > Clang :: CodeGen/fsgsbase-builtins.c
> > Clang :: CodeGen/lzcnt-builtins.c
> > Clang :: CodeGen/mmx-builtins.c
> > Clang :: CodeGen/mmx-inline-asm.c
> > Clang :: CodeGen/mmx-shift-with-immediate.c
> > Clang :: CodeGen/ms-intrinsics.c
> > Clang :: CodeGen/ms-mm-align.c
> > Clang :: CodeGen/palignr.c
> > Clang :: CodeGen/pclmul-builtins.c
> > Clang :: CodeGen/popcnt-builtins.c
> > Clang :: CodeGen/prefetchw-builtins.c
> > Clang :: CodeGen/rdrand-builtins.c
> > Clang :: CodeGen/rtm-builtins.c
> > Clang :: CodeGen/sha-builtins.c
> > Clang :: CodeGen/sse-builtins-dbg.c
> > Clang :: CodeGen/sse-builtins.c
> > Clang :: CodeGen/sse.c
> > Clang :: CodeGen/sse3-builtins.c
> > Clang :: CodeGen/sse41-builtins.c
> > Clang :: CodeGen/sse42-builtins.c
> > Clang :: CodeGen/sse4a-builtins.c
> > Clang :: CodeGen/ssse3-builtins.c
> > Clang :: CodeGen/target-builtin-error-2.c
> > Clang :: CodeGen/target-builtin-error.c
> > Clang :: CodeGen/target-builtin-noerror.c
> > Clang :: CodeGen/tbm-builtins.c
> > Clang :: CodeGen/vector.c
> > Clang :: CodeGen/x86_32-xsave.c
> > Clang :: CodeGen/x86_64-xsave.c
> > Clang :: CodeGen/xop-builtins.c
> > Clang :: CodeGenCXX/mangle-ms-vector-types.cpp
> > Clang :: Headers/c89.c
> > Clang :: Headers/ms-intrin.cpp
> > Clang :: Headers/pmmintrin.c
> > Clang :: Headers/wmmintrin.c
> > Clang :: Headers/x86-intrinsics-headers.c
> > Clang :: Headers/x86intrin-2.c
> > Clang :: Headers/x86intrin.c
> > Clang :: Headers/xmmintrin.c
> > Clang :: Integration/carbon.c
> > Clang :: Integration/cocoa-pch.m
> > Clang :: Integration/cocoa.m
> > Clang :: Modules/compiler_builtins.m
> > Clang :: Sema/builtins-x86.c
> > Clang :: Sema/warn-shadow-intrinsics.c
> > Clang :: Sema/x86-builtin-palignr.c
> >
> >   Expected Passes: 8545
> >   Expected Failures  : 15
> >   Unsupported Tests  : 15
> >   Unexpected Failures: 68
> >
> > with lots of failures that look like:
> >
> > In file included from
> >
> /Users/echristo/builds/build-llvm/Debug+Asserts/bin/../lib/clang/3.8.0/include/immintrin.h:143:
> >
> /Users/echristo/builds/build-llvm/Debug+Asserts/bin/../lib/clang/3.8.0/include/shaintrin.h:40:19:
> > error: '__builtin_ia32_sha1nexte' needs target feature sha
> >   return (__m128i)__builtin_ia32_sha1nexte((__v4si)__X, (__v4si)__Y);
> >   ^
> >
> > for files that include more headers than they need (think x86intrin.h
> being
> > the only header included), but not calling any of the functions and so
> not
> > using a command line option that enables every feature for the x86
> target.
> >
> > -eric
> >
> > On Sat, Oct 17, 2015 at 2:11 AM Justin Bogner 
> wrote:
> >
> >> Eric Christopher  writes:
> >> > Can't be. We don't know we're going to make the call until we code
> gen.
> >> :)
> >>
> >> Okay... but then why don't any tests fail with the attached? It looks
> >> like it does the right thing in a very cursory test, as well.
> >>
> >>
> >> > On Fri, Oct 16, 2015, 7:50 PM Justin Bogner 
> >> wrote:
> >> >
> >> >> Eric Christopher via cfe-commits 
> writes:
> >> >> > Author: echristo
> >> >> > Date: Thu Oct 15 18:47:11 2015
> >> >> > New Revision: 250473
> >> >> >
> >> >> > URL: http://llvm.org/viewvc/llvm-project?rev=250473=rev
> >> >> > Log:
> >> >> > Add an error when 

r250666 - No functionality change, just fix whitespace, a typo and remove an unnecessary

2015-10-18 Thread Nick Lewycky via cfe-commits
Author: nicholas
Date: Sun Oct 18 15:32:12 2015
New Revision: 250666

URL: http://llvm.org/viewvc/llvm-project?rev=250666=rev
Log:
No functionality change, just fix whitespace, a typo and remove an unnecessary
emacs mode marker. (Changes left behind from another patch that ended up not
working out.)

Modified:
cfe/trunk/lib/AST/DeclBase.cpp
cfe/trunk/lib/Sema/SemaLookup.cpp
cfe/trunk/lib/Serialization/ASTWriterDecl.cpp

Modified: cfe/trunk/lib/AST/DeclBase.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclBase.cpp?rev=250666=250665=250666=diff
==
--- cfe/trunk/lib/AST/DeclBase.cpp (original)
+++ cfe/trunk/lib/AST/DeclBase.cpp Sun Oct 18 15:32:12 2015
@@ -1233,7 +1233,7 @@ void DeclContext::addHiddenDecl(Decl *D)
   }
 
   // Notify a C++ record declaration that we've added a member, so it can
-  // update it's class-specific state.
+  // update its class-specific state.
   if (CXXRecordDecl *Record = dyn_cast(this))
 Record->addedMember(D);
 

Modified: cfe/trunk/lib/Sema/SemaLookup.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaLookup.cpp?rev=250666=250665=250666=diff
==
--- cfe/trunk/lib/Sema/SemaLookup.cpp (original)
+++ cfe/trunk/lib/Sema/SemaLookup.cpp Sun Oct 18 15:32:12 2015
@@ -1,4 +1,4 @@
-//===- SemaLookup.cpp - Name Lookup  *- C++ 
-*-===//
+//===- SemaLookup.cpp - Name Lookup  
--===//
 //
 // The LLVM Compiler Infrastructure
 //
@@ -154,7 +154,7 @@ namespace {
 // by its using directives, transitively) as if they appeared in
 // the given effective context.
 void addUsingDirectives(DeclContext *DC, DeclContext *EffectiveDC) {
-  SmallVector queue;
+  SmallVector queue;
   while (true) {
 for (auto UD : DC->using_directives()) {
   DeclContext *NS = UD->getNominatedNamespace();
@@ -2189,7 +2189,7 @@ void Sema::DiagnoseAmbiguousLookup(Looku
   case LookupResult::AmbiguousTagHiding: {
 Diag(NameLoc, diag::err_ambiguous_tag_hiding) << Name << LookupRange;
 
-llvm::SmallPtrSet TagDecls;
+llvm::SmallPtrSet TagDecls;
 
 for (auto *D : Result)
   if (TagDecl *TD = dyn_cast(D)) {

Modified: cfe/trunk/lib/Serialization/ASTWriterDecl.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTWriterDecl.cpp?rev=250666=250665=250666=diff
==
--- cfe/trunk/lib/Serialization/ASTWriterDecl.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTWriterDecl.cpp Sun Oct 18 15:32:12 2015
@@ -260,7 +260,7 @@ void ASTDeclWriter::Visit(Decl *D) {
   // Source locations require array (variable-length) abbreviations.  The
   // abbreviation infrastructure requires that arrays are encoded last, so
   // we handle it here in the case of those classes derived from DeclaratorDecl
-  if (DeclaratorDecl *DD = dyn_cast(D)){
+  if (DeclaratorDecl *DD = dyn_cast(D)) {
 Writer.AddTypeSourceInfo(DD->getTypeSourceInfo(), Record);
   }
 
@@ -2101,7 +2101,7 @@ void ASTWriter::WriteDecl(ASTContext 
 if (IDR == 0)
   IDR = NextDeclID++;
 
-ID= IDR;
+ID = IDR;
   }
 
   bool isReplacingADecl = ID < FirstDeclID;


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


r250672 - Update `clang-format -help` output in clang-format docs.

2015-10-18 Thread Nico Weber via cfe-commits
Author: nico
Date: Sun Oct 18 20:08:30 2015
New Revision: 250672

URL: http://llvm.org/viewvc/llvm-project?rev=250672=rev
Log:
Update `clang-format -help` output in clang-format docs.

-assume-filename, -fallback-style, and -sort-includes are new.  (They're also
longer than the previous options, so all descriptions shift over by some amount,
making this diff look larger than it is.)

It looks like someone renamed "General options" to "Generic Options" too.

Modified:
cfe/trunk/docs/ClangFormat.rst

Modified: cfe/trunk/docs/ClangFormat.rst
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/ClangFormat.rst?rev=250672=250671=250672=diff
==
--- cfe/trunk/docs/ClangFormat.rst (original)
+++ cfe/trunk/docs/ClangFormat.rst Sun Oct 18 20:08:30 2015
@@ -16,7 +16,7 @@ to format C/C++/Obj-C code.
 .. code-block:: console
 
   $ clang-format -help
-  OVERVIEW: A tool to format C/C++/Obj-C code.
+  OVERVIEW: A tool to format C/C++/Java/JavaScript/Objective-C/Protobuf code.
 
   If no arguments are specified, it formats the code from standard input
   and writes the result to the standard output.
@@ -30,44 +30,53 @@ to format C/C++/Obj-C code.
 
   Clang-format options:
 
--cursor=   - The position of the cursor when invoking
-   clang-format from an editor integration
--dump-config - Dump configuration options to stdout and exit.
-   Can be used with -style option.
--i   - Inplace edit s, if specified.
--length=   - Format a range of this length (in bytes).
-   Multiple ranges can be formatted by specifying
-   several -offset and -length pairs.
-   When only a single -offset is specified without
-   -length, clang-format will format up to the end
-   of the file.
-   Can only be used with one input file.
--lines=  - : - format a range of
-   lines (both 1-based).
-   Multiple ranges can be formatted by specifying
-   several -lines arguments.
-   Can't be used with -offset and -length.
-   Can only be used with one input file.
--offset=   - Format a range starting at this byte offset.
-   Multiple ranges can be formatted by specifying
-   several -offset and -length pairs.
-   Can only be used with one input file.
--output-replacements-xml - Output replacements as XML.
--style=  - Coding style, currently supports:
- LLVM, Google, Chromium, Mozilla, WebKit.
-   Use -style=file to load style configuration from
-   .clang-format file located in one of the parent
-   directories of the source file (or current
-   directory for stdin).
-   Use -style="{key: value, ...}" to set specific
-   parameters, e.g.:
- -style="{BasedOnStyle: llvm, IndentWidth: 8}"
-
-  General options:
-
--help- Display available options (-help-hidden for 
more)
--help-list   - Display list of available options 
(-help-list-hidden for more)
--version - Display the version of this program
+-assume-filename= - When reading from stdin, clang-format assumes 
this
+filename to look for a style config file (with
+-style=file) and to determine the language.
+-cursor=- The position of the cursor when invoking
+clang-format from an editor integration
+-dump-config  - Dump configuration options to stdout and exit.
+Can be used with -style option.
+-fallback-style=  - The name of the predefined style used as a
+fallback in case clang-format is invoked with
+-style=file, but can not find the .clang-format
+file to use.
+Use -fallback-style=none to skip formatting.
+-i- Inplace edit s, if specified.
+-length=- Format a range of this length (in bytes).
+Multiple ranges can be formatted by specifying
+several -offset and -length pairs.
+When only a single -offset is specified without
+

r250677 - Revert r250676 "Return an ArrayRef instead of having two out parameters of a pointer and length. NFC"

2015-10-18 Thread Craig Topper via cfe-commits
Author: ctopper
Date: Sun Oct 18 22:17:00 2015
New Revision: 250677

URL: http://llvm.org/viewvc/llvm-project?rev=250677=rev
Log:
Revert r250676 "Return an ArrayRef instead of having two out parameters of a 
pointer and length. NFC"

Modified:
cfe/trunk/include/clang/Basic/TargetInfo.h
cfe/trunk/lib/Basic/TargetInfo.cpp
cfe/trunk/lib/Basic/Targets.cpp

Modified: cfe/trunk/include/clang/Basic/TargetInfo.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/TargetInfo.h?rev=250677=250676=250677=diff
==
--- cfe/trunk/include/clang/Basic/TargetInfo.h (original)
+++ cfe/trunk/include/clang/Basic/TargetInfo.h Sun Oct 18 22:17:00 2015
@@ -930,10 +930,14 @@ protected:
   virtual enum IntType getPtrDiffTypeV(unsigned AddrSpace) const {
 return PtrDiffType;
   }
-  virtual ArrayRef getGCCRegNames() const = 0;
-  virtual ArrayRef getGCCRegAliases() const = 0;
-  virtual ArrayRef getGCCAddlRegNames() const {
-return None;
+  virtual void getGCCRegNames(const char * const *,
+  unsigned ) const = 0;
+  virtual void getGCCRegAliases(const GCCRegAlias *,
+unsigned ) const = 0;
+  virtual void getGCCAddlRegNames(const AddlRegName *,
+  unsigned ) const {
+Addl = nullptr;
+NumAddl = 0;
   }
 };
 

Modified: cfe/trunk/lib/Basic/TargetInfo.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/TargetInfo.cpp?rev=250677=250676=250677=diff
==
--- cfe/trunk/lib/Basic/TargetInfo.cpp (original)
+++ cfe/trunk/lib/Basic/TargetInfo.cpp Sun Oct 18 22:17:00 2015
@@ -349,41 +349,49 @@ bool TargetInfo::isValidGCCRegisterName(
   if (Name.empty())
 return false;
 
+  const char * const *Names;
+  unsigned NumNames;
+
   // Get rid of any register prefix.
   Name = removeGCCRegisterPrefix(Name);
   if (Name.empty())
   return false;
 
-  ArrayRef Names = getGCCRegNames();
+  getGCCRegNames(Names, NumNames);
 
   // If we have a number it maps to an entry in the register name array.
   if (isDigit(Name[0])) {
 int n;
 if (!Name.getAsInteger(0, n))
-  return n >= 0 && (unsigned)n < Names.size();
+  return n >= 0 && (unsigned)n < NumNames;
   }
 
   // Check register names.
-  for (unsigned i = 0; i < Names.size(); i++) {
+  for (unsigned i = 0; i < NumNames; i++) {
 if (Name == Names[i])
   return true;
   }
 
   // Check any additional names that we have.
-  ArrayRef AddlNames = getGCCAddlRegNames();
-  for (unsigned i = 0; i < AddlNames.size(); i++)
+  const AddlRegName *AddlNames;
+  unsigned NumAddlNames;
+  getGCCAddlRegNames(AddlNames, NumAddlNames);
+  for (unsigned i = 0; i < NumAddlNames; i++)
 for (unsigned j = 0; j < llvm::array_lengthof(AddlNames[i].Names); j++) {
   if (!AddlNames[i].Names[j])
 break;
   // Make sure the register that the additional name is for is within
   // the bounds of the register names from above.
-  if (AddlNames[i].Names[j] == Name && AddlNames[i].RegNum < Names.size())
+  if (AddlNames[i].Names[j] == Name && AddlNames[i].RegNum < NumNames)
 return true;
   }
 
   // Now check aliases.
-  ArrayRef Aliases = getGCCRegAliases();
-  for (unsigned i = 0; i < Aliases.size(); i++) {
+  const GCCRegAlias *Aliases;
+  unsigned NumAliases;
+
+  getGCCRegAliases(Aliases, NumAliases);
+  for (unsigned i = 0; i < NumAliases; i++) {
 for (unsigned j = 0 ; j < llvm::array_lengthof(Aliases[i].Aliases); j++) {
   if (!Aliases[i].Aliases[j])
 break;
@@ -402,33 +410,41 @@ TargetInfo::getNormalizedGCCRegisterName
   // Get rid of any register prefix.
   Name = removeGCCRegisterPrefix(Name);
 
-  ArrayRef Names = getGCCRegNames();
+  const char * const *Names;
+  unsigned NumNames;
+
+  getGCCRegNames(Names, NumNames);
 
   // First, check if we have a number.
   if (isDigit(Name[0])) {
 int n;
 if (!Name.getAsInteger(0, n)) {
-  assert(n >= 0 && (unsigned)n < Names.size() &&
+  assert(n >= 0 && (unsigned)n < NumNames &&
  "Out of bounds register number!");
   return Names[n];
 }
   }
 
   // Check any additional names that we have.
-  ArrayRef AddlNames = getGCCAddlRegNames();
-  for (unsigned i = 0; i < AddlNames.size(); i++)
+  const AddlRegName *AddlNames;
+  unsigned NumAddlNames;
+  getGCCAddlRegNames(AddlNames, NumAddlNames);
+  for (unsigned i = 0; i < NumAddlNames; i++)
 for (unsigned j = 0; j < llvm::array_lengthof(AddlNames[i].Names); j++) {
   if (!AddlNames[i].Names[j])
 break;
   // Make sure the register that the additional name is for is within
   // the bounds of the register names from above.
-  if (AddlNames[i].Names[j] == Name && AddlNames[i].RegNum < Names.size())
+  if (AddlNames[i].Names[j] == Name && AddlNames[i].RegNum < NumNames)
 return 

r250674 - docs: remote stale refs

2015-10-18 Thread Saleem Abdulrasool via cfe-commits
Author: compnerd
Date: Sun Oct 18 20:24:08 2015
New Revision: 250674

URL: http://llvm.org/viewvc/llvm-project?rev=250674=rev
Log:
docs: remote stale refs

Since the attribute documentation is now auto-generated, the previous references
are no longer valid.  This prevented the docs build from completing
successfully.

Modified:
cfe/trunk/docs/AddressSanitizer.rst
cfe/trunk/docs/MemorySanitizer.rst
cfe/trunk/docs/ThreadSanitizer.rst

Modified: cfe/trunk/docs/AddressSanitizer.rst
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/AddressSanitizer.rst?rev=250674=250673=250674=diff
==
--- cfe/trunk/docs/AddressSanitizer.rst (original)
+++ cfe/trunk/docs/AddressSanitizer.rst Sun Oct 18 20:24:08 2015
@@ -196,12 +196,11 @@ Disabling Instrumentation with ``__attri
 --
 
 Some code should not be instrumented by AddressSanitizer. One may use the
-function attribute ``__attribute__((no_sanitize("address")))``
-(which has deprecated synonyms
-:ref:`no_sanitize_address ` and
-`no_address_safety_analysis`) to disable instrumentation of a particular
-function. This attribute may not be supported by other compilers, so we suggest
-to use it together with ``__has_feature(address_sanitizer)``.
+function attribute ``__attribute__((no_sanitize("address")))`` (which has
+deprecated synonyms `no_sanitize_address` and `no_address_safety_analysis`) to
+disable instrumentation of a particular function. This attribute may not be
+supported by other compilers, so we suggest to use it together with
+``__has_feature(address_sanitizer)``.
 
 Suppressing Errors in Recompiled Code (Blacklist)
 -

Modified: cfe/trunk/docs/MemorySanitizer.rst
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/MemorySanitizer.rst?rev=250674=250673=250674=diff
==
--- cfe/trunk/docs/MemorySanitizer.rst (original)
+++ cfe/trunk/docs/MemorySanitizer.rst Sun Oct 18 20:24:08 2015
@@ -80,14 +80,11 @@ whether MemorySanitizer is enabled. :ref
 ``__attribute__((no_sanitize_memory))``
 ---
 
-Some code should not be checked by MemorySanitizer.
-One may use the function attribute
-:ref:`no_sanitize_memory `
-to disable uninitialized checks in a particular function.
-MemorySanitizer may still instrument such functions to avoid false positives.
-This attribute may not be
-supported by other compilers, so we suggest to use it together with
-``__has_feature(memory_sanitizer)``.
+Some code should not be checked by MemorySanitizer.  One may use the function
+attribute `no_sanitize_memory` to disable uninitialized checks in a particular
+function.  MemorySanitizer may still instrument such functions to avoid false
+positives.  This attribute may not be supported by other compilers, so we
+suggest to use it together with ``__has_feature(memory_sanitizer)``.
 
 Blacklist
 -

Modified: cfe/trunk/docs/ThreadSanitizer.rst
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/ThreadSanitizer.rst?rev=250674=250673=250674=diff
==
--- cfe/trunk/docs/ThreadSanitizer.rst (original)
+++ cfe/trunk/docs/ThreadSanitizer.rst Sun Oct 18 20:24:08 2015
@@ -86,25 +86,22 @@ this purpose.
 ``__attribute__((no_sanitize_thread))``
 ---
 
-Some code should not be instrumented by ThreadSanitizer.
-One may use the function attribute
-:ref:`no_sanitize_thread `
-to disable instrumentation of plain (non-atomic) loads/stores in a particular 
function.
-ThreadSanitizer still instruments such functions to avoid false positives and
-provide meaningful stack traces.
-This attribute may not be
-supported by other compilers, so we suggest to use it together with
-``__has_feature(thread_sanitizer)``.
+Some code should not be instrumented by ThreadSanitizer.  One may use the
+function attribute `no_sanitize_thread` to disable instrumentation of plain
+(non-atomic) loads/stores in a particular function.  ThreadSanitizer still
+instruments such functions to avoid false positives and provide meaningful 
stack
+traces.  This attribute may not be supported by other compilers, so we suggest
+to use it together with ``__has_feature(thread_sanitizer)``.
 
 Blacklist
 -
 
 ThreadSanitizer supports ``src`` and ``fun`` entity types in
-:doc:`SanitizerSpecialCaseList`, that can be used to suppress data race 
reports in
-the specified source files or functions. Unlike functions marked with
-:ref:`no_sanitize_thread ` attribute,
-blacklisted functions are not instrumented at all. This can lead to false 
positives
-due to missed synchronization via atomic operations and missed stack frames in 
reports.
+:doc:`SanitizerSpecialCaseList`, that can be used to 

r250676 - Return an ArrayRef instead of having two out parameters of a pointer and length. NFC

2015-10-18 Thread Craig Topper via cfe-commits
Author: ctopper
Date: Sun Oct 18 22:05:12 2015
New Revision: 250676

URL: http://llvm.org/viewvc/llvm-project?rev=250676=rev
Log:
Return an ArrayRef instead of having two out parameters of a pointer and 
length. NFC

Modified:
cfe/trunk/include/clang/Basic/TargetInfo.h
cfe/trunk/lib/Basic/TargetInfo.cpp
cfe/trunk/lib/Basic/Targets.cpp

Modified: cfe/trunk/include/clang/Basic/TargetInfo.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/TargetInfo.h?rev=250676=250675=250676=diff
==
--- cfe/trunk/include/clang/Basic/TargetInfo.h (original)
+++ cfe/trunk/include/clang/Basic/TargetInfo.h Sun Oct 18 22:05:12 2015
@@ -930,14 +930,10 @@ protected:
   virtual enum IntType getPtrDiffTypeV(unsigned AddrSpace) const {
 return PtrDiffType;
   }
-  virtual void getGCCRegNames(const char * const *,
-  unsigned ) const = 0;
-  virtual void getGCCRegAliases(const GCCRegAlias *,
-unsigned ) const = 0;
-  virtual void getGCCAddlRegNames(const AddlRegName *,
-  unsigned ) const {
-Addl = nullptr;
-NumAddl = 0;
+  virtual ArrayRef getGCCRegNames() const = 0;
+  virtual ArrayRef getGCCRegAliases() const = 0;
+  virtual ArrayRef getGCCAddlRegNames() const {
+return None;
   }
 };
 

Modified: cfe/trunk/lib/Basic/TargetInfo.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/TargetInfo.cpp?rev=250676=250675=250676=diff
==
--- cfe/trunk/lib/Basic/TargetInfo.cpp (original)
+++ cfe/trunk/lib/Basic/TargetInfo.cpp Sun Oct 18 22:05:12 2015
@@ -349,49 +349,41 @@ bool TargetInfo::isValidGCCRegisterName(
   if (Name.empty())
 return false;
 
-  const char * const *Names;
-  unsigned NumNames;
-
   // Get rid of any register prefix.
   Name = removeGCCRegisterPrefix(Name);
   if (Name.empty())
   return false;
 
-  getGCCRegNames(Names, NumNames);
+  ArrayRef Names = getGCCRegNames();
 
   // If we have a number it maps to an entry in the register name array.
   if (isDigit(Name[0])) {
 int n;
 if (!Name.getAsInteger(0, n))
-  return n >= 0 && (unsigned)n < NumNames;
+  return n >= 0 && (unsigned)n < Names.size();
   }
 
   // Check register names.
-  for (unsigned i = 0; i < NumNames; i++) {
+  for (unsigned i = 0; i < Names.size(); i++) {
 if (Name == Names[i])
   return true;
   }
 
   // Check any additional names that we have.
-  const AddlRegName *AddlNames;
-  unsigned NumAddlNames;
-  getGCCAddlRegNames(AddlNames, NumAddlNames);
-  for (unsigned i = 0; i < NumAddlNames; i++)
+  ArrayRef AddlNames = getGCCAddlRegNames();
+  for (unsigned i = 0; i < AddlNames.size(); i++)
 for (unsigned j = 0; j < llvm::array_lengthof(AddlNames[i].Names); j++) {
   if (!AddlNames[i].Names[j])
 break;
   // Make sure the register that the additional name is for is within
   // the bounds of the register names from above.
-  if (AddlNames[i].Names[j] == Name && AddlNames[i].RegNum < NumNames)
+  if (AddlNames[i].Names[j] == Name && AddlNames[i].RegNum < Names.size())
 return true;
   }
 
   // Now check aliases.
-  const GCCRegAlias *Aliases;
-  unsigned NumAliases;
-
-  getGCCRegAliases(Aliases, NumAliases);
-  for (unsigned i = 0; i < NumAliases; i++) {
+  ArrayRef Aliases = getGCCRegAliases();
+  for (unsigned i = 0; i < Aliases.size(); i++) {
 for (unsigned j = 0 ; j < llvm::array_lengthof(Aliases[i].Aliases); j++) {
   if (!Aliases[i].Aliases[j])
 break;
@@ -410,41 +402,33 @@ TargetInfo::getNormalizedGCCRegisterName
   // Get rid of any register prefix.
   Name = removeGCCRegisterPrefix(Name);
 
-  const char * const *Names;
-  unsigned NumNames;
-
-  getGCCRegNames(Names, NumNames);
+  ArrayRef Names = getGCCRegNames();
 
   // First, check if we have a number.
   if (isDigit(Name[0])) {
 int n;
 if (!Name.getAsInteger(0, n)) {
-  assert(n >= 0 && (unsigned)n < NumNames &&
+  assert(n >= 0 && (unsigned)n < Names.size() &&
  "Out of bounds register number!");
   return Names[n];
 }
   }
 
   // Check any additional names that we have.
-  const AddlRegName *AddlNames;
-  unsigned NumAddlNames;
-  getGCCAddlRegNames(AddlNames, NumAddlNames);
-  for (unsigned i = 0; i < NumAddlNames; i++)
+  ArrayRef AddlNames = getGCCAddlRegNames();
+  for (unsigned i = 0; i < AddlNames.size(); i++)
 for (unsigned j = 0; j < llvm::array_lengthof(AddlNames[i].Names); j++) {
   if (!AddlNames[i].Names[j])
 break;
   // Make sure the register that the additional name is for is within
   // the bounds of the register names from above.
-  if (AddlNames[i].Names[j] == Name && AddlNames[i].RegNum < NumNames)
+  if (AddlNames[i].Names[j] == Name && AddlNames[i].RegNum < Names.size())
 return Name;
 }
 
  

[PATCH] D13854: Template class: emit better diagnostic in case of missing template argument list

2015-10-18 Thread Davide Italiano via cfe-commits
davide created this revision.
davide added a reviewer: rsmith.
davide added a subscriber: cfe-commits.
davide set the repository for this revision to rL LLVM.

Richard, this implements what you proposed in 
https://llvm.org/bugs/show_bug.cgi?id=25223 , hopefully in the correct way.
This is what we emit now:

template.cpp:7:3: error: missing template argument list for class template 'X'
T X::foo(void)
  ^
  X
template.cpp:2:7: note: 'X' declared here
class X {
  ^
1 error generated.


I will tackle the case where we emit a terrible diagnostic for ambigous lookup 
separately.



Repository:
  rL LLVM

http://reviews.llvm.org/D13854

Files:
  include/clang/Basic/DiagnosticSemaKinds.td
  lib/Sema/SemaCXXScopeSpec.cpp
  test/SemaTemplate/temp_arg_lookup.cpp

Index: test/SemaTemplate/temp_arg_lookup.cpp
===
--- test/SemaTemplate/temp_arg_lookup.cpp
+++ test/SemaTemplate/temp_arg_lookup.cpp
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+template
+class X { // expected-note{{declared here}}
+  T foo(void);
+};
+
+template
+T X::foo(void)  // expected-error{{missing template argument list for class 
template}}}
+{
+  return 0;
+}
Index: lib/Sema/SemaCXXScopeSpec.cpp
===
--- lib/Sema/SemaCXXScopeSpec.cpp
+++ lib/Sema/SemaCXXScopeSpec.cpp
@@ -771,9 +771,29 @@
   }
 
   if (!Found.empty()) {
-if (TypeDecl *TD = Found.getAsSingle())
+if (ClassTemplateDecl *CTD = Found.getAsSingle()) {
+  TemplateParameterList *TPL = CTD->getTemplateParameters();
+  assert(TPL && "NULL template parameter list");
+  std::string FixString = Identifier.getName();
+  FixString += "<";
+  bool FirstArg = true;
+  for (NamedDecl *TemplArg : *TPL) {
+if (FirstArg)
+  FirstArg = false;
+else
+  FixString += ", ";
+FixString += TemplArg->getName();
+  }
+  FixString += ">";
+  Diag(IdentifierLoc, diag::err_missing_argument_list) << 
+  << FixItHint::CreateReplacement(IdentifierLoc, FixString);
+  if (NamedDecl *ND = Found.getAsSingle())
+Diag(ND->getLocation(), diag::note_entity_declared_at) << 
+}
+else if (TypeDecl *TD = Found.getAsSingle()) {
   Diag(IdentifierLoc, diag::err_expected_class_or_namespace)
   << QualType(TD->getTypeForDecl(), 0) << getLangOpts().CPlusPlus;
+}
 else {
   Diag(IdentifierLoc, diag::err_expected_class_or_namespace)
   <<  << getLangOpts().CPlusPlus;
Index: include/clang/Basic/DiagnosticSemaKinds.td
===
--- include/clang/Basic/DiagnosticSemaKinds.td
+++ include/clang/Basic/DiagnosticSemaKinds.td
@@ -5831,6 +5831,8 @@
   
 def err_expected_class_or_namespace : Error<"%0 is not a class"
   "%select{ or namespace|, namespace, or enumeration}1">;
+def err_missing_argument_list : Error<"missing template argument list for "
+  "class template %0">;
 def err_invalid_declarator_scope : Error<"cannot define or redeclare %0 here "
   "because namespace %1 does not enclose namespace %2">;
 def err_invalid_declarator_global_scope : Error<


Index: test/SemaTemplate/temp_arg_lookup.cpp
===
--- test/SemaTemplate/temp_arg_lookup.cpp
+++ test/SemaTemplate/temp_arg_lookup.cpp
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+template
+class X { // expected-note{{declared here}}
+  T foo(void);
+};
+
+template
+T X::foo(void)  // expected-error{{missing template argument list for class template}}}
+{
+  return 0;
+}
Index: lib/Sema/SemaCXXScopeSpec.cpp
===
--- lib/Sema/SemaCXXScopeSpec.cpp
+++ lib/Sema/SemaCXXScopeSpec.cpp
@@ -771,9 +771,29 @@
   }
 
   if (!Found.empty()) {
-if (TypeDecl *TD = Found.getAsSingle())
+if (ClassTemplateDecl *CTD = Found.getAsSingle()) {
+  TemplateParameterList *TPL = CTD->getTemplateParameters();
+  assert(TPL && "NULL template parameter list");
+  std::string FixString = Identifier.getName();
+  FixString += "<";
+  bool FirstArg = true;
+  for (NamedDecl *TemplArg : *TPL) {
+if (FirstArg)
+  FirstArg = false;
+else
+  FixString += ", ";
+FixString += TemplArg->getName();
+  }
+  FixString += ">";
+  Diag(IdentifierLoc, diag::err_missing_argument_list) << 
+  << FixItHint::CreateReplacement(IdentifierLoc, FixString);
+  if (NamedDecl *ND = Found.getAsSingle())
+Diag(ND->getLocation(), diag::note_entity_declared_at) << 
+}
+else if (TypeDecl *TD = Found.getAsSingle()) {
   Diag(IdentifierLoc, diag::err_expected_class_or_namespace)
   << QualType(TD->getTypeForDecl(), 0) << getLangOpts().CPlusPlus;
+}
 else {
   Diag(IdentifierLoc, diag::err_expected_class_or_namespace)
   

Re: [PATCH] D7639: Add readability-redundant-void-arg check to clang-tidy

2015-10-18 Thread Richard via cfe-commits
LegalizeAdulthood added a comment.

In http://reviews.llvm.org/D7639#266332, @Eugene.Zelenko wrote:

> What is preventing to add this check to Clang-tidy? Just found another piece 
> of fresh C++ code in LLDB with (void) as argument list...


To be honest, I don't know.  This review had taken SO long to get 
approved.  At this point, the code is correct and I'd really like to get it 
committed and available for use instead of fussing with it any longer.


http://reviews.llvm.org/D7639



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


r250681 - Make getTargetBuiltins return an ArrayRef instead of having two out parameters of a pointer and length. NFC

2015-10-18 Thread Craig Topper via cfe-commits
Author: ctopper
Date: Sun Oct 18 23:51:35 2015
New Revision: 250681

URL: http://llvm.org/viewvc/llvm-project?rev=250681=rev
Log:
Make getTargetBuiltins return an ArrayRef instead of having two out parameters 
of a pointer and length. NFC

Modified:
cfe/trunk/include/clang/Basic/Builtins.h
cfe/trunk/include/clang/Basic/TargetInfo.h
cfe/trunk/lib/Basic/Builtins.cpp
cfe/trunk/lib/Basic/Targets.cpp

Modified: cfe/trunk/include/clang/Basic/Builtins.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Builtins.h?rev=250681=250680=250681=diff
==
--- cfe/trunk/include/clang/Basic/Builtins.h (original)
+++ cfe/trunk/include/clang/Basic/Builtins.h Sun Oct 18 23:51:35 2015
@@ -16,6 +16,7 @@
 #ifndef LLVM_CLANG_BASIC_BUILTINS_H
 #define LLVM_CLANG_BASIC_BUILTINS_H
 
+#include "llvm/ADT/ArrayRef.h"
 #include 
 
 // VC++ defines 'alloca' as an object-like macro, which interferes with our
@@ -58,16 +59,14 @@ struct Info {
 /// target-specific builtins, allowing easy queries by clients.
 ///
 /// Builtins from an optional auxiliary target are stored in
-/// AuxTSRecords. Their IDs are shifted up by NumTSRecords and need to
+/// AuxTSRecords. Their IDs are shifted up by TSRecords.size() and need to
 /// be translated back with getAuxBuiltinID() before use.
 class Context {
-  const Info *TSRecords;
-  const Info *AuxTSRecords;
-  unsigned NumTSRecords;
-  unsigned NumAuxTSRecords;
+  llvm::ArrayRef TSRecords;
+  llvm::ArrayRef AuxTSRecords;
 
 public:
-  Context();
+  Context() {}
 
   /// \brief Perform target-specific initialization
   /// \param AuxTarget Target info to incorporate builtins from. May be 
nullptr.
@@ -186,12 +185,12 @@ public:
 
   /// \brief Return true if builtin ID belongs to AuxTarget.
   bool isAuxBuiltinID(unsigned ID) const {
-return ID >= (Builtin::FirstTSBuiltin + NumTSRecords);
+return ID >= (Builtin::FirstTSBuiltin + TSRecords.size());
   }
 
   /// Return real buitin ID (i.e. ID it would have furing compilation
   /// for AuxTarget).
-  unsigned getAuxBuiltinID(unsigned ID) const { return ID - NumTSRecords; }
+  unsigned getAuxBuiltinID(unsigned ID) const { return ID - TSRecords.size(); }
 
 private:
   const Info (unsigned ID) const;

Modified: cfe/trunk/include/clang/Basic/TargetInfo.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/TargetInfo.h?rev=250681=250680=250681=diff
==
--- cfe/trunk/include/clang/Basic/TargetInfo.h (original)
+++ cfe/trunk/include/clang/Basic/TargetInfo.h Sun Oct 18 23:51:35 2015
@@ -516,8 +516,7 @@ public:
   /// Return information about target-specific builtins for
   /// the current primary target, and info about which builtins are 
non-portable
   /// across the current set of primary and secondary targets.
-  virtual void getTargetBuiltins(const Builtin::Info *,
- unsigned ) const = 0;
+  virtual ArrayRef getTargetBuiltins() const = 0;
 
   /// The __builtin_clz* and __builtin_ctz* built-in
   /// functions are specified to have undefined results for zero inputs, but

Modified: cfe/trunk/lib/Basic/Builtins.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Builtins.cpp?rev=250681=250680=250681=diff
==
--- cfe/trunk/lib/Basic/Builtins.cpp (original)
+++ cfe/trunk/lib/Basic/Builtins.cpp Sun Oct 18 23:51:35 2015
@@ -32,27 +32,20 @@ static const Builtin::Info BuiltinInfo[]
 const Builtin::Info ::Context::getRecord(unsigned ID) const {
   if (ID < Builtin::FirstTSBuiltin)
 return BuiltinInfo[ID];
-  assert(ID - Builtin::FirstTSBuiltin < (NumTSRecords + NumAuxTSRecords) &&
+  assert(((ID - Builtin::FirstTSBuiltin) <
+  (TSRecords.size() + AuxTSRecords.size())) &&
  "Invalid builtin ID!");
   if (isAuxBuiltinID(ID))
 return AuxTSRecords[getAuxBuiltinID(ID) - Builtin::FirstTSBuiltin];
   return TSRecords[ID - Builtin::FirstTSBuiltin];
 }
 
-Builtin::Context::Context() {
-  // Get the target specific builtins from the target.
-  TSRecords = nullptr;
-  AuxTSRecords = nullptr;
-  NumTSRecords = 0;
-  NumAuxTSRecords = 0;
-}
-
 void Builtin::Context::InitializeTarget(const TargetInfo ,
 const TargetInfo *AuxTarget) {
-  assert(NumTSRecords == 0 && "Already initialized target?");
-  Target.getTargetBuiltins(TSRecords, NumTSRecords);
+  assert(TSRecords.empty() && "Already initialized target?");
+  TSRecords = Target.getTargetBuiltins();
   if (AuxTarget)
-AuxTarget->getTargetBuiltins(AuxTSRecords, NumAuxTSRecords);
+AuxTSRecords = AuxTarget->getTargetBuiltins();
 }
 
 bool Builtin::Context::builtinIsSupported(const Builtin::Info ,
@@ -82,14 +75,14 @@ void Builtin::Context::initializeBuiltin
 }
 
   // Step #2: Register target-specific builtins.
-  for 

Re: [PATCH] D7639: Add readability-redundant-void-arg check to clang-tidy

2015-10-18 Thread Richard via cfe-commits
LegalizeAdulthood updated this revision to Diff 37717.

http://reviews.llvm.org/D7639

Files:
  clang-tidy/readability/CMakeLists.txt
  clang-tidy/readability/ReadabilityTidyModule.cpp
  clang-tidy/readability/RedundantVoidArgCheck.cpp
  clang-tidy/readability/RedundantVoidArgCheck.h
  test/clang-tidy/readability-redundant-void-arg.c
  test/clang-tidy/readability-redundant-void-arg.cpp

Index: test/clang-tidy/readability-redundant-void-arg.cpp
===
--- /dev/null
+++ test/clang-tidy/readability-redundant-void-arg.cpp
@@ -0,0 +1,419 @@
+// RUN: %python %S/check_clang_tidy.py %s readability-redundant-void-arg %t
+
+#include 
+
+int foo();
+
+void bar();
+
+void bar2();
+
+extern "C" void ecfoo(void);
+
+extern "C" void ecfoo(void) {
+}
+
+extern int i;
+
+int j = 1;
+
+int foo(void) {
+// CHECK-MESSAGES: :[[@LINE-1]]:9: warning: redundant void argument list in function definition [readability-redundant-void-arg]
+// CHECK-FIXES: {{^}}int foo() {{{$}}
+return 0;
+}
+
+typedef unsigned int my_uint;
+
+typedef void my_void;
+
+// A function taking void and returning a pointer to function taking void
+// and returning int.
+int (*returns_fn_void_int(void))(void);
+// CHECK-MESSAGES: :[[@LINE-1]]:27: warning: {{.*}} in function declaration
+// CHECK-MESSAGES: :[[@LINE-2]]:34: warning: {{.*}} in function declaration
+// CHECK-FIXES: {{^}}int (*returns_fn_void_int())();{{$}}
+
+typedef int (*returns_fn_void_int_t(void))(void);
+// CHECK-MESSAGES: :[[@LINE-1]]:37: warning: {{.*}} in typedef
+// CHECK-MESSAGES: :[[@LINE-2]]:44: warning: {{.*}} in typedef
+// CHECK-FIXES: {{^}}typedef int (*returns_fn_void_int_t())();{{$}}
+
+int (*returns_fn_void_int(void))(void) {
+// CHECK-MESSAGES: :[[@LINE-1]]:27: warning: {{.*}} in function definition
+// CHECK-MESSAGES: :[[@LINE-2]]:34: warning: {{.*}} in function definition
+// CHECK-FIXES: {{^}}int (*returns_fn_void_int())() {{{$}}
+  return nullptr;
+}
+
+// A function taking void and returning a pointer to a function taking void
+// and returning a pointer to a function taking void and returning void.
+void (*(*returns_fn_returns_fn_void_void(void))(void))(void);
+// CHECK-MESSAGES: :[[@LINE-1]]:42: warning: {{.*}} in function declaration
+// CHECK-MESSAGES: :[[@LINE-2]]:49: warning: {{.*}} in function declaration
+// CHECK-MESSAGES: :[[@LINE-3]]:56: warning: {{.*}} in function declaration
+// CHECK-FIXES: {{^}}void (*(*returns_fn_returns_fn_void_void())())();{{$}}
+
+typedef void (*(*returns_fn_returns_fn_void_void_t(void))(void))(void);
+// CHECK-MESSAGES: :[[@LINE-1]]:52: warning: {{.*}} in typedef
+// CHECK-MESSAGES: :[[@LINE-2]]:59: warning: {{.*}} in typedef
+// CHECK-MESSAGES: :[[@LINE-3]]:66: warning: {{.*}} in typedef
+// CHECK-FIXES: {{^}}typedef void (*(*returns_fn_returns_fn_void_void_t())())();{{$}}
+
+void (*(*returns_fn_returns_fn_void_void(void))(void))(void) {
+// CHECK-MESSAGES: :[[@LINE-1]]:42: warning: {{.*}} in function definition
+// CHECK-MESSAGES: :[[@LINE-2]]:49: warning: {{.*}} in function definition
+// CHECK-MESSAGES: :[[@LINE-3]]:56: warning: {{.*}} in function definition
+// CHECK-FIXES: {{^}}void (*(*returns_fn_returns_fn_void_void())())() {{{$}}
+return nullptr;
+}
+
+void bar(void) {
+// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: {{.*}} in function definition
+// CHECK-FIXES: {{^}}void bar() {{{$}}
+}
+
+void op_fn(int i) {
+}
+
+class gronk {
+public:
+  gronk();
+  ~gronk();
+
+void foo();
+void bar();
+void bar2
+();
+void operation(int i) { }
+
+private:
+int m_i;
+int *m_pi;
+float m_f;
+float *m_pf;
+double m_d;
+double *m_pd;
+
+void (*f1)(void);
+// CHECK-MESSAGES: :[[@LINE-1]]:16: warning: {{.*}} in field declaration
+// CHECK-FIXES: {{^}}void (*f1)();{{$}}
+
+  void (*op)(int i);
+
+  void (gronk::*p1)(void);
+  // CHECK-MESSAGES: :[[@LINE-1]]:21: warning: {{.*}} in field declaration
+  // CHECK-FIXES: {{^  }}void (gronk::*p1)();{{$}}
+
+  int (gronk::*p_mi);
+
+  void (gronk::*p2)(int);
+
+  void (*(*returns_fn_returns_fn_void_void(void))(void))(void);
+  // CHECK-MESSAGES: :[[@LINE-1]]:44: warning: {{.*}} in function declaration
+  // CHECK-MESSAGES: :[[@LINE-2]]:51: warning: {{.*}} in function declaration
+  // CHECK-MESSAGES: :[[@LINE-3]]:58: warning: {{.*}} in function declaration
+  // CHECK-FIXES: {{^}}  void (*(*returns_fn_returns_fn_void_void())())();{{$}}
+
+  void (*(*(gronk::*returns_fn_returns_fn_void_void_mem)(void))(void))(void);
+  // CHECK-MESSAGES: :[[@LINE-1]]:58: warning: {{.*}} in field declaration
+  // CHECK-MESSAGES: :[[@LINE-2]]:65: warning: {{.*}} in field declaration
+  // CHECK-MESSAGES: :[[@LINE-3]]:72: warning: {{.*}} in field declaration
+  // CHECK-FIXES: {{^}}  void (*(*(gronk::*returns_fn_returns_fn_void_void_mem)())())();{{$}}
+};
+
+int i;
+int *pi;
+void *pv = (void *) pi;
+float f;
+float *fi;
+double d;
+double *pd;
+
+void (*f1)(void);
+// CHECK-MESSAGES: 

Re: [PATCH] D13643: [Sema] Warn on ternary comparison

2015-10-18 Thread Matěj Grabovský via cfe-commits
mgrabovsky added a comment.

In http://reviews.llvm.org/D13643#266926, @aaron.ballman wrote:

> I would spend some time digging into how GCC handles those cases, and use 
> that as a baseline that we can then improve upon. I like the fact that GCC 
> basically says "use parens to clarify your intent", as that solves all of the 
> cases regarding equality and inequality.
>
> I would imagine type == type == bool should behave the same as bool == bool 
> == bool; it can be valid code that just needs parens to clarify intent. As 
> for C90 behavior, I'm not too worried about what we do there.


I'm back. The warning is emitted in `gcc/c-family/c-common.c` L11488–11503; GCC 
only does this for what LLVM calls 'relational' operators (i.e., comparisons 
except == and !=) and for integral types.


http://reviews.llvm.org/D13643



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


r250678 - Recommit "Return an ArrayRef instead of having two out parameters of a pointer and length. NFC". Hopefully this time the bots will be happy.

2015-10-18 Thread Craig Topper via cfe-commits
Author: ctopper
Date: Sun Oct 18 22:52:27 2015
New Revision: 250678

URL: http://llvm.org/viewvc/llvm-project?rev=250678=rev
Log:
Recommit "Return an ArrayRef instead of having two out parameters of a pointer 
and length. NFC". Hopefully this time the bots will be happy.

Modified:
cfe/trunk/include/clang/Basic/TargetInfo.h
cfe/trunk/lib/Basic/TargetInfo.cpp
cfe/trunk/lib/Basic/Targets.cpp

Modified: cfe/trunk/include/clang/Basic/TargetInfo.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/TargetInfo.h?rev=250678=250677=250678=diff
==
--- cfe/trunk/include/clang/Basic/TargetInfo.h (original)
+++ cfe/trunk/include/clang/Basic/TargetInfo.h Sun Oct 18 22:52:27 2015
@@ -930,14 +930,10 @@ protected:
   virtual enum IntType getPtrDiffTypeV(unsigned AddrSpace) const {
 return PtrDiffType;
   }
-  virtual void getGCCRegNames(const char * const *,
-  unsigned ) const = 0;
-  virtual void getGCCRegAliases(const GCCRegAlias *,
-unsigned ) const = 0;
-  virtual void getGCCAddlRegNames(const AddlRegName *,
-  unsigned ) const {
-Addl = nullptr;
-NumAddl = 0;
+  virtual ArrayRef getGCCRegNames() const = 0;
+  virtual ArrayRef getGCCRegAliases() const = 0;
+  virtual ArrayRef getGCCAddlRegNames() const {
+return None;
   }
 };
 

Modified: cfe/trunk/lib/Basic/TargetInfo.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/TargetInfo.cpp?rev=250678=250677=250678=diff
==
--- cfe/trunk/lib/Basic/TargetInfo.cpp (original)
+++ cfe/trunk/lib/Basic/TargetInfo.cpp Sun Oct 18 22:52:27 2015
@@ -349,49 +349,41 @@ bool TargetInfo::isValidGCCRegisterName(
   if (Name.empty())
 return false;
 
-  const char * const *Names;
-  unsigned NumNames;
-
   // Get rid of any register prefix.
   Name = removeGCCRegisterPrefix(Name);
   if (Name.empty())
   return false;
 
-  getGCCRegNames(Names, NumNames);
+  ArrayRef Names = getGCCRegNames();
 
   // If we have a number it maps to an entry in the register name array.
   if (isDigit(Name[0])) {
 int n;
 if (!Name.getAsInteger(0, n))
-  return n >= 0 && (unsigned)n < NumNames;
+  return n >= 0 && (unsigned)n < Names.size();
   }
 
   // Check register names.
-  for (unsigned i = 0; i < NumNames; i++) {
+  for (unsigned i = 0; i < Names.size(); i++) {
 if (Name == Names[i])
   return true;
   }
 
   // Check any additional names that we have.
-  const AddlRegName *AddlNames;
-  unsigned NumAddlNames;
-  getGCCAddlRegNames(AddlNames, NumAddlNames);
-  for (unsigned i = 0; i < NumAddlNames; i++)
+  ArrayRef AddlNames = getGCCAddlRegNames();
+  for (unsigned i = 0; i < AddlNames.size(); i++)
 for (unsigned j = 0; j < llvm::array_lengthof(AddlNames[i].Names); j++) {
   if (!AddlNames[i].Names[j])
 break;
   // Make sure the register that the additional name is for is within
   // the bounds of the register names from above.
-  if (AddlNames[i].Names[j] == Name && AddlNames[i].RegNum < NumNames)
+  if (AddlNames[i].Names[j] == Name && AddlNames[i].RegNum < Names.size())
 return true;
   }
 
   // Now check aliases.
-  const GCCRegAlias *Aliases;
-  unsigned NumAliases;
-
-  getGCCRegAliases(Aliases, NumAliases);
-  for (unsigned i = 0; i < NumAliases; i++) {
+  ArrayRef Aliases = getGCCRegAliases();
+  for (unsigned i = 0; i < Aliases.size(); i++) {
 for (unsigned j = 0 ; j < llvm::array_lengthof(Aliases[i].Aliases); j++) {
   if (!Aliases[i].Aliases[j])
 break;
@@ -410,41 +402,33 @@ TargetInfo::getNormalizedGCCRegisterName
   // Get rid of any register prefix.
   Name = removeGCCRegisterPrefix(Name);
 
-  const char * const *Names;
-  unsigned NumNames;
-
-  getGCCRegNames(Names, NumNames);
+  ArrayRef Names = getGCCRegNames();
 
   // First, check if we have a number.
   if (isDigit(Name[0])) {
 int n;
 if (!Name.getAsInteger(0, n)) {
-  assert(n >= 0 && (unsigned)n < NumNames &&
+  assert(n >= 0 && (unsigned)n < Names.size() &&
  "Out of bounds register number!");
   return Names[n];
 }
   }
 
   // Check any additional names that we have.
-  const AddlRegName *AddlNames;
-  unsigned NumAddlNames;
-  getGCCAddlRegNames(AddlNames, NumAddlNames);
-  for (unsigned i = 0; i < NumAddlNames; i++)
+  ArrayRef AddlNames = getGCCAddlRegNames();
+  for (unsigned i = 0; i < AddlNames.size(); i++)
 for (unsigned j = 0; j < llvm::array_lengthof(AddlNames[i].Names); j++) {
   if (!AddlNames[i].Names[j])
 break;
   // Make sure the register that the additional name is for is within
   // the bounds of the register names from above.
-  if (AddlNames[i].Names[j] == Name && AddlNames[i].RegNum < NumNames)
+  if (AddlNames[i].Names[j] == Name && 

Re: r250671 - Update list of languages advertised in OVERVIEW: A tool to format C/C++/Java/JavaScript/Objective-C/Protobuf code.

2015-10-18 Thread Nico Weber via cfe-commits
I had committed this with

  svn commit tools/clang-format -m "Update list of languages advertised in
`clang-format -h` output."

and since I used "" and not '' the shell executed the `clang-format -h` bit
and made the commit message look funny. Apologies.

On Sun, Oct 18, 2015 at 6:03 PM, Nico Weber via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

> Author: nico
> Date: Sun Oct 18 20:03:19 2015
> New Revision: 250671
>
> URL: http://llvm.org/viewvc/llvm-project?rev=250671=rev
> Log:
> Update list of languages advertised in OVERVIEW: A tool to format
> C/C++/Java/JavaScript/Objective-C/Protobuf code.
>
> If no arguments are specified, it formats the code from standard input
> and writes the result to the standard output.
> If s are given, it reformats the files. If -i is specified
> together with s, the files are edited in-place. Otherwise, the
> result is written to the standard output.
>
> USAGE: clang-format [options] [ ...]
>
> OPTIONS:
>   -assume-filename= - When reading from stdin, clang-format
> assumes this
>   filename to look for a style config file
> (with
>   -style=file) and to determine the language.
>   -cursor=- The position of the cursor when invoking
>   clang-format from an editor integration
>   -dump-config  - Dump configuration options to stdout and
> exit.
>   Can be used with -style option.
>   -fallback-style=  - The name of the predefined style used as a
>   fallback in case clang-format is invoked with
>   -style=file, but can not find the
> .clang-format
>   file to use.
>   Use -fallback-style=none to skip formatting.
>   -help - Display available options (-help-hidden for
> more)
>   -i- Inplace edit s, if specified.
>   -length=- Format a range of this length (in bytes).
>   Multiple ranges can be formatted by
> specifying
>   several -offset and -length pairs.
>   When only a single -offset is specified
> without
>   -length, clang-format will format up to the
> end
>   of the file.
>   Can only be used with one input file.
>   -lines=   - : - format a range of
>   lines (both 1-based).
>   Multiple ranges can be formatted by
> specifying
>   several -lines arguments.
>   Can't be used with -offset and -length.
>   Can only be used with one input file.
>   -offset=- Format a range starting at this byte offset.
>   Multiple ranges can be formatted by
> specifying
>   several -offset and -length pairs.
>   Can only be used with one input file.
>   -output-replacements-xml  - Output replacements as XML.
>   -sort-includes- Sort touched include lines
>   -style=   - Coding style, currently supports:
> LLVM, Google, Chromium, Mozilla, WebKit.
>   Use -style=file to load style configuration
> from
>   .clang-format file located in one of the
> parent
>   directories of the source file (or current
>   directory for stdin).
>   Use -style="{key: value, ...}" to set
> specific
>   parameters, e.g.:
> -style="{BasedOnStyle: llvm, IndentWidth:
> 8}"
>   -version  - Display the version of this program output.
>
> Modified:
> cfe/trunk/tools/clang-format/ClangFormat.cpp
>
> Modified: cfe/trunk/tools/clang-format/ClangFormat.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-format/ClangFormat.cpp?rev=250671=250670=250671=diff
>
> ==
> --- cfe/trunk/tools/clang-format/ClangFormat.cpp (original)
> +++ cfe/trunk/tools/clang-format/ClangFormat.cpp Sun Oct 18 20:03:19 2015
> @@ -324,7 +324,7 @@ int main(int argc, const char **argv) {
>cl::SetVersionPrinter(PrintVersion);
>cl::ParseCommandLineOptions(
>argc, argv,
> -  "A tool to format C/C++/Obj-C code.\n\n"
> +  "A tool to format C/C++/Java/JavaScript/Objective-C/Protobuf
> code.\n\n"
>"If no arguments are specified, it formats the code from standard
> input\n"
>"and writes the result to the standard output.\n"
>"If s are given, it reformats the files. If -i is specified\n"
>
>
> 

Re: r248782 - clang-format: Extend #include sorting functionality

2015-10-18 Thread Nico Weber via cfe-commits
On Tue, Sep 29, 2015 at 12:53 AM, Daniel Jasper via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

> Author: djasper
> Date: Tue Sep 29 02:53:08 2015
> New Revision: 248782
>
> URL: http://llvm.org/viewvc/llvm-project?rev=248782=rev
> Log:
> clang-format: Extend #include sorting functionality
>
> Recognize the main module header as well as different #include categories.
> This should now mimic the behavior of llvm/utils/sort_includes.py as
> well as clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.cpp very
> closely.
>
> Modified:
> cfe/trunk/include/clang/Format/Format.h
> cfe/trunk/lib/Format/Format.cpp
> cfe/trunk/tools/clang-format/ClangFormat.cpp
> cfe/trunk/unittests/Format/SortIncludesTest.cpp
>
> Modified: cfe/trunk/include/clang/Format/Format.h
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Format/Format.h?rev=248782=248781=248782=diff
>
> ==
> --- cfe/trunk/include/clang/Format/Format.h (original)
> +++ cfe/trunk/include/clang/Format/Format.h Tue Sep 29 02:53:08 2015
> @@ -259,6 +259,21 @@ struct FormatStyle {
>/// For example: BOOST_FOREACH.
>std::vector ForEachMacros;
>
> +  /// \brief Regular expressions denoting the different #include
> categories used
> +  /// for ordering #includes.
> +  ///
> +  /// These regular expressions are matched against the filename of an
> include
> +  /// (including the <> or "") in order. The value belonging to the first
> +  /// matching regular expression is assigned and #includes are sorted
> first
> +  /// according to increasing category number and then alphabetically
> within
> +  /// each category.
> +  ///
> +  /// If none of the regular expressions match, UINT_MAX is assigned as
> +  /// category. The main header for a source file automatically gets
> category 0,
> +  /// so that it is kept at the beginning of the #includes
> +  /// (http://llvm.org/docs/CodingStandards.html#include-style).
> +  std::vector> IncludeCategories;
> +
>/// \brief Indent case labels one level from the switch statement.
>///
>/// When \c false, use the same indentation level as for the switch
> statement.
>
> Modified: cfe/trunk/lib/Format/Format.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/Format.cpp?rev=248782=248781=248782=diff
>
> ==
> --- cfe/trunk/lib/Format/Format.cpp (original)
> +++ cfe/trunk/lib/Format/Format.cpp Tue Sep 29 02:53:08 2015
> @@ -13,6 +13,7 @@
>  ///
>
>  
> //===--===//
>
> +#include "clang/Format/Format.h"
>  #include "ContinuationIndenter.h"
>  #include "TokenAnnotator.h"
>  #include "UnwrappedLineFormatter.h"
> @@ -21,7 +22,6 @@
>  #include "clang/Basic/Diagnostic.h"
>  #include "clang/Basic/DiagnosticOptions.h"
>  #include "clang/Basic/SourceManager.h"
> -#include "clang/Format/Format.h"
>  #include "clang/Lex/Lexer.h"
>  #include "llvm/ADT/STLExtras.h"
>  #include "llvm/Support/Allocator.h"
> @@ -375,6 +375,9 @@ FormatStyle getLLVMStyle() {
>LLVMStyle.ForEachMacros.push_back("foreach");
>LLVMStyle.ForEachMacros.push_back("Q_FOREACH");
>LLVMStyle.ForEachMacros.push_back("BOOST_FOREACH");
> +  LLVMStyle.IncludeCategories = {{"^\"(llvm|llvm-c|clang|clang-c)/", 2},
> + {"^(<|\"(gtest|isl|json)/)", 3},
> + {".*", 1}};
>LLVMStyle.IndentCaseLabels = false;
>LLVMStyle.IndentWrappedFunctionNames = false;
>LLVMStyle.IndentWidth = 2;
> @@ -423,6 +426,7 @@ FormatStyle getGoogleStyle(FormatStyle::
>GoogleStyle.AlwaysBreakTemplateDeclarations = true;
>GoogleStyle.ConstructorInitializerAllOnOneLineOrOnePerLine = true;
>GoogleStyle.DerivePointerAlignment = true;
> +  GoogleStyle.IncludeCategories = {{"^<.*\\.h>", 1}, {"^<.*", 2}, {".*",
> 3}};
>GoogleStyle.IndentCaseLabels = true;
>GoogleStyle.KeepEmptyLinesAtTheStartOfBlocks = false;
>GoogleStyle.ObjCSpaceAfterProperty = false;
> @@ -1575,7 +1579,7 @@ struct IncludeDirective {
>StringRef Filename;
>StringRef Text;
>unsigned Offset;
> -  bool IsAngled;
> +  unsigned Category;
>  };
>
>  } // end anonymous namespace
> @@ -1605,7 +1609,8 @@ static void sortIncludes(const FormatSty
>for (unsigned i = 0, e = Includes.size(); i != e; ++i)
>  Indices.push_back(i);
>std::sort(Indices.begin(), Indices.end(), [&](unsigned LHSI, unsigned
> RHSI) {
> -return Includes[LHSI].Filename < Includes[RHSI].Filename;
> +return std::tie(Includes[LHSI].Category, Includes[LHSI].Filename) <
> +   std::tie(Includes[RHSI].Category, Includes[RHSI].Filename);
>});
>
>// If the #includes are out of order, we generate a single replacement
> fixing
> @@ -1642,22 +1647,49 @@ tooling::Replacements sortIncludes(const
>tooling::Replacements 

Re: [PATCH] D13765: clang-format: [JS] Handle string literals spanning character classes.

2015-10-18 Thread Daniel Jasper via cfe-commits
djasper closed this revision.
djasper added a comment.

Submitted as r250648.


http://reviews.llvm.org/D13765



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


r250648 - clang-format: [JS] Handle string literals spanning character classes.

2015-10-18 Thread Daniel Jasper via cfe-commits
Author: djasper
Date: Sun Oct 18 02:02:28 2015
New Revision: 250648

URL: http://llvm.org/viewvc/llvm-project?rev=250648=rev
Log:
clang-format: [JS] Handle string literals spanning character classes.

If a RegExp contains a character group with a quote (/["]/), the
trailing end of it is first tokenized as a string literal, which leads
to the merging code seeing an unbalanced bracket.

This change parses regex literals from the left hand side. That
simplifies the parsing code and also allows correctly handling escapes
and character classes, hopefully correctly parsing all regex literals.

Patch by Martin Probst, thank you.
Review: http://reviews.llvm.org/D13765

Modified:
cfe/trunk/lib/Format/Format.cpp
cfe/trunk/unittests/Format/FormatTestJS.cpp

Modified: cfe/trunk/lib/Format/Format.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/Format.cpp?rev=250648=250647=250648=diff
==
--- cfe/trunk/lib/Format/Format.cpp (original)
+++ cfe/trunk/lib/Format/Format.cpp Sun Oct 18 02:02:28 2015
@@ -732,6 +732,8 @@ public:
 assert(FirstInLineIndex == 0);
 do {
   Tokens.push_back(getNextToken());
+  if (Style.Language == FormatStyle::LK_JavaScript)
+tryParseJSRegexLiteral();
   tryMergePreviousTokens();
   if (Tokens.back()->NewlinesBefore > 0 || Tokens.back()->IsMultiline)
 FirstInLineIndex = Tokens.size() - 1;
@@ -751,10 +753,6 @@ private:
   return;
 
 if (Style.Language == FormatStyle::LK_JavaScript) {
-  if (tryMergeJSRegexLiteral())
-return;
-  if (tryMergeEscapeSequence())
-return;
   if (tryMergeTemplateString())
 return;
 
@@ -826,107 +824,97 @@ private:
 return true;
   }
 
-  // Tries to merge an escape sequence, i.e. a "\\" and the following
-  // character. Use e.g. inside JavaScript regex literals.
-  bool tryMergeEscapeSequence() {
-if (Tokens.size() < 2)
-  return false;
-FormatToken *Previous = Tokens[Tokens.size() - 2];
-if (Previous->isNot(tok::unknown) || Previous->TokenText != "\\")
-  return false;
-++Previous->ColumnWidth;
-StringRef Text = Previous->TokenText;
-Previous->TokenText = StringRef(Text.data(), Text.size() + 1);
-resetLexer(SourceMgr.getFileOffset(Tokens.back()->Tok.getLocation()) + 1);
-Tokens.resize(Tokens.size() - 1);
-Column = Previous->OriginalColumn + Previous->ColumnWidth;
+  // Returns \c true if \p Tok can only be followed by an operand in 
JavaScript.
+  bool precedesOperand(FormatToken *Tok) {
+// NB: This is not entirely correct, as an r_paren can introduce an operand
+// location in e.g. `if (foo) /bar/.exec(...);`. That is a rare enough
+// corner case to not matter in practice, though.
+return Tok->isOneOf(tok::period, tok::l_paren, tok::comma, tok::l_brace,
+tok::r_brace, tok::l_square, tok::semi, tok::exclaim,
+tok::colon, tok::question, tok::tilde) ||
+   Tok->isOneOf(tok::kw_return, tok::kw_do, tok::kw_case, 
tok::kw_throw,
+tok::kw_else, tok::kw_new, tok::kw_delete, 
tok::kw_void,
+tok::kw_typeof, Keywords.kw_instanceof,
+Keywords.kw_in) ||
+   Tok->isBinaryOperator();
+  }
+
+  bool canPrecedeRegexLiteral(FormatToken *Prev) {
+if (!Prev)
+  return true;
+
+// Regex literals can only follow after prefix unary operators, not after
+// postfix unary operators. If the '++' is followed by a non-operand
+// introducing token, the slash here is the operand and not the start of a
+// regex.
+if (Prev->isOneOf(tok::plusplus, tok::minusminus))
+  return (Tokens.size() < 3 || precedesOperand(Tokens[Tokens.size() - 3]));
+
+// The previous token must introduce an operand location where regex
+// literals can occur.
+if (!precedesOperand(Prev))
+  return false;
+
 return true;
   }
 
-  // Try to determine whether the current token ends a JavaScript regex 
literal.
-  // We heuristically assume that this is a regex literal if we find two
-  // unescaped slashes on a line and the token before the first slash is one of
-  // "(;,{}![:?", a binary operator or 'return', as those cannot be followed by
-  // a division.
-  bool tryMergeJSRegexLiteral() {
-if (Tokens.size() < 2)
-  return false;
-
-// If this is a string literal with a slash inside, compute the slash's
-// offset and try to find the beginning of the regex literal.
-// Also look at tok::unknown, as it can be an unterminated char literal.
-size_t SlashInStringPos = StringRef::npos;
-if (Tokens.back()->isOneOf(tok::string_literal, tok::char_constant,
-   tok::unknown)) {
-  // Start search from position 1 as otherwise, this is an unknown token
-  // for an unterminated /*-comment which is handled elsewhere.
-  

r250657 - Support linking against OpenMP runtime on FreeBSD.

2015-10-18 Thread Dimitry Andric via cfe-commits
Author: dim
Date: Sun Oct 18 08:32:20 2015
New Revision: 250657

URL: http://llvm.org/viewvc/llvm-project?rev=250657=rev
Log:
Support linking against OpenMP runtime on FreeBSD.

Summary:
Similar to rL248426 (which was a followup to rL248379 and rL248424), add the
required libraries for OpenMP on the linker command line, and update the test
case.

Reviewers: emaste, theraven, joerg

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D13822

Modified:
cfe/trunk/lib/Driver/Tools.cpp
cfe/trunk/test/Driver/fopenmp.c

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=250657=250656=250657=diff
==
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Sun Oct 18 08:32:20 2015
@@ -7612,6 +7612,7 @@ void freebsd::Linker::ConstructJob(Compi
 
   if (!Args.hasArg(options::OPT_nostdlib) &&
   !Args.hasArg(options::OPT_nodefaultlibs)) {
+addOpenMPRuntime(CmdArgs, ToolChain, Args);
 if (D.CCCIsCXX()) {
   ToolChain.AddCXXStdlibLibArgs(Args, CmdArgs);
   if (Args.hasArg(options::OPT_pg))

Modified: cfe/trunk/test/Driver/fopenmp.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/fopenmp.c?rev=250657=250656=250657=diff
==
--- cfe/trunk/test/Driver/fopenmp.c (original)
+++ cfe/trunk/test/Driver/fopenmp.c Sun Oct 18 08:32:20 2015
@@ -4,6 +4,9 @@
 // RUN: %clang -target x86_64-apple-darwin -fopenmp=libomp -c %s -### 2>&1 | 
FileCheck %s --check-prefix=CHECK-CC1-OPENMP
 // RUN: %clang -target x86_64-apple-darwin -fopenmp=libgomp -c %s -### 2>&1 | 
FileCheck %s --check-prefix=CHECK-CC1-NO-OPENMP
 // RUN: %clang -target x86_64-apple-darwin -fopenmp=libiomp5 -c %s -### 2>&1 | 
FileCheck %s --check-prefix=CHECK-CC1-OPENMP
+// RUN: %clang -target x86_64-freebsd -fopenmp=libomp -c %s -### 2>&1 | 
FileCheck %s --check-prefix=CHECK-CC1-OPENMP
+// RUN: %clang -target x86_64-freebsd -fopenmp=libgomp -c %s -### 2>&1 | 
FileCheck %s --check-prefix=CHECK-CC1-NO-OPENMP
+// RUN: %clang -target x86_64-freebsd -fopenmp=libiomp5 -c %s -### 2>&1 | 
FileCheck %s --check-prefix=CHECK-CC1-OPENMP
 // RUN: %clang -target x86_64-netbsd -fopenmp=libomp -c %s -### 2>&1 | 
FileCheck %s --check-prefix=CHECK-CC1-OPENMP
 // RUN: %clang -target x86_64-netbsd -fopenmp=libgomp -c %s -### 2>&1 | 
FileCheck %s --check-prefix=CHECK-CC1-NO-OPENMP
 // RUN: %clang -target x86_64-netbsd -fopenmp=libiomp5 -c %s -### 2>&1 | 
FileCheck %s --check-prefix=CHECK-CC1-OPENMP
@@ -34,6 +37,10 @@
 // RUN: %clang -target x86_64-netbsd -fopenmp=libgomp %s -o %t -### 2>&1 | 
FileCheck %s --check-prefix=CHECK-LD-GOMP
 // RUN: %clang -target x86_64-netbsd -fopenmp=libiomp5 %s -o %t -### 2>&1 | 
FileCheck %s --check-prefix=CHECK-LD-IOMP5
 //
+// RUN: %clang -nostdlib -target x86_64-freebsd -fopenmp=libomp %s -o %t -### 
2>&1 | FileCheck %s --check-prefix=CHECK-NO-OMP
+// RUN: %clang -nostdlib -target x86_64-freebsd -fopenmp=libgomp %s -o %t -### 
2>&1 | FileCheck %s --check-prefix=CHECK-NO-GOMP
+// RUN: %clang -nostdlib -target x86_64-freebsd -fopenmp=libiomp5 %s -o %t 
-### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-IOMP5
+//
 // RUN: %clang -nostdlib -target x86_64-netbsd -fopenmp=libomp %s -o %t -### 
2>&1 | FileCheck %s --check-prefix=CHECK-NO-OMP
 // RUN: %clang -nostdlib -target x86_64-netbsd -fopenmp=libgomp %s -o %t -### 
2>&1 | FileCheck %s --check-prefix=CHECK-NO-GOMP
 // RUN: %clang -nostdlib -target x86_64-netbsd -fopenmp=libiomp5 %s -o %t -### 
2>&1 | FileCheck %s --check-prefix=CHECK-NO-IOMP5
@@ -64,6 +71,7 @@
 //
 // RUN: %clang -target x86_64-linux-gnu -fopenmp %s -o %t -### 2>&1 | 
FileCheck %s --check-prefix=CHECK-LD-ANY
 // RUN: %clang -target x86_64-darwin -fopenmp %s -o %t -### 2>&1 | FileCheck 
%s --check-prefix=CHECK-LD-ANY
+// RUN: %clang -target x86_64-freebsd -fopenmp %s -o %t -### 2>&1 | FileCheck 
%s --check-prefix=CHECK-LD-ANY
 // RUN: %clang -target x86_64-netbsd -fopenmp %s -o %t -### 2>&1 | FileCheck 
%s --check-prefix=CHECK-LD-ANY
 //
 // CHECK-LD-ANY: "{{.*}}ld{{(.exe)?}}"


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


Re: [Diffusion] rL248424: Push OpenMP linker flags after linker input on Darwin. Don't add any

2015-10-18 Thread Dimitry Andric via cfe-commits
dim added a subscriber: dim.
dim added auditors: 3.7-release, cfe-commits, tstellarAMD, joerg.
dim added a comment.

Should be merged together with http://reviews.llvm.org/rL248379, 
http://reviews.llvm.org/rL248426, and http://reviews.llvm.org/rL250657.  
Together, these add support for linking against OpenMP on FreeBSD and NetBSD.


Users:
  joerg (Author, Auditor)
  3.7-release (Auditor)
  cfe-commits (Auditor)
  tstellarAMD (Auditor)

http://reviews.llvm.org/rL248424



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


Re: [Diffusion] rL248379: Refactor library decision for -fopenmp support from Darwin into a

2015-10-18 Thread Dimitry Andric via cfe-commits
dim added a subscriber: dim.
dim added auditors: 3.7-release, cfe-commits, tstellarAMD, joerg.
dim added a comment.

Should be merged together with http://reviews.llvm.org/rL248424, 
http://reviews.llvm.org/rL248426, and http://reviews.llvm.org/rL250657.  
Together, these add support for linking against OpenMP on FreeBSD and NetBSD.


Users:
  joerg (Author, Auditor)
  3.7-release (Auditor)
  cfe-commits (Auditor)
  tstellarAMD (Auditor)

http://reviews.llvm.org/rL248379



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


Re: [Diffusion] rL248426: Support linking against OpenMP runtime on NetBSD.

2015-10-18 Thread Dimitry Andric via cfe-commits
dim added a subscriber: dim.
dim added auditors: 3.7-release, cfe-commits, tstellarAMD, joerg.
dim added a comment.

Should be merged together with http://reviews.llvm.org/rL248379, 
http://reviews.llvm.org/rL248424, and http://reviews.llvm.org/rL250657.  
Together, these add support for linking against OpenMP on FreeBSD and NetBSD.


Users:
  joerg (Author, Auditor)
  3.7-release (Auditor)
  cfe-commits (Auditor)
  tstellarAMD (Auditor)

http://reviews.llvm.org/rL248426



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


Re: [Diffusion] rL250657: Support linking against OpenMP runtime on FreeBSD.

2015-10-18 Thread Dimitry Andric via cfe-commits
dim added auditors: 3.7-release, cfe-commits, tstellarAMD, joerg.
dim added a comment.

Should be merged together with http://reviews.llvm.org/rL248379, 
http://reviews.llvm.org/rL248424, and http://reviews.llvm.org/rL248426.  
Together, these add support for linking against OpenMP on FreeBSD and NetBSD.


Users:
  dim (Author)
  3.7-release (Auditor)
  cfe-commits (Auditor)
  tstellarAMD (Auditor)
  joerg (Auditor)

http://reviews.llvm.org/rL250657



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