Re: r316379 - [Driver] Use ld.lld directly for Fuchsia rather than passing flavor

2017-10-23 Thread Rui Ueyama via cfe-commits
Nice. Dispatching based on argv[0] is more common and probably a
recommended way now, so this patch aligned with that.

On Mon, Oct 23, 2017 at 2:31 PM, Petr Hosek via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

> Author: phosek
> Date: Mon Oct 23 14:31:05 2017
> New Revision: 316379
>
> URL: http://llvm.org/viewvc/llvm-project?rev=316379&view=rev
> Log:
> [Driver] Use ld.lld directly for Fuchsia rather than passing flavor
>
> Passing a flavor to LLD requires command line argument, but if these
> are being passed through a response file, this will fail because LLD
> needs to know which driver to use before processing the response file.
> Use ld.lld directly instead to avoid this issue.
>
> Differential Revision: https://reviews.llvm.org/D39176
>
> Modified:
> cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp
> cfe/trunk/lib/Driver/ToolChains/Fuchsia.h
> cfe/trunk/test/Driver/fuchsia.c
> cfe/trunk/test/Driver/fuchsia.cpp
>
> Modified: cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/
> ToolChains/Fuchsia.cpp?rev=316379&r1=316378&r2=316379&view=diff
> 
> ==
> --- cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp (original)
> +++ cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp Mon Oct 23 14:31:05 2017
> @@ -44,10 +44,8 @@ void fuchsia::Linker::ConstructJob(Compi
>Args.ClaimAllArgs(options::OPT_w);
>
>const char *Exec = Args.MakeArgString(ToolChain.GetLinkerPath());
> -  if (llvm::sys::path::stem(Exec).equals_lower("lld")) {
> -CmdArgs.push_back("-flavor");
> -CmdArgs.push_back("gnu");
> -
> +  if (llvm::sys::path::filename(Exec).equals_lower("ld.lld") ||
> +  llvm::sys::path::stem(Exec).equals_lower("ld.lld")) {
>  CmdArgs.push_back("-z");
>  CmdArgs.push_back("rodynamic");
>}
>
> Modified: cfe/trunk/lib/Driver/ToolChains/Fuchsia.h
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/
> ToolChains/Fuchsia.h?rev=316379&r1=316378&r2=316379&view=diff
> 
> ==
> --- cfe/trunk/lib/Driver/ToolChains/Fuchsia.h (original)
> +++ cfe/trunk/lib/Driver/ToolChains/Fuchsia.h Mon Oct 23 14:31:05 2017
> @@ -82,7 +82,7 @@ public:
> llvm::opt::ArgStringList &CmdArgs) const
> override;
>
>const char *getDefaultLinker() const override {
> -return "lld";
> +return "ld.lld";
>}
>
>  protected:
>
> Modified: cfe/trunk/test/Driver/fuchsia.c
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/
> fuchsia.c?rev=316379&r1=316378&r2=316379&view=diff
> 
> ==
> --- cfe/trunk/test/Driver/fuchsia.c (original)
> +++ cfe/trunk/test/Driver/fuchsia.c Mon Oct 23 14:31:05 2017
> @@ -1,16 +1,15 @@
>  // RUN: %clang %s -### -no-canonical-prefixes --target=x86_64-unknown-fuchsia
> \
> -// RUN: --sysroot=%S/platform -fuse-ld=ld 2>&1 \
> +// RUN: --sysroot=%S/platform 2>&1 \
>  // RUN: | FileCheck -check-prefixes=CHECK,CHECK-X86_64 %s
>  // RUN: %clang %s -### -no-canonical-prefixes 
> --target=aarch64-unknown-fuchsia
> \
> -// RUN: --sysroot=%S/platform -fuse-ld=ld 2>&1 \
> +// RUN: --sysroot=%S/platform 2>&1 \
>  // RUN: | FileCheck -check-prefixes=CHECK,CHECK-AARCH64 %s
>  // CHECK: {{.*}}clang{{.*}}" "-cc1"
>  // CHECK: "-munwind-tables"
>  // CHECK: "-fuse-init-array"
>  // CHECK: "-isysroot" "[[SYSROOT:[^"]+]]"
>  // CHECK: "-internal-externc-isystem" "[[SYSROOT]]{{/|}}include"
> -// CHECK: {{.*}}lld{{.*}}" "-flavor" "gnu"
> -// CHECK: "-z" "rodynamic"
> +// CHECK: {{.*}}ld.lld{{.*}}" "-z" "rodynamic"
>  // CHECK: "--sysroot=[[SYSROOT]]"
>  // CHECK: "-pie"
>  // CHECK: "--build-id"
>
> Modified: cfe/trunk/test/Driver/fuchsia.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/
> fuchsia.cpp?rev=316379&r1=316378&r2=316379&view=diff
> 
> ==
> --- cfe/trunk/test/Driver/fuchsia.cpp (original)
> +++ cfe/trunk/test/Driver/fuchsia.cpp Mon Oct 23 14:31:05 2017
> @@ -1,13 +1,12 @@
>  // RUN: %clangxx %s -### -no-canonical-prefixes 
> --target=x86_64-unknown-fuchsia
> \
> -// RUN: --sysroot=%S/platform 2>&1 -fuse-ld=ld | FileCheck %s
> +// RUN: --sysroot=%S/platform 2>&1 | FileCheck %s
>  // CHECK: {{.*}}clang{{.*}}" "-cc1"
>  // CHECK: "-triple" "x86_64-fuchsia"
>  // CHECK: "-fuse-init-array"
>  // CHECK: "-isysroot" "[[SYSROOT:[^"]+]]"
>  // CHECK: "-internal-isystem" "{{.*[/\\]}}x86_64-fuchsia{{/|
> }}include{{/|}}c++{{/|}}v1"
>  // CHECK: "-internal-externc-isystem" "[[SYSROOT]]{{/|}}include"
> -// CHECK: {{.*}}lld{{.*}}" "-flavor" "gnu"
> -// CHECK: "-z" "rodynamic"
> +// CHECK: {{.*}}ld.lld{{.*}}" "-z" "rodynamic"
>  // CHECK: "--sysroot=[[SYSROOT]]"
>  // CHECK: "-pie"
>  // CHECK: "--build-id"
>
>
> 

Re: [PATCH] D33726: [driver][netbsd] Build and pass `-L` arguments to the linker

2017-06-08 Thread Rui Ueyama via cfe-commits
On Wed, Jun 7, 2017 at 6:55 AM, Joerg Sonnenberger via Phabricator <
revi...@reviews.llvm.org> wrote:

> joerg added a comment.
>
> In https://reviews.llvm.org/D33726#774105, @ruiu wrote:
>
> > I'm totally against adding per-OS path knowledge to our linker.
> Compilers already know include paths and I don't want to maintain another
> list of paths in the linker. Also this can be more confusing than useful
> when you are doing cross-linking.
>
>
> The only reason for compilers to maintain that list is for finding crt*.o.
> They otherwise don't care about the library paths at all. There is no
> confusion for cross-linking as long as proper sysroot support is used.
> Which we have been doing on NetBSD for ages.


That's not what clang is trying to do for all Unix-like systems (except
NetBSD due to the bug), right? The compiler driver actually passes library
paths to the linker. If you think that is wrong, you should make a change
to stop doing that on all systems. I don't see a reason to not do this only
on NetBSD.

> For all OSes other than NetBSD, LLD works fine with the clang driver as
> the driver passes include paths to the linker. I don't see any reason not
> to do the same thing for NetBSD. That stands even if the linker has to have
> a list of include paths.
>
> Sorry, but this is again ignorant and wrong. The very same problem of
> build systems calling ld directly apply on most other systems. Even then,
> the list of linker paths is not the only OS-specific knowledge. Things like
> the DT_RPATH vs DT_RUNPATH mess, init vs init_array all belong into this
> category. The list goes on.
>
>
> Repository:
>   rL LLVM
>
> https://reviews.llvm.org/D33726
>
>
>
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D33726: [driver][netbsd] Build and pass `-L` arguments to the linker

2017-06-08 Thread Rui Ueyama via cfe-commits
I don't remember the details, but I believe LLD-generated executables are
fine with either Linux or on NetBSD

On Thu, Jun 8, 2017 at 3:08 PM, Kamil Rytarowski  wrote:

> On 08.06.2017 22:39, Rui Ueyama wrote:
> > On Wed, Jun 7, 2017 at 6:55 AM, Joerg Sonnenberger via Phabricator
> > mailto:revi...@reviews.llvm.org>> wrote:
> >
> > joerg added a comment.
> >
> > In https://reviews.llvm.org/D33726#774105
> > , @ruiu wrote:
> >
> > > I'm totally against adding per-OS path knowledge to our linker.
> Compilers already know include paths and I don't want to maintain another
> list of paths in the linker. Also this can be more confusing than useful
> when you are doing cross-linking.
> >
> >
> > The only reason for compilers to maintain that list is for finding
> > crt*.o. They otherwise don't care about the library paths at all.
> > There is no confusion for cross-linking as long as proper sysroot
> > support is used. Which we have been doing on NetBSD for ages.
> >
> >
> > That's not what clang is trying to do for all Unix-like systems (except
> > NetBSD due to the bug), right? The compiler driver actually passes
> > library paths to the linker. If you think that is wrong, you should make
> > a change to stop doing that on all systems. I don't see a reason to not
> > do this only on NetBSD.
> >
>
> I'm convinced that Joerg is right, that there is need some knowledge on
> the LLD side. I'm more relaxed about -L paths as long as they work for
> regular use-cases, but DT_RPATH vs DT_RUNPATH behaves differently on
> Linux and NetBSD.
>
> > > For all OSes other than NetBSD, LLD works fine with the clang
> driver as the driver passes include paths to the linker. I don't see any
> reason not to do the same thing for NetBSD. That stands even if the linker
> has to have a list of include paths.
> >
> > Sorry, but this is again ignorant and wrong. The very same problem
> > of build systems calling ld directly apply on most other systems.
> > Even then, the list of linker paths is not the only OS-specific
> > knowledge. Things like the DT_RPATH vs DT_RUNPATH mess, init vs
> > init_array all belong into this category. The list goes on.
> >
> >
> > Repository:
> >   rL LLVM
> >
> > https://reviews.llvm.org/D33726 
> >
> >
> >
> >
>
>
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r305930 - Use -NOT prefix instead of adding `not` to FileCheck.

2017-06-21 Thread Rui Ueyama via cfe-commits
Author: ruiu
Date: Wed Jun 21 11:50:38 2017
New Revision: 305930

URL: http://llvm.org/viewvc/llvm-project?rev=305930&view=rev
Log:
Use -NOT prefix instead of adding `not` to FileCheck.

If we want to make sure that a particular string is not in an output,
the regular way of doing it is to add `-NOT` prefix instead of checking
if FileCheck resulted in an error.

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

Modified:
cfe/trunk/test/Driver/autocomplete.c

Modified: cfe/trunk/test/Driver/autocomplete.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/autocomplete.c?rev=305930&r1=305929&r2=305930&view=diff
==
--- cfe/trunk/test/Driver/autocomplete.c (original)
+++ cfe/trunk/test/Driver/autocomplete.c Wed Jun 21 11:50:38 2017
@@ -2,8 +2,8 @@
 // FSYN: -fsyntax-only
 // RUN: %clang --autocomplete=-s | FileCheck %s -check-prefix=STD
 // STD: -std={{.*}}-stdlib=
-// RUN: %clang --autocomplete=foo | not FileCheck %s -check-prefix=NONE
-// NONE: foo
+// RUN: %clang --autocomplete=foo | FileCheck %s -check-prefix=FOO
+// FOO-NOT: foo
 // RUN: %clang --autocomplete=-stdlib=,l | FileCheck %s -check-prefix=STDLIB
 // STDLIB: libc++ libstdc++
 // RUN: %clang --autocomplete=-stdlib=, | FileCheck %s -check-prefix=STDLIBALL


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


r306116 - Sort the autocomplete candidates before printing them out.

2017-06-23 Thread Rui Ueyama via cfe-commits
Author: ruiu
Date: Fri Jun 23 10:37:52 2017
New Revision: 306116

URL: http://llvm.org/viewvc/llvm-project?rev=306116&view=rev
Log:
Sort the autocomplete candidates before printing them out.

Currently, autocompleted options are displayed in the same order as we
wrote them in .td files. This patch sort them out in clang so that they
are sorted alphabetically. This should improve usability.

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

Modified:
cfe/trunk/lib/Driver/Driver.cpp
cfe/trunk/test/Driver/autocomplete.c

Modified: cfe/trunk/lib/Driver/Driver.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=306116&r1=306115&r2=306116&view=diff
==
--- cfe/trunk/lib/Driver/Driver.cpp (original)
+++ cfe/trunk/lib/Driver/Driver.cpp Fri Jun 23 10:37:52 2017
@@ -1245,6 +1245,13 @@ bool Driver::HandleImmediateArgs(const C
   SuggestedCompletions = Opts->suggestValueCompletions(Option, Arg);
 }
 
+// Sort the autocomplete candidates so that shells print them out in a
+// deterministic order. We could sort in any way, but we chose
+// case-insensitive sorting for consistency with the -help option
+// which prints out options in the case-insensitive alphabetical order.
+std::sort(SuggestedCompletions.begin(), SuggestedCompletions.end(),
+  [](StringRef A, StringRef B) { return A.compare_lower(B) < 0; });
+
 llvm::outs() << llvm::join(SuggestedCompletions, " ") << '\n';
 return false;
   }

Modified: cfe/trunk/test/Driver/autocomplete.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/autocomplete.c?rev=306116&r1=306115&r2=306116&view=diff
==
--- cfe/trunk/test/Driver/autocomplete.c (original)
+++ cfe/trunk/test/Driver/autocomplete.c Fri Jun 23 10:37:52 2017
@@ -11,7 +11,7 @@
 // RUN: %clang --autocomplete=-meabi,d | FileCheck %s -check-prefix=MEABI
 // MEABI: default
 // RUN: %clang --autocomplete=-meabi, | FileCheck %s -check-prefix=MEABIALL
-// MEABIALL: default 4 5 gnu
+// MEABIALL: 4 5 default gnu
 // RUN: %clang --autocomplete=-cl-std=,CL2 | FileCheck %s -check-prefix=CLSTD
 // CLSTD: CL2.0
 // RUN: %clang --autocomplete=-cl-std=, | FileCheck %s -check-prefix=CLSTDALL
@@ -19,18 +19,18 @@
 // RUN: %clang --autocomplete=-fno-sanitize-coverage=,f | FileCheck %s 
-check-prefix=FNOSANICOVER
 // FNOSANICOVER: func
 // RUN: %clang --autocomplete=-fno-sanitize-coverage=, | FileCheck %s 
-check-prefix=FNOSANICOVERALL
-// FNOSANICOVERALL: func bb edge indirect-calls trace-bb trace-cmp trace-div 
trace-gep 8bit-counters trace-pc trace-pc-guard no-prune inline-8bit-counters
+// FNOSANICOVERALL: 8bit-counters bb edge func indirect-calls 
inline-8bit-counters no-prune trace-bb trace-cmp trace-div trace-gep trace-pc 
trace-pc-guard
 // RUN: %clang --autocomplete=-ffp-contract=, | FileCheck %s 
-check-prefix=FFPALL
-// FFPALL: fast on off
+// FFPALL: fast off on
 // RUN: %clang --autocomplete=-flto=, | FileCheck %s -check-prefix=FLTOALL
-// FLTOALL: thin full
+// FLTOALL: full thin
 // RUN: %clang --autocomplete=-fveclib=, | FileCheck %s 
-check-prefix=FVECLIBALL
-// FVECLIBALL: Accelerate SVML none
+// FVECLIBALL: Accelerate none SVML
 // RUN: %clang --autocomplete=-fshow-overloads=, | FileCheck %s 
-check-prefix=FSOVERALL
-// FSOVERALL: best all
+// FSOVERALL: all best
 // RUN: %clang --autocomplete=-fvisibility=, | FileCheck %s 
-check-prefix=FVISIBILITYALL
-// FVISIBILITYALL: hidden default
+// FVISIBILITYALL: default hidden
 // RUN: %clang --autocomplete=-mfloat-abi=, | FileCheck %s 
-check-prefix=MFLOATABIALL
-// MFLOATABIALL: soft softfp hard
+// MFLOATABIALL: hard soft softfp
 // RUN: %clang --autocomplete=-mthread-model, | FileCheck %s 
-check-prefix=MTHREADMODELALL
 // MTHREADMODELALL: posix single


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


r311936 - Remove trailing space.

2017-08-28 Thread Rui Ueyama via cfe-commits
Author: ruiu
Date: Mon Aug 28 14:38:14 2017
New Revision: 311936

URL: http://llvm.org/viewvc/llvm-project?rev=311936&view=rev
Log:
Remove trailing space.

Modified:
cfe/trunk/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp

Modified: cfe/trunk/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp?rev=311936&r1=311935&r2=311936&view=diff
==
--- cfe/trunk/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp Mon Aug 28 14:38:14 
2017
@@ -360,15 +360,15 @@ SVal SimpleSValBuilder::evalBinOpNN(Prog
   Loc lhsL = lhs.castAs().getLoc();
   switch (rhs.getSubKind()) {
 case nonloc::LocAsIntegerKind:
-  // FIXME: at the moment the implementation 
+  // FIXME: at the moment the implementation
   // of modeling "pointers as integers" is not complete.
   if (!BinaryOperator::isComparisonOp(op))
-return UnknownVal(); 
+return UnknownVal();
   return evalBinOpLL(state, op, lhsL,
  rhs.castAs().getLoc(),
  resultTy);
 case nonloc::ConcreteIntKind: {
-  // FIXME: at the moment the implementation 
+  // FIXME: at the moment the implementation
   // of modeling "pointers as integers" is not complete.
   if (!BinaryOperator::isComparisonOp(op))
 return UnknownVal();


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


Re: r313088 - Revert "[Driver] MinGW: Remove custom linker detection"

2017-09-12 Thread Rui Ueyama via cfe-commits
When you revert a commit, please explain why you are reverting it in the
commit message.

On Tue, Sep 12, 2017 at 3:58 PM, Martell Malone via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

> Author: martell
> Date: Tue Sep 12 15:58:12 2017
> New Revision: 313088
>
> URL: http://llvm.org/viewvc/llvm-project?rev=313088&view=rev
> Log:
> Revert "[Driver] MinGW: Remove custom linker detection"
>
> This reverts rL313082
>
> Modified:
> cfe/trunk/lib/Driver/ToolChains/MinGW.cpp
> cfe/trunk/test/Driver/mingw-useld.c
>
> Modified: cfe/trunk/lib/Driver/ToolChains/MinGW.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Too
> lChains/MinGW.cpp?rev=313088&r1=313087&r2=313088&view=diff
> 
> ==
> --- cfe/trunk/lib/Driver/ToolChains/MinGW.cpp (original)
> +++ cfe/trunk/lib/Driver/ToolChains/MinGW.cpp Tue Sep 12 15:58:12 2017
> @@ -104,6 +104,14 @@ void tools::MinGW::Linker::ConstructJob(
>// handled somewhere else.
>Args.ClaimAllArgs(options::OPT_w);
>
> +  StringRef LinkerName = Args.getLastArgValue(options::OPT_fuse_ld_EQ,
> "ld");
> +  if (LinkerName.equals_lower("lld")) {
> +CmdArgs.push_back("-flavor");
> +CmdArgs.push_back("gnu");
> +  } else if (!LinkerName.equals_lower("ld")) {
> +D.Diag(diag::err_drv_unsupported_linker) << LinkerName;
> +  }
> +
>if (!D.SysRoot.empty())
>  CmdArgs.push_back(Args.MakeArgString("--sysroot=" + D.SysRoot));
>
> @@ -233,7 +241,7 @@ void tools::MinGW::Linker::ConstructJob(
>
>if (Args.hasArg(options::OPT_static))
>  CmdArgs.push_back("--end-group");
> -  else
> +  else if (!LinkerName.equals_lower("lld"))
>  AddLibGCC(Args, CmdArgs);
>  }
>
> @@ -244,7 +252,7 @@ void tools::MinGW::Linker::ConstructJob(
>CmdArgs.push_back(Args.MakeArgString(TC.GetFilePath("crtend.o")));
>  }
>}
> -  const char *Exec = Args.MakeArgString(TC.GetLinkerPath());
> +  const char *Exec = Args.MakeArgString(TC.GetProgr
> amPath(LinkerName.data()));
>C.addCommand(llvm::make_unique(JA, *this, Exec, CmdArgs,
> Inputs));
>  }
>
>
> Modified: cfe/trunk/test/Driver/mingw-useld.c
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/mi
> ngw-useld.c?rev=313088&r1=313087&r2=313088&view=diff
> 
> ==
> --- cfe/trunk/test/Driver/mingw-useld.c (original)
> +++ cfe/trunk/test/Driver/mingw-useld.c Tue Sep 12 15:58:12 2017
> @@ -1,19 +1,19 @@
> -// RUN: %clang -### -target i686-pc-windows-gnu
> --sysroot=%S/Inputs/mingw_clang_tree/mingw32 %s -fuse-ld=platform 2>&1 |
> FileCheck -check-prefix=CHECK_LD_32 %s
> -// CHECK_LD_32: "{{[^"]*}}ld{{(.exe)?}}"
> +// RUN: %clang -### -target i686-pc-windows-gnu
> --sysroot=%S/Inputs/mingw_clang_tree/mingw32 %s 2>&1 | FileCheck
> -check-prefix=CHECK_LD_32 %s
> +// CHECK_LD_32: ld{{(.exe)?}}"
>  // CHECK_LD_32: "i386pe"
> -// CHECK_LD_32-NOT: "{{[^"]*}}ld.lld{{(.exe)?}}"
> +// CHECK_LD_32-NOT: "-flavor" "gnu"
>
>  // RUN: %clang -### -target i686-pc-windows-gnu
> --sysroot=%S/Inputs/mingw_clang_tree/mingw32 %s -fuse-ld=lld 2>&1 |
> FileCheck -check-prefix=CHECK_LLD_32 %s
>  // CHECK_LLD_32-NOT: invalid linker name in argument
> -// CHECK_LLD_32: "{{[^"]*}}ld.lld{{(.exe)?}}"
> +// CHECK_LLD_32: lld{{(.exe)?}}" "-flavor" "gnu"
>  // CHECK_LLD_32: "i386pe"
>
>  // RUN: %clang -### -target x86_64-pc-windows-gnu
> --sysroot=%S/Inputs/mingw_clang_tree/mingw32 %s -fuse-ld=lld 2>&1 |
> FileCheck -check-prefix=CHECK_LLD_64 %s
>  // CHECK_LLD_64-NOT: invalid linker name in argument
> -// CHECK_LLD_64: "{{[^"]*}}ld.lld{{(.exe)?}}"
> +// CHECK_LLD_64: lld{{(.exe)?}}" "-flavor" "gnu"
>  // CHECK_LLD_64: "i386pep"
>
>  // RUN: %clang -### -target arm-pc-windows-gnu
> --sysroot=%S/Inputs/mingw_clang_tree/mingw32 %s -fuse-ld=lld 2>&1 |
> FileCheck -check-prefix=CHECK_LLD_ARM %s
>  // CHECK_LLD_ARM-NOT: invalid linker name in argument
> -// CHECK_LLD_ARM: "{{[^"]*}}ld.lld{{(.exe)?}}"
> +// CHECK_LLD_ARM: lld{{(.exe)?}}" "-flavor" "gnu"
>  // CHECK_LLD_ARM: "thumb2pe"
>
>
> ___
> 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: r313088 - Revert "[Driver] MinGW: Remove custom linker detection"

2017-09-12 Thread Rui Ueyama via cfe-commits
I wonder why you reverted this change.

On Tue, Sep 12, 2017 at 4:04 PM, Martell Malone 
wrote:

> Will do in future, thanks Rui.
>
> On Wed, Sep 13, 2017 at 12:03 AM, Rui Ueyama  wrote:
>
>> When you revert a commit, please explain why you are reverting it in the
>> commit message.
>>
>> On Tue, Sep 12, 2017 at 3:58 PM, Martell Malone via cfe-commits <
>> cfe-commits@lists.llvm.org> wrote:
>>
>>> Author: martell
>>> Date: Tue Sep 12 15:58:12 2017
>>> New Revision: 313088
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=313088&view=rev
>>> Log:
>>> Revert "[Driver] MinGW: Remove custom linker detection"
>>>
>>> This reverts rL313082
>>>
>>> Modified:
>>> cfe/trunk/lib/Driver/ToolChains/MinGW.cpp
>>> cfe/trunk/test/Driver/mingw-useld.c
>>>
>>> Modified: cfe/trunk/lib/Driver/ToolChains/MinGW.cpp
>>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Too
>>> lChains/MinGW.cpp?rev=313088&r1=313087&r2=313088&view=diff
>>> 
>>> ==
>>> --- cfe/trunk/lib/Driver/ToolChains/MinGW.cpp (original)
>>> +++ cfe/trunk/lib/Driver/ToolChains/MinGW.cpp Tue Sep 12 15:58:12 2017
>>> @@ -104,6 +104,14 @@ void tools::MinGW::Linker::ConstructJob(
>>>// handled somewhere else.
>>>Args.ClaimAllArgs(options::OPT_w);
>>>
>>> +  StringRef LinkerName = Args.getLastArgValue(options::OPT_fuse_ld_EQ,
>>> "ld");
>>> +  if (LinkerName.equals_lower("lld")) {
>>> +CmdArgs.push_back("-flavor");
>>> +CmdArgs.push_back("gnu");
>>> +  } else if (!LinkerName.equals_lower("ld")) {
>>> +D.Diag(diag::err_drv_unsupported_linker) << LinkerName;
>>> +  }
>>> +
>>>if (!D.SysRoot.empty())
>>>  CmdArgs.push_back(Args.MakeArgString("--sysroot=" + D.SysRoot));
>>>
>>> @@ -233,7 +241,7 @@ void tools::MinGW::Linker::ConstructJob(
>>>
>>>if (Args.hasArg(options::OPT_static))
>>>  CmdArgs.push_back("--end-group");
>>> -  else
>>> +  else if (!LinkerName.equals_lower("lld"))
>>>  AddLibGCC(Args, CmdArgs);
>>>  }
>>>
>>> @@ -244,7 +252,7 @@ void tools::MinGW::Linker::ConstructJob(
>>>CmdArgs.push_back(Args.MakeArgString(TC.GetFilePath("crtend
>>> .o")));
>>>  }
>>>}
>>> -  const char *Exec = Args.MakeArgString(TC.GetLinkerPath());
>>> +  const char *Exec = Args.MakeArgString(TC.GetProgr
>>> amPath(LinkerName.data()));
>>>C.addCommand(llvm::make_unique(JA, *this, Exec, CmdArgs,
>>> Inputs));
>>>  }
>>>
>>>
>>> Modified: cfe/trunk/test/Driver/mingw-useld.c
>>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/mi
>>> ngw-useld.c?rev=313088&r1=313087&r2=313088&view=diff
>>> 
>>> ==
>>> --- cfe/trunk/test/Driver/mingw-useld.c (original)
>>> +++ cfe/trunk/test/Driver/mingw-useld.c Tue Sep 12 15:58:12 2017
>>> @@ -1,19 +1,19 @@
>>> -// RUN: %clang -### -target i686-pc-windows-gnu
>>> --sysroot=%S/Inputs/mingw_clang_tree/mingw32 %s -fuse-ld=platform 2>&1
>>> | FileCheck -check-prefix=CHECK_LD_32 %s
>>> -// CHECK_LD_32: "{{[^"]*}}ld{{(.exe)?}}"
>>> +// RUN: %clang -### -target i686-pc-windows-gnu
>>> --sysroot=%S/Inputs/mingw_clang_tree/mingw32 %s 2>&1 | FileCheck
>>> -check-prefix=CHECK_LD_32 %s
>>> +// CHECK_LD_32: ld{{(.exe)?}}"
>>>  // CHECK_LD_32: "i386pe"
>>> -// CHECK_LD_32-NOT: "{{[^"]*}}ld.lld{{(.exe)?}}"
>>> +// CHECK_LD_32-NOT: "-flavor" "gnu"
>>>
>>>  // RUN: %clang -### -target i686-pc-windows-gnu
>>> --sysroot=%S/Inputs/mingw_clang_tree/mingw32 %s -fuse-ld=lld 2>&1 |
>>> FileCheck -check-prefix=CHECK_LLD_32 %s
>>>  // CHECK_LLD_32-NOT: invalid linker name in argument
>>> -// CHECK_LLD_32: "{{[^"]*}}ld.lld{{(.exe)?}}"
>>> +// CHECK_LLD_32: lld{{(.exe)?}}" "-flavor" "gnu"
>>>  // CHECK_LLD_32: "i386pe"
>>>
>>>  // RUN: %clang -### -target x86_64-pc-windows-gnu
>>> --sysroot=%S/Inputs/mingw_clang_tree/mingw32 %s -fuse-ld=lld 2>&1 |
>>> FileCheck -check-prefix=CHECK_LLD_64 %s
>>>  // CHECK_LLD_64-NOT: invalid linker name in argument
>>> -// CHECK_LLD_64: "{{[^"]*}}ld.lld{{(.exe)?}}"
>>> +// CHECK_LLD_64: lld{{(.exe)?}}" "-flavor" "gnu"
>>>  // CHECK_LLD_64: "i386pep"
>>>
>>>  // RUN: %clang -### -target arm-pc-windows-gnu
>>> --sysroot=%S/Inputs/mingw_clang_tree/mingw32 %s -fuse-ld=lld 2>&1 |
>>> FileCheck -check-prefix=CHECK_LLD_ARM %s
>>>  // CHECK_LLD_ARM-NOT: invalid linker name in argument
>>> -// CHECK_LLD_ARM: "{{[^"]*}}ld.lld{{(.exe)?}}"
>>> +// CHECK_LLD_ARM: lld{{(.exe)?}}" "-flavor" "gnu"
>>>  // CHECK_LLD_ARM: "thumb2pe"
>>>
>>>
>>> ___
>>> 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: r313082 - [Driver] MinGW: Remove custom linker detection

2017-09-12 Thread Rui Ueyama via cfe-commits
I'm perhaps not the only person who is wondering, so I'll update the
original thread instead of replying to this thread.

On Tue, Sep 12, 2017 at 4:07 PM, Martell Malone 
wrote:

> cc @rui this is why I reverted it.
>
> On Wed, Sep 13, 2017 at 12:00 AM, Martell Malone 
> wrote:
>
>> Hi Mike,
>>
>> I reverted this for now, I assume it has to do with the argument ordering.
>> Will try a change and re apply.
>>
>> Many Thanks,
>> Martell
>>
>> On Tue, Sep 12, 2017 at 11:57 PM, Martell Malone > > wrote:
>>
>>> Hi Mike,
>>>
>>> I actually posted this in the phab thread a few minutes ago.
>>>
>>> ```
>>> Tests for this pass locally but the build bots are complaining with
>>>
>>> // CHECK_LLD_32: "{{[^"]*}}ld.lld{{(.exe)?}}"
>>>  ^
>>> :1:1: note: scanning from here
>>> clang version 6.0.0 (trunk 313082)
>>> ^
>>> :5:51: note: possible intended match here
>>> clang-6.0: error: invalid linker name in argument '-fuse-ld=lld'
>>>
>>>
>>> Can someone enlighten me before I do a revert? :)
>>> ```
>>>
>>> Best,
>>> Martell
>>>
>>> On Tue, Sep 12, 2017 at 11:54 PM, Mike Edwards  wrote:
>>>
 Hi,
 Would you please have a look at:
 http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-in
 cremental/42380/

 it appears this commit is causing some tests to fail on our bots.  Any
 assistance you may provide in getting the bots back green would be greatly
 appreciated.

 Respectfully,
 Mike Edwards

 On Tue, Sep 12, 2017 at 3:14 PM, Martell Malone via cfe-commits <
 cfe-commits@lists.llvm.org> wrote:

> Author: martell
> Date: Tue Sep 12 15:14:18 2017
> New Revision: 313082
>
> URL: http://llvm.org/viewvc/llvm-project?rev=313082&view=rev
> Log:
> [Driver] MinGW: Remove custom linker detection
>
> In rL289668 the ability to specify the default linker at compile time
> was added but because the MinGW driver used custom detection we could
> not take advantage of this new CMAKE flag CLANG_DEFAULT_LINKER.
>
> Modified:
> cfe/trunk/lib/Driver/ToolChains/MinGW.cpp
> cfe/trunk/test/Driver/mingw-useld.c
>
> Modified: cfe/trunk/lib/Driver/ToolChains/MinGW.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Too
> lChains/MinGW.cpp?rev=313082&r1=313081&r2=313082&view=diff
> 
> ==
> --- cfe/trunk/lib/Driver/ToolChains/MinGW.cpp (original)
> +++ cfe/trunk/lib/Driver/ToolChains/MinGW.cpp Tue Sep 12 15:14:18 2017
> @@ -104,14 +104,6 @@ void tools::MinGW::Linker::ConstructJob(
>// handled somewhere else.
>Args.ClaimAllArgs(options::OPT_w);
>
> -  StringRef LinkerName = Args.getLastArgValue(options::OPT_fuse_ld_EQ,
> "ld");
> -  if (LinkerName.equals_lower("lld")) {
> -CmdArgs.push_back("-flavor");
> -CmdArgs.push_back("gnu");
> -  } else if (!LinkerName.equals_lower("ld")) {
> -D.Diag(diag::err_drv_unsupported_linker) << LinkerName;
> -  }
> -
>if (!D.SysRoot.empty())
>  CmdArgs.push_back(Args.MakeArgString("--sysroot=" + D.SysRoot));
>
> @@ -241,7 +233,7 @@ void tools::MinGW::Linker::ConstructJob(
>
>if (Args.hasArg(options::OPT_static))
>  CmdArgs.push_back("--end-group");
> -  else if (!LinkerName.equals_lower("lld"))
> +  else
>  AddLibGCC(Args, CmdArgs);
>  }
>
> @@ -252,7 +244,7 @@ void tools::MinGW::Linker::ConstructJob(
>CmdArgs.push_back(Args.MakeArgString(TC.GetFilePath("crtend
> .o")));
>  }
>}
> -  const char *Exec = Args.MakeArgString(TC.GetProgr
> amPath(LinkerName.data()));
> +  const char *Exec = Args.MakeArgString(TC.GetLinkerPath());
>C.addCommand(llvm::make_unique(JA, *this, Exec, CmdArgs,
> Inputs));
>  }
>
>
> Modified: cfe/trunk/test/Driver/mingw-useld.c
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/mi
> ngw-useld.c?rev=313082&r1=313081&r2=313082&view=diff
> 
> ==
> --- cfe/trunk/test/Driver/mingw-useld.c (original)
> +++ cfe/trunk/test/Driver/mingw-useld.c Tue Sep 12 15:14:18 2017
> @@ -1,19 +1,19 @@
> -// RUN: %clang -### -target i686-pc-windows-gnu
> --sysroot=%S/Inputs/mingw_clang_tree/mingw32 %s 2>&1 | FileCheck
> -check-prefix=CHECK_LD_32 %s
> -// CHECK_LD_32: ld{{(.exe)?}}"
> +// RUN: %clang -### -target i686-pc-windows-gnu
> --sysroot=%S/Inputs/mingw_clang_tree/mingw32 %s -fuse-ld=platform
> 2>&1 | FileCheck -check-prefix=CHECK_LD_32 %s
> +// CHECK_LD_32: "{{[^"]*}}ld{{(.exe)?}}"
>  // CHECK_LD_32: "i386pe"
> -// CHECK_LD_32-NOT: "-flavor" "gnu"
> +// CHECK_LD_32-NOT: "{{[^"]*}}ld.lld{{(.exe)?}}"
>
>  // RUN: %clang -### -target i686-pc-win

Re: r313088 - Revert "[Driver] MinGW: Remove custom linker detection"

2017-09-12 Thread Rui Ueyama via cfe-commits
It is reverted because it broke buildbots:
http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-incremental/42380/testReport/junit/Clang/Driver/mingw_useld_c/

On Tue, Sep 12, 2017 at 4:05 PM, Rui Ueyama  wrote:

> I wonder why you reverted this change.
>
> On Tue, Sep 12, 2017 at 4:04 PM, Martell Malone 
> wrote:
>
>> Will do in future, thanks Rui.
>>
>> On Wed, Sep 13, 2017 at 12:03 AM, Rui Ueyama  wrote:
>>
>>> When you revert a commit, please explain why you are reverting it in the
>>> commit message.
>>>
>>> On Tue, Sep 12, 2017 at 3:58 PM, Martell Malone via cfe-commits <
>>> cfe-commits@lists.llvm.org> wrote:
>>>
 Author: martell
 Date: Tue Sep 12 15:58:12 2017
 New Revision: 313088

 URL: http://llvm.org/viewvc/llvm-project?rev=313088&view=rev
 Log:
 Revert "[Driver] MinGW: Remove custom linker detection"

 This reverts rL313082

 Modified:
 cfe/trunk/lib/Driver/ToolChains/MinGW.cpp
 cfe/trunk/test/Driver/mingw-useld.c

 Modified: cfe/trunk/lib/Driver/ToolChains/MinGW.cpp
 URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Too
 lChains/MinGW.cpp?rev=313088&r1=313087&r2=313088&view=diff
 
 ==
 --- cfe/trunk/lib/Driver/ToolChains/MinGW.cpp (original)
 +++ cfe/trunk/lib/Driver/ToolChains/MinGW.cpp Tue Sep 12 15:58:12 2017
 @@ -104,6 +104,14 @@ void tools::MinGW::Linker::ConstructJob(
// handled somewhere else.
Args.ClaimAllArgs(options::OPT_w);

 +  StringRef LinkerName = Args.getLastArgValue(options::OPT_fuse_ld_EQ,
 "ld");
 +  if (LinkerName.equals_lower("lld")) {
 +CmdArgs.push_back("-flavor");
 +CmdArgs.push_back("gnu");
 +  } else if (!LinkerName.equals_lower("ld")) {
 +D.Diag(diag::err_drv_unsupported_linker) << LinkerName;
 +  }
 +
if (!D.SysRoot.empty())
  CmdArgs.push_back(Args.MakeArgString("--sysroot=" + D.SysRoot));

 @@ -233,7 +241,7 @@ void tools::MinGW::Linker::ConstructJob(

if (Args.hasArg(options::OPT_static))
  CmdArgs.push_back("--end-group");
 -  else
 +  else if (!LinkerName.equals_lower("lld"))
  AddLibGCC(Args, CmdArgs);
  }

 @@ -244,7 +252,7 @@ void tools::MinGW::Linker::ConstructJob(
CmdArgs.push_back(Args.MakeArgString(TC.GetFilePath("crtend
 .o")));
  }
}
 -  const char *Exec = Args.MakeArgString(TC.GetLinkerPath());
 +  const char *Exec = Args.MakeArgString(TC.GetProgr
 amPath(LinkerName.data()));
C.addCommand(llvm::make_unique(JA, *this, Exec, CmdArgs,
 Inputs));
  }


 Modified: cfe/trunk/test/Driver/mingw-useld.c
 URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/mi
 ngw-useld.c?rev=313088&r1=313087&r2=313088&view=diff
 
 ==
 --- cfe/trunk/test/Driver/mingw-useld.c (original)
 +++ cfe/trunk/test/Driver/mingw-useld.c Tue Sep 12 15:58:12 2017
 @@ -1,19 +1,19 @@
 -// RUN: %clang -### -target i686-pc-windows-gnu
 --sysroot=%S/Inputs/mingw_clang_tree/mingw32 %s -fuse-ld=platform 2>&1
 | FileCheck -check-prefix=CHECK_LD_32 %s
 -// CHECK_LD_32: "{{[^"]*}}ld{{(.exe)?}}"
 +// RUN: %clang -### -target i686-pc-windows-gnu
 --sysroot=%S/Inputs/mingw_clang_tree/mingw32 %s 2>&1 | FileCheck
 -check-prefix=CHECK_LD_32 %s
 +// CHECK_LD_32: ld{{(.exe)?}}"
  // CHECK_LD_32: "i386pe"
 -// CHECK_LD_32-NOT: "{{[^"]*}}ld.lld{{(.exe)?}}"
 +// CHECK_LD_32-NOT: "-flavor" "gnu"

  // RUN: %clang -### -target i686-pc-windows-gnu
 --sysroot=%S/Inputs/mingw_clang_tree/mingw32 %s -fuse-ld=lld 2>&1 |
 FileCheck -check-prefix=CHECK_LLD_32 %s
  // CHECK_LLD_32-NOT: invalid linker name in argument
 -// CHECK_LLD_32: "{{[^"]*}}ld.lld{{(.exe)?}}"
 +// CHECK_LLD_32: lld{{(.exe)?}}" "-flavor" "gnu"
  // CHECK_LLD_32: "i386pe"

  // RUN: %clang -### -target x86_64-pc-windows-gnu
 --sysroot=%S/Inputs/mingw_clang_tree/mingw32 %s -fuse-ld=lld 2>&1 |
 FileCheck -check-prefix=CHECK_LLD_64 %s
  // CHECK_LLD_64-NOT: invalid linker name in argument
 -// CHECK_LLD_64: "{{[^"]*}}ld.lld{{(.exe)?}}"
 +// CHECK_LLD_64: lld{{(.exe)?}}" "-flavor" "gnu"
  // CHECK_LLD_64: "i386pep"

  // RUN: %clang -### -target arm-pc-windows-gnu
 --sysroot=%S/Inputs/mingw_clang_tree/mingw32 %s -fuse-ld=lld 2>&1 |
 FileCheck -check-prefix=CHECK_LLD_ARM %s
  // CHECK_LLD_ARM-NOT: invalid linker name in argument
 -// CHECK_LLD_ARM: "{{[^"]*}}ld.lld{{(.exe)?}}"
 +// CHECK_LLD_ARM: lld{{(.exe)?}}" "-flavor" "gnu"
  // CHECK_LLD_ARM: "thumb2pe"


 ___
 cfe-commits mailing list
 cfe-commits@lists.llvm.org
 http

Re: r313104 - Revert "[Driver] MinGW: Remove custom linker detection"

2017-09-13 Thread Rui Ueyama via cfe-commits
This is a wild guess, but don't you need to add `REQUIRES: lld` to your
test if your test depends on lld? I don't think all bots have lld, and if
`ld.lld` is not found, clang prints out that error message.

On Tue, Sep 12, 2017 at 7:16 PM, Martell Malone 
wrote:

> Just to follow up,
> The test case here was added by yaron in https://reviews.llvm.org/rL253066
> As a follow up to the original detection which I originally wrote and reid
> reviewed https://reviews.llvm.org/rL242121
> Given that no other target does special checks except msvc for lld-link
> removing this test case might also be an option.
>
> On Wed, Sep 13, 2017 at 2:54 AM, Martell Malone 
> wrote:
>
>> Hey Reid, Rui,
>>
>> I had to revert this twice. I'm not sure where the configurations for the
>> build bots are but there are 2 issues as I mentioned in the commit message
>>
>> Looking through the clang test directory I only se -fuse-ld=lld tested in
>> 4 locations
>>
>> test/Driver/windows-cross.c does some really old tests like
>> `-fuse-ld=lld-link2` which was back when Rui had just started the new COFF
>> linker. (maybe we should remove / update these ? )
>> test/Driver/cl-link.c which checks that for cl -fuse-ld=lld is converted
>> to lld-link and not ld.lld
>> test/Driver/cl-options.c just checks an error showing LTO that requires
>> -fuse-ld=lld
>> and in
>> test/Driver/mingw-useld.c where we run into our errors.
>>
>> So to begin there does not seem to be any checking for lld in the test
>> suite because it is not properly tested anywhere (from a clang perspective).
>>
>> For the first error `error: invalid linker name in argument
>> '-fuse-ld=lld'`
>> I'm not sure exactly how to add requirements to the lit tooling, I did a
>> few greps build only came up with target checks.
>> but do you know where I would look to implement something like this?
>> `// REQUIRES: lld`
>>
>> As for the second issue.
>>
>> lld-link.exe: warning: ignoring unknown argument: -fuse-ld=lld
>>
>> I can't confirm but it seems like a configuration with the buildbot
>> itself.
>> Possibly related to setting LLD_SYMLINKS_TO_CREATE within the bot itself
>> or some bat file on the system itself for symlinking?
>>
>> I don't think it is clang itself that is doing this because the only
>> place where lld is remapped to lld-link is in lib/Driver/ToolChains/MSVC.
>> cpp
>> and that is only for msvc targets with a testcase in test/Driver/cl-link.c
>>
>> Best,
>> Martell
>>
>>
>> On Wed, Sep 13, 2017 at 1:57 AM, Martell Malone via cfe-commits <
>> cfe-commits@lists.llvm.org> wrote:
>>
>>> Author: martell
>>> Date: Tue Sep 12 17:57:50 2017
>>> New Revision: 313104
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=313104&view=rev
>>> Log:
>>> Revert "[Driver] MinGW: Remove custom linker detection"
>>>
>>> This reverts rL313102 because it still fails some build bot tests.
>>>
>>> On many linux bots it fails with the following error.
>>> error: invalid linker name in argument '-fuse-ld=lld'
>>> and on some windows bots also because there is no ld.lld.exe
>>> lld-link.exe: warning: ignoring unknown argument: -fuse-ld=lld
>>>
>>> Modified:
>>> cfe/trunk/lib/Driver/ToolChains/MinGW.cpp
>>> cfe/trunk/test/Driver/mingw-useld.c
>>>
>>> Modified: cfe/trunk/lib/Driver/ToolChains/MinGW.cpp
>>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Too
>>> lChains/MinGW.cpp?rev=313104&r1=313103&r2=313104&view=diff
>>> 
>>> ==
>>> --- cfe/trunk/lib/Driver/ToolChains/MinGW.cpp (original)
>>> +++ cfe/trunk/lib/Driver/ToolChains/MinGW.cpp Tue Sep 12 17:57:50 2017
>>> @@ -104,6 +104,14 @@ void tools::MinGW::Linker::ConstructJob(
>>>// handled somewhere else.
>>>Args.ClaimAllArgs(options::OPT_w);
>>>
>>> +  StringRef LinkerName = Args.getLastArgValue(options::OPT_fuse_ld_EQ,
>>> "ld");
>>> +  if (LinkerName.equals_lower("lld")) {
>>> +CmdArgs.push_back("-flavor");
>>> +CmdArgs.push_back("gnu");
>>> +  } else if (!LinkerName.equals_lower("ld")) {
>>> +D.Diag(diag::err_drv_unsupported_linker) << LinkerName;
>>> +  }
>>> +
>>>if (!D.SysRoot.empty())
>>>  CmdArgs.push_back(Args.MakeArgString("--sysroot=" + D.SysRoot));
>>>
>>> @@ -233,7 +241,7 @@ void tools::MinGW::Linker::ConstructJob(
>>>
>>>if (Args.hasArg(options::OPT_static))
>>>  CmdArgs.push_back("--end-group");
>>> -  else
>>> +  else if (!LinkerName.equals_lower("lld"))
>>>  AddLibGCC(Args, CmdArgs);
>>>  }
>>>
>>> @@ -244,7 +252,7 @@ void tools::MinGW::Linker::ConstructJob(
>>>CmdArgs.push_back(Args.MakeArgString(TC.GetFilePath("crtend
>>> .o")));
>>>  }
>>>}
>>> -  const char *Exec = Args.MakeArgString(TC.GetLinkerPath());
>>> +  const char *Exec = Args.MakeArgString(TC.GetProgr
>>> amPath(LinkerName.data()));
>>>C.addCommand(llvm::make_unique(JA, *this, Exec, CmdArgs,
>>> Inputs));
>>>  }
>>>
>>>
>>> Modified: cfe/trunk/test/Driver/mingw-useld.c
>>> URL: htt

Re: r313104 - Revert "[Driver] MinGW: Remove custom linker detection"

2017-09-13 Thread Rui Ueyama via cfe-commits
Ah, sorry, you mentioned that. Yes, I think you need it.

On Wed, Sep 13, 2017 at 1:00 PM, Rui Ueyama  wrote:

> This is a wild guess, but don't you need to add `REQUIRES: lld` to your
> test if your test depends on lld? I don't think all bots have lld, and if
> `ld.lld` is not found, clang prints out that error message.
>
> On Tue, Sep 12, 2017 at 7:16 PM, Martell Malone 
> wrote:
>
>> Just to follow up,
>> The test case here was added by yaron in https://reviews.llvm.org/rL253
>> 066
>> As a follow up to the original detection which I originally wrote and
>> reid reviewed https://reviews.llvm.org/rL242121
>> Given that no other target does special checks except msvc for lld-link
>> removing this test case might also be an option.
>>
>> On Wed, Sep 13, 2017 at 2:54 AM, Martell Malone 
>> wrote:
>>
>>> Hey Reid, Rui,
>>>
>>> I had to revert this twice. I'm not sure where the configurations for
>>> the build bots are but there are 2 issues as I mentioned in the commit
>>> message
>>>
>>> Looking through the clang test directory I only se -fuse-ld=lld tested
>>> in 4 locations
>>>
>>> test/Driver/windows-cross.c does some really old tests like
>>> `-fuse-ld=lld-link2` which was back when Rui had just started the new COFF
>>> linker. (maybe we should remove / update these ? )
>>> test/Driver/cl-link.c which checks that for cl -fuse-ld=lld is converted
>>> to lld-link and not ld.lld
>>> test/Driver/cl-options.c just checks an error showing LTO that requires
>>> -fuse-ld=lld
>>> and in
>>> test/Driver/mingw-useld.c where we run into our errors.
>>>
>>> So to begin there does not seem to be any checking for lld in the test
>>> suite because it is not properly tested anywhere (from a clang perspective).
>>>
>>> For the first error `error: invalid linker name in argument
>>> '-fuse-ld=lld'`
>>> I'm not sure exactly how to add requirements to the lit tooling, I did a
>>> few greps build only came up with target checks.
>>> but do you know where I would look to implement something like this?
>>> `// REQUIRES: lld`
>>>
>>> As for the second issue.
>>>
>>> lld-link.exe: warning: ignoring unknown argument: -fuse-ld=lld
>>>
>>> I can't confirm but it seems like a configuration with the buildbot
>>> itself.
>>> Possibly related to setting LLD_SYMLINKS_TO_CREATE within the bot itself
>>> or some bat file on the system itself for symlinking?
>>>
>>> I don't think it is clang itself that is doing this because the only
>>> place where lld is remapped to lld-link is in lib/Driver/ToolChains/MSVC.
>>> cpp
>>> and that is only for msvc targets with a testcase
>>> in test/Driver/cl-link.c
>>>
>>> Best,
>>> Martell
>>>
>>>
>>> On Wed, Sep 13, 2017 at 1:57 AM, Martell Malone via cfe-commits <
>>> cfe-commits@lists.llvm.org> wrote:
>>>
 Author: martell
 Date: Tue Sep 12 17:57:50 2017
 New Revision: 313104

 URL: http://llvm.org/viewvc/llvm-project?rev=313104&view=rev
 Log:
 Revert "[Driver] MinGW: Remove custom linker detection"

 This reverts rL313102 because it still fails some build bot tests.

 On many linux bots it fails with the following error.
 error: invalid linker name in argument '-fuse-ld=lld'
 and on some windows bots also because there is no ld.lld.exe
 lld-link.exe: warning: ignoring unknown argument: -fuse-ld=lld

 Modified:
 cfe/trunk/lib/Driver/ToolChains/MinGW.cpp
 cfe/trunk/test/Driver/mingw-useld.c

 Modified: cfe/trunk/lib/Driver/ToolChains/MinGW.cpp
 URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Too
 lChains/MinGW.cpp?rev=313104&r1=313103&r2=313104&view=diff
 
 ==
 --- cfe/trunk/lib/Driver/ToolChains/MinGW.cpp (original)
 +++ cfe/trunk/lib/Driver/ToolChains/MinGW.cpp Tue Sep 12 17:57:50 2017
 @@ -104,6 +104,14 @@ void tools::MinGW::Linker::ConstructJob(
// handled somewhere else.
Args.ClaimAllArgs(options::OPT_w);

 +  StringRef LinkerName = Args.getLastArgValue(options::OPT_fuse_ld_EQ,
 "ld");
 +  if (LinkerName.equals_lower("lld")) {
 +CmdArgs.push_back("-flavor");
 +CmdArgs.push_back("gnu");
 +  } else if (!LinkerName.equals_lower("ld")) {
 +D.Diag(diag::err_drv_unsupported_linker) << LinkerName;
 +  }
 +
if (!D.SysRoot.empty())
  CmdArgs.push_back(Args.MakeArgString("--sysroot=" + D.SysRoot));

 @@ -233,7 +241,7 @@ void tools::MinGW::Linker::ConstructJob(

if (Args.hasArg(options::OPT_static))
  CmdArgs.push_back("--end-group");
 -  else
 +  else if (!LinkerName.equals_lower("lld"))
  AddLibGCC(Args, CmdArgs);
  }

 @@ -244,7 +252,7 @@ void tools::MinGW::Linker::ConstructJob(
CmdArgs.push_back(Args.MakeArgString(TC.GetFilePath("crtend
 .o")));
  }
}
 -  const char *Exec = Args.MakeArgString(TC.GetLinkerPa

[clang-tools-extra] r366304 - Replace CRLF with LF.

2019-07-17 Thread Rui Ueyama via cfe-commits
Author: ruiu
Date: Wed Jul 17 01:31:51 2019
New Revision: 366304

URL: http://llvm.org/viewvc/llvm-project?rev=366304&view=rev
Log:
Replace CRLF with LF.

Modified:

clang-tools-extra/trunk/unittests/clang-tidy/ClangTidyDiagnosticConsumerTest.cpp

Modified: 
clang-tools-extra/trunk/unittests/clang-tidy/ClangTidyDiagnosticConsumerTest.cpp
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/clang-tidy/ClangTidyDiagnosticConsumerTest.cpp?rev=366304&r1=366303&r2=366304&view=diff
==
--- 
clang-tools-extra/trunk/unittests/clang-tidy/ClangTidyDiagnosticConsumerTest.cpp
 (original)
+++ 
clang-tools-extra/trunk/unittests/clang-tidy/ClangTidyDiagnosticConsumerTest.cpp
 Wed Jul 17 01:31:51 2019
@@ -1,94 +1,94 @@
-#include "ClangTidy.h"
-#include "ClangTidyTest.h"
-#include "gtest/gtest.h"
-
-namespace clang {
-namespace tidy {
-namespace test {
-
-class TestCheck : public ClangTidyCheck {
-public:
-  TestCheck(StringRef Name, ClangTidyContext *Context)
-  : ClangTidyCheck(Name, Context) {}
-  void registerMatchers(ast_matchers::MatchFinder *Finder) override {
-Finder->addMatcher(ast_matchers::varDecl().bind("var"), this);
-  }
-  void check(const ast_matchers::MatchFinder::MatchResult &Result) override {
-const auto *Var = Result.Nodes.getNodeAs("var");
-// Add diagnostics in the wrong order.
-diag(Var->getLocation(), "variable");
-diag(Var->getTypeSpecStartLoc(), "type specifier");
-  }
-};
-
-TEST(ClangTidyDiagnosticConsumer, SortsErrors) {
-  std::vector Errors;
-  runCheckOnCode("int a;", &Errors);
-  EXPECT_EQ(2ul, Errors.size());
-  EXPECT_EQ("type specifier", Errors[0].Message.Message);
-  EXPECT_EQ("variable", Errors[1].Message.Message);
-}
-
-TEST(GlobList, Empty) {
-  GlobList Filter("");
-
-  EXPECT_TRUE(Filter.contains(""));
-  EXPECT_FALSE(Filter.contains("aaa"));
-}
-
-TEST(GlobList, Nothing) {
-  GlobList Filter("-*");
-
-  EXPECT_FALSE(Filter.contains(""));
-  EXPECT_FALSE(Filter.contains("a"));
-  EXPECT_FALSE(Filter.contains("-*"));
-  EXPECT_FALSE(Filter.contains("-"));
-  EXPECT_FALSE(Filter.contains("*"));
-}
-
-TEST(GlobList, Everything) {
-  GlobList Filter("*");
-
-  EXPECT_TRUE(Filter.contains(""));
-  EXPECT_TRUE(Filter.contains(""));
-  EXPECT_TRUE(Filter.contains("-*"));
-  EXPECT_TRUE(Filter.contains("-"));
-  EXPECT_TRUE(Filter.contains("*"));
-}
-
-TEST(GlobList, Simple) {
-  GlobList Filter("aaa");
-
-  EXPECT_TRUE(Filter.contains("aaa"));
-  EXPECT_FALSE(Filter.contains(""));
-  EXPECT_FALSE(Filter.contains("aa"));
-  EXPECT_FALSE(Filter.contains(""));
-  EXPECT_FALSE(Filter.contains("bbb"));
-}
-
-TEST(GlobList, WhitespacesAtBegin) {
-  GlobList Filter("-*,   a.b.*");
-
-  EXPECT_TRUE(Filter.contains("a.b.c"));
-  EXPECT_FALSE(Filter.contains("b.c"));
-}
-
-TEST(GlobList, Complex) {
-  GlobList Filter("*,-a.*, -b.*, \r  \n  a.1.* ,-a.1.A.*,-..,-...,-..+,-*$, 
-*qwe* ");
-
-  EXPECT_TRUE(Filter.contains("aaa"));
-  EXPECT_TRUE(Filter.contains("qqq"));
-  EXPECT_FALSE(Filter.contains("a."));
-  EXPECT_FALSE(Filter.contains("a.b"));
-  EXPECT_FALSE(Filter.contains("b."));
-  EXPECT_FALSE(Filter.contains("b.b"));
-  EXPECT_TRUE(Filter.contains("a.1.b"));
-  EXPECT_FALSE(Filter.contains("a.1.A.a"));
-  EXPECT_FALSE(Filter.contains("qwe"));
-  EXPECT_FALSE(Filter.contains("asdfqweasdf"));
-  EXPECT_TRUE(Filter.contains("asdfqwEasdf"));
-}
-
-} // namespace test
-} // namespace tidy
-} // namespace clang
+#include "ClangTidy.h"
+#include "ClangTidyTest.h"
+#include "gtest/gtest.h"
+
+namespace clang {
+namespace tidy {
+namespace test {
+
+class TestCheck : public ClangTidyCheck {
+public:
+  TestCheck(StringRef Name, ClangTidyContext *Context)
+  : ClangTidyCheck(Name, Context) {}
+  void registerMatchers(ast_matchers::MatchFinder *Finder) override {
+Finder->addMatcher(ast_matchers::varDecl().bind("var"), this);
+  }
+  void check(const ast_matchers::MatchFinder::MatchResult &Result) override {
+const auto *Var = Result.Nodes.getNodeAs("var");
+// Add diagnostics in the wrong order.
+diag(Var->getLocation(), "variable");
+diag(Var->getTypeSpecStartLoc(), "type specifier");
+  }
+};
+
+TEST(ClangTidyDiagnosticConsumer, SortsErrors) {
+  std::vector Errors;
+  runCheckOnCode("int a;", &Errors);
+  EXPECT_EQ(2ul, Errors.size());
+  EXPECT_EQ("type specifier", Errors[0].Message.Message);
+  EXPECT_EQ("variable", Errors[1].Message.Message);
+}
+
+TEST(GlobList, Empty) {
+  GlobList Filter("");
+
+  EXPECT_TRUE(Filter.contains(""));
+  EXPECT_FALSE(Filter.contains("aaa"));
+}
+
+TEST(GlobList, Nothing) {
+  GlobList Filter("-*");
+
+  EXPECT_FALSE(Filter.contains(""));
+  EXPECT_FALSE(Filter.contains("a"));
+  EXPECT_FALSE(Filter.contains("-*"));
+  EXPECT_FALSE(Filter.contains("-"));
+  EXPECT_FALSE(Filter.contains("*"));
+}
+
+TEST(GlobList, Everything) {
+  GlobList Filter("*");
+
+  EXPECT_TRUE(Filter.contains(""));
+  EXPECT_TRUE(Fi

r367649 - Improve raw_ostream so that you can "write" colors using operator<

2019-08-01 Thread Rui Ueyama via cfe-commits
Author: ruiu
Date: Thu Aug  1 21:48:30 2019
New Revision: 367649

URL: http://llvm.org/viewvc/llvm-project?rev=367649&view=rev
Log:
Improve raw_ostream so that you can "write" colors using operator<<

1. raw_ostream supports ANSI colors so that you can write messages to
the termina with colors. Previously, in order to change and reset
color, you had to call `changeColor` and `resetColor` functions,
respectively.

So, if you print out "error: " in red, for example, you had to do
something like this:

  OS.changeColor(raw_ostream::RED);
  OS << "error: ";
  OS.resetColor();

With this patch, you can write the same code as follows:

  OS << raw_ostream::RED << "error: " << raw_ostream::RESET;

2. Add a boolean flag to raw_ostream so that you can disable colored
output. If you disable colors, changeColor, operator<<(Color),
resetColor and other color-related functions have no effect.

Most LLVM tools automatically prints out messages using colors, and
you can disable it by passing a flag such as `--disable-colors`.
This new flag makes it easy to write code that works that way.

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

Modified:
cfe/trunk/include/clang/AST/ASTDumperUtils.h
cfe/trunk/lib/Analysis/CFG.cpp
cfe/trunk/lib/Frontend/CompilerInvocation.cpp
cfe/trunk/lib/Frontend/TextDiagnostic.cpp
cfe/trunk/tools/diagtool/TreeView.cpp

Modified: cfe/trunk/include/clang/AST/ASTDumperUtils.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ASTDumperUtils.h?rev=367649&r1=367648&r2=367649&view=diff
==
--- cfe/trunk/include/clang/AST/ASTDumperUtils.h (original)
+++ cfe/trunk/include/clang/AST/ASTDumperUtils.h Thu Aug  1 21:48:30 2019
@@ -27,7 +27,7 @@ enum ASTDumpOutputFormat {
 // Do not use bold yellow for any text.  It is hard to read on white screens.
 
 struct TerminalColor {
-  llvm::raw_ostream::Colors Color;
+  llvm::raw_ostream::Color Color;
   bool Bold;
 };
 

Modified: cfe/trunk/lib/Analysis/CFG.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CFG.cpp?rev=367649&r1=367648&r2=367649&view=diff
==
--- cfe/trunk/lib/Analysis/CFG.cpp (original)
+++ cfe/trunk/lib/Analysis/CFG.cpp Thu Aug  1 21:48:30 2019
@@ -5509,7 +5509,7 @@ static void print_block(raw_ostream &OS,
   if (print_edges) {
 // Print the predecessors of this block.
 if (!B.pred_empty()) {
-  const raw_ostream::Colors Color = raw_ostream::BLUE;
+  const raw_ostream::Color Color = raw_ostream::BLUE;
   if (ShowColors)
 OS.changeColor(Color);
   OS << "   Preds " ;
@@ -5546,7 +5546,7 @@ static void print_block(raw_ostream &OS,
 
 // Print the successors of this block.
 if (!B.succ_empty()) {
-  const raw_ostream::Colors Color = raw_ostream::MAGENTA;
+  const raw_ostream::Color Color = raw_ostream::MAGENTA;
   if (ShowColors)
 OS.changeColor(Color);
   OS << "   Succs ";

Modified: cfe/trunk/lib/Frontend/CompilerInvocation.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=367649&r1=367648&r2=367649&view=diff
==
--- cfe/trunk/lib/Frontend/CompilerInvocation.cpp (original)
+++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp Thu Aug  1 21:48:30 2019
@@ -1491,6 +1491,10 @@ bool clang::ParseDiagnosticArgs(Diagnost
OPT_fno_diagnostics_show_option, DefaultShowOpt);
 
   llvm::sys::Process::UseANSIEscapeCodes(Args.hasArg(OPT_fansi_escape_codes));
+  if (Opts.ShowColors) {
+llvm::outs().enable_colors();
+llvm::errs().enable_colors();
+  }
 
   // Default behavior is to not to show note include stacks.
   Opts.ShowNoteIncludeStack = false;

Modified: cfe/trunk/lib/Frontend/TextDiagnostic.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/TextDiagnostic.cpp?rev=367649&r1=367648&r2=367649&view=diff
==
--- cfe/trunk/lib/Frontend/TextDiagnostic.cpp (original)
+++ cfe/trunk/lib/Frontend/TextDiagnostic.cpp Thu Aug  1 21:48:30 2019
@@ -23,23 +23,16 @@
 
 using namespace clang;
 
-static const enum raw_ostream::Colors noteColor =
-  raw_ostream::BLACK;
-static const enum raw_ostream::Colors remarkColor =
-  raw_ostream::BLUE;
-static const enum raw_ostream::Colors fixitColor =
-  raw_ostream::GREEN;
-static const enum raw_ostream::Colors caretColor =
-  raw_ostream::GREEN;
-static const enum raw_ostream::Colors warningColor =
-  raw_ostream::MAGENTA;
-static const enum raw_ostream::Colors templateColor =
-  raw_ostream::CYAN;
-static const enum raw_ostream::Colors errorColor = raw_ostream::RED;
-static const enum raw_ostream::Colors fatalColor = raw_ostream::RED;
+static const raw_ostream::Color noteColor = raw_ostream::BLACK;
+static const raw_ostream

r367658 - Revert r367649: Improve raw_ostream so that you can "write" colors using operator<

2019-08-02 Thread Rui Ueyama via cfe-commits
Author: ruiu
Date: Fri Aug  2 00:22:34 2019
New Revision: 367658

URL: http://llvm.org/viewvc/llvm-project?rev=367658&view=rev
Log:
Revert r367649: Improve raw_ostream so that you can "write" colors using 
operator<<

This reverts commit r367649 in an attempt to unbreak Windows bots.

Modified:
cfe/trunk/include/clang/AST/ASTDumperUtils.h
cfe/trunk/lib/Analysis/CFG.cpp
cfe/trunk/lib/Frontend/CompilerInvocation.cpp
cfe/trunk/lib/Frontend/TextDiagnostic.cpp
cfe/trunk/tools/diagtool/TreeView.cpp

Modified: cfe/trunk/include/clang/AST/ASTDumperUtils.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ASTDumperUtils.h?rev=367658&r1=367657&r2=367658&view=diff
==
--- cfe/trunk/include/clang/AST/ASTDumperUtils.h (original)
+++ cfe/trunk/include/clang/AST/ASTDumperUtils.h Fri Aug  2 00:22:34 2019
@@ -27,7 +27,7 @@ enum ASTDumpOutputFormat {
 // Do not use bold yellow for any text.  It is hard to read on white screens.
 
 struct TerminalColor {
-  llvm::raw_ostream::Color Color;
+  llvm::raw_ostream::Colors Color;
   bool Bold;
 };
 

Modified: cfe/trunk/lib/Analysis/CFG.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CFG.cpp?rev=367658&r1=367657&r2=367658&view=diff
==
--- cfe/trunk/lib/Analysis/CFG.cpp (original)
+++ cfe/trunk/lib/Analysis/CFG.cpp Fri Aug  2 00:22:34 2019
@@ -5509,7 +5509,7 @@ static void print_block(raw_ostream &OS,
   if (print_edges) {
 // Print the predecessors of this block.
 if (!B.pred_empty()) {
-  const raw_ostream::Color Color = raw_ostream::BLUE;
+  const raw_ostream::Colors Color = raw_ostream::BLUE;
   if (ShowColors)
 OS.changeColor(Color);
   OS << "   Preds " ;
@@ -5546,7 +5546,7 @@ static void print_block(raw_ostream &OS,
 
 // Print the successors of this block.
 if (!B.succ_empty()) {
-  const raw_ostream::Color Color = raw_ostream::MAGENTA;
+  const raw_ostream::Colors Color = raw_ostream::MAGENTA;
   if (ShowColors)
 OS.changeColor(Color);
   OS << "   Succs ";

Modified: cfe/trunk/lib/Frontend/CompilerInvocation.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=367658&r1=367657&r2=367658&view=diff
==
--- cfe/trunk/lib/Frontend/CompilerInvocation.cpp (original)
+++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp Fri Aug  2 00:22:34 2019
@@ -1491,10 +1491,6 @@ bool clang::ParseDiagnosticArgs(Diagnost
OPT_fno_diagnostics_show_option, DefaultShowOpt);
 
   llvm::sys::Process::UseANSIEscapeCodes(Args.hasArg(OPT_fansi_escape_codes));
-  if (Opts.ShowColors) {
-llvm::outs().enable_colors();
-llvm::errs().enable_colors();
-  }
 
   // Default behavior is to not to show note include stacks.
   Opts.ShowNoteIncludeStack = false;

Modified: cfe/trunk/lib/Frontend/TextDiagnostic.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/TextDiagnostic.cpp?rev=367658&r1=367657&r2=367658&view=diff
==
--- cfe/trunk/lib/Frontend/TextDiagnostic.cpp (original)
+++ cfe/trunk/lib/Frontend/TextDiagnostic.cpp Fri Aug  2 00:22:34 2019
@@ -23,16 +23,23 @@
 
 using namespace clang;
 
-static const raw_ostream::Color noteColor = raw_ostream::BLACK;
-static const raw_ostream::Color remarkColor = raw_ostream::BLUE;
-static const raw_ostream::Color fixitColor = raw_ostream::GREEN;
-static const raw_ostream::Color caretColor = raw_ostream::GREEN;
-static const raw_ostream::Color warningColor = raw_ostream::MAGENTA;
-static const raw_ostream::Color templateColor = raw_ostream::CYAN;
-static const raw_ostream::Color errorColor = raw_ostream::RED;
-static const raw_ostream::Color fatalColor = raw_ostream::RED;
+static const enum raw_ostream::Colors noteColor =
+  raw_ostream::BLACK;
+static const enum raw_ostream::Colors remarkColor =
+  raw_ostream::BLUE;
+static const enum raw_ostream::Colors fixitColor =
+  raw_ostream::GREEN;
+static const enum raw_ostream::Colors caretColor =
+  raw_ostream::GREEN;
+static const enum raw_ostream::Colors warningColor =
+  raw_ostream::MAGENTA;
+static const enum raw_ostream::Colors templateColor =
+  raw_ostream::CYAN;
+static const enum raw_ostream::Colors errorColor = raw_ostream::RED;
+static const enum raw_ostream::Colors fatalColor = raw_ostream::RED;
 // Used for changing only the bold attribute.
-static const raw_ostream::Color savedColor = raw_ostream::SAVEDCOLOR;
+static const enum raw_ostream::Colors savedColor =
+  raw_ostream::SAVEDCOLOR;
 
 /// Add highlights to differences in template strings.
 static void applyTemplateHighlighting(raw_ostream &OS, StringRef Str,

Modified: cfe/trunk/tools/diagtool/TreeView.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/

r368131 - Re-submit r367649: Improve raw_ostream so that you can "write" colors using operator<

2019-08-07 Thread Rui Ueyama via cfe-commits
Author: ruiu
Date: Wed Aug  7 01:08:17 2019
New Revision: 368131

URL: http://llvm.org/viewvc/llvm-project?rev=368131&view=rev
Log:
Re-submit r367649: Improve raw_ostream so that you can "write" colors using 
operator<<

The original patch broke buildbots, perhaps because it changed the
default setting whether colors are enabled or not.

Modified:
cfe/trunk/tools/diagtool/TreeView.cpp

Modified: cfe/trunk/tools/diagtool/TreeView.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/diagtool/TreeView.cpp?rev=368131&r1=368130&r2=368131&view=diff
==
--- cfe/trunk/tools/diagtool/TreeView.cpp (original)
+++ cfe/trunk/tools/diagtool/TreeView.cpp Wed Aug  7 01:08:17 2019
@@ -37,7 +37,8 @@ public:
 
   void setColor(llvm::raw_ostream::Colors Color) {
 if (ShowColors)
-  out << llvm::sys::Process::OutputColor(Color, false, false);
+  out << llvm::sys::Process::OutputColor(static_cast(Color), false,
+ false);
   }
 
   void resetColor() {


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


r368259 - [diagtool] Use `operator<<(Colors)` to print out colored output.

2019-08-08 Thread Rui Ueyama via cfe-commits
Author: ruiu
Date: Thu Aug  8 00:04:01 2019
New Revision: 368259

URL: http://llvm.org/viewvc/llvm-project?rev=368259&view=rev
Log:
[diagtool] Use `operator<<(Colors)` to print out colored output.

r368131 introduced this new API to print out messages in colors.
If the colored output is disabled, `operator<<(Colors)` becomes nop.
No functionality change intended.

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

Modified:
cfe/trunk/tools/diagtool/TreeView.cpp

Modified: cfe/trunk/tools/diagtool/TreeView.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/diagtool/TreeView.cpp?rev=368259&r1=368258&r2=368259&view=diff
==
--- cfe/trunk/tools/diagtool/TreeView.cpp (original)
+++ cfe/trunk/tools/diagtool/TreeView.cpp Thu Aug  8 00:04:01 2019
@@ -20,31 +20,14 @@ DEF_DIAGTOOL("tree", "Show warning flags
 using namespace clang;
 using namespace diagtool;
 
-static bool hasColors(const llvm::raw_ostream &out) {
-  if (&out != &llvm::errs() && &out != &llvm::outs())
-return false;
-  return llvm::errs().is_displayed() && llvm::outs().is_displayed();
-}
-
 class TreePrinter {
+  using Colors = llvm::raw_ostream::Colors;
+
 public:
   llvm::raw_ostream &out;
-  const bool ShowColors;
   bool Internal;
 
-  TreePrinter(llvm::raw_ostream &out)
-  : out(out), ShowColors(hasColors(out)), Internal(false) {}
-
-  void setColor(llvm::raw_ostream::Colors Color) {
-if (ShowColors)
-  out << llvm::sys::Process::OutputColor(static_cast(Color), false,
- false);
-  }
-
-  void resetColor() {
-if (ShowColors)
-  out << llvm::sys::Process::ResetColor();
-  }
+  TreePrinter(llvm::raw_ostream &out) : out(out), Internal(false) {}
 
   static bool isIgnored(unsigned DiagID) {
 // FIXME: This feels like a hack.
@@ -71,12 +54,11 @@ public:
 out.indent(Indent * 2);
 
 if (enabledByDefault(Group))
-  setColor(llvm::raw_ostream::GREEN);
+  out << Colors::GREEN;
 else
-  setColor(llvm::raw_ostream::YELLOW);
+  out << Colors::YELLOW;
 
-out << "-W" << Group.getName() << "\n";
-resetColor();
+out << "-W" << Group.getName() << "\n" << Colors::RESET;
 
 ++Indent;
 for (const GroupRecord &GR : Group.subgroups()) {
@@ -85,12 +67,10 @@ public:
 
 if (Internal) {
   for (const DiagnosticRecord &DR : Group.diagnostics()) {
-if (ShowColors && !isIgnored(DR.DiagID))
-  setColor(llvm::raw_ostream::GREEN);
+if (!isIgnored(DR.DiagID))
+  out << Colors::GREEN;
 out.indent(Indent * 2);
-out << DR.getName();
-resetColor();
-out << "\n";
+out << DR.getName() << Colors::RESET << "\n";
   }
 }
   }
@@ -136,13 +116,8 @@ public:
   }
 
   void showKey() {
-if (ShowColors) {
-  out << '\n';
-  setColor(llvm::raw_ostream::GREEN);
-  out << "GREEN";
-  resetColor();
-  out << " = enabled by default\n\n";
-}
+out << '\n' << Colors::GREEN << "GREEN" << Colors::RESET
+<< " = enabled by default\n\n";
   }
 };
 
@@ -182,6 +157,8 @@ int TreeView::run(unsigned int argc, cha
 return -1;
   }
 
+  out.enable_colors(out.has_colors());
+
   TreePrinter TP(out);
   TP.Internal = Internal;
   TP.showKey();


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


r330067 - Use InitLLVM in clang as well.

2018-04-13 Thread Rui Ueyama via cfe-commits
Author: ruiu
Date: Fri Apr 13 13:57:57 2018
New Revision: 330067

URL: http://llvm.org/viewvc/llvm-project?rev=330067&view=rev
Log:
Use InitLLVM in clang as well.

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

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

Modified: cfe/trunk/tools/clang-format/ClangFormat.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-format/ClangFormat.cpp?rev=330067&r1=330066&r2=330067&view=diff
==
--- cfe/trunk/tools/clang-format/ClangFormat.cpp (original)
+++ cfe/trunk/tools/clang-format/ClangFormat.cpp Fri Apr 13 13:57:57 2018
@@ -22,8 +22,8 @@
 #include "clang/Rewrite/Core/Rewriter.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/FileSystem.h"
+#include "llvm/Support/InitLLVM.h"
 #include "llvm/Support/Process.h"
-#include "llvm/Support/Signals.h"
 
 using namespace llvm;
 using clang::tooling::Replacements;
@@ -338,21 +338,13 @@ static void PrintVersion(raw_ostream &OS
 }
 
 int main(int argc, const char **argv) {
-  llvm::sys::PrintStackTraceOnErrorSignal(argv[0]);
-
-  SmallVector Args;
-  llvm::SpecificBumpPtrAllocator ArgAllocator;
-  std::error_code EC = llvm::sys::Process::GetArgumentVector(
-  Args, llvm::makeArrayRef(argv, argc), ArgAllocator);
-  if (EC) {
-llvm::errs() << "error: couldn't get arguments: " << EC.message() << '\n';
-  }
+  llvm::InitLLVM X(argc, argv);
 
   cl::HideUnrelatedOptions(ClangFormatCategory);
 
   cl::SetVersionPrinter(PrintVersion);
   cl::ParseCommandLineOptions(
-  Args.size(), &Args[0],
+  argc, argv,
   "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"

Modified: cfe/trunk/tools/driver/driver.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/driver/driver.cpp?rev=330067&r1=330066&r2=330067&view=diff
==
--- cfe/trunk/tools/driver/driver.cpp (original)
+++ cfe/trunk/tools/driver/driver.cpp Fri Apr 13 13:57:57 2018
@@ -12,9 +12,9 @@
 //
 
//===--===//
 
+#include "clang/Driver/Driver.h"
 #include "clang/Basic/DiagnosticOptions.h"
 #include "clang/Driver/Compilation.h"
-#include "clang/Driver/Driver.h"
 #include "clang/Driver/DriverDiagnostic.h"
 #include "clang/Driver/Options.h"
 #include "clang/Driver/ToolChain.h"
@@ -34,9 +34,8 @@
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/Host.h"
-#include "llvm/Support/ManagedStatic.h"
+#include "llvm/Support/InitLLVM.h"
 #include "llvm/Support/Path.h"
-#include "llvm/Support/PrettyStackTrace.h"
 #include "llvm/Support/Process.h"
 #include "llvm/Support/Program.h"
 #include "llvm/Support/Regex.h"
@@ -322,22 +321,12 @@ static int ExecuteCC1Tool(ArrayRef argv(argv_, argv_ + argc_);
 
   if (llvm::sys::Process::FixupStandardFileDescriptors())
 return 1;
 
-  SmallVector argv;
-  llvm::SpecificBumpPtrAllocator ArgAllocator;
-  std::error_code EC = llvm::sys::Process::GetArgumentVector(
-  argv, llvm::makeArrayRef(argv_, argc_), ArgAllocator);
-  if (EC) {
-llvm::errs() << "error: couldn't get arguments: " << EC.message() << '\n';
-return 1;
-  }
-
   llvm::InitializeAllTargets();
   auto TargetAndMode = ToolChain::getTargetAndModeFromProgramName(argv[0]);
 


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


[PATCH] D25579: [codeview] emit debug info for indirect virtual base classes

2016-10-13 Thread Rui Ueyama via cfe-commits
ruiu added inline comments.



Comment at: lib/CodeGen/CGDebugInfo.cpp:1392
+auto *BaseTy = getOrCreateType(BI.getType(), Unit);
+if (SeenTypes.find(BaseTy) != SeenTypes.end())
+  continue;

zturner wrote:
> rnk wrote:
> > IMO `SeenTypes.count(...)` would be more idiomatic.
> What a silly function.  I wonder why it isn't called `contains()` and return 
> a `bool`.
It's probably because std::set doesn't provide `contains()` but `count()` too.


https://reviews.llvm.org/D25579



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


r311557 - Revert r311552: [Bash-autocompletion] Add support for static analyzer flags

2017-08-23 Thread Rui Ueyama via cfe-commits
Author: ruiu
Date: Wed Aug 23 07:48:58 2017
New Revision: 311557

URL: http://llvm.org/viewvc/llvm-project?rev=311557&view=rev
Log:
Revert r311552: [Bash-autocompletion] Add support for static analyzer flags

This reverts commit r311552 because it broke ubsan and asan bots.

Modified:
cfe/trunk/include/clang/Driver/CC1Options.td
cfe/trunk/lib/Driver/DriverOptions.cpp
cfe/trunk/test/Driver/autocomplete.c

Modified: cfe/trunk/include/clang/Driver/CC1Options.td
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/CC1Options.td?rev=311557&r1=311556&r2=311557&view=diff
==
--- cfe/trunk/include/clang/Driver/CC1Options.td (original)
+++ cfe/trunk/include/clang/Driver/CC1Options.td Wed Aug 23 07:48:58 2017
@@ -99,19 +99,7 @@ def analyzer_stats : Flag<["-"], "analyz
   HelpText<"Print internal analyzer statistics.">;
 
 def analyzer_checker : Separate<["-"], "analyzer-checker">,
-  HelpText<"Choose analyzer checkers to enable">,
-  ValuesCode<[{
-const char *Values =
-#define GET_CHECKERS
-#define CHECKER(FULLNAME, CLASS, DESCFILE, HT, G, H)  FULLNAME ","
-#include "clang/StaticAnalyzer/Checkers/Checkers.inc"
-#undef GET_CHECKERS
-#define GET_PACKAGES
-#define PACKAGE(FULLNAME, G, D)  FULLNAME ","
-#include "clang/StaticAnalyzer/Checkers/Checkers.inc"
-#undef GET_PACKAGES
-;
-  }]>;
+  HelpText<"Choose analyzer checkers to enable">;
 def analyzer_checker_EQ : Joined<["-"], "analyzer-checker=">,
   Alias;
 

Modified: cfe/trunk/lib/Driver/DriverOptions.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/DriverOptions.cpp?rev=311557&r1=311556&r2=311557&view=diff
==
--- cfe/trunk/lib/Driver/DriverOptions.cpp (original)
+++ cfe/trunk/lib/Driver/DriverOptions.cpp Wed Aug 23 07:48:58 2017
@@ -11,7 +11,6 @@
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/Option/OptTable.h"
 #include "llvm/Option/Option.h"
-#include 
 
 using namespace clang::driver;
 using namespace clang::driver::options;
@@ -41,13 +40,5 @@ public:
 }
 
 std::unique_ptr clang::driver::createDriverOptTable() {
-  auto Result = llvm::make_unique();
-  // Options.inc is included in DriverOptions.cpp, and calls OptTable's
-  // addValues function.
-  // Opt is a variable used in the code fragment in Options.inc.
-  OptTable &Opt = *Result;
-#define OPTTABLE_ARG_INIT
-#include "clang/Driver/Options.inc"
-#undef OPTTABLE_ARG_INIT
-  return std::move(Result);
+  return llvm::make_unique();
 }

Modified: cfe/trunk/test/Driver/autocomplete.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/autocomplete.c?rev=311557&r1=311556&r2=311557&view=diff
==
--- cfe/trunk/test/Driver/autocomplete.c (original)
+++ cfe/trunk/test/Driver/autocomplete.c Wed Aug 23 07:48:58 2017
@@ -93,5 +93,3 @@
 // WARNING-NEXT: -Wmax-unsigned-zero
 // RUN: %clang --autocomplete=-Wno-invalid-pp- | FileCheck %s 
-check-prefix=NOWARNING
 // NOWARNING: -Wno-invalid-pp-token
-// RUN: %clang --autocomplete=-analyzer-checker, | FileCheck %s 
-check-prefix=ANALYZER
-// ANALYZER: unix.Malloc


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


[clang] 3f76260 - Use InitLLVM to setup a pretty stack printer

2019-11-25 Thread Rui Ueyama via cfe-commits

Author: Rui Ueyama
Date: 2019-11-26T10:56:10+09:00
New Revision: 3f76260dc0674cc0acb25f550a0f0c594cf537ea

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

LOG: Use InitLLVM to setup a pretty stack printer

InitLLVM does not only save a few lines from main() but also makes the
commands do the right thing for multibyte character pathnames on
Windows (i.e. canonicalize argv's to UTF-8) because of the code we
have in this file:

https://github.com/llvm/llvm-project/blob/master/llvm/lib/Support/InitLLVM.cpp#L32

For many LLVM commands, we already have calls of InitLLVM, but there
are still remainings.

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

Added: 


Modified: 
clang-tools-extra/clang-change-namespace/tool/ClangChangeNamespace.cpp
clang-tools-extra/clang-doc/tool/ClangDocMain.cpp
clang-tools-extra/clang-move/tool/ClangMove.cpp
clang-tools-extra/clang-query/tool/ClangQuery.cpp
clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp
clang-tools-extra/clangd/index/dex/dexp/Dexp.cpp
clang-tools-extra/clangd/indexer/IndexerMain.cpp
clang-tools-extra/clangd/tool/ClangdMain.cpp
clang-tools-extra/tool-template/ToolTemplate.cpp
clang/tools/arcmt-test/arcmt-test.cpp
clang/tools/c-index-test/core_main.cpp
clang/tools/clang-check/ClangCheck.cpp
clang/tools/clang-extdef-mapping/ClangExtDefMapGen.cpp
clang/tools/clang-offload-bundler/ClangOffloadBundler.cpp
clang/tools/clang-offload-wrapper/ClangOffloadWrapper.cpp
clang/tools/clang-refactor/ClangRefactor.cpp
clang/utils/TableGen/TableGen.cpp
llvm/utils/KillTheDoctor/KillTheDoctor.cpp
llvm/utils/TableGen/TableGen.cpp

Removed: 




diff  --git 
a/clang-tools-extra/clang-change-namespace/tool/ClangChangeNamespace.cpp 
b/clang-tools-extra/clang-change-namespace/tool/ClangChangeNamespace.cpp
index a97be99b0bd8..a567d7f82dea 100644
--- a/clang-tools-extra/clang-change-namespace/tool/ClangChangeNamespace.cpp
+++ b/clang-tools-extra/clang-change-namespace/tool/ClangChangeNamespace.cpp
@@ -37,6 +37,7 @@
 #include "clang/Tooling/Refactoring.h"
 #include "clang/Tooling/Tooling.h"
 #include "llvm/Support/CommandLine.h"
+#include "llvm/Support/InitLLVM.h"
 #include "llvm/Support/Signals.h"
 #include "llvm/Support/YAMLTraits.h"
 
@@ -98,7 +99,7 @@ llvm::ErrorOr> 
GetWhiteListedSymbolPatterns() {
 } // anonymous namespace
 
 int main(int argc, const char **argv) {
-  llvm::sys::PrintStackTraceOnErrorSignal(argv[0]);
+  llvm::InitLLVM X(argc, argv);
   tooling::CommonOptionsParser OptionsParser(argc, argv,
  ChangeNamespaceCategory);
   const auto &Files = OptionsParser.getSourcePathList();

diff  --git a/clang-tools-extra/clang-doc/tool/ClangDocMain.cpp 
b/clang-tools-extra/clang-doc/tool/ClangDocMain.cpp
index 38b781ed39f4..d27a012b78ff 100644
--- a/clang-tools-extra/clang-doc/tool/ClangDocMain.cpp
+++ b/clang-tools-extra/clang-doc/tool/ClangDocMain.cpp
@@ -36,6 +36,7 @@
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/FileSystem.h"
+#include "llvm/Support/InitLLVM.h"
 #include "llvm/Support/Mutex.h"
 #include "llvm/Support/Path.h"
 #include "llvm/Support/Process.h"
@@ -179,7 +180,7 @@ llvm::Expected> 
getInfoOutputFile(StringRef Root,
 }
 
 int main(int argc, const char **argv) {
-  llvm::sys::PrintStackTraceOnErrorSignal(argv[0]);
+  llvm::InitLLVM X(argc, argv);
   std::error_code OK;
 
   ExecutorName.setInitialValue("all-TUs");

diff  --git a/clang-tools-extra/clang-move/tool/ClangMove.cpp 
b/clang-tools-extra/clang-move/tool/ClangMove.cpp
index 2df7df7fe3a7..fdf83ab4604b 100644
--- a/clang-tools-extra/clang-move/tool/ClangMove.cpp
+++ b/clang-tools-extra/clang-move/tool/ClangMove.cpp
@@ -15,6 +15,7 @@
 #include "clang/Tooling/Tooling.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/CommandLine.h"
+#include "llvm/Support/InitLLVM.h"
 #include "llvm/Support/Path.h"
 #include "llvm/Support/Process.h"
 #include "llvm/Support/Signals.h"
@@ -94,7 +95,7 @@ cl::opt DumpDecls(
 } // namespace
 
 int main(int argc, const char **argv) {
-  llvm::sys::PrintStackTraceOnErrorSignal(argv[0]);
+  llvm::InitLLVM X(argc, argv);
   tooling::CommonOptionsParser OptionsParser(argc, argv, ClangMoveCategory);
 
   if (OldDependOnNew && NewDependOnOld) {

diff  --git a/clang-tools-extra/clang-query/tool/ClangQuery.cpp 
b/clang-tools-extra/clang-query/tool/ClangQuery.cpp
index 80e1c602796c..56a1e25e1447 100644
--- a/clang-tools-extra/clang-query/tool/ClangQuery.cpp
+++ b/clang-tools-extra/clang-query/tool/ClangQuery.cpp
@@ -33,6 +33,7 @@
 #include "clang/Tooling/Tooling.h"
 #include "llvm/LineEditor/LineEditor.h"
 #include "llvm/Support/CommandLine.h"
+#include "llvm/Support/InitLLVM.h"
 #incl

[clang-tools-extra] a7acba2 - Use InitLLVM in clang-tidy

2019-11-27 Thread Rui Ueyama via cfe-commits

Author: Rui Ueyama
Date: 2019-11-28T13:50:35+09:00
New Revision: a7acba29c19ac67c77ed282ec9432602ae21268d

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

LOG: Use InitLLVM in clang-tidy

Update clang-tidy to use InitLLVM, like several other llvm tools that
were previously updated. On Windows, this allows clang-tidy to operate
on arguments containing characters which cannot be represented in the
system's ANSI code page such as filenames with Unicode characters.

Fixes bugzilla bug 43751.

Patch by Tristan Labelle.

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

Added: 


Modified: 
clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp

Removed: 




diff  --git a/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp 
b/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp
index df83de856238..ad6182def20d 100644
--- a/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp
+++ b/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp
@@ -18,6 +18,7 @@
 #include "../ClangTidyForceLinker.h"
 #include "../GlobList.h"
 #include "clang/Tooling/CommonOptionsParser.h"
+#include "llvm/Support/InitLLVM.h"
 #include "llvm/Support/Process.h"
 #include "llvm/Support/Signals.h"
 #include "llvm/Support/TargetSelect.h"
@@ -327,7 +328,7 @@ getVfsFromFile(const std::string &OverlayFile,
 }
 
 static int clangTidyMain(int argc, const char **argv) {
-  llvm::sys::PrintStackTraceOnErrorSignal(argv[0]);
+  llvm::InitLLVM X(argc, argv);
   CommonOptionsParser OptionsParser(argc, argv, ClangTidyCategory,
 cl::ZeroOrMore);
   llvm::IntrusiveRefCntPtr BaseFS(



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


Re: [PATCH] D31591: Fix a bug which access nullptr and cause segmentation fault

2017-04-12 Thread Rui Ueyama via cfe-commits
It seems to me the test have already been simplified enough, so I'm not
quite sure what you are trying to do more than this. Isn't this just ready
to submit?

On Wed, Apr 12, 2017 at 5:46 PM, Yuka Takahashi via Phabricator <
revi...@reviews.llvm.org> wrote:

> yamaguchi updated this revision to Diff 95064.
> yamaguchi added a comment.
>
> I've been trying to minimal the testcase, add comments to describe what it
> is testing, and fix styles of the testcase properly.
> However, I don't have clear idea what will be the best. I would like to
> ask for the advice.
>
>
> https://reviews.llvm.org/D31591
>
> Files:
>   lib/Sema/SemaInit.cpp
>   test/Sema/designated-initializers.c
>
>
> Index: lib/Sema/SemaInit.cpp
> ===
> --- lib/Sema/SemaInit.cpp
> +++ lib/Sema/SemaInit.cpp
> @@ -2269,15 +2269,17 @@
>assert(StructuredList->getNumInits() == 1
>   && "A union should never have more than one
> initializer!");
>
> -  // We're about to throw away an initializer, emit warning.
> -  SemaRef.Diag(D->getFieldLoc(),
> -   diag::warn_initializer_overrides)
> -<< D->getSourceRange();
>Expr *ExistingInit = StructuredList->getInit(0);
> -  SemaRef.Diag(ExistingInit->getLocStart(),
> -   diag::note_previous_initializer)
> -<< /*FIXME:has side effects=*/0
> -<< ExistingInit->getSourceRange();
> +  if (ExistingInit) {
> +// We're about to throw away an initializer, emit warning.
> +SemaRef.Diag(D->getFieldLoc(),
> + diag::warn_initializer_overrides)
> +  << D->getSourceRange();
> +SemaRef.Diag(ExistingInit->getLocStart(),
> + diag::note_previous_initializer)
> +  << /*FIXME:has side effects=*/0
> +  << ExistingInit->getSourceRange();
> +  }
>
>// remove existing initializer
>StructuredList->resizeInits(SemaRef.Context, 0);
> Index: test/Sema/designated-initializers.c
> ===
> --- test/Sema/designated-initializers.c
> +++ test/Sema/designated-initializers.c
> @@ -351,3 +351,20 @@
>{ { 'f', 'o', 'o' }, 1 },
>[0].L[4] = 'x' // no-warning
>  };
> +
> +struct {
> +  struct { } s1;
> +  union {
> +int a;
> +int b;
> +  } u1;
> +} s = {
> +  .s1 = {
> +.x = 0, // expected-error{{field designator}}
> +  },
> +
> +  .u1 = {
> +.a = 0,
> +.b = 0,
> +  },
> +};
>
>
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: r306127 - [GSoC] Add support for CC1 options.

2017-06-26 Thread Rui Ueyama via cfe-commits
On Mon, Jun 26, 2017 at 10:17 PM, Saleem Abdulrasool via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

> I think that we shouldn't be providing completion for `-cc1` options.
>  `-cc1as` options are fine as the IAS serves as a replacement for the
> traditional unix `as`.  But, the `NoDriverOption` values shouldn't be
> exposed to users.  They are internal details, with no compatibility.  If
> users start using those options, it makes it harder to prevent command line
> incompatibilities.
>

That may make sense, but it is convenient for clang developers if it can
auto-complete cc1 command line options. I think these options are at least
displayed when you do `clang -cc1 --help` and all of them have help texts,
so I don't think it isn't that bad (and actually fairly useful) if it
autocompletes these options.

On Fri, Jun 23, 2017 at 10:05 AM, Yuka Takahashi via cfe-commits <
> cfe-commits@lists.llvm.org> wrote:
>
>> Author: yamaguchi
>> Date: Fri Jun 23 12:05:50 2017
>> New Revision: 306127
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=306127&view=rev
>> Log:
>> [GSoC] Add support for CC1 options.
>>
>> Summary:
>> Add value completion support for options which are defined in
>> CC1Options.td, because we only handled options in Options.td.
>>
>> Reviewers: ruiu, v.g.vassilev, teemperor
>>
>> Subscribers: llvm-commits
>>
>> Differential Revision: https://reviews.llvm.org/D34558
>>
>> Modified:
>> cfe/trunk/include/clang/Driver/CC1Options.td
>> cfe/trunk/test/Driver/autocomplete.c
>>
>> Modified: cfe/trunk/include/clang/Driver/CC1Options.td
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/
>> Driver/CC1Options.td?rev=306127&r1=306126&r2=306127&view=diff
>> 
>> ==
>> --- cfe/trunk/include/clang/Driver/CC1Options.td (original)
>> +++ cfe/trunk/include/clang/Driver/CC1Options.td Fri Jun 23 12:05:50 2017
>> @@ -158,7 +158,7 @@ def msave_temp_labels : Flag<["-"], "msa
>> "Note this may change .s semantics and shouldn't generally be
>> used "
>> "on compiler-generated code.">;
>>  def mrelocation_model : Separate<["-"], "mrelocation-model">,
>> -  HelpText<"The relocation model to use">;
>> +  HelpText<"The relocation model to use">, Values<"static,pic,ropi,rwpi,r
>> opi-rwpi,dynamic-no-pic">;
>>  def fno_math_builtin : Flag<["-"], "fno-math-builtin">,
>>HelpText<"Disable implicit builtin knowledge of math functions">;
>>  }
>> @@ -229,7 +229,7 @@ def no_struct_path_tbaa : Flag<["-"], "n
>>  def masm_verbose : Flag<["-"], "masm-verbose">,
>>HelpText<"Generate verbose assembly output">;
>>  def mcode_model : Separate<["-"], "mcode-model">,
>> -  HelpText<"The code model to use">;
>> +  HelpText<"The code model to use">, Values<"small,kernel,medium,la
>> rge">;
>>  def mdebug_pass : Separate<["-"], "mdebug-pass">,
>>HelpText<"Enable additional debug output">;
>>  def mdisable_fp_elim : Flag<["-"], "mdisable-fp-elim">,
>> @@ -308,7 +308,7 @@ def fsanitize_coverage_no_prune
>>HelpText<"Disable coverage pruning (i.e. instrument all
>> blocks/edges)">;
>>  def fprofile_instrument_EQ : Joined<["-"], "fprofile-instrument=">,
>>  HelpText<"Enable PGO instrumentation. The accepted value is clang,
>> llvm, "
>> - "or none">;
>> + "or none">, Values<"none,clang,llvm">;
>>  def fprofile_instrument_path_EQ : Joined<["-"],
>> "fprofile-instrument-path=">,
>>  HelpText<"Generate instrumented code to collect execution counts
>> into "
>>   " (overridden by LLVM_PROFILE_FILE env var)">;
>> @@ -348,9 +348,9 @@ def diagnostic_serialized_file : Separat
>>HelpText<"File for serializing diagnostics in a binary format">;
>>
>>  def fdiagnostics_format : Separate<["-"], "fdiagnostics-format">,
>> -  HelpText<"Change diagnostic formatting to match IDE and command line
>> tools">;
>> +  HelpText<"Change diagnostic formatting to match IDE and command line
>> tools">, Values<"clang,msvc,msvc-fallback,vi">;
>>  def fdiagnostics_show_category : Separate<["-"],
>> "fdiagnostics-show-category">,
>> -  HelpText<"Print diagnostic category">;
>> +  HelpText<"Print diagnostic category">, Values<"none,id,name">;
>>  def fno_diagnostics_use_presumed_location : Flag<["-"],
>> "fno-diagnostics-use-presumed-location">,
>>HelpText<"Ignore #line directives when displaying diagnostic
>> locations">;
>>  def ftabstop : Separate<["-"], "ftabstop">, MetaVarName<"">,
>> @@ -595,11 +595,11 @@ def fconstant_string_class : Separate<["
>>MetaVarName<"">,
>>HelpText<"Specify the class to use for constant Objective-C string
>> objects.">;
>>  def fobjc_arc_cxxlib_EQ : Joined<["-"], "fobjc-arc-cxxlib=">,
>> -  HelpText<"Objective-C++ Automatic Reference Counting standard library
>> kind">;
>> +  HelpText<"Objective-C++ Automatic Reference Counting standard library
>> kind">, Values<"libc++,libstdc++,none">;
>>  def fobjc_runtime_has_weak : Flag<["-"], "fobjc-

Re: [PATCH] D42758: Support `#pragma comment(lib, "name")` in the frontend for ELF

2018-02-01 Thread Rui Ueyama via cfe-commits
On Wed, Jan 31, 2018 at 7:23 PM, Paul Robinson via Phabricator <
revi...@reviews.llvm.org> wrote:

> probinson added a comment.
>
> In https://reviews.llvm.org/D42758#993936, @ruiu wrote:
>
> > > I also wonder which is better `#pragma comment(lib, "m")` or `#pragma
> comment(lib, "m")`.
> >
> > Sorry, I meant `#pragma comment(lib, "m")` or `#pragma comment("lib",
> "m")`.
>
>
> I can't swear to it but I don't think Microsoft invented `#pragma
> comment`.  Various IBM compilers have it, with a syntax of `#pragma comment
> (  [ , "string" ] )`.  I'm not seeing a `lib` keyword specifically
> in the IBM docs, but being a keyword would be consistent with past practice.
>

Thank you for the info. If it's a common practice, I don't see a reason to
change that.

>
> 
> Comment at: lib/Parse/ParsePragma.cpp:299
> +  getTargetInfo().getTriple().isOSBinFormatELF()) {
>  MSCommentHandler.reset(new PragmaCommentHandler(Actions));
>  PP.AddPragmaHandler(MSCommentHandler.get());
> 
> PS4's binary format is ELF, so you should be able to remove the isPS4
> predicate.
>
>
> 
> Comment at: lib/Parse/ParsePragma.cpp:382
> +  getTargetInfo().getTriple().isOSBinFormatELF()) {
>  PP.RemovePragmaHandler(MSCommentHandler.get());
>  MSCommentHandler.reset();
> 
> Don't need isPS4, as it uses ELF.
>
>
> Repository:
>   rC Clang
>
> https://reviews.llvm.org/D42758
>
>
>
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: r294879 - [Driver] Use stem() and not filename().

2017-02-11 Thread Rui Ueyama via cfe-commits
On Sat, Feb 11, 2017 at 3:44 PM, Davide Italiano via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

> Author: davide
> Date: Sat Feb 11 17:44:37 2017
> New Revision: 294879
>
> URL: http://llvm.org/viewvc/llvm-project?rev=294879&view=rev
> Log:
> [Driver] Use stem() and not filename().
>
> On Windows the filename might have an extension, namely
> `.exe`, so the search will fail. Sorry, I don't have a
> good way to test this as it seems to fail only in some
> weird configurations. r284430 has the same modification
> for Fuchsia.
>
> Modified:
> cfe/trunk/lib/Driver/Tools.cpp
>
> Modified: cfe/trunk/lib/Driver/Tools.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/
> Tools.cpp?rev=294879&r1=294878&r2=294879&view=diff
> 
> ==
> --- cfe/trunk/lib/Driver/Tools.cpp (original)
> +++ cfe/trunk/lib/Driver/Tools.cpp Sat Feb 11 17:44:37 2017
> @@ -10163,7 +10163,7 @@ void gnutools::Linker::ConstructJob(Comp
>Args.ClaimAllArgs(options::OPT_w);
>
>const char *Exec = Args.MakeArgString(ToolChain.GetLinkerPath());
> -  if (llvm::sys::path::filename(Exec) == "lld") {
> +  if (llvm::sys::path::stem(Exec) == "lld") {
>  CmdArgs.push_back("-flavor");
>  CmdArgs.push_back("old-gnu");
>

This line caught my attention. I think we've removed "-flavor old-gnu" a
long time ago. Is that still live somewhere?


>  CmdArgs.push_back("-target");
>
>
> ___
> 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


r301487 - Replace HashString algorithm with xxHash64

2017-04-26 Thread Rui Ueyama via cfe-commits
Author: ruiu
Date: Wed Apr 26 17:45:04 2017
New Revision: 301487

URL: http://llvm.org/viewvc/llvm-project?rev=301487&view=rev
Log:
Replace HashString algorithm with xxHash64

The previous algorithm processed one character at a time, which is very
painful on a modern CPU. Replace it with xxHash64, which both already
exists in the codebase and is fairly fast.

Patch from Scott Smith!

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

Modified:
cfe/trunk/test/CodeGen/target-features-error-2.c
cfe/trunk/test/CodeGen/target-features-error.c
cfe/trunk/test/SemaCXX/typo-correction-delayed.cpp
cfe/trunk/unittests/Tooling/CompilationDatabaseTest.cpp

Modified: cfe/trunk/test/CodeGen/target-features-error-2.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/target-features-error-2.c?rev=301487&r1=301486&r2=301487&view=diff
==
--- cfe/trunk/test/CodeGen/target-features-error-2.c (original)
+++ cfe/trunk/test/CodeGen/target-features-error-2.c Wed Apr 26 17:45:04 2017
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -triple=x86_64-linux-gnu -S -verify -o - -D NEED_SSE42
+// RUN: %clang_cc1 %s -triple=x86_64-linux-gnu -S -verify -o - -D NEED_SSE41
 // RUN: %clang_cc1 %s -triple=x86_64-linux-gnu -S -verify -o - -D NEED_AVX_1
 // RUN: %clang_cc1 %s -triple=x86_64-linux-gnu -S -verify -o - -D NEED_AVX_2
 // RUN: %clang_cc1 %s -triple=x86_64-linux-gnu -S -verify -o - -D NEED_AVX_3
@@ -7,9 +7,12 @@
 #define __MM_MALLOC_H
 #include 
 
-#if NEED_SSE42
+// Really, this needs AVX, but because targetting AVX includes all the SSE 
features too, and
+// features are sorted by hash function, and we just return the first missing 
feature, then we end
+// up returning the subfeature sse4.1 instead of avx.
+#if NEED_SSE41
 int baz(__m256i a) {
-  return _mm256_extract_epi32(a, 3); // expected-error {{always_inline 
function '_mm256_extract_epi32' requires target feature 'sse4.2', but would be 
inlined into function 'baz' that is compiled without support for 'sse4.2'}}
+  return _mm256_extract_epi32(a, 3); // expected-error {{always_inline 
function '_mm256_extract_epi32' requires target feature 'sse4.1', but would be 
inlined into function 'baz' that is compiled without support for 'sse4.1'}}
 }
 #endif
 

Modified: cfe/trunk/test/CodeGen/target-features-error.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/target-features-error.c?rev=301487&r1=301486&r2=301487&view=diff
==
--- cfe/trunk/test/CodeGen/target-features-error.c (original)
+++ cfe/trunk/test/CodeGen/target-features-error.c Wed Apr 26 17:45:04 2017
@@ -3,6 +3,5 @@ int __attribute__((target("avx"), always
   return a + 4;
 }
 int bar() {
-  return foo(4); // expected-error {{always_inline function 'foo' requires 
target feature 'sse4.2', but would be inlined into function 'bar' that is 
compiled without support for 'sse4.2'}}
+  return foo(4); // expected-error {{always_inline function 'foo' requires 
target feature 'sse4.1', but would be inlined into function 'bar' that is 
compiled without support for 'sse4.1'}}
 }
-

Modified: cfe/trunk/test/SemaCXX/typo-correction-delayed.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/typo-correction-delayed.cpp?rev=301487&r1=301486&r2=301487&view=diff
==
--- cfe/trunk/test/SemaCXX/typo-correction-delayed.cpp (original)
+++ cfe/trunk/test/SemaCXX/typo-correction-delayed.cpp Wed Apr 26 17:45:04 2017
@@ -52,6 +52,7 @@ void testNoCandidates() {
 }
 
 class string {};
+
 struct Item {
   void Nest();
   string text();
@@ -88,12 +89,16 @@ void f(LinkedNode *node) {
 struct NestedNode {
   NestedNode* Nest();
   NestedNode* next();
-  string text() const;
+  // Note, this test is dependent on the order in which identifiers are passed
+  // to the typo corrector, which is based on the hash function used.  For
+  // consistency, I am making the next keyword the first identifier returned.
+  string eext() const;
 };
 void f(NestedNode *node) {
   // There are two equidistant, usable corrections for Next: next and Nest
   NestedNode *next = node->Next();  // expected-error-re {{no member named 
'Next' in 'initializerCorrections::NestedNode'{{$
 }
+
 }
 
 namespace PR21669 {

Modified: cfe/trunk/unittests/Tooling/CompilationDatabaseTest.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Tooling/CompilationDatabaseTest.cpp?rev=301487&r1=301486&r2=301487&view=diff
==
--- cfe/trunk/unittests/Tooling/CompilationDatabaseTest.cpp (original)
+++ cfe/trunk/unittests/Tooling/CompilationDatabaseTest.cpp Wed Apr 26 17:45:04 
2017
@@ -81,10 +81,10 @@ TEST(JSONCompilationDatabase, GetAllFile
 
   std::vector expected_files;
   SmallString<16> PathStorage;
-  llvm::sys::path::n

r301491 - Revert r301487: Replace HashString algorithm with xxHash64

2017-04-26 Thread Rui Ueyama via cfe-commits
Author: ruiu
Date: Wed Apr 26 18:15:10 2017
New Revision: 301491

URL: http://llvm.org/viewvc/llvm-project?rev=301491&view=rev
Log:
Revert r301487: Replace HashString algorithm with xxHash64

This reverts commit r301487 to make buildbots green.

Modified:
cfe/trunk/test/CodeGen/target-features-error-2.c
cfe/trunk/test/CodeGen/target-features-error.c
cfe/trunk/test/SemaCXX/typo-correction-delayed.cpp
cfe/trunk/unittests/Tooling/CompilationDatabaseTest.cpp

Modified: cfe/trunk/test/CodeGen/target-features-error-2.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/target-features-error-2.c?rev=301491&r1=301490&r2=301491&view=diff
==
--- cfe/trunk/test/CodeGen/target-features-error-2.c (original)
+++ cfe/trunk/test/CodeGen/target-features-error-2.c Wed Apr 26 18:15:10 2017
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -triple=x86_64-linux-gnu -S -verify -o - -D NEED_SSE41
+// RUN: %clang_cc1 %s -triple=x86_64-linux-gnu -S -verify -o - -D NEED_SSE42
 // RUN: %clang_cc1 %s -triple=x86_64-linux-gnu -S -verify -o - -D NEED_AVX_1
 // RUN: %clang_cc1 %s -triple=x86_64-linux-gnu -S -verify -o - -D NEED_AVX_2
 // RUN: %clang_cc1 %s -triple=x86_64-linux-gnu -S -verify -o - -D NEED_AVX_3
@@ -7,12 +7,9 @@
 #define __MM_MALLOC_H
 #include 
 
-// Really, this needs AVX, but because targetting AVX includes all the SSE 
features too, and
-// features are sorted by hash function, and we just return the first missing 
feature, then we end
-// up returning the subfeature sse4.1 instead of avx.
-#if NEED_SSE41
+#if NEED_SSE42
 int baz(__m256i a) {
-  return _mm256_extract_epi32(a, 3); // expected-error {{always_inline 
function '_mm256_extract_epi32' requires target feature 'sse4.1', but would be 
inlined into function 'baz' that is compiled without support for 'sse4.1'}}
+  return _mm256_extract_epi32(a, 3); // expected-error {{always_inline 
function '_mm256_extract_epi32' requires target feature 'sse4.2', but would be 
inlined into function 'baz' that is compiled without support for 'sse4.2'}}
 }
 #endif
 

Modified: cfe/trunk/test/CodeGen/target-features-error.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/target-features-error.c?rev=301491&r1=301490&r2=301491&view=diff
==
--- cfe/trunk/test/CodeGen/target-features-error.c (original)
+++ cfe/trunk/test/CodeGen/target-features-error.c Wed Apr 26 18:15:10 2017
@@ -3,5 +3,6 @@ int __attribute__((target("avx"), always
   return a + 4;
 }
 int bar() {
-  return foo(4); // expected-error {{always_inline function 'foo' requires 
target feature 'sse4.1', but would be inlined into function 'bar' that is 
compiled without support for 'sse4.1'}}
+  return foo(4); // expected-error {{always_inline function 'foo' requires 
target feature 'sse4.2', but would be inlined into function 'bar' that is 
compiled without support for 'sse4.2'}}
 }
+

Modified: cfe/trunk/test/SemaCXX/typo-correction-delayed.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/typo-correction-delayed.cpp?rev=301491&r1=301490&r2=301491&view=diff
==
--- cfe/trunk/test/SemaCXX/typo-correction-delayed.cpp (original)
+++ cfe/trunk/test/SemaCXX/typo-correction-delayed.cpp Wed Apr 26 18:15:10 2017
@@ -52,7 +52,6 @@ void testNoCandidates() {
 }
 
 class string {};
-
 struct Item {
   void Nest();
   string text();
@@ -89,16 +88,12 @@ void f(LinkedNode *node) {
 struct NestedNode {
   NestedNode* Nest();
   NestedNode* next();
-  // Note, this test is dependent on the order in which identifiers are passed
-  // to the typo corrector, which is based on the hash function used.  For
-  // consistency, I am making the next keyword the first identifier returned.
-  string eext() const;
+  string text() const;
 };
 void f(NestedNode *node) {
   // There are two equidistant, usable corrections for Next: next and Nest
   NestedNode *next = node->Next();  // expected-error-re {{no member named 
'Next' in 'initializerCorrections::NestedNode'{{$
 }
-
 }
 
 namespace PR21669 {

Modified: cfe/trunk/unittests/Tooling/CompilationDatabaseTest.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Tooling/CompilationDatabaseTest.cpp?rev=301491&r1=301490&r2=301491&view=diff
==
--- cfe/trunk/unittests/Tooling/CompilationDatabaseTest.cpp (original)
+++ cfe/trunk/unittests/Tooling/CompilationDatabaseTest.cpp Wed Apr 26 18:15:10 
2017
@@ -81,10 +81,10 @@ TEST(JSONCompilationDatabase, GetAllFile
 
   std::vector expected_files;
   SmallString<16> PathStorage;
-  llvm::sys::path::native("//net/dir/file2", PathStorage);
-  expected_files.push_back(PathStorage.str());
   llvm::sys::path::native("//net/dir/file1", PathStorage);
   expected_files.push_back(PathStorage.str());
+ 

Re: r284137 - [ThinLTO] Update doc to include lld (now supported).

2016-10-17 Thread Rui Ueyama via cfe-commits
Agreed. We should define them as aliases to existing options without
-plugin-opt.

On Sun, Oct 16, 2016 at 6:43 PM, Sean Silva via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

> Nice to see this land!
>
> One nit:
> Currently, doesn't LLD/ELF ignore -plugin-opt? That will mean that if a
> user uses the "gold syntax" then LLD will silently ignore it, which isn't
> good. At the very least, can we issue an error if we see `-plugin-opt
> jobs=N` and suggest the LLD spelling?
>
> Or maybe just accept the gold syntax? Our current handling of `-plugin`
> and `-plugin-opt` is intended to make LLD transparently Do The Right Thing
> when LLD is invoked as if it were gold, so clearly gold compatibility is
> important enough for that. This suggests it is important enough to be
> compatible from a ThinLTO perspective too.
>
> -- Sean Silva
>
> On Thu, Oct 13, 2016 at 10:42 AM, Davide Italiano via cfe-commits <
> cfe-commits@lists.llvm.org> wrote:
>
>> Author: davide
>> Date: Thu Oct 13 12:42:38 2016
>> New Revision: 284137
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=284137&view=rev
>> Log:
>> [ThinLTO] Update doc to include lld (now supported).
>>
>> Differential Revision:  https://reviews.llvm.org/D25537
>>
>> Modified:
>> cfe/trunk/docs/ThinLTO.rst
>>
>> Modified: cfe/trunk/docs/ThinLTO.rst
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/ThinLTO.
>> rst?rev=284137&r1=284136&r2=284137&view=diff
>> 
>> ==
>> --- cfe/trunk/docs/ThinLTO.rst (original)
>> +++ cfe/trunk/docs/ThinLTO.rst Thu Oct 13 12:42:38 2016
>> @@ -62,8 +62,8 @@ ThinLTO is currently supported for the f
>>`_.
>>  - **ld64**:
>>Starting with `Xcode 8 `_.
>> -
>> -Additionally, support is being added to the *lld* linker.
>> +- **lld**:
>> +  Starting with r284050 (ELF only).
>>
>>  Usage
>>  =
>> @@ -109,6 +109,8 @@ be reduced to ``N`` via:
>>``-Wl,-plugin-opt,jobs=N``
>>  - ld64:
>>``-Wl,-mllvm,-threads=N``
>> +- lld:
>> +  ``-Wl,--thinlto-jobs=N``
>>
>>  Incremental
>>  ---
>>
>>
>> ___
>> 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
>
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r285162 - Use printf instead of "echo -ne".

2016-10-25 Thread Rui Ueyama via cfe-commits
Author: ruiu
Date: Tue Oct 25 22:38:48 2016
New Revision: 285162

URL: http://llvm.org/viewvc/llvm-project?rev=285162&view=rev
Log:
Use printf instead of "echo -ne".

Not all echo commands support "-e".

Modified:
cfe/trunk/test/Driver/response-file-extra-whitespace.c

Modified: cfe/trunk/test/Driver/response-file-extra-whitespace.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/response-file-extra-whitespace.c?rev=285162&r1=285161&r2=285162&view=diff
==
--- cfe/trunk/test/Driver/response-file-extra-whitespace.c (original)
+++ cfe/trunk/test/Driver/response-file-extra-whitespace.c Tue Oct 25 22:38:48 
2016
@@ -3,7 +3,7 @@
 // some joined arguments (like "-x c") across lines to ensure that regular
 // clang (not clang-cl) can process it correctly.
 //
-// RUN: echo -en "-x\r\nc\r\n-DTEST\r\n" > %t.0.txt
+// RUN: printf " -x\r\nc\r\n-DTEST\r\n" > %t.0.txt
 // RUN: %clang -E @%t.0.txt %s -v 2>&1 | FileCheck %s -check-prefix=SHORT
 // SHORT: extern int it_works;
 


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


Re: [PATCH] D12695: [Driver] Use UniversalCRT on Windows if available

2015-09-10 Thread Rui Ueyama via cfe-commits
ruiu added a comment.

I'm sorry about leave http://reviews.llvm.org/D12604 hanging. I didn't notice 
that it got a new review message. Don't mind my patch -- please just submit 
when you got LGTM


http://reviews.llvm.org/D12695



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


Re: r248433 - [CUDA] Added CUDA installation detector class.

2015-09-23 Thread Rui Ueyama via cfe-commits
On Wed, Sep 23, 2015 at 2:49 PM, Artem Belevich via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

> Author: tra
> Date: Wed Sep 23 16:49:39 2015
> New Revision: 248433
>
> URL: http://llvm.org/viewvc/llvm-project?rev=248433&view=rev
> Log:
> [CUDA] Added CUDA installation detector class.
>
> Added new option --cuda-path= which allows
> overriding default search paths.
> If it's not specified we look for CUDA installation in
> /usr/include/cuda and /usr/include/cuda-7.0.
>
> Differential Revision: http://reviews.llvm.org/D12989
>
> Added:
> cfe/trunk/test/Driver/Inputs/CUDA/usr/local/cuda/include/.keep
> cfe/trunk/test/Driver/Inputs/CUDA/usr/local/cuda/lib/.keep
> cfe/trunk/test/Driver/Inputs/CUDA/usr/local/cuda/lib64/.keep
> cfe/trunk/test/Driver/Inputs/CUDA/usr/local/cuda/nvvm/libdevice/.keep
> cfe/trunk/test/Driver/cuda-detect.cu
> Modified:
> cfe/trunk/include/clang/Driver/Options.td
> cfe/trunk/lib/Driver/ToolChains.cpp
> cfe/trunk/lib/Driver/ToolChains.h
>
> Modified: cfe/trunk/include/clang/Driver/Options.td
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Options.td?rev=248433&r1=248432&r2=248433&view=diff
>
> ==
> --- cfe/trunk/include/clang/Driver/Options.td (original)
> +++ cfe/trunk/include/clang/Driver/Options.td Wed Sep 23 16:49:39 2015
> @@ -359,6 +359,8 @@ def cuda_gpu_arch_EQ : Joined<["--"], "c
>Flags<[DriverOption, HelpHidden]>, HelpText<"CUDA GPU architecture">;
>  def cuda_host_only : Flag<["--"], "cuda-host-only">,
>HelpText<"Do host-side CUDA compilation only">;
> +def cuda_path_EQ : Joined<["--"], "cuda-path=">, Group,
> +  HelpText<"CUDA installation path">;
>  def dA : Flag<["-"], "dA">, Group;
>  def dD : Flag<["-"], "dD">, Group, Flags<[CC1Option]>,
>HelpText<"Print macro definitions in -E mode in addition to normal
> output">;
>
> Modified: cfe/trunk/lib/Driver/ToolChains.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=248433&r1=248432&r2=248433&view=diff
>
> ==
> --- cfe/trunk/lib/Driver/ToolChains.cpp (original)
> +++ cfe/trunk/lib/Driver/ToolChains.cpp Wed Sep 23 16:49:39 2015
> @@ -1482,6 +1482,48 @@ bool Generic_GCC::GCCInstallationDetecto
>  BiarchTripleAliases.push_back(BiarchTriple.str());
>  }
>
> +// \brief -- try common CUDA installation paths looking for files we need
> for
> +// CUDA compilation.
> +
> +void
> +Generic_GCC::CudaInstallationDetector::init(const Driver &D,
> +const llvm::Triple
> &TargetTriple,
> +const llvm::opt::ArgList
> &Args) {
> +  SmallVector CudaPathCandidates;
> +
> +  if (Args.hasArg(options::OPT_cuda_path_EQ))
> +CudaPathCandidates.push_back(
> +Args.getLastArgValue(options::OPT_cuda_path_EQ));
> +  else {
> +CudaPathCandidates.push_back(D.SysRoot + "/usr/local/cuda");
> +CudaPathCandidates.push_back(D.SysRoot + "/usr/local/cuda-7.0");
> +  }
> +
> +  for (const auto CudaPath : CudaPathCandidates) {
> +if (CudaPath.empty() || !llvm::sys::fs::exists(CudaPath))
> +  continue;
> +
> +CudaInstallPath = CudaPath;
> +CudaIncludePath = CudaInstallPath + "/include";
> +CudaLibDevicePath = CudaInstallPath + "/nvvm/libdevice";
> +CudaLibPath =
> +CudaInstallPath + (TargetTriple.isArch64Bit() ? "/lib64" :
> "/lib");
> +
> +if (!(llvm::sys::fs::exists(CudaIncludePath) &&
> +  llvm::sys::fs::exists(CudaLibPath) &&
> +  llvm::sys::fs::exists(CudaLibDevicePath)))
> +  continue;
> +
> +IsValid = true;
> +break;
> +  }
> +}
> +
> +void Generic_GCC::CudaInstallationDetector::print(raw_ostream &OS) const {
> +  if (isValid())
> +OS << "Found CUDA installation: " << CudaInstallPath << "\n";
> +}
> +
>  namespace {
>  // Filter to remove Multilibs that don't exist as a suffix to Path
>  class FilterNonExistent {
> @@ -2053,7 +2095,7 @@ void Generic_GCC::GCCInstallationDetecto
>
>  Generic_GCC::Generic_GCC(const Driver &D, const llvm::Triple &Triple,
>   const ArgList &Args)
> -: ToolChain(D, Triple, Args), GCCInstallation() {
> +: ToolChain(D, Triple, Args), GCCInstallation(), CudaInstallation() {
>getProgramPaths().push_back(getDriver().getInstalledDir());
>if (getDriver().getInstalledDir() != getDriver().Dir)
>  getProgramPaths().push_back(getDriver().Dir);
> @@ -2085,6 +2127,7 @@ Tool *Generic_GCC::buildLinker() const {
>  void Generic_GCC::printVerboseInfo(raw_ostream &OS) const {
>// Print the information about how we detected the GCC installation.
>GCCInstallation.print(OS);
> +  CudaInstallation.print(OS);
>  }
>
>  bool Generic_GCC::IsUnwindTablesDefault() const {
> @@ -3261,6 +3304,7 @@ static StringRef getOSLibDir(const llvm:
>  Linux::Linux(const Driver &D, co

Re: r248433 - [CUDA] Added CUDA installation detector class.

2015-09-23 Thread Rui Ueyama via cfe-commits
Yes I can. Create a deep nested directly, create a symlink from there to
your Inputs/CUDA, and run "clang -v --target=i386-unknown-linux
--sysroot=/Inputs/CUDA".

On Wed, Sep 23, 2015 at 4:47 PM, Artem Belevich  wrote:

> I'm looking into it. Can you reproduce it on linux?
>
>
> On Wed, Sep 23, 2015 at 4:43 PM, Rui Ueyama  wrote:
>
>> On Wed, Sep 23, 2015 at 2:49 PM, Artem Belevich via cfe-commits <
>> cfe-commits@lists.llvm.org> wrote:
>>
>>> Author: tra
>>> Date: Wed Sep 23 16:49:39 2015
>>> New Revision: 248433
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=248433&view=rev
>>> Log:
>>> [CUDA] Added CUDA installation detector class.
>>>
>>> Added new option --cuda-path= which allows
>>> overriding default search paths.
>>> If it's not specified we look for CUDA installation in
>>> /usr/include/cuda and /usr/include/cuda-7.0.
>>>
>>> Differential Revision: http://reviews.llvm.org/D12989
>>>
>>> Added:
>>> cfe/trunk/test/Driver/Inputs/CUDA/usr/local/cuda/include/.keep
>>> cfe/trunk/test/Driver/Inputs/CUDA/usr/local/cuda/lib/.keep
>>> cfe/trunk/test/Driver/Inputs/CUDA/usr/local/cuda/lib64/.keep
>>> cfe/trunk/test/Driver/Inputs/CUDA/usr/local/cuda/nvvm/libdevice/.keep
>>> cfe/trunk/test/Driver/cuda-detect.cu
>>> Modified:
>>> cfe/trunk/include/clang/Driver/Options.td
>>> cfe/trunk/lib/Driver/ToolChains.cpp
>>> cfe/trunk/lib/Driver/ToolChains.h
>>>
>>> Modified: cfe/trunk/include/clang/Driver/Options.td
>>> URL:
>>> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Options.td?rev=248433&r1=248432&r2=248433&view=diff
>>>
>>> ==
>>> --- cfe/trunk/include/clang/Driver/Options.td (original)
>>> +++ cfe/trunk/include/clang/Driver/Options.td Wed Sep 23 16:49:39 2015
>>> @@ -359,6 +359,8 @@ def cuda_gpu_arch_EQ : Joined<["--"], "c
>>>Flags<[DriverOption, HelpHidden]>, HelpText<"CUDA GPU architecture">;
>>>  def cuda_host_only : Flag<["--"], "cuda-host-only">,
>>>HelpText<"Do host-side CUDA compilation only">;
>>> +def cuda_path_EQ : Joined<["--"], "cuda-path=">, Group,
>>> +  HelpText<"CUDA installation path">;
>>>  def dA : Flag<["-"], "dA">, Group;
>>>  def dD : Flag<["-"], "dD">, Group, Flags<[CC1Option]>,
>>>HelpText<"Print macro definitions in -E mode in addition to normal
>>> output">;
>>>
>>> Modified: cfe/trunk/lib/Driver/ToolChains.cpp
>>> URL:
>>> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=248433&r1=248432&r2=248433&view=diff
>>>
>>> ==
>>> --- cfe/trunk/lib/Driver/ToolChains.cpp (original)
>>> +++ cfe/trunk/lib/Driver/ToolChains.cpp Wed Sep 23 16:49:39 2015
>>> @@ -1482,6 +1482,48 @@ bool Generic_GCC::GCCInstallationDetecto
>>>  BiarchTripleAliases.push_back(BiarchTriple.str());
>>>  }
>>>
>>> +// \brief -- try common CUDA installation paths looking for files we
>>> need for
>>> +// CUDA compilation.
>>> +
>>> +void
>>> +Generic_GCC::CudaInstallationDetector::init(const Driver &D,
>>> +const llvm::Triple
>>> &TargetTriple,
>>> +const llvm::opt::ArgList
>>> &Args) {
>>> +  SmallVector CudaPathCandidates;
>>> +
>>> +  if (Args.hasArg(options::OPT_cuda_path_EQ))
>>> +CudaPathCandidates.push_back(
>>> +Args.getLastArgValue(options::OPT_cuda_path_EQ));
>>> +  else {
>>> +CudaPathCandidates.push_back(D.SysRoot + "/usr/local/cuda");
>>> +CudaPathCandidates.push_back(D.SysRoot + "/usr/local/cuda-7.0");
>>> +  }
>>> +
>>> +  for (const auto CudaPath : CudaPathCandidates) {
>>> +if (CudaPath.empty() || !llvm::sys::fs::exists(CudaPath))
>>> +  continue;
>>> +
>>> +CudaInstallPath = CudaPath;
>>> +CudaIncludePath = CudaInstallPath + "/include";
>>> +CudaLibDevicePath = CudaInstallPath + "/nvvm/libdevice";
>>> +CudaLibPath =
>>> +CudaInstallPath + (TargetTriple.isArch64Bit() ? "/lib64" :
>>> "/lib");
>>> +
>>> +if (!(llvm::sys::fs::exists(CudaIncludePath) &&
>>> +  llvm::sys::fs::exists(CudaLibPath) &&
>>> +  llvm::sys::fs::exists(CudaLibDevicePath)))
>>> +  continue;
>>> +
>>> +IsValid = true;
>>> +break;
>>> +  }
>>> +}
>>> +
>>> +void Generic_GCC::CudaInstallationDetector::print(raw_ostream &OS)
>>> const {
>>> +  if (isValid())
>>> +OS << "Found CUDA installation: " << CudaInstallPath << "\n";
>>> +}
>>> +
>>>  namespace {
>>>  // Filter to remove Multilibs that don't exist as a suffix to Path
>>>  class FilterNonExistent {
>>> @@ -2053,7 +2095,7 @@ void Generic_GCC::GCCInstallationDetecto
>>>
>>>  Generic_GCC::Generic_GCC(const Driver &D, const llvm::Triple &Triple,
>>>   const ArgList &Args)
>>> -: ToolChain(D, Triple, Args), GCCInstallation() {
>>> +: ToolChain(D, Triple, Args), GCCInstallation(), CudaInstallation()
>>> {
>>>getProgramPaths().push_back

Re: r248433 - [CUDA] Added CUDA installation detector class.

2015-09-23 Thread Rui Ueyama via cfe-commits
I don't know the exact condition, but here's my results.

OK

$ bin/clang -v -target=i386-unknown-linux
--sysroot=/tmp/x/CUDA
clang-3.7: error: unknown argument: '-target=i386-unknown-linux'
clang version 3.8.0 (http://llvm.org/git/clang.git
261b6512ccd334c6fc80d0d254a98627b053b07d) (llvm/trunk 248446)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /ssd/build/bin
Found CUDA installation:
/tmp/x/CUDA/usr/local/cuda

NG

$ bin/clang -v -target=i386-unknown-linux
--sysroot=/tmp/x/x/x/x/x/x/x/x/x/x/CUDA
clang-3.7: error: unknown argument: '-target=i386-unknown-linux'
clang version 3.8.0 (http://llvm.org/git/clang.git
261b6512ccd334c6fc80d0d254a98627b053b07d) (llvm/trunk 248446)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /ssd/build/bin

(no "Found CUDA installation")

On Wed, Sep 23, 2015 at 5:00 PM, Artem Belevich  wrote:

> How long is very long? I've tested on ubuntu with ~1600-character-long
> path and it works.
>
> Buildbot filed with a much shorter path:
>
> http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA_check/7416/consoleFull#-1841136826a1ca8a51-895e-46c6-af87-ce24fa4cd561
>
> I'll unroll my change if I fail to figure out how to fix it shortly.
>
> --Artem
>
>
> On Wed, Sep 23, 2015 at 4:51 PM, Rui Ueyama  wrote:
>
>> Yes I can. Create a deep nested directly, create a symlink from there to
>> your Inputs/CUDA, and run "clang -v --target=i386-unknown-linux
>> --sysroot=/Inputs/CUDA".
>>
>> On Wed, Sep 23, 2015 at 4:47 PM, Artem Belevich  wrote:
>>
>>> I'm looking into it. Can you reproduce it on linux?
>>>
>>>
>>> On Wed, Sep 23, 2015 at 4:43 PM, Rui Ueyama  wrote:
>>>
 On Wed, Sep 23, 2015 at 2:49 PM, Artem Belevich via cfe-commits <
 cfe-commits@lists.llvm.org> wrote:

> Author: tra
> Date: Wed Sep 23 16:49:39 2015
> New Revision: 248433
>
> URL: http://llvm.org/viewvc/llvm-project?rev=248433&view=rev
> Log:
> [CUDA] Added CUDA installation detector class.
>
> Added new option --cuda-path= which allows
> overriding default search paths.
> If it's not specified we look for CUDA installation in
> /usr/include/cuda and /usr/include/cuda-7.0.
>
> Differential Revision: http://reviews.llvm.org/D12989
>
> Added:
> cfe/trunk/test/Driver/Inputs/CUDA/usr/local/cuda/include/.keep
> cfe/trunk/test/Driver/Inputs/CUDA/usr/local/cuda/lib/.keep
> cfe/trunk/test/Driver/Inputs/CUDA/usr/local/cuda/lib64/.keep
>
> cfe/trunk/test/Driver/Inputs/CUDA/usr/local/cuda/nvvm/libdevice/.keep
> cfe/trunk/test/Driver/cuda-detect.cu
> Modified:
> cfe/trunk/include/clang/Driver/Options.td
> cfe/trunk/lib/Driver/ToolChains.cpp
> cfe/trunk/lib/Driver/ToolChains.h
>
> Modified: cfe/trunk/include/clang/Driver/Options.td
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Options.td?rev=248433&r1=248432&r2=248433&view=diff
>
> ==
> --- cfe/trunk/include/clang/Driver/Options.td (original)
> +++ cfe/trunk/include/clang/Driver/Options.td Wed Sep 23 16:49:39 2015
> @@ -359,6 +359,8 @@ def cuda_gpu_arch_EQ : Joined<["--"], "c
>Flags<[DriverOption, HelpHidden]>, HelpText<"CUDA GPU
> architecture">;
>  def cuda_host_only : Flag<["--"], "cuda-host-only">,
>HelpText<"Do host-side CUDA compilation only">;
> +def cuda_path_EQ : Joined<["--"], "cuda-path=">, Group,
> +  HelpText<"CUDA installation path">;
>  def dA : Flag<["-"], "dA">, Group;
>  def dD : Flag<["-"], "dD">, Group, Flags<[CC1Option]>,
>HelpText<"Print macro definitions in -E mode in addition to normal
> output">;
>
> Modified: cfe/trunk/lib/Driver/ToolChains.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=248433&r1=2

Re: Don't pass --build-id by default.

2016-06-02 Thread Rui Ueyama via cfe-commits
I'm not a person who can sign it off, but it looks good to me.

On Thu, Jun 2, 2016 at 3:55 PM, Rafael Espíndola  wrote:

> We do it just because gcc in some distributions do it.
>
> I can see why --build-id is useful for distributions, but given the
> cost on day to day edit+build cycles, any distro using clang should
> really just pass -Wl,--build-id in rpmbuild (or corresponding tool).
>
> Even upstream gcc is not as aggressive as current clang. It has a
> --enable-linker-build-id configure option and it defaults to false.
>
> Cheers,
> Rafael
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: r272701 - Rename Intrin.h to intrin.h, that's how all the documentation calls it.

2016-06-14 Thread Rui Ueyama via cfe-commits
Hans seems to fix it in r272701.

On Tue, Jun 14, 2016 at 1:26 PM, Vitaly Buka via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

> Probably the bot was broken by this CL
> http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fuzzer/builds/9922
>
> On Tue, Jun 14, 2016 at 1:03 PM Nico Weber via cfe-commits <
> cfe-commits@lists.llvm.org> wrote:
>
>> This change was generated by running `svn mv -m "Rename Intrin.h to
>> intrin.h, that's how all the documentation calls it."
>> https://n...@llvm.org/svn/llvm-project/cfe/trunk/lib/Headers/Intrin.h
>> https://n...@llvm.org/svn/llvm-project/cfe/trunk/lib/Headers/intrin.h`
>> 
>> – I didn't manually do anything with that svn:mergeinfo chunk.
>>
>> On Tue, Jun 14, 2016 at 9:54 PM, Nico Weber via cfe-commits <
>> cfe-commits@lists.llvm.org> wrote:
>>
>>> Author: nico
>>> Date: Tue Jun 14 14:54:40 2016
>>> New Revision: 272701
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=272701&view=rev
>>> Log:
>>> Rename Intrin.h to intrin.h, that's how all the documentation calls it.
>>>
>>> Added:
>>> cfe/trunk/lib/Headers/intrin.h   (props changed)
>>>   - copied unchanged from r272700, cfe/trunk/lib/Headers/Intrin.h
>>> Removed:
>>> cfe/trunk/lib/Headers/Intrin.h
>>>
>>> Removed: cfe/trunk/lib/Headers/Intrin.h
>>> URL:
>>> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/Intrin.h?rev=272700&view=auto
>>>
>>> ==
>>> --- cfe/trunk/lib/Headers/Intrin.h (original)
>>> +++ cfe/trunk/lib/Headers/Intrin.h (removed)
>>> @@ -1,957 +0,0 @@
>>> -/* === Intrin.h
>>> ---===
>>> - *
>>> - * Permission is hereby granted, free of charge, to any person
>>> obtaining a copy
>>> - * of this software and associated documentation files (the
>>> "Software"), to deal
>>> - * in the Software without restriction, including without limitation
>>> the rights
>>> - * to use, copy, modify, merge, publish, distribute, sublicense, and/or
>>> sell
>>> - * copies of the Software, and to permit persons to whom the Software is
>>> - * furnished to do so, subject to the following conditions:
>>> - *
>>> - * The above copyright notice and this permission notice shall be
>>> included in
>>> - * all copies or substantial portions of the Software.
>>> - *
>>> - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
>>> EXPRESS OR
>>> - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
>>> MERCHANTABILITY,
>>> - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
>>> SHALL THE
>>> - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
>>> OTHER
>>> - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
>>> ARISING FROM,
>>> - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
>>> DEALINGS IN
>>> - * THE SOFTWARE.
>>> - *
>>> -
>>> *===---===
>>> - */
>>> -
>>> -/* Only include this if we're compiling for the windows platform. */
>>> -#ifndef _MSC_VER
>>> -#include_next 
>>> -#else
>>> -
>>> -#ifndef __INTRIN_H
>>> -#define __INTRIN_H
>>> -
>>> -/* First include the standard intrinsics. */
>>> -#if defined(__i386__) || defined(__x86_64__)
>>> -#include 
>>> -#endif
>>> -
>>> -/* For the definition of jmp_buf. */
>>> -#if __STDC_HOSTED__
>>> -#include 
>>> -#endif
>>> -
>>> -/* Define the default attributes for the functions in this file. */
>>> -#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__,
>>> __nodebug__))
>>> -
>>> -#ifdef __cplusplus
>>> -extern "C" {
>>> -#endif
>>> -
>>> -#if defined(__MMX__)
>>> -/* And the random ones that aren't in those files. */
>>> -__m64 _m_from_float(float);
>>> -float _m_to_float(__m64);
>>> -#endif
>>> -
>>> -/* Other assorted instruction intrinsics. */
>>> -void __addfsbyte(unsigned long, unsigned char);
>>> -void __addfsdword(unsigned long, unsigned long);
>>> -void __addfsword(unsigned long, unsigned short);
>>> -void __code_seg(const char *);
>>> -static __inline__
>>> -void __cpuid(int[4], int);
>>> -static __inline__
>>> -void __cpuidex(int[4], int, int);
>>> -void __debugbreak(void);
>>> -__int64 __emul(int, int);
>>> -unsigned __int64 __emulu(unsigned int, unsigned int);
>>> -void __cdecl __fastfail(unsigned int);
>>> -unsigned int __getcallerseflags(void);
>>> -static __inline__
>>> -void __halt(void);
>>> -unsigned char __inbyte(unsigned short);
>>> -void __inbytestring(unsigned short, unsigned char *, unsigned long);
>>> -void __incfsbyte(unsigned long);
>>> -void __incfsdword(unsigned long);
>>> -void __incfsword(unsigned long);
>>> -unsigned long __indword(unsigned short);
>>> -void __indwordstring(unsigned short, unsigned long *, unsigned long);
>>> -void __int2c(void);
>>> -void __invlpg(void *);
>>> -unsigned short __inword(unsigned short);
>>> -void __inwordstring(unsigned short,

Re: [PATCH] D15953: Driver: Pass -flavor gnu to lld for AMDGPU rather than -flavor gnu-old

2016-01-07 Thread Rui Ueyama via cfe-commits
ruiu added a comment.

You can use "ld.lld" which is a symlink to lld instead of "lld -flavor gnu".


http://reviews.llvm.org/D15953



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


Re: [PATCH] D15953: Driver: Pass -flavor gnu to lld for AMDGPU rather than -flavor gnu-old

2016-01-07 Thread Rui Ueyama via cfe-commits
ruiu accepted this revision.
ruiu added a comment.
This revision is now accepted and ready to land.

LGTM


http://reviews.llvm.org/D15953



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


r257802 - Update for LLVM function name change.

2016-01-14 Thread Rui Ueyama via cfe-commits
Author: ruiu
Date: Thu Jan 14 15:00:27 2016
New Revision: 257802

URL: http://llvm.org/viewvc/llvm-project?rev=257802&view=rev
Log:
Update for LLVM function name change.

Modified:
cfe/trunk/include/clang/AST/CharUnits.h
cfe/trunk/include/clang/AST/StmtOpenMP.h
cfe/trunk/include/clang/AST/TypeLoc.h
cfe/trunk/lib/AST/ASTContext.cpp
cfe/trunk/lib/AST/ExprConstant.cpp
cfe/trunk/lib/AST/Mangle.cpp
cfe/trunk/lib/AST/MicrosoftCXXABI.cpp
cfe/trunk/lib/AST/RecordLayoutBuilder.cpp
cfe/trunk/lib/AST/Stmt.cpp
cfe/trunk/lib/AST/StmtOpenMP.cpp
cfe/trunk/lib/AST/TypeLoc.cpp
cfe/trunk/lib/CodeGen/CGAtomic.cpp
cfe/trunk/lib/CodeGen/CGBlocks.cpp
cfe/trunk/lib/CodeGen/CGCleanup.cpp
cfe/trunk/lib/CodeGen/CGCleanup.h
cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
cfe/trunk/lib/CodeGen/CGExprConstant.cpp
cfe/trunk/lib/CodeGen/CGObjCMac.cpp
cfe/trunk/lib/CodeGen/CGObjCRuntime.cpp
cfe/trunk/lib/CodeGen/CGRecordLayoutBuilder.cpp
cfe/trunk/lib/CodeGen/TargetInfo.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/PaddingChecker.cpp

Modified: cfe/trunk/include/clang/AST/CharUnits.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/CharUnits.h?rev=257802&r1=257801&r2=257802&view=diff
==
--- cfe/trunk/include/clang/AST/CharUnits.h (original)
+++ cfe/trunk/include/clang/AST/CharUnits.h Thu Jan 14 15:00:27 2016
@@ -133,7 +133,7 @@ namespace clang {
   /// Test whether this is a multiple of the other value.
   ///
   /// Among other things, this promises that
-  /// self.RoundUpToAlignment(N) will just return self.
+  /// self.alignTo(N) will just return self.
   bool isMultipleOf(CharUnits N) const {
 return (*this % N) == 0;
   }
@@ -170,12 +170,11 @@ namespace clang {
   /// getQuantity - Get the raw integer representation of this quantity.
   QuantityType getQuantity() const { return Quantity; }
 
-  /// RoundUpToAlignment - Returns the next integer (mod 2**64) that is
+  /// alignTo - Returns the next integer (mod 2**64) that is
   /// greater than or equal to this quantity and is a multiple of \p Align.
   /// Align must be non-zero.
-  CharUnits RoundUpToAlignment(const CharUnits &Align) const {
-return CharUnits(llvm::RoundUpToAlignment(Quantity, 
-  Align.Quantity));
+  CharUnits alignTo(const CharUnits &Align) const {
+return CharUnits(llvm::alignTo(Quantity, Align.Quantity));
   }
 
   /// Given that this is a non-zero alignment value, what is the

Modified: cfe/trunk/include/clang/AST/StmtOpenMP.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/StmtOpenMP.h?rev=257802&r1=257801&r2=257802&view=diff
==
--- cfe/trunk/include/clang/AST/StmtOpenMP.h (original)
+++ cfe/trunk/include/clang/AST/StmtOpenMP.h Thu Jan 14 15:00:27 2016
@@ -70,8 +70,7 @@ protected:
   : Stmt(SC), Kind(K), StartLoc(std::move(StartLoc)),
 EndLoc(std::move(EndLoc)), NumClauses(NumClauses),
 NumChildren(NumChildren),
-ClausesOffset(llvm::RoundUpToAlignment(sizeof(T),
-   llvm::alignOf())) 
{}
+ClausesOffset(llvm::alignTo(sizeof(T), llvm::alignOf())) 
{}
 
   /// \brief Sets the list of variables for this clause.
   ///

Modified: cfe/trunk/include/clang/AST/TypeLoc.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/TypeLoc.h?rev=257802&r1=257801&r2=257802&view=diff
==
--- cfe/trunk/include/clang/AST/TypeLoc.h (original)
+++ cfe/trunk/include/clang/AST/TypeLoc.h Thu Jan 14 15:00:27 2016
@@ -254,7 +254,7 @@ public:
 unsigned align =
 TypeLoc::getLocalAlignmentForType(QualType(getTypePtr(), 0));
 uintptr_t dataInt = reinterpret_cast(Data);
-dataInt = llvm::RoundUpToAlignment(dataInt, align);
+dataInt = llvm::alignTo(dataInt, align);
 return UnqualTypeLoc(getTypePtr(), reinterpret_cast(dataInt));
   }
 
@@ -353,7 +353,7 @@ public:
   unsigned getLocalDataSize() const {
 unsigned size = sizeof(LocalData);
 unsigned extraAlign = asDerived()->getExtraLocalDataAlignment();
-size = llvm::RoundUpToAlignment(size, extraAlign);
+size = llvm::alignTo(size, extraAlign);
 size += asDerived()->getExtraLocalDataSize();
 return size;
   }
@@ -399,14 +399,14 @@ protected:
   void *getExtraLocalData() const {
 unsigned size = sizeof(LocalData);
 unsigned extraAlign = asDerived()->getExtraLocalDataAlignment();
-size = llvm::RoundUpToAlignment(size, extraAlign);
+size = llvm::alignTo(size, extraAlign);
 return reinterpret_cast(Base::Data) + size;
   }
 
   void *getNonLocalData() const {
 uintptr_t data = reinterpret_cast(Base::Data);