RE: [clang-tools-extra] r314989 - [clangd] Added async API to run code completion.

2017-10-05 Thread Yung, Douglas via cfe-commits
Hi Ilya,

Your change has broken the build on the PS4 Windows bot.

http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/12525

Can you take a look and fix it?

Douglas Yung

> -Original Message-
> From: cfe-commits [mailto:cfe-commits-boun...@lists.llvm.org] On Behalf Of
> Ilya Biryukov via cfe-commits
> Sent: Thursday, October 05, 2017 10:04
> To: cfe-commits@lists.llvm.org
> Subject: [clang-tools-extra] r314989 - [clangd] Added async API to run code
> completion.
> 
> Author: ibiryukov
> Date: Thu Oct  5 10:04:13 2017
> New Revision: 314989
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=314989&view=rev
> Log:
> [clangd] Added async API to run code completion.
> 
> Summary:
> ClangdServer now provides async code completion API.
> It is still used synchronously by ClangdLSPServer, more work is needed to
> allow processing other requests in parallel while completion (or any other
> request) is running.
> 
> Reviewers: klimek, bkramer, krasimir
> 
> Reviewed By: klimek
> 
> Subscribers: cfe-commits
> 
> Differential Revision: https://reviews.llvm.org/D38583
> 
> Modified:
> clang-tools-extra/trunk/clangd/ClangdLSPServer.cpp
> clang-tools-extra/trunk/clangd/ClangdServer.cpp
> clang-tools-extra/trunk/clangd/ClangdServer.h
> clang-tools-extra/trunk/unittests/clangd/ClangdTests.cpp
> 
> Modified: clang-tools-extra/trunk/clangd/ClangdLSPServer.cpp
> URL: http://llvm.org/viewvc/llvm-project/clang-tools-
> extra/trunk/clangd/ClangdLSPServer.cpp?rev=314989&r1=314988&r2=314989&view=dif
> f
> ==
> --- clang-tools-extra/trunk/clangd/ClangdLSPServer.cpp (original)
> +++ clang-tools-extra/trunk/clangd/ClangdLSPServer.cpp Thu Oct  5
> +++ 10:04:13 2017
> @@ -149,6 +149,9 @@ void ClangdLSPServer::onCompletion(TextD
> .codeComplete(Params.textDocument.uri.file,
>   Position{Params.position.line,
>Params.position.character})
> +   .get() // FIXME(ibiryukov): This could be made async if we
> +  // had an API that would allow to attach callbacks
> to
> +  // futures returned by ClangdServer.
> .Value;
> 
>std::string Completions;
> 
> Modified: clang-tools-extra/trunk/clangd/ClangdServer.cpp
> URL: http://llvm.org/viewvc/llvm-project/clang-tools-
> extra/trunk/clangd/ClangdServer.cpp?rev=314989&r1=314988&r2=314989&view=diff
> ==
> --- clang-tools-extra/trunk/clangd/ClangdServer.cpp (original)
> +++ clang-tools-extra/trunk/clangd/ClangdServer.cpp Thu Oct  5 10:04:13
> +++ 2017
> @@ -194,18 +194,19 @@ std::future ClangdServer::forceRep
>   std::move(TaggedFS));  }
> 
> -Tagged>
> +std::future>>
>  ClangdServer::codeComplete(PathRef File, Position Pos,
> llvm::Optional OverridenContents,
> IntrusiveRefCntPtr *UsedFS) {
> -  std::string DraftStorage;
> -  if (!OverridenContents) {
> +  std::string Contents;
> +  if (OverridenContents) {
> +Contents = *OverridenContents;
> +  } else {
>  auto FileContents = DraftMgr.getDraft(File);
>  assert(FileContents.Draft &&
> "codeComplete is called for non-added document");
> 
> -DraftStorage = std::move(*FileContents.Draft);
> -OverridenContents = DraftStorage;
> +Contents = std::move(*FileContents.Draft);
>}
> 
>auto TaggedFS = FSProvider.getTaggedFileSystem(File);
> @@ -215,12 +216,36 @@ ClangdServer::codeComplete(PathRef File,
>std::shared_ptr Resources = Units.getFile(File);
>assert(Resources && "Calling completion on non-added file");
> 
> -  auto Preamble = Resources->getPossiblyStalePreamble();
> -  std::vector Result = clangd::codeComplete(
> -  File, Resources->getCompileCommand(),
> -  Preamble ? &Preamble->Preamble : nullptr, *OverridenContents, Pos,
> -  TaggedFS.Value, PCHs, SnippetCompletions, Logger);
> -  return make_tagged(std::move(Result), TaggedFS.Tag);
> +  using PackagedTask =
> +  std::packaged_task>()>;
> +
> +  // Remember the current Preamble and use it when async task starts
> executing.
> +  // At the point when async task starts executing, we may have a
> + different  // Preamble in Resources. However, we assume the Preamble
> + that we obtain here  // is reusable in completion more often.
> +  std::shared_ptr Preamble =
> +  Resources->getPossiblyStalePreamble();
> +  // A task that will be run asynchronously.
> +  PackagedTask Task([=]() mutable { // 'mutable' to reassign Preamble
> variable.
> +if (!Preamble) {
> +  // Maybe we built some preamble before processing this request.
> +  Preamble = Resources->getPossiblyStalePreamble();
> +}
> +// FIXME(ibiryukov): even if Preamble is non-null

RE: r315984 - [CodeGen] EmitPointerWithAlignment() to generate TBAA info along with LValue base info

2017-10-18 Thread Yung, Douglas via cfe-commits
Hi Ivan,

This change caused a compiler crash in one of our tests. I have put the details 
in PR34992, can you take a look?

Douglas Yung

> -Original Message-
> From: cfe-commits [mailto:cfe-commits-boun...@lists.llvm.org] On Behalf Of
> Ivan A. Kosarev via cfe-commits
> Sent: Tuesday, October 17, 2017 2:12
> To: cfe-commits@lists.llvm.org
> Subject: r315984 - [CodeGen] EmitPointerWithAlignment() to generate TBAA info
> along with LValue base info
> 
> Author: kosarev
> Date: Tue Oct 17 02:12:13 2017
> New Revision: 315984
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=315984&view=rev
> Log:
> [CodeGen] EmitPointerWithAlignment() to generate TBAA info along with LValue
> base info
> 
> Differential Revision: https://reviews.llvm.org/D38796
> 
> Added:
> cfe/trunk/test/CodeGen/tbaa-cast.cpp
> Modified:
> cfe/trunk/lib/CodeGen/CGExpr.cpp
> cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
> cfe/trunk/lib/CodeGen/CodeGenFunction.h
> cfe/trunk/lib/CodeGen/CodeGenModule.cpp
> cfe/trunk/lib/CodeGen/CodeGenModule.h
> cfe/trunk/lib/CodeGen/CodeGenTBAA.cpp
> cfe/trunk/lib/CodeGen/CodeGenTBAA.h
> 
> Modified: cfe/trunk/lib/CodeGen/CGExpr.cpp
> URL: http://llvm.org/viewvc/llvm-
> project/cfe/trunk/lib/CodeGen/CGExpr.cpp?rev=315984&r1=315983&r2=315984&view=d
> iff
> ==
> --- cfe/trunk/lib/CodeGen/CGExpr.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CGExpr.cpp Tue Oct 17 02:12:13 2017
> @@ -916,7 +916,8 @@ void CodeGenModule::EmitExplicitCastExpr
>  /// EmitPointerWithAlignment - Given an expression of pointer type, try to
> /// derive a more accurate bound on the alignment of the pointer.
>  Address CodeGenFunction::EmitPointerWithAlignment(const Expr *E,
> -  LValueBaseInfo *BaseInfo) {
> +  LValueBaseInfo *BaseInfo,
> +  TBAAAccessInfo
> + *TBAAInfo) {
>// We allow this with ObjC object pointers because of fragile ABIs.
>assert(E->getType()->isPointerType() ||
>   E->getType()->isObjCObjectPointerType());
> @@ -936,20 +937,30 @@ Address CodeGenFunction::EmitPointerWith
>  if (PtrTy->getPointeeType()->isVoidType())
>break;
> 
> -LValueBaseInfo InnerInfo;
> -Address Addr = EmitPointerWithAlignment(CE->getSubExpr(),
> &InnerInfo);
> -if (BaseInfo) *BaseInfo = InnerInfo;
> -
> -// If this is an explicit bitcast, and the source l-value is
> -// opaque, honor the alignment of the casted-to type.
> -if (isa(CE) &&
> -InnerInfo.getAlignmentSource() != AlignmentSource::Decl) {
> -  LValueBaseInfo ExpInfo;
> +LValueBaseInfo InnerBaseInfo;
> +TBAAAccessInfo InnerTBAAInfo;
> +Address Addr = EmitPointerWithAlignment(CE->getSubExpr(),
> +&InnerBaseInfo,
> +&InnerTBAAInfo);
> +if (BaseInfo) *BaseInfo = InnerBaseInfo;
> +if (TBAAInfo) *TBAAInfo = InnerTBAAInfo;
> +
> +if (isa(CE)) {
> +  LValueBaseInfo TargetTypeBaseInfo;
> +  TBAAAccessInfo TargetTypeTBAAInfo;
>CharUnits Align = getNaturalPointeeTypeAlignment(E->getType(),
> -   &ExpInfo);
> -  if (BaseInfo)
> -BaseInfo->mergeForCast(ExpInfo);
> -  Addr = Address(Addr.getPointer(), Align);
> +
> &TargetTypeBaseInfo,
> +
> &TargetTypeTBAAInfo);
> +  if (TBAAInfo)
> +*TBAAInfo = CGM.mergeTBAAInfoForCast(*TBAAInfo,
> + TargetTypeTBAAInfo);
> +  // If the source l-value is opaque, honor the alignment of the
> +  // casted-to type.
> +  if (InnerBaseInfo.getAlignmentSource() != AlignmentSource::Decl) {
> +if (BaseInfo)
> +  BaseInfo->mergeForCast(TargetTypeBaseInfo);
> +Addr = Address(Addr.getPointer(), Align);
> +  }
>  }
> 
>  if (SanOpts.has(SanitizerKind::CFIUnrelatedCast) && @@ -969,12
> +980,13 @@ Address CodeGenFunction::EmitPointerWith
> 
>  // Array-to-pointer decay.
>  case CK_ArrayToPointerDecay:
> -  return EmitArrayToPointerDecay(CE->getSubExpr(), BaseInfo);
> +  return EmitArrayToPointerDecay(CE->getSubExpr(), BaseInfo,
> + TBAAInfo);
> 
>  // Derived-to-base conversions.
>  case CK_UncheckedDerivedToBase:
>  case CK_DerivedToBase: {
> -  Address Addr = EmitPointerWithAlignment(CE->getSubExpr(), BaseInfo);
> +  Address Addr = EmitPointerWithAlignment(CE->getSubExpr(), BaseInfo,
> +  TBAAInfo);
>auto Derived = CE->getSubExpr()->getType()->getPointeeCXXRecordDecl();
>return GetAddressOfBaseClass(Addr, Derived,
>  

RE: r312181 - Fix tests for ARM targets

2017-08-30 Thread Yung, Douglas via cfe-commits
Sorry about that, thanks for fixing it up for me!

Douglas Yung

> -Original Message-
> From: hwennb...@google.com [mailto:hwennb...@google.com] On Behalf Of Hans
> Wennborg
> Sent: Wednesday, August 30, 2017 16:28
> To: Yung, Douglas
> Cc: cfe-commits
> Subject: Re: r312181 - Fix tests for ARM targets
> 
> I fixed them some more in r312193 :-)
> 
> See e.g. here for the sample breakage:
> http://bb.pgr.jp/builders/test-clang-i686-linux-
> RA/builds/6961/steps/test_clang/logs/Clang%20%3A%3A%20CodeGen__profile-sample-
> accurate.c
> 
> On Wed, Aug 30, 2017 at 3:30 PM, Douglas Yung via cfe-commits  comm...@lists.llvm.org> wrote:
> > Author: dyung
> > Date: Wed Aug 30 15:30:08 2017
> > New Revision: 312181
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=312181&view=rev
> > Log:
> > Fix tests for ARM targets
> >
> > Tests fail on ARM targets due to ABI name between define and void. Added reg
> ex to skip.
> >
> > Patch by Glenn Howe (and expanded on by Douglas Yung)!
> >
> > Differential Revision: https://reviews.llvm.org/D33410
> >
> >
> > Modified:
> > cfe/trunk/test/CodeGen/profile-sample-accurate.c
> > cfe/trunk/test/CodeGen/thinlto-emit-llvm.c
> > cfe/trunk/test/Integration/thinlto_profile_sample_accurate.c
> >
> > Modified: cfe/trunk/test/CodeGen/profile-sample-accurate.c
> > URL:
> > http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/profile-sam
> > ple-accurate.c?rev=312181&r1=312180&r2=312181&view=diff
> > ==
> > 
> > --- cfe/trunk/test/CodeGen/profile-sample-accurate.c (original)
> > +++ cfe/trunk/test/CodeGen/profile-sample-accurate.c Wed Aug 30
> > +++ 15:30:08 2017
> > @@ -1,7 +1,7 @@
> >  // Test to ensure -emit-llvm profile-sample-accurate is honored by clang.
> >  // RUN: %clang -S -emit-llvm %s -fprofile-sample-accurate -o - |
> > FileCheck %s
> >
> > -// CHECK: define void @foo()
> > +// CHECK: define {{.*}} void @foo()
> >  // CHECK: attributes {{.*}} "profile-sample-accurate"
> >  void foo() {
> >  }
> >
> > Modified: cfe/trunk/test/CodeGen/thinlto-emit-llvm.c
> > URL:
> > http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/thinlto-emi
> > t-llvm.c?rev=312181&r1=312180&r2=312181&view=diff
> > ==
> > 
> > --- cfe/trunk/test/CodeGen/thinlto-emit-llvm.c (original)
> > +++ cfe/trunk/test/CodeGen/thinlto-emit-llvm.c Wed Aug 30 15:30:08
> > +++ 2017
> > @@ -5,6 +5,6 @@
> >  // RUN: %clang_cc1 -O2 -x ir %t.o -fthinlto-index=%t.thinlto.bc
> > -emit-llvm -o - | FileCheck %s  // RUN: %clang_cc1 -O2 -x ir %t.o
> > -fthinlto-index=%t.thinlto.bc -emit-llvm-bc -o - | llvm-dis -o - |
> > FileCheck %s
> >
> > -// CHECK: define void @foo()
> > +// CHECK: define {{.*}} void @foo()
> >  void foo() {
> >  }
> >
> > Modified: cfe/trunk/test/Integration/thinlto_profile_sample_accurate.c
> > URL:
> > http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Integration/thinlto
> > _profile_sample_accurate.c?rev=312181&r1=312180&r2=312181&view=diff
> > ==
> > 
> > --- cfe/trunk/test/Integration/thinlto_profile_sample_accurate.c
> > (original)
> > +++ cfe/trunk/test/Integration/thinlto_profile_sample_accurate.c Wed
> > +++ Aug 30 15:30:08 2017
> > @@ -3,7 +3,7 @@
> >  // RUN: llvm-lto -thinlto -o %t %t.o
> >  // RUN: %clang_cc1 -O2 -x ir %t.o -fthinlto-index=%t.thinlto.bc
> > -emit-llvm -o - | FileCheck %s
> >
> > -// CHECK: define void @foo()
> > +// CHECK: define {{.*}} void @foo()
> >  // CHECK: attributes {{.*}} "profile-sample-accurate"
> >  void foo() {
> >  }
> >
> >
> > ___
> > 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: [clang] 466e8b7 - Add StringLiteral to SyntaxTree

2020-06-25 Thread Yung, Douglas via cfe-commits
Hi Eduardo,

Your change is causing a build failure on PS4 Windows build bot, can you please 
take a look and fix it or revert the change if you cannot fix it soon so we can 
get the bot green again?

http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/33164

FAILED: 
tools/clang/unittests/Tooling/Syntax/CMakeFiles/SyntaxTests.dir/TreeTest.cpp.obj
 
C:\PROGRA~2\MIB055~1\2019\COMMUN~1\VC\Tools\MSVC\1425~1.286\bin\Hostx64\x64\cl.exe
  /nologo /TP -DBUILD_EXAMPLES -DGTEST_HAS_RTTI=0 -DGTEST_HAS_TR1_TUPLE=0 
-DGTEST_LANG_CXX11=1 -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE 
-D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS 
-D_GNU_SOURCE -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE 
-D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS 
-D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS 
-Itools\clang\unittests\Tooling\Syntax 
-IC:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm-project\clang\unittests\Tooling\Syntax
 
-IC:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm-project\clang\include
 -Itools\clang\include -Iinclude 
-IC:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm-project\llvm\include
 
-IC:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm-project\llvm\utils\unittest\googletest\include
 
-IC:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm-project\llvm\utils\unittest\googlemock\include
 /DWIN32 /D_WINDOWS   /Zc:inline /Zc:strictStrings /Oi /Zc:rvalueCast /W4 
-wd4141 -wd4146 -wd4244 -wd4267 -wd4291 -wd4351 -wd4456 -wd4457 -wd4458 -wd4459 
-wd4503 -wd4624 -wd4722 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 
-wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 
-wd4091 -wd4592 -wd4319 -wd4709 -wd4324 -w14062 -we4238 /Gw /MD /O2 /Ob2
/EHs-c- /GR- -UNDEBUG -std:c++14 /showIncludes 
/Fotools\clang\unittests\Tooling\Syntax\CMakeFiles\SyntaxTests.dir\TreeTest.cpp.obj
 /Fdtools\clang\unittests\Tooling\Syntax\CMakeFiles\SyntaxTests.dir\ /FS -c 
C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm-project\clang\unittests\Tooling\Syntax\TreeTest.cpp
C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm-project\clang\unittests\Tooling\Syntax\TreeTest.cpp(1665):
 error C2017: illegal escape sequence
C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm-project\clang\unittests\Tooling\Syntax\TreeTest.cpp(1639):
 error C2146: syntax error: missing ')' before identifier 'n'
C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm-project\clang\unittests\Tooling\Syntax\TreeTest.cpp(1639):
 error C2660: 'testing::internal::GetBoolAssertionFailureMessage': function 
does not take 2 arguments
C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm-project\llvm\utils\unittest\googletest\include\gtest/internal/gtest-internal.h(226):
 note: see declaration of 'testing::internal::GetBoolAssertionFailureMessage'
C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm-project\clang\unittests\Tooling\Syntax\TreeTest.cpp(1639):
 error C2440: '': cannot convert from 'initializer list' 
to 'testing::internal::AssertHelper'
C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm-project\clang\unittests\Tooling\Syntax\TreeTest.cpp(1665):
 note: No constructor could take the source type, or constructor overload 
resolution was ambiguous
C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm-project\clang\unittests\Tooling\Syntax\TreeTest.cpp(1639):
 error C2064: term does not evaluate to a function taking 3 arguments
C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm-project\clang\unittests\Tooling\Syntax\TreeTest.cpp(1639):
 error C2146: syntax error: missing ';' before identifier 'n'
C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm-project\clang\unittests\Tooling\Syntax\TreeTest.cpp(1665):
 error C2059: syntax error: ')'
C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm-project\clang\unittests\Tooling\Syntax\TreeTest.cpp(1639):
 error C2065: 'n': undeclared identifier
C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm-project\clang\unittests\Tooling\Syntax\TreeTest.cpp(1639):
 error C2146: syntax error: missing ';' before identifier 'SyntaxTree'
C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm-project\clang\unittests\Tooling\Syntax\TreeTest.cpp(1639):
 error C2065: 'SyntaxTree': undeclared identifier
C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm-project\clang\unittests\Tooling\Syntax\TreeTest.cpp(1639):
 error C2143: syntax error: missing ';' before 'string'

Douglas Yung

-Original Message-
From: cfe-commits  On Behalf Of Eduardo 
Caldas via cfe-commits
Sent: Thursday, June 25, 2020 10:05
To: cfe-commits@lists.llvm.org
Subjec

RE: r283802 - Change Builtins name to be stored as StringRef instead of raw pointers (NFC)

2016-10-11 Thread Yung, Douglas via cfe-commits
We noticed that this change also caused VS2015 to take a lot longer when 
building Targets.cpp. The revert in r283920 seems to have fixed it. The 
upstream PS4 Windows bot went from a build time of 17:53 
(http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/12771)
 to 5:51 
(http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/12772).

Douglas Yung

> -Original Message-
> From: cfe-commits [mailto:cfe-commits-boun...@lists.llvm.org] On Behalf
> Of Mehdi Amini via cfe-commits
> Sent: Tuesday, October 11, 2016 12:14
> To: Benjamin Kramer
> Cc: cfe-commits
> Subject: Re: r283802 - Change Builtins name to be stored as StringRef
> instead of raw pointers (NFC)
> 
> Reverted in r283920, can you check if it is enough to “fix” the GCC
> issue?
> 
> > On Oct 11, 2016, at 12:04 PM, Benjamin Kramer 
> wrote:
> >
> > Committing this patch before the constexpr change seems backwards
> > then? The static initializers are already breaking stuff because it
> > takes GCC with optimization and debug info takes 10+ minutes to
> > generate megabytes of static initializer code in Targets.cpp. Can you
> > please revert this until the constexpr change is ready?
> >
> > On Tue, Oct 11, 2016 at 8:40 PM, Mehdi Amini 
> wrote:
> >> This is temporary: the last patch of my series of patches adds the
> constexpr ctor and remove all these static initializers.
> >>
> >>> On Oct 11, 2016, at 11:26 AM, Benjamin Kramer 
> wrote:
> >>>
> >>> I don't think this change is worth it. We create huge static arrays
> >>> with Builtin::Info in Builtins.cpp and Targets.cpp, StringRef(const
> >>> char*) is not constexpr (because of strlen). This means you'll get
> a
> >>> huge generated initialization function for it. We want to reduce
> the
> >>> number of global initializers in LLVM, not create new ones.
> >>>
> >>> On Mon, Oct 10, 2016 at 11:34 PM, Mehdi Amini via cfe-commits
> >>>  wrote:
>  Author: mehdi_amini
>  Date: Mon Oct 10 16:34:29 2016
>  New Revision: 283802
> 
>  URL: http://llvm.org/viewvc/llvm-project?rev=283802&view=rev
>  Log:
>  Change Builtins name to be stored as StringRef instead of raw
>  pointers (NFC)
> 
>  Modified:
>    cfe/trunk/include/clang/Basic/Builtins.h
>    cfe/trunk/lib/CodeGen/CGBuiltin.cpp
>    cfe/trunk/lib/Sema/SemaChecking.cpp
> 
>  Modified: cfe/trunk/include/clang/Basic/Builtins.h
>  URL:
>  http://llvm.org/viewvc/llvm-
> project/cfe/trunk/include/clang/Basic/B
>  uiltins.h?rev=283802&r1=283801&r2=283802&view=diff
> 
> ===
>  ===
>  --- cfe/trunk/include/clang/Basic/Builtins.h (original)
>  +++ cfe/trunk/include/clang/Basic/Builtins.h Mon Oct 10 16:34:29
>  +++ 2016
>  @@ -51,7 +51,8 @@ enum ID {
>  };
> 
>  struct Info {
>  -  const char *Name, *Type, *Attributes, *HeaderName;
>  +  llvm::StringRef Name;
>  +  const char *Type, *Attributes, *HeaderName;
>   LanguageID Langs;
>   const char *Features;
>  };
>  @@ -80,7 +81,7 @@ public:
> 
>   /// \brief Return the identifier name for the specified builtin,
>  /// e.g. "__builtin_abs".
>  -  const char *getName(unsigned ID) const {
>  +  llvm::StringRef getName(unsigned ID) const {
> return getRecord(ID).Name;
>   }
> 
> 
>  Modified: cfe/trunk/lib/CodeGen/CGBuiltin.cpp
>  URL:
>  http://llvm.org/viewvc/llvm-
> project/cfe/trunk/lib/CodeGen/CGBuiltin
>  .cpp?rev=283802&r1=283801&r2=283802&view=diff
> 
> ===
>  ===
>  --- cfe/trunk/lib/CodeGen/CGBuiltin.cpp (original)
>  +++ cfe/trunk/lib/CodeGen/CGBuiltin.cpp Mon Oct 10 16:34:29 2016
>  @@ -50,7 +50,7 @@ llvm::Value *CodeGenModule::getBuiltinLi  if
>  (FD->hasAttr())
> Name = getMangledName(D);
>   else
>  -Name = Context.BuiltinInfo.getName(BuiltinID) + 10;
>  +Name = Context.BuiltinInfo.getName(BuiltinID).drop_front(10);
> 
>   llvm::FunctionType *Ty =
> cast(getTypes().ConvertType(FD-
> >getType()));
>  @@ -2523,11 +2523,11 @@ RValue CodeGenFunction::EmitBuiltinExpr(
>  checkTargetFeatures(E, FD);
> 
>   // See if we have a target specific intrinsic.
>  -  const char *Name = getContext().BuiltinInfo.getName(BuiltinID);
>   Intrinsic::ID IntrinsicID = Intrinsic::not_intrinsic;  StringRef
>  Prefix =
> 
> 
> llvm::Triple::getArchTypePrefix(getTarget().getTriple().getArch());
>   if (!Prefix.empty()) {
>  +StringRef Name = getContext().BuiltinInfo.getName(BuiltinID);
> IntrinsicID =
> Intrinsic::getIntrinsicForGCCBuiltin(Prefix.data(), Name);
> // NOTE we dont need to perform a compatibility flag check here
> since the
> // intrinsics are declared in Builtins*.

RE: [clang-tools-extra] r319557 - [clangd] Fuzzy match scorer

2017-12-01 Thread Yung, Douglas via cfe-commits
Hi Sam, the FuzzyMatch tests you added in this commit seem to be failing on the 
Windows bot:

http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/13869

Can you take a look?

Douglas Yung

> -Original Message-
> From: cfe-commits [mailto:cfe-commits-boun...@lists.llvm.org] On Behalf Of Sam
> McCall via cfe-commits
> Sent: Friday, December 01, 2017 9:08
> To: cfe-commits@lists.llvm.org
> Subject: [clang-tools-extra] r319557 - [clangd] Fuzzy match scorer
> 
> Author: sammccall
> Date: Fri Dec  1 09:08:02 2017
> New Revision: 319557
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=319557&view=rev
> Log:
> [clangd] Fuzzy match scorer
> 
> Summary:
> This will be used for rescoring code completion results based on partial
> identifiers.
> Short-term use:
>   - we want to limit the number of code completion results returned to
>   improve performance of global completion. The scorer will be used to
>   rerank the results to return when the user has applied a filter.
>   - ranking of completion results from in-memory index
>   - merging of completion results from multiple sources (merging usually
> Long-term use case:
>   works best when done at the component-score level, rescoring the
>   fuzzy-match quality avoids different backends needing to have
>   comparable scores)
> 
> Reviewers: ilya-biryukov
> 
> Subscribers: cfe-commits, mgorny
> 
> Differential Revision: https://reviews.llvm.org/D40060
> 
> Added:
> clang-tools-extra/trunk/clangd/FuzzyMatch.cpp
> clang-tools-extra/trunk/clangd/FuzzyMatch.h
> clang-tools-extra/trunk/unittests/clangd/FuzzyMatchTests.cpp
> Modified:
> clang-tools-extra/trunk/clangd/CMakeLists.txt
> clang-tools-extra/trunk/unittests/clangd/CMakeLists.txt
> 
> Modified: clang-tools-extra/trunk/clangd/CMakeLists.txt
> URL: http://llvm.org/viewvc/llvm-project/clang-tools-
> extra/trunk/clangd/CMakeLists.txt?rev=319557&r1=319556&r2=319557&view=diff
> ==
> --- clang-tools-extra/trunk/clangd/CMakeLists.txt (original)
> +++ clang-tools-extra/trunk/clangd/CMakeLists.txt Fri Dec  1 09:08:02
> +++ 2017
> @@ -8,6 +8,7 @@ add_clang_library(clangDaemon
>ClangdUnit.cpp
>ClangdUnitStore.cpp
>DraftStore.cpp
> +  FuzzyMatch.cpp
>GlobalCompilationDatabase.cpp
>JSONExpr.cpp
>JSONRPCDispatcher.cpp
> 
> Added: clang-tools-extra/trunk/clangd/FuzzyMatch.cpp
> URL: http://llvm.org/viewvc/llvm-project/clang-tools-
> extra/trunk/clangd/FuzzyMatch.cpp?rev=319557&view=auto
> ==
> --- clang-tools-extra/trunk/clangd/FuzzyMatch.cpp (added)
> +++ clang-tools-extra/trunk/clangd/FuzzyMatch.cpp Fri Dec  1 09:08:02
> +++ 2017
> @@ -0,0 +1,373 @@
> +//===--- FuzzyMatch.h - Approximate identifier matching  -*-
> +C++-*-===// //
> +// The LLVM Compiler Infrastructure
> +//
> +// This file is distributed under the University of Illinois Open
> +Source // License. See LICENSE.TXT for details.
> +//
> +//===--
> +===//
> +//
> +// To check for a match between a Pattern ('u_p') and a Word
> +('unique_ptr'), // we consider the possible partial match states:
> +//
> +// u n i q u e _ p t r
> +//   +-
> +//   |A . . . . . . . . . .
> +//  u|
> +//   |. . . . . . . . . . .
> +//  _|
> +//   |. . . . . . . O . . .
> +//  p|
> +//   |. . . . . . . . . . B
> +//
> +// Each dot represents some prefix of the pattern being matched against
> +some // prefix of the word.
> +//   - A is the initial state: '' matched against ''
> +//   - O is an intermediate state: 'u_' matched against 'unique_'
> +//   - B is the target state: 'u_p' matched against 'unique_ptr'
> +//
> +// We aim to find the best path from A->B.
> +//  - Moving right (consuming a word character)
> +//Always legal: not all word characters must match.
> +//  - Moving diagonally (consuming both a word and pattern character)
> +//Legal if the characters match.
> +//  - Moving down (consuming a pattern character) is never legal.
> +//Never legal: all pattern characters must match something.
> +//
> +// The scoring is based on heuristics:
> +//  - when matching a character, apply a bonus or penalty depending on the
> +//match quality (does case match, do word segments align, etc)
> +//  - when skipping a character, apply a penalty if it hurts the match
> +//(it starts a word segment, or splits the matched region, etc)
> +//
> +// These heuristics require the ability to "look backward" one
> +character, to // see whether it was matched or not. Therefore the
> +dynamic-programming matrix // has an extra dimension (last character
> matched).
> +// Each entry also has an additional flag indicating whether the
> +last-but-one // character matched, which is needed to trace back
> +through the scoring table // a

RE: r310960 - Revert "Revert "Fix LLVMgold plugin name/path for non-Linux.""

2017-08-15 Thread Yung, Douglas via cfe-commits
Hi Dan,

I don't know if you are aware, but the tests you added/changed in this commit 
are causing failures on the PS4 Windows bot. The root cause seems to be that 
you are looking for a forward slash, but Windows generates double backslashes, 
so the match fails:

http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/11545/steps/test/logs/stdio:

$ 
"C:/ps4-buildslave2/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/llvm.obj/./bin/clang.EXE"
 "-target" "x86_64-unknown-linux" "-###" 
"C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\test\Driver\lto-plugin-windows.c"
 "-flto"
$ 
"C:/ps4-buildslave2/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/llvm.obj/./bin\FileCheck.EXE"
 "-check-prefix=CHECK-LTO-PLUGIN" 
"C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\test\Driver\lto-plugin-windows.c"
# command stderr:
C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\test\Driver\lto-plugin-windows.c:6:22:
 error: expected string not found in input

// CHECK-LTO-PLUGIN: "-plugin" "{{.*}}/LLVMgold.dll"

 ^

:1:1: note: scanning from here

clang version 6.0.0 (trunk 310972)

^

:6:230: note: possible intended match here

 "ld" "--eh-frame-hdr" "-m" "elf_x86_64" "-dynamic-linker" 
"/lib64/ld-linux-x86-64.so.2" "-o" "a.out" "crt1.o" "crti.o" "crtbegin.o" 
"-LC:\\ps4-buildslave2\\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\\llvm.obj\\bin/../lib"
 "-plugin" 
"C:\\ps4-buildslave2\\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\\llvm.obj\\bin\\..\\lib\\LLVMgold.dll"
 "-plugin-opt=mcpu=x86-64" 
"c:\\users\\buildbot\\appdata\\local\\temp\\lit_tmp_wsgjna\\lto-plugin-windows-5f76f0.o"
 "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "-lc" "-lgcc" "--as-needed" 
"-lgcc_s" "--no-as-needed" "crtend.o" "crtn.o"



The affected tests are:

Driver/gold-lto.c
Driver/lto-plugin-windows.c
Driver/lto.c
Driver/thinlto.c

Can you fix these tests?

Thanks!

> -Original Message-
> From: cfe-commits [mailto:cfe-commits-boun...@lists.llvm.org] On Behalf Of Dan
> Albert via cfe-commits
> Sent: Tuesday, August 15, 2017 14:31
> To: cfe-commits@lists.llvm.org
> Subject: r310960 - Revert "Revert "Fix LLVMgold plugin name/path for non-
> Linux.""
> 
> Author: danalbert
> Date: Tue Aug 15 14:31:17 2017
> New Revision: 310960
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=310960&view=rev
> Log:
> Revert "Revert "Fix LLVMgold plugin name/path for non-Linux.""
> 
> Summary:
> Relanding https://reviews.llvm.org/D35739 which was reverted because it broke
> the tests on non-Linux. The tests have been fixed to be platform agnostic, and
> additional tests have been added to make sure that the plugin has the correct
> extension on each platform (%pluginext doesn't work in CHECK lines).
> 
> Reviewers: srhines, pirama
> 
> Reviewed By: srhines
> 
> Subscribers: emaste, mehdi_amini, eraman, cfe-commits
> 
> Differential Revision: https://reviews.llvm.org/D36769
> 
> Added:
> cfe/trunk/test/Driver/lto-plugin-darwin.c
> cfe/trunk/test/Driver/lto-plugin-linux.c
> cfe/trunk/test/Driver/lto-plugin-windows.c
> Modified:
> cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp
> cfe/trunk/test/Driver/freebsd.c
> cfe/trunk/test/Driver/gold-lto.c
> cfe/trunk/test/Driver/lto.c
> cfe/trunk/test/Driver/thinlto.c
> 
> Modified: cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp
> URL: http://llvm.org/viewvc/llvm-
> project/cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp?rev=310960&r1=310959&r2
> =310960&view=diff
> ==
> --- cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp (original)
> +++ cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp Tue Aug 15 14:31:17
> +++ 2017
> @@ -376,8 +376,20 @@ void tools::AddGoldPlugin(const ToolChai
>// as gold requires -plugin to come before any -plugin-opt that -Wl might
>// forward.
>CmdArgs.push_back("-plugin");
> -  std::string Plugin =
> -  ToolChain.getDriver().Dir + "/../lib" CLANG_LIBDIR_SUFFIX
> "/LLVMgold.so";
> +
> +#if defined(LLVM_ON_WIN32)
> +  const char *Suffix = ".dll";
> +#elif defined(__APPLE__)
> +  const char *Suffix = ".dylib";
> +#else
> +  const char *Suffix = ".so";
> +#endif
> +
> +  SmallString<1024> Plugin;
> +  llvm::sys::path::native(Twine(ToolChain.getDriver().Dir) +
> +  "/../lib" CLANG_LIBDIR_SUFFIX "/LLVMgold" +
> +  Suffix,
> +  Plugin);
>CmdArgs.push_back(Args.MakeArgString(Plugin));
> 
>// Try to pass driver level flags relevant to LTO code generation down to
> 
> Modified: cfe/trunk/test/Driver/freebsd.c
> URL: http://llvm.org/viewvc/llvm-
> project/cfe/trunk/test/Driver/freebsd.c?rev=310960&r1=310959&r2=310960&view=di
> ff
> ==
> --- cfe/trunk/te

RE: [clang] 6f428e0 - [AST] Fix crashes on decltype(recovery-expr).

2020-04-01 Thread Yung, Douglas via cfe-commits
Hi Haojian,

I noticed that after your change, the compiler is now giving an error when 
trying to create a vector of >= 1024 elements when previously it worked, and 
gcc has no problem with the same code. Is that intentional? I have put the 
details in PR45387, can you take a look?

Douglas Yung

-Original Message-
From: cfe-commits  On Behalf Of Haojian Wu 
via cfe-commits
Sent: Monday, March 30, 2020 5:57
To: cfe-commits@lists.llvm.org
Subject: [clang] 6f428e0 - [AST] Fix crashes on decltype(recovery-expr).


Author: Haojian Wu
Date: 2020-03-30T14:56:33+02:00
New Revision: 6f428e09fbe8ce7e3510ae024031a5fc19653483

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

LOG: [AST] Fix crashes on decltype(recovery-expr).

Summary: We mark these decls as invalid.

Reviewers: sammccall

Subscribers: cfe-commits

Tags: #clang

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

Added: 


Modified: 
clang/include/clang/AST/DependenceFlags.h
clang/include/clang/AST/Type.h
clang/lib/Parse/ParseExprCXX.cpp
clang/lib/Sema/SemaType.cpp
clang/test/AST/ast-dump-expr-errors.cpp
clang/test/Sema/invalid-member.cpp
clang/unittests/Sema/CodeCompleteTest.cpp

Removed: 




diff  --git a/clang/include/clang/AST/DependenceFlags.h 
b/clang/include/clang/AST/DependenceFlags.h
index 75c9aa1656b8..0b24bae6df9b 100644
--- a/clang/include/clang/AST/DependenceFlags.h
+++ b/clang/include/clang/AST/DependenceFlags.h
@@ -50,14 +50,16 @@ struct TypeDependenceScope {
 /// Whether this type is a variably-modified type (C99 6.7.5).
 VariablyModified = 8,
 
-// FIXME: add Error bit.
+/// Whether this type references an error, e.g. decltype(err-expression)
+/// yields an error type.
+Error = 16,
 
 None = 0,
-All = 15,
+All = 31,
 
 DependentInstantiation = Dependent | Instantiation,
 
-LLVM_MARK_AS_BITMASK_ENUM(/*LargestValue=*/VariablyModified)
+LLVM_MARK_AS_BITMASK_ENUM(/*LargestValue=*/Error)
   };
 };
 using TypeDependence = TypeDependenceScope::TypeDependence;
@@ -147,6 +149,7 @@ class Dependence {
 return translate(V, UnexpandedPack, TypeDependence::UnexpandedPack) |
translate(V, Instantiation, TypeDependence::Instantiation) |
translate(V, Dependent, TypeDependence::Dependent) |
+   translate(V, Error, TypeDependence::Error) |
translate(V, VariablyModified, TypeDependence::VariablyModified);
   }
 

diff  --git a/clang/include/clang/AST/Type.h b/clang/include/clang/AST/Type.h 
index 248fbcfba98e..5d2c035ea0fe 100644
--- a/clang/include/clang/AST/Type.h
+++ b/clang/include/clang/AST/Type.h
@@ -2139,6 +2139,11 @@ class alignas(8) Type : public ExtQualsTypeCommonBase {
 return static_cast(TypeBits.Dependence);
   }
 
+  /// Whether this type is an error type.
+  bool containsErrors() const {
+return getDependence() & TypeDependence::Error;  }
+
   /// Whether this type is a dependent type, meaning that its definition
   /// somehow depends on a template parameter (C++ [temp.dep.type]).
   bool isDependentType() const {

diff  --git a/clang/lib/Parse/ParseExprCXX.cpp 
b/clang/lib/Parse/ParseExprCXX.cpp
index 761fad9456be..4389c8777c6d 100644
--- a/clang/lib/Parse/ParseExprCXX.cpp
+++ b/clang/lib/Parse/ParseExprCXX.cpp
@@ -3105,10 +3105,14 @@ Parser::ParseCXXNewExpression(bool UseGlobal, 
SourceLocation Start) {
   auto RunSignatureHelp = [&]() {
 ParsedType TypeRep =
 Actions.ActOnTypeName(getCurScope(), DeclaratorInfo).get();
-assert(TypeRep && "invalid types should be handled before");
-QualType PreferredType = Actions.ProduceConstructorSignatureHelp(
-getCurScope(), TypeRep.get()->getCanonicalTypeInternal(),
-DeclaratorInfo.getEndLoc(), ConstructorArgs, ConstructorLParen);
+QualType PreferredType;
+// ActOnTypeName might adjust DeclaratorInfo and return a null type 
even
+// the passing DeclaratorInfo is valid, e.g. running SignatureHelp on
+// `new decltype(invalid) (^)`.
+if (TypeRep)
+  PreferredType = Actions.ProduceConstructorSignatureHelp(
+  getCurScope(), TypeRep.get()->getCanonicalTypeInternal(),
+  DeclaratorInfo.getEndLoc(), ConstructorArgs, 
+ ConstructorLParen);
 CalledSignatureHelp = true;
 return PreferredType;
   };

diff  --git a/clang/lib/Sema/SemaType.cpp b/clang/lib/Sema/SemaType.cpp index 
55ce028fb8c2..e128ebf31270 100644
--- a/clang/lib/Sema/SemaType.cpp
+++ b/clang/lib/Sema/SemaType.cpp
@@ -1678,6 +1678,12 @@ static QualType 
ConvertDeclSpecToType(TypeProcessingState &state) {
 break;
   }
 
+  // FIXME: we want resulting declarations to be marked invalid, but 
+ claiming  // the type is invalid

RE: [clang-tools-extra] r318774 - [clangd] Add parsing and value inspection to JSONExpr.

2017-11-21 Thread Yung, Douglas via cfe-commits
Hi Sam,

Your change is causing the PS4 Windows bot to fail because your test includes a 
divide by zero exception that the compiler is issuing an error for:

http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/13639/

FAILED: 
tools/clang/tools/extra/unittests/clangd/CMakeFiles/ClangdTests.dir/JSONExprTests.cpp.obj
 
C:\PROGRA~2\MICROS~1.0\VC\bin\cl.exe  /nologo /TP -DGTEST_HAS_RTTI=0 
-DGTEST_HAS_TR1_TUPLE=0 -DGTEST_LANG_CXX11=1 -DUNICODE 
-D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS 
-D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_FILE_OFFSET_BITS=64 
-D_GNU_SOURCE -D_HAS_EXCEPTIONS=0 -D_LARGEFILE_SOURCE 
-D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE 
-D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS 
-Itools\clang\tools\extra\unittests\clangd 
-IC:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\tools\extra\unittests\clangd
 
-IC:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\include
 -Itools\clang\include -Iinclude 
-IC:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\include
 
-IC:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\tools\extra\clangd
 
-IC:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\utils\unittest\googletest\include
 
-IC:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\utils\unittest\googlemock\include
 /DWIN32 /D_WINDOWS   /Zc:inline /Zc:strictStrings /Oi /Zc:rvalueCast /W4 
-wd4141 -wd4146 -wd4180 -wd4244 -wd4258 -wd4267 -wd4291 -wd4345 -wd4351 -wd4355 
-wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4800 -wd4100 -wd4127 
-wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 
-wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4324 -w14062 
-we4238 /MD /O2 /Ob2   -UNDEBUG  /EHs-c- /GR- /showIncludes 
/Fotools\clang\tools\extra\unittests\clangd\CMakeFiles\ClangdTests.dir\JSONExprTests.cpp.obj
 /Fdtools\clang\tools\extra\unittests\clangd\CMakeFiles\ClangdTests.dir\ /FS -c 
C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\tools\extra\unittests\clangd\JSONExprTests.cpp
C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\tools\extra\unittests\clangd\JSONExprTests.cpp(140):
 warning C4566: character represented by universal-character-name '\U00010437' 
cannot be represented in the current code page (1252)
C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\tools\extra\unittests\clangd\JSONExprTests.cpp(141):
 warning C4566: character represented by universal-character-name '\U0001D11E' 
cannot be represented in the current code page (1252)
C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\tools\extra\unittests\clangd\JSONExprTests.cpp(142):
 warning C4566: character represented by universal-character-name '\uFFFD' 
cannot be represented in the current code page (1252)
C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\tools\extra\unittests\clangd\JSONExprTests.cpp(134):
 error C2124: divide or mod by zero

Can you fix this so that we can get the bot green again? Thanks!

Douglas Yung

> -Original Message-
> From: cfe-commits [mailto:cfe-commits-boun...@lists.llvm.org] On Behalf Of Sam
> McCall via cfe-commits
> Sent: Tuesday, November 21, 2017 8:01
> To: cfe-commits@lists.llvm.org
> Subject: [clang-tools-extra] r318774 - [clangd] Add parsing and value
> inspection to JSONExpr.
> 
> Author: sammccall
> Date: Tue Nov 21 08:00:53 2017
> New Revision: 318774
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=318774&view=rev
> Log:
> [clangd] Add parsing and value inspection to JSONExpr.
> 
> Summary:
> This will replace the places where we're using YAMLParser to parse JSON now:
>   - the new marshalling code (T::parse()) should handle fewer cases and
> require
> fewer explicit casts
>   - we'll early-reject invalid JSON that YAMLParser accepts
>   - we'll be able to fix protocol-parsing bugs caused by the fact that YAML
> can
> only parse forward
> 
> I plan to do the conversion as soon as this lands, but I don't want it in one
> patch as the protocol.cpp changes are conflict-prone.
> 
> Reviewers: ioeric
> 
> Subscribers: ilya-biryukov, cfe-commits
> 
> Differential Revision: https://reviews.llvm.org/D40182
> 
> Modified:
> clang-tools-extra/trunk/clangd/JSONExpr.cpp
> clang-tools-extra/trunk/clangd/JSONExpr.h
> clang-tools-extra/trunk/unittests/clangd/JSONExprTests.cpp
> 
> Modified: clang-tools-extra/trunk/clangd/JSONExpr.cpp
> URL: http://llvm.org/viewvc/llvm-project/clang-tools-
> extra/trunk/clangd/JSONExpr.cpp?rev=318774&r1=318773&r2=318774&view=diff
> ==
> --

RE: [clang-tools-extra] r318774 - [clangd] Add parsing and value inspection to JSONExpr.

2017-11-21 Thread Yung, Douglas via cfe-commits
Hi Sam,

Thanks for looking into this. Just to clarify, the real issue is the divide by 
zero errors. The encoding related messages are only warnings.

JSONExprTests.cpp(134): error C2124: divide or mod by zero

Douglas Yung

From: Sam McCall [mailto:sam.mcc...@gmail.com]
Sent: Tuesday, November 21, 2017 11:07
To: Yung, Douglas
Cc: cfe-commits
Subject: Re: [clang-tools-extra] r318774 - [clangd] Add parsing and value 
inspection to JSONExpr.

Hi Douglas,

Sorry about that! It's an encoding problem, I forgot there were encodings other 
than UTF-8 :-)
I'll fix it.

Thanks for the heads up.

On Tue, Nov 21, 2017 at 7:56 PM, Yung, Douglas 
mailto:douglas.y...@sony.com>> wrote:
Hi Sam,

Your change is causing the PS4 Windows bot to fail because your test includes a 
divide by zero exception that the compiler is issuing an error for:

http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/13639/

FAILED: 
tools/clang/tools/extra/unittests/clangd/CMakeFiles/ClangdTests.dir/JSONExprTests.cpp.obj
C:\PROGRA~2\MICROS~1.0\VC\bin\cl.exe  /nologo /TP -DGTEST_HAS_RTTI=0 
-DGTEST_HAS_TR1_TUPLE=0 -DGTEST_LANG_CXX11=1 -DUNICODE 
-D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS 
-D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_FILE_OFFSET_BITS=64 
-D_GNU_SOURCE -D_HAS_EXCEPTIONS=0 -D_LARGEFILE_SOURCE 
-D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE 
-D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS 
-Itools\clang\tools\extra\unittests\clangd 
-IC:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\tools\extra\unittests\clangd
 
-IC:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\include
 -Itools\clang\include -Iinclude 
-IC:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\include
 
-IC:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\tools\extra\clangd
 
-IC:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\utils\unittest\googletest\include
 
-IC:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\utils\unittest\googlemock\include
 /DWIN32 /D_WINDOWS   /Zc:inline /Zc:strictStrings /Oi /Zc:rvalueCast /W4 
-wd4141 -wd4146 -wd4180 -wd4244 -wd4258 -wd4267 -wd4291 -wd4345 -wd4351 -wd4355 
-wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4800 -wd4100 -wd4127 
-wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 
-wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4324 -w14062 
-we4238 /MD /O2 /Ob2   -UNDEBUG  /EHs-c- /GR- /showIncludes 
/Fotools\clang\tools\extra\unittests\clangd\CMakeFiles\ClangdTests.dir\JSONExprTests.cpp.obj
 /Fdtools\clang\tools\extra\unittests\clangd\CMakeFiles\ClangdTests.dir\ /FS -c 
C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\tools\extra\unittests\clangd\JSONExprTests.cpp
C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\tools\extra\unittests\clangd\JSONExprTests.cpp(140):
 warning C4566: character represented by universal-character-name '\U00010437' 
cannot be represented in the current code page (1252)
C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\tools\extra\unittests\clangd\JSONExprTests.cpp(141):
 warning C4566: character represented by universal-character-name '\U0001D11E' 
cannot be represented in the current code page (1252)
C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\tools\extra\unittests\clangd\JSONExprTests.cpp(142):
 warning C4566: character represented by universal-character-name '\uFFFD' 
cannot be represented in the current code page (1252)
C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\tools\extra\unittests\clangd\JSONExprTests.cpp(134):
 error C2124: divide or mod by zero

Can you fix this so that we can get the bot green again? Thanks!

Douglas Yung

> -Original Message-
> From: cfe-commits 
> [mailto:cfe-commits-boun...@lists.llvm.org]
>  On Behalf Of Sam
> McCall via cfe-commits
> Sent: Tuesday, November 21, 2017 8:01
> To: cfe-commits@lists.llvm.org
> Subject: [clang-tools-extra] r318774 - [clangd] Add parsing and value
> inspection to JSONExpr.
>
> Author: sammccall
> Date: Tue Nov 21 08:00:53 2017
> New Revision: 318774
>
> URL: http://llvm.org/viewvc/llvm-project?rev=318774&view=rev
> Log:
> [clangd] Add parsing and value inspection to JSONExpr.
>
> Summary:
> This will replace the places where we're using YAMLParser to parse JSON now:
>   - the new marshalling code (T::parse()) should handle fewer cases and
> require
> fewer explicit casts
>   - we'll early-reject invalid JSON that YAMLParser accepts
>   - we'll be able to fix protocol-parsing bugs caused by the fact t

RE: [clang-tools-extra] r318774 - [clangd] Add parsing and value inspection to JSONExpr.

2017-11-21 Thread Yung, Douglas via cfe-commits
Hi Sam,

Thanks for the quick fixes! Fingers crossed that it all works now!

Douglas Yung

From: Sam McCall [mailto:sam.mcc...@gmail.com]
Sent: Tuesday, November 21, 2017 11:39
To: Yung, Douglas
Cc: cfe-commits
Subject: Re: [clang-tools-extra] r318774 - [clangd] Add parsing and value 
inspection to JSONExpr.

Hi Douglas,
The unicode issue is fixed in r318793 and the div0 in r318798.
Sorry about that!

On Tue, Nov 21, 2017 at 8:20 PM, Yung, Douglas 
mailto:douglas.y...@sony.com>> wrote:
Hi Sam,

Thanks for looking into this. Just to clarify, the real issue is the divide by 
zero errors. The encoding related messages are only warnings.

JSONExprTests.cpp(134): error C2124: divide or mod by zero

Douglas Yung

From: Sam McCall [mailto:sam.mcc...@gmail.com]
Sent: Tuesday, November 21, 2017 11:07
To: Yung, Douglas
Cc: cfe-commits
Subject: Re: [clang-tools-extra] r318774 - [clangd] Add parsing and value 
inspection to JSONExpr.

Hi Douglas,

Sorry about that! It's an encoding problem, I forgot there were encodings other 
than UTF-8 :-)
I'll fix it.

Thanks for the heads up.

On Tue, Nov 21, 2017 at 7:56 PM, Yung, Douglas 
mailto:douglas.y...@sony.com>> wrote:
Hi Sam,

Your change is causing the PS4 Windows bot to fail because your test includes a 
divide by zero exception that the compiler is issuing an error for:

http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/13639/

FAILED: 
tools/clang/tools/extra/unittests/clangd/CMakeFiles/ClangdTests.dir/JSONExprTests.cpp.obj
C:\PROGRA~2\MICROS~1.0\VC\bin\cl.exe  /nologo /TP -DGTEST_HAS_RTTI=0 
-DGTEST_HAS_TR1_TUPLE=0 -DGTEST_LANG_CXX11=1 -DUNICODE 
-D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS 
-D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_FILE_OFFSET_BITS=64 
-D_GNU_SOURCE -D_HAS_EXCEPTIONS=0 -D_LARGEFILE_SOURCE 
-D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE 
-D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS 
-Itools\clang\tools\extra\unittests\clangd 
-IC:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\tools\extra\unittests\clangd
 
-IC:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\include
 -Itools\clang\include -Iinclude 
-IC:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\include
 
-IC:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\tools\extra\clangd
 
-IC:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\utils\unittest\googletest\include
 
-IC:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\utils\unittest\googlemock\include
 /DWIN32 /D_WINDOWS   /Zc:inline /Zc:strictStrings /Oi /Zc:rvalueCast /W4 
-wd4141 -wd4146 -wd4180 -wd4244 -wd4258 -wd4267 -wd4291 -wd4345 -wd4351 -wd4355 
-wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4800 -wd4100 -wd4127 
-wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 
-wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4324 -w14062 
-we4238 /MD /O2 /Ob2   -UNDEBUG  /EHs-c- /GR- /showIncludes 
/Fotools\clang\tools\extra\unittests\clangd\CMakeFiles\ClangdTests.dir\JSONExprTests.cpp.obj
 /Fdtools\clang\tools\extra\unittests\clangd\CMakeFiles\ClangdTests.dir\ /FS -c 
C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\tools\extra\unittests\clangd\JSONExprTests.cpp
C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\tools\extra\unittests\clangd\JSONExprTests.cpp(140):
 warning C4566: character represented by universal-character-name '\U00010437' 
cannot be represented in the current code page (1252)
C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\tools\extra\unittests\clangd\JSONExprTests.cpp(141):
 warning C4566: character represented by universal-character-name '\U0001D11E' 
cannot be represented in the current code page (1252)
C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\tools\extra\unittests\clangd\JSONExprTests.cpp(142):
 warning C4566: character represented by universal-character-name '\uFFFD' 
cannot be represented in the current code page (1252)
C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\tools\extra\unittests\clangd\JSONExprTests.cpp(134):
 error C2124: divide or mod by zero

Can you fix this so that we can get the bot green again? Thanks!

Douglas Yung

> -Original Message-
> From: cfe-commits 
> [mailto:cfe-commits-boun...@lists.llvm.org]
>  On Behalf Of Sam
> McCall via cfe-commits
> Sent: Tuesday, November 21, 2017 8:01
> To: cfe-commits@lists.llvm.org
> Subject: [clang-tools-extra] r318774 - [clangd] Add parsing and value
> inspection to JSONExpr.
>
> Author: sammccall

RE: [clang-tools-extra] f7dffc2 - Don't include None.h (NFC)

2022-12-10 Thread Yung, Douglas via cfe-commits
Hi Kazu,

Your change caused the build of cross-project-tests to fail, can you take a 
look?

https://lab.llvm.org/buildbot/#/builders/139/builds/32528
https://lab.llvm.org/buildbot/#/builders/216/builds/14213

Douglas Yung

-Original Message-
From: cfe-commits  On Behalf Of Kazu Hirata 
via cfe-commits
Sent: Saturday, December 10, 2022 11:25
To: cfe-commits@lists.llvm.org
Subject: [clang-tools-extra] f7dffc2 - Don't include None.h (NFC)


Author: Kazu Hirata
Date: 2022-12-10T11:24:26-08:00
New Revision: f7dffc28b3f82e25a0e283d2b11ffb9c6a129340

URL: 
https://urldefense.com/v3/__https://github.com/llvm/llvm-project/commit/f7dffc28b3f82e25a0e283d2b11ffb9c6a129340__;!!JmoZiZGBv3RvKRSx!-wSCRml8NKZ6L_rFklXVIa3eZ-9Oj9ghkmY_pDw3qu_F5kgPjlairS6IxzEhDrh1PHN6EmJeDNagyNtcXt744ldc21A$
 
DIFF: 
https://urldefense.com/v3/__https://github.com/llvm/llvm-project/commit/f7dffc28b3f82e25a0e283d2b11ffb9c6a129340.diff__;!!JmoZiZGBv3RvKRSx!-wSCRml8NKZ6L_rFklXVIa3eZ-9Oj9ghkmY_pDw3qu_F5kgPjlairS6IxzEhDrh1PHN6EmJeDNagyNtcXt74E--JnXY$
 

LOG: Don't include None.h (NFC)

I've converted all known uses of None to std::nullopt, so we no longer
need to include None.h.

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://urldefense.com/v3/__https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716__;!!JmoZiZGBv3RvKRSx!-wSCRml8NKZ6L_rFklXVIa3eZ-9Oj9ghkmY_pDw3qu_F5kgPjlairS6IxzEhDrh1PHN6EmJeDNagyNtcXt74QT09naM$
 

Added: 


Modified: 
clang-tools-extra/clang-tidy/NoLintDirectiveHandler.cpp
clang-tools-extra/clang-tidy/objc/NSInvocationArgumentLifetimeCheck.cpp
clang-tools-extra/clangd/ConfigCompile.cpp
clang-tools-extra/clangd/SourceCode.cpp
clang-tools-extra/clangd/TUScheduler.cpp
clang-tools-extra/clangd/XRefs.cpp
clang-tools-extra/clangd/support/ThreadsafeFS.h
clang-tools-extra/clangd/unittests/ConfigCompileTests.cpp
clang-tools-extra/clangd/unittests/ConfigYAMLTests.cpp
clang-tools-extra/clangd/unittests/XRefsTests.cpp
clang/include/clang/AST/DeclObjC.h
clang/include/clang/AST/ExprCXX.h
clang/include/clang/AST/ExprObjC.h
clang/include/clang/AST/Type.h
clang/include/clang/Frontend/ASTUnit.h
clang/include/clang/Lex/Preprocessor.h
clang/include/clang/Sema/Overload.h
clang/lib/AST/ASTContext.cpp
clang/lib/AST/ASTImporter.cpp
clang/lib/AST/ASTStructuralEquivalence.cpp
clang/lib/AST/Decl.cpp
clang/lib/AST/DeclCXX.cpp
clang/lib/AST/DeclObjC.cpp
clang/lib/AST/DeclTemplate.cpp
clang/lib/AST/TemplateBase.cpp
clang/lib/AST/Type.cpp
clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp
clang/lib/Basic/SourceManager.cpp
clang/lib/Frontend/ASTUnit.cpp
clang/lib/Frontend/CompilerInvocation.cpp
clang/lib/Lex/Lexer.cpp
clang/lib/Lex/ModuleMap.cpp
clang/lib/Sema/SemaChecking.cpp
clang/lib/Serialization/ASTReader.cpp
clang/lib/StaticAnalyzer/Core/BugReporter.cpp
clang/unittests/Analysis/FlowSensitive/MultiVarConstantPropagationTest.cpp
clang/unittests/Analysis/FlowSensitive/SingleVarConstantPropagationTest.cpp
clang/utils/TableGen/NeonEmitter.cpp
libc/benchmarks/automemcpy/lib/RandomFunctionGenerator.cpp
lldb/source/Core/Debugger.cpp
lldb/source/Core/ThreadedCommunication.cpp

lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.cpp
lldb/source/Plugins/Trace/intel-pt/TraceIntelPT.cpp
lldb/source/Plugins/Trace/intel-pt/TraceIntelPTBundleSaver.cpp
llvm/include/llvm/ADT/ArrayRef.h
llvm/include/llvm/ADT/BreadthFirstIterator.h
llvm/include/llvm/ADT/DepthFirstIterator.h
llvm/include/llvm/ADT/Optional.h
llvm/include/llvm/ADT/SmallSet.h
llvm/include/llvm/ADT/TinyPtrVector.h
llvm/include/llvm/BinaryFormat/AMDGPUMetadataVerifier.h
llvm/include/llvm/CodeGen/LiveRangeEdit.h
llvm/include/llvm/CodeGen/MIRParser/MIRParser.h
llvm/include/llvm/CodeGen/MachineTraceMetrics.h
llvm/include/llvm/CodeGen/TargetInstrInfo.h
llvm/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h
llvm/include/llvm/DebugInfo/DWARF/DWARFFormValue.h
llvm/include/llvm/IR/Constants.h
llvm/include/llvm/IR/DebugInfoMetadata.h
llvm/include/llvm/IR/GCStrategy.h
llvm/include/llvm/IR/IRBuilder.h
llvm/include/llvm/IR/InstrTypes.h
llvm/include/llvm/IR/Instruction.h
llvm/include/llvm/IR/Instructions.h
llvm/include/llvm/IR/Intrinsics.h
llvm/include/llvm/IR/Metadata.h
llvm/include/llvm/IR/Operator.h
llvm/include/llvm/IR/ValueMap.h
llvm/include/llvm/MC/MCParser/MCAsmParser.h
llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h
llvm/include/llvm/Support/CommandLine.h
llvm/include/llvm/Support/VirtualFileSystem.h
llvm/lib/Analysis/BlockFrequencyInfo.cpp
llvm/lib/Analysis/ScalarEvolution.cpp
llvm/lib/AsmParser/LLParser.cpp
llvm/lib/Bitcode/Reader/MetadataLoader.cpp
llvm/lib/Bitcod

RE: r289995 - [libclang] Restore the CXXRecordDecl path for clang_Type_getNumTemplateArguments and clang_Type_getTemplateArgumentAsType

2016-12-16 Thread Yung, Douglas via cfe-commits
Hi, this change seems to be causing the PS4 Windows build bot to be red, can 
you take a look?

http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/2784

C:\PROGRA~2\MICROS~1.0\VC\bin\amd64\cl.exe   /nologo /TP -DCLANG_ENABLE_ARCMT 
-DCLANG_ENABLE_OBJC_REWRITER -DCLANG_ENABLE_STATIC_ANALYZER 
-DCLANG_TOOL_EXTRA_BUILD -DGTEST_HAS_RTTI=0 -DUNICODE -D_CINDEX_LIB_ 
-D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS 
-D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_GNU_SOURCE 
-D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS 
-D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS 
-D__STDC_LIMIT_MACROS -Itools\clang\tools\libclang 
-IC:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\tools\libclang
 
-IC:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\include
 -Itools\clang\include -Iinclude 
-IC:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\include
 /DWIN32 /D_WINDOWS   /W4 -wd4141 -wd4146 -wd4180 -wd4244 -wd4258 -wd4267 
-wd4291 -wd4345 -wd4351 -wd4355 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 
-wd4722 -wd4800 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 
-wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 
-wd4592 -wd4319 -wd4324 -w14062 -we4238 /Zc:inline /Zc:strictStrings /Oi 
/Zc:rvalueCast /MD /O2 /Ob2   -UNDEBUG  /EHs-c- /GR- /showIncludes 
/Fotools\clang\tools\libclang\CMakeFiles\libclang.dir\CXType.cpp.obj 
/Fdtools\clang\tools\libclang\CMakeFiles\libclang.dir\ /FS -c 
C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\tools\libclang\CXType.cpp
C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\tools\libclang\CXType.cpp(924):
 error C2526: 'GetTemplateArguments': C linkage function cannot return C++ 
class 'llvm::Optional>'
C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\tools\libclang\CXType.cpp(927):
 error C2562: 'GetTemplateArguments': 'void' function returning a value
C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\tools\libclang\CXType.cpp(924):
 note: see declaration of 'GetTemplateArguments'
C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\tools\libclang\CXType.cpp(933):
 error C2562: 'GetTemplateArguments': 'void' function returning a value
C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\tools\libclang\CXType.cpp(924):
 note: see declaration of 'GetTemplateArguments'
C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\tools\libclang\CXType.cpp(936):
 error C2562: 'GetTemplateArguments': 'void' function returning a value
C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\tools\libclang\CXType.cpp(924):
 note: see declaration of 'GetTemplateArguments'
C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\tools\libclang\CXType.cpp(926):
 warning C4390: ';': empty controlled statement found; is this the intent?
C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\tools\libclang\CXType.cpp(932):
 warning C4390: ';': empty controlled statement found; is this the intent?
C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\tools\libclang\CXType.cpp(952):
 error C3313: 'TA': variable cannot have the type 'void'
C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\tools\libclang\CXType.cpp(953):
 error C3536: 'TA': cannot be used before it is initialized
C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\tools\libclang\CXType.cpp(956):
 error C2228: left of '.getValue' must have class/struct/union
C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\tools\libclang\CXType.cpp(956):
 note: type is 'int'
C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\tools\libclang\CXType.cpp(959):
 error C2526: 'TemplateArgumentToQualType': C linkage function cannot return 
C++ class 'llvm::Optional'
C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\tools\libclang\CXType.cpp(961):
 error C2562: 'TemplateArgumentToQualType': 'void' function returning a value
C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\tools\libclang\CXType.cpp(959):
 note: see declaration of 'TemplateArgumentToQualType'
C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\tools\libclang\CXType.cpp(962):
 error C2562: 'TemplateArgumentToQualType': 'void' function returning a value
C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\cla

RE: r297972 - [index/AST] Add references for ObjC getter=/setter= property attributes and related property getter/setter role fixes

2017-03-16 Thread Yung, Douglas via cfe-commits
[I can't find Nathan's email, so sending to the submitter, Argyrios]

Hi Argyrios/Nathan,

This change appears to be causing 9 tests on Windows to fail. It seems the 
compiler crashes when trying to run the tests. Can you please take a look?

The affected tests are the following:

Clang :: ASTMerge/property/test.m
Clang :: Index/annotate-comments-objc.m
Clang :: Index/c-index-api-loadTU-test.m
Clang :: Index/index-pch-objc.m
Clang :: Modules/objc-categories.m
Clang :: PCH/chain-categories.m
Clang :: PCH/chain-categories2.m
Clang :: PCH/chain-class-extension.m
Clang :: PCH/objc_property.m

Recent failure of the PS4 Windows bot: 
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/6902/steps/test/logs/stdio

> -Original Message-
> From: cfe-commits [mailto:cfe-commits-boun...@lists.llvm.org] On Behalf Of
> Argyrios Kyrtzidis via cfe-commits
> Sent: Thursday, March 16, 2017 11:26
> To: cfe-commits@lists.llvm.org
> Subject: r297972 - [index/AST] Add references for ObjC getter=/setter=
> property attributes and related property getter/setter role fixes
> 
> Author: akirtzidis
> Date: Thu Mar 16 13:25:40 2017
> New Revision: 297972
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=297972&view=rev
> Log:
> [index/AST] Add references for ObjC getter=/setter= property attributes and
> related property getter/setter role fixes
> 
> This enhances the AST to keep track of locations of the names in those ObjC
> property attributes, and reports them for indexing.
> 
> Patch by Nathan Hawes!
> https://reviews.llvm.org/D30907
> 
> Modified:
> cfe/trunk/include/clang/AST/DeclObjC.h
> cfe/trunk/include/clang/Sema/DeclSpec.h
> cfe/trunk/include/clang/Sema/Sema.h
> cfe/trunk/lib/AST/ASTImporter.cpp
> cfe/trunk/lib/Index/IndexBody.cpp
> cfe/trunk/lib/Index/IndexDecl.cpp
> cfe/trunk/lib/Parse/ParseObjc.cpp
> cfe/trunk/lib/Sema/SemaObjCProperty.cpp
> cfe/trunk/lib/Serialization/ASTReaderDecl.cpp
> cfe/trunk/lib/Serialization/ASTWriterDecl.cpp
> cfe/trunk/test/Index/Core/index-source.m
> 
> Modified: cfe/trunk/include/clang/AST/DeclObjC.h
> URL: http://llvm.org/viewvc/llvm-
> project/cfe/trunk/include/clang/AST/DeclObjC.h?rev=297972&r1=297971&r2=297972&
> view=diff
> ==
> --- cfe/trunk/include/clang/AST/DeclObjC.h (original)
> +++ cfe/trunk/include/clang/AST/DeclObjC.h Thu Mar 16 13:25:40 2017
> @@ -743,6 +743,8 @@ private:
> 
>Selector GetterName;// getter name of NULL if no getter
>Selector SetterName;// setter name of NULL if no setter
> +  SourceLocation GetterNameLoc; // location of the getter attribute's
> + value  SourceLocation SetterNameLoc; // location of the setter
> + attribute's value
> 
>ObjCMethodDecl *GetterMethodDecl; // Declaration of getter instance method
>ObjCMethodDecl *SetterMethodDecl; // Declaration of setter instance method
> @@ -855,10 +857,18 @@ public:
>}
> 
>Selector getGetterName() const { return GetterName; }
> -  void setGetterName(Selector Sel) { GetterName = Sel; }
> +  SourceLocation getGetterNameLoc() const { return GetterNameLoc; }
> + void setGetterName(Selector Sel, SourceLocation Loc) {
> +GetterName = Sel;
> +GetterNameLoc = Loc;
> +  }
> 
>Selector getSetterName() const { return SetterName; }
> -  void setSetterName(Selector Sel) { SetterName = Sel; }
> +  SourceLocation getSetterNameLoc() const { return SetterNameLoc; }
> + void setSetterName(Selector Sel, SourceLocation Loc) {
> +SetterName = Sel;
> +SetterNameLoc = Loc;
> +  }
> 
>ObjCMethodDecl *getGetterMethodDecl() const { return GetterMethodDecl; }
>void setGetterMethodDecl(ObjCMethodDecl *gDecl) { GetterMethodDecl = gDecl;
> }
> 
> Modified: cfe/trunk/include/clang/Sema/DeclSpec.h
> URL: http://llvm.org/viewvc/llvm-
> project/cfe/trunk/include/clang/Sema/DeclSpec.h?rev=297972&r1=297971&r2=297972
> &view=diff
> ==
> --- cfe/trunk/include/clang/Sema/DeclSpec.h (original)
> +++ cfe/trunk/include/clang/Sema/DeclSpec.h Thu Mar 16 13:25:40 2017
> @@ -861,11 +861,19 @@ public:
> 
>const IdentifierInfo *getGetterName() const { return GetterName; }
>IdentifierInfo *getGetterName() { return GetterName; }
> -  void setGetterName(IdentifierInfo *name) { GetterName = name; }
> +  SourceLocation getGetterNameLoc() const { return GetterNameLoc; }
> + void setGetterName(IdentifierInfo *name, SourceLocation loc) {
> +GetterName = name;
> +GetterNameLoc = loc;
> +  }
> 
>const IdentifierInfo *getSetterName() const { return SetterName; }
>IdentifierInfo *getSetterName() { return SetterName; }
> -  void setSetterName(IdentifierInfo *name) { SetterName = name; }
> +  SourceLocation getSetterNameLoc() const { return SetterNameLoc; }
> + void setSetterName(IdentifierInfo *name, SourceLocation loc) {
> +SetterName = name;
> +

RE: r297972 - [index/AST] Add references for ObjC getter=/setter= property attributes and related property getter/setter role fixes

2017-03-16 Thread Yung, Douglas via cfe-commits
Your change does seem to have done the trick. Thanks!

Douglas Yung

> -Original Message-
> From: Argyrios Kyrtzidis [mailto:akyr...@gmail.com]
> Sent: Thursday, March 16, 2017 18:03
> To: Yung, Douglas
> Cc: cfe-commits
> Subject: Re: r297972 - [index/AST] Add references for ObjC getter=/setter=
> property attributes and related property getter/setter role fixes
> 
> I have high hopes r298027 will fix this.
> 
> > On Mar 16, 2017, at 5:42 PM, Argyrios Kyrtzidis  wrote:
> >
> > I think I know what the issue is, preparing a fix.
> >
> >
> >> On Mar 16, 2017, at 4:38 PM, Yung, Douglas  wrote:
> >>
> >> [I can't find Nathan's email, so sending to the submitter, Argyrios]
> >>
> >> Hi Argyrios/Nathan,
> >>
> >> This change appears to be causing 9 tests on Windows to fail. It seems the
> compiler crashes when trying to run the tests. Can you please take a look?
> >>
> >> The affected tests are the following:
> >>
> >> Clang :: ASTMerge/property/test.m
> >> Clang :: Index/annotate-comments-objc.m Clang ::
> >> Index/c-index-api-loadTU-test.m Clang :: Index/index-pch-objc.m Clang
> >> :: Modules/objc-categories.m Clang :: PCH/chain-categories.m Clang ::
> >> PCH/chain-categories2.m Clang :: PCH/chain-class-extension.m Clang ::
> >> PCH/objc_property.m
> >>
> >> Recent failure of the PS4 Windows bot:
> >> http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-wind
> >> ows10pro-fast/builds/6902/steps/test/logs/stdio
> >>
> >>> -Original Message-
> >>> From: cfe-commits [mailto:cfe-commits-boun...@lists.llvm.org] On
> >>> Behalf Of Argyrios Kyrtzidis via cfe-commits
> >>> Sent: Thursday, March 16, 2017 11:26
> >>> To: cfe-commits@lists.llvm.org
> >>> Subject: r297972 - [index/AST] Add references for ObjC
> >>> getter=/setter= property attributes and related property
> >>> getter/setter role fixes
> >>>
> >>> Author: akirtzidis
> >>> Date: Thu Mar 16 13:25:40 2017
> >>> New Revision: 297972
> >>>
> >>> URL: http://llvm.org/viewvc/llvm-project?rev=297972&view=rev
> >>> Log:
> >>> [index/AST] Add references for ObjC getter=/setter= property
> >>> attributes and related property getter/setter role fixes
> >>>
> >>> This enhances the AST to keep track of locations of the names in
> >>> those ObjC property attributes, and reports them for indexing.
> >>>
> >>> Patch by Nathan Hawes!
> >>> https://reviews.llvm.org/D30907
> >>>
> >>> Modified:
> >>>   cfe/trunk/include/clang/AST/DeclObjC.h
> >>>   cfe/trunk/include/clang/Sema/DeclSpec.h
> >>>   cfe/trunk/include/clang/Sema/Sema.h
> >>>   cfe/trunk/lib/AST/ASTImporter.cpp
> >>>   cfe/trunk/lib/Index/IndexBody.cpp
> >>>   cfe/trunk/lib/Index/IndexDecl.cpp
> >>>   cfe/trunk/lib/Parse/ParseObjc.cpp
> >>>   cfe/trunk/lib/Sema/SemaObjCProperty.cpp
> >>>   cfe/trunk/lib/Serialization/ASTReaderDecl.cpp
> >>>   cfe/trunk/lib/Serialization/ASTWriterDecl.cpp
> >>>   cfe/trunk/test/Index/Core/index-source.m
> >>>
> >>> Modified: cfe/trunk/include/clang/AST/DeclObjC.h
> >>> URL: http://llvm.org/viewvc/llvm-
> >>> project/cfe/trunk/include/clang/AST/DeclObjC.h?rev=297972&r1=297971&
> >>> r2=297972&
> >>> view=diff
> >>> 
> >>> ==
> >>> --- cfe/trunk/include/clang/AST/DeclObjC.h (original)
> >>> +++ cfe/trunk/include/clang/AST/DeclObjC.h Thu Mar 16 13:25:40 2017
> >>> @@ -743,6 +743,8 @@ private:
> >>>
> >>>  Selector GetterName;// getter name of NULL if no getter
> >>>  Selector SetterName;// setter name of NULL if no setter
> >>> +  SourceLocation GetterNameLoc; // location of the getter
> >>> + attribute's value  SourceLocation SetterNameLoc; // location of
> >>> + the setter attribute's value
> >>>
> >>>  ObjCMethodDecl *GetterMethodDecl; // Declaration of getter instance
> >>> method  ObjCMethodDecl *SetterMethodDecl; // Declaration of setter
> >>> instance method @@ -855,10 +857,18 @@ public:
> >>>  }
> >>>
> >>>  Selector getGetterName() const { return GetterName; }
> >>> -  void setGetterName(Selector Sel) { GetterName = Sel; }
> >>> +  SourceLocation getGetterNameLoc() const { return GetterNameLoc; }
> >>> + void setGetterName(Selector Sel, SourceLocation Loc) {
> >>> +GetterName = Sel;
> >>> +GetterNameLoc = Loc;
> >>> +  }
> >>>
> >>>  Selector getSetterName() const { return SetterName; }
> >>> -  void setSetterName(Selector Sel) { SetterName = Sel; }
> >>> +  SourceLocation getSetterNameLoc() const { return SetterNameLoc; }
> >>> + void setSetterName(Selector Sel, SourceLocation Loc) {
> >>> +SetterName = Sel;
> >>> +SetterNameLoc = Loc;
> >>> +  }
> >>>
> >>>  ObjCMethodDecl *getGetterMethodDecl() const { return
> >>> GetterMethodDecl; }  void setGetterMethodDecl(ObjCMethodDecl *gDecl)
> >>> { GetterMethodDecl = gDecl; }
> >>>
> >>> Modified: cfe/trunk/include/clang/Sema/DeclSpec.h
> >>> URL: http://llvm.org/viewvc/llvm-
> >>> project/cfe/trunk/include/clang/Sema/DeclSpec.h?rev=297972&r1=297971
> >>> &r2=297972
> >>> &view=diff
> >>> =

RE: r298410 - Correct class-template deprecation behavior

2017-03-21 Thread Yung, Douglas via cfe-commits
Hi Erich,

Your change is causing the Sema/attr-deprecated.c test to fail on the PS4 bot 
(http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/7087).
 Can you take a look?

Douglas Yung

> -Original Message-
> From: cfe-commits [mailto:cfe-commits-boun...@lists.llvm.org] On Behalf Of
> Erich Keane via cfe-commits
> Sent: Tuesday, March 21, 2017 10:49
> To: cfe-commits@lists.llvm.org
> Subject: r298410 - Correct class-template deprecation behavior
> 
> Author: erichkeane
> Date: Tue Mar 21 12:49:17 2017
> New Revision: 298410
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=298410&view=rev
> Log:
> Correct class-template deprecation behavior
> 
> Based on the comment in the test, and my reading of the standard, a deprecated
> warning should be issued in the following case:
> template [[deprecated]] class Foo{}; Foo f;
> 
> This was not the case, because the ClassTemplateSpecializationDecl creation
> did not also copy the deprecated attribute.
> 
> Note: I did NOT audit the complete set of attributes to see WHICH ones should
> be copied, so instead I simply copy ONLY the deprecated attribute.
> 
> Differential Revision: https://reviews.llvm.org/D27486
> 
> Modified:
> cfe/trunk/include/clang/Basic/Attr.td
> cfe/trunk/include/clang/Sema/Sema.h
> cfe/trunk/lib/Sema/SemaDeclAttr.cpp
> cfe/trunk/lib/Sema/SemaTemplate.cpp
> cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp
> cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp
> cfe/trunk/test/CXX/dcl.dcl/dcl.attr/dcl.attr.deprecated/p1.cpp
> cfe/trunk/test/Sema/attr-deprecated.c
> cfe/trunk/test/SemaCXX/attr-deprecated.cpp
> cfe/trunk/test/SemaObjC/attr-deprecated.m
> cfe/trunk/test/SemaObjC/special-dep-unavail-warning.m
> cfe/trunk/test/SemaObjC/warn-deprecated-implementations.m
> cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp
> 
> Modified: cfe/trunk/include/clang/Basic/Attr.td
> URL: http://llvm.org/viewvc/llvm-
> project/cfe/trunk/include/clang/Basic/Attr.td?rev=298410&r1=298409&r2=298410&v
> iew=diff
> ==
> --- cfe/trunk/include/clang/Basic/Attr.td (original)
> +++ cfe/trunk/include/clang/Basic/Attr.td Tue Mar 21 12:49:17 2017
> @@ -302,6 +302,9 @@ class Attr {
>// Set to true if this attribute can be duplicated on a subject when
> merging
>// attributes. By default, attributes are not merged.
>bit DuplicatesAllowedWhileMerging = 0;
> +  // Set to true if this attribute is meaningful when applied to or
> + inherited  // in a class template definition.
> +  bit MeaningfulToClassTemplateDefinition = 0;
>// Lists language options, one of which is required to be true for the
>// attribute to be applicable. If empty, no language options are required.
>list LangOpts = [];
> @@ -373,6 +376,7 @@ def AbiTag : Attr {
>let Args = [VariadicStringArgument<"Tags">];
>let Subjects = SubjectList<[Struct, Var, Function, Namespace], ErrorDiag,
>"ExpectedStructClassVariableFunctionOrInlineNamespace">;
> +  let MeaningfulToClassTemplateDefinition = 1;
>let Documentation = [AbiTagsDocs];
>  }
> 
> @@ -805,6 +809,7 @@ def Deprecated : InheritableAttr {
>// An optional string argument that enables us to provide a
>// Fix-It.
>StringArgument<"Replacement", 1>];
> +  let MeaningfulToClassTemplateDefinition = 1;
>let Documentation = [DeprecatedDocs];  }
> 
> @@ -1723,6 +1728,7 @@ def Visibility : InheritableAttr {
>let Args = [EnumArgument<"Visibility", "VisibilityType",
> ["default", "hidden", "internal", "protected"],
> ["Default", "Hidden", "Hidden", "Protected"]>];
> +  let MeaningfulToClassTemplateDefinition = 1;
>let Documentation = [Undocumented];
>  }
> 
> 
> Modified: cfe/trunk/include/clang/Sema/Sema.h
> URL: http://llvm.org/viewvc/llvm-
> project/cfe/trunk/include/clang/Sema/Sema.h?rev=298410&r1=298409&r2=298410&vie
> w=diff
> ==
> --- cfe/trunk/include/clang/Sema/Sema.h (original)
> +++ cfe/trunk/include/clang/Sema/Sema.h Tue Mar 21 12:49:17 2017
> @@ -7505,6 +7505,12 @@ public:
>  LateInstantiatedAttrVec *LateAttrs = nullptr,
>  LocalInstantiationScope *OuterMostScope = nullptr);
> 
> +  void
> +  InstantiateAttrsForDecl(const MultiLevelTemplateArgumentList &TemplateArgs,
> +  const Decl *Pattern, Decl *Inst,
> +  LateInstantiatedAttrVec *LateAttrs = nullptr,
> +  LocalInstantiationScope *OuterMostScope =
> + nullptr);
> +
>bool
>InstantiateClassTemplateSpecialization(SourceLocation PointOfInstantiation,
> ClassTemplateSpecializationDecl
> *ClassTemplateSpec,
> 
> Modified: cfe/trunk/lib/Sema/SemaDeclAttr.cpp
> URL: htt

RE: r298410 - Correct class-template deprecation behavior

2017-03-21 Thread Yung, Douglas via cfe-commits
Thanks, and yes, the PS4 target has slightly different defaults for both C and 
C++. I should have mentioned that in my original email, but I also was running 
out to lunch. :) Sorry about that.

Douglas Yung

> -Original Message-
> From: Keane, Erich [mailto:erich.ke...@intel.com]
> Sent: Tuesday, March 21, 2017 13:28
> To: Yung, Douglas
> Cc: cfe-commits
> Subject: RE: r298410 - Correct class-template deprecation behavior
> 
> Ended up being simpler than I expected.  I added -r298433  To fix this.
> 
> The issue is that the test had a conditional based on the "C" version, so I
> explicitly added a test for C89 and C99, which the PS4 is apparently not
> defaulting to.
> 
> Thanks!
> -Erich
> 
> 
> -Original Message-
> From: Yung, Douglas [mailto:douglas.y...@sony.com]
> Sent: Tuesday, March 21, 2017 12:59 PM
> To: Keane, Erich 
> Cc: cfe-commits 
> Subject: RE: r298410 - Correct class-template deprecation behavior
> 
> Hi Erich,
> 
> Your change is causing the Sema/attr-deprecated.c test to fail on the PS4 bot
> (http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-
> windows10pro-fast/builds/7087). Can you take a look?
> 
> Douglas Yung
> 
> > -Original Message-
> > From: cfe-commits [mailto:cfe-commits-boun...@lists.llvm.org] On
> > Behalf Of Erich Keane via cfe-commits
> > Sent: Tuesday, March 21, 2017 10:49
> > To: cfe-commits@lists.llvm.org
> > Subject: r298410 - Correct class-template deprecation behavior
> >
> > Author: erichkeane
> > Date: Tue Mar 21 12:49:17 2017
> > New Revision: 298410
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=298410&view=rev
> > Log:
> > Correct class-template deprecation behavior
> >
> > Based on the comment in the test, and my reading of the standard, a
> > deprecated warning should be issued in the following case:
> > template [[deprecated]] class Foo{}; Foo f;
> >
> > This was not the case, because the ClassTemplateSpecializationDecl
> > creation did not also copy the deprecated attribute.
> >
> > Note: I did NOT audit the complete set of attributes to see WHICH ones
> > should be copied, so instead I simply copy ONLY the deprecated attribute.
> >
> > Differential Revision: https://reviews.llvm.org/D27486
> >
> > Modified:
> > cfe/trunk/include/clang/Basic/Attr.td
> > cfe/trunk/include/clang/Sema/Sema.h
> > cfe/trunk/lib/Sema/SemaDeclAttr.cpp
> > cfe/trunk/lib/Sema/SemaTemplate.cpp
> > cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp
> > cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp
> > cfe/trunk/test/CXX/dcl.dcl/dcl.attr/dcl.attr.deprecated/p1.cpp
> > cfe/trunk/test/Sema/attr-deprecated.c
> > cfe/trunk/test/SemaCXX/attr-deprecated.cpp
> > cfe/trunk/test/SemaObjC/attr-deprecated.m
> > cfe/trunk/test/SemaObjC/special-dep-unavail-warning.m
> > cfe/trunk/test/SemaObjC/warn-deprecated-implementations.m
> > cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp
> >
> > Modified: cfe/trunk/include/clang/Basic/Attr.td
> > URL: http://llvm.org/viewvc/llvm-
> > project/cfe/trunk/include/clang/Basic/Attr.td?rev=298410&r1=298409&r2=
> > 298410&v
> > iew=diff
> > ==
> > 
> > --- cfe/trunk/include/clang/Basic/Attr.td (original)
> > +++ cfe/trunk/include/clang/Basic/Attr.td Tue Mar 21 12:49:17 2017
> > @@ -302,6 +302,9 @@ class Attr {
> >// Set to true if this attribute can be duplicated on a subject
> > when merging
> >// attributes. By default, attributes are not merged.
> >bit DuplicatesAllowedWhileMerging = 0;
> > +  // Set to true if this attribute is meaningful when applied to or
> > + inherited  // in a class template definition.
> > +  bit MeaningfulToClassTemplateDefinition = 0;
> >// Lists language options, one of which is required to be true for the
> >// attribute to be applicable. If empty, no language options are
> required.
> >list LangOpts = [];
> > @@ -373,6 +376,7 @@ def AbiTag : Attr {
> >let Args = [VariadicStringArgument<"Tags">];
> >let Subjects = SubjectList<[Struct, Var, Function, Namespace], ErrorDiag,
> >"ExpectedStructClassVariableFunctionOrInlineNamespace">;
> > +  let MeaningfulToClassTemplateDefinition = 1;
> >let Documentation = [AbiTagsDocs];
> >  }
> >
> > @@ -805,6 +809,7 @@ def Deprecated : InheritableAttr {
> >// An optional string argument that enables us to provide a
> >// Fix-It.
> >StringArgument<"Replacement", 1>];
> > +  let MeaningfulToClassTemplateDefinition = 1;
> >let Documentation = [DeprecatedDocs];  }
> >
> > @@ -1723,6 +1728,7 @@ def Visibility : InheritableAttr {
> >let Args = [EnumArgument<"Visibility", "VisibilityType",
> > ["default", "hidden", "internal", "protected"],
> > ["Default", "Hidden", "Hidden",
> > "Protected"]>];
> > +  let MeaningfulToClassTemplateDefinition = 1;
> >let Documentation = [Undocumente

RE: [clang-tools-extra] r299119 - [clang-tidy] Reuse FileID in getLocation

2017-03-30 Thread Yung, Douglas via cfe-commits
Hi, this change seems to be causing the test clang-tidy/llvm-include-order.cpp 
to fail with a crash on the PS4 Windows bot:

(From 
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/7487)

 TEST 'Clang Tools :: clang-tidy/llvm-include-order.cpp' 
FAILED 
Script:
--
C:/Python27/python.exe 
C:/Buildbot/Slave/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/llvm.src/tools/clang/tools/extra/test/../test\clang-tidy\check_clang_tidy.py
 
C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\tools\extra\test\clang-tidy\llvm-include-order.cpp
 llvm-include-order 
C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\tools\clang\tools\extra\test\clang-tidy\Output\llvm-include-order.cpp.tmp
 -- -- -isystem 
C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\tools\extra\test\clang-tidy/Inputs/Headers
--
Exit Code: 1

Command Output (stdout):
--
$ "C:/Python27/python.exe" 
"C:/Buildbot/Slave/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/llvm.src/tools/clang/tools/extra/test/../test\clang-tidy\check_clang_tidy.py"
 
"C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\tools\extra\test\clang-tidy\llvm-include-order.cpp"
 "llvm-include-order" 
"C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\tools\clang\tools\extra\test\clang-tidy\Output\llvm-include-order.cpp.tmp"
 "--" "--" "-isystem" 
"C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\tools\extra\test\clang-tidy/Inputs/Headers"
# command output:
Running ['clang-tidy', 
'C:\\Buildbot\\Slave\\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\\llvm.obj\\tools\\clang\\tools\\extra\\test\\clang-tidy\\Output\\llvm-include-order.cpp.tmp.cpp',
 '-fix', '--checks=-*,llvm-include-order', '--', '-isystem', 
'C:\\Buildbot\\Slave\\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\\llvm.src\\tools\\clang\\tools\\extra\\test\\clang-tidy/Inputs/Headers',
 '-nostdinc++']...
clang-tidy failed:
2 warnings generated.

Assertion failed: EndColNo <= map.getSourceLine().size() && "Invalid range!", 
file 
C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\lib\Frontend\TextDiagnostic.cpp,
 line 999



# command stderr:
Traceback (most recent call last):

  File 
"C:/Buildbot/Slave/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/llvm.src/tools/clang/tools/extra/test/../test\clang-tidy\check_clang_tidy.py",
 line 140, in 

main()

  File 
"C:/Buildbot/Slave/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/llvm.src/tools/clang/tools/extra/test/../test\clang-tidy\check_clang_tidy.py",
 line 96, in main

subprocess.check_output(args, stderr=subprocess.STDOUT).decode()

  File "C:\Python27\lib\subprocess.py", line 573, in check_output

raise CalledProcessError(retcode, cmd, output=output)

subprocess.CalledProcessError: Command '['clang-tidy', 
'C:\\Buildbot\\Slave\\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\\llvm.obj\\tools\\clang\\tools\\extra\\test\\clang-tidy\\Output\\llvm-include-order.cpp.tmp.cpp',
 '-fix', '--checks=-*,llvm-include-order', '--', '-isystem', 
'C:\\Buildbot\\Slave\\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\\llvm.src\\tools\\clang\\tools\\extra\\test\\clang-tidy/Inputs/Headers',
 '-nostdinc++']' returned non-zero exit status 255


error: command failed with exit status: 1

--



Can you take a look?

Douglas Yung

> -Original Message-
> From: cfe-commits [mailto:cfe-commits-boun...@lists.llvm.org] On Behalf Of
> Chih-Hung Hsieh via cfe-commits
> Sent: Thursday, March 30, 2017 15:09
> To: cfe-commits@lists.llvm.org
> Subject: [clang-tools-extra] r299119 - [clang-tidy] Reuse FileID in
> getLocation
> 
> Author: chh
> Date: Thu Mar 30 17:09:17 2017
> New Revision: 299119
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=299119&view=rev
> Log:
> [clang-tidy] Reuse FileID in getLocation
> 
> One FileID per warning will increase and overflow NextLocalOffset when input
> file is large with many warnings.
> Reusing FileID avoids this problem.
> 
> Differential Revision: http://reviews.llvm.org/D31406
> 
> 
> Modified:
> clang-tools-extra/trunk/clang-tidy/ClangTidy.cpp
> 
> Modified: clang-tools-extra/trunk/clang-tidy/ClangTidy.cpp
> URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-
> tidy/ClangTidy.cpp?rev=299119&r1=299118&r2=299119&view=diff
> ==
> --- clang-tools-extra/trunk/clang-tidy/ClangTidy.cpp (original)
> +++ clang-tools-extra/trunk/clang-tidy/ClangTidy.cpp Thu Mar 30 17:09:17
> +++ 2017
> @@ -238,7 +238,7 @@ private:
>return SourceLocation();
> 
>  const FileEntry *File = SourceMgr.getFileManager().getFile(FilePath);
> -FileID ID = SourceMgr.createFileID(File, SourceLocation(),
> SrcMgr::C_User);
> 

RE: r299355 - [ASTImporter] Fix for importing unnamed structs

2017-04-03 Thread Yung, Douglas via cfe-commits
Hi Peter and Gabor,

This change is causing a failure of the test "Clang :: ASTMerge/struct/test.c" 
on the PS4 Windows bot:

http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/7609

FAIL: Clang :: ASTMerge/struct/test.c (18568 of 32374)
 TEST 'Clang :: ASTMerge/struct/test.c' FAILED 

Script:
--
C:/Buildbot/Slave/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/llvm.obj/./bin/clang.EXE
 -cc1 -internal-isystem 
C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\lib\clang\5.0.0\include
 -nostdsysteminc -emit-pch -o 
C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\tools\clang\test\ASTMerge\struct\Output\test.c.tmp.1.ast
 
C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\test\ASTMerge\struct/Inputs/struct1.c
C:/Buildbot/Slave/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/llvm.obj/./bin/clang.EXE
 -cc1 -internal-isystem 
C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\lib\clang\5.0.0\include
 -nostdsysteminc -emit-pch -o 
C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\tools\clang\test\ASTMerge\struct\Output\test.c.tmp.2.ast
 
C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\test\ASTMerge\struct/Inputs/struct2.c
not 
C:/Buildbot/Slave/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/llvm.obj/./bin/clang.EXE
 -cc1 -internal-isystem 
C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\lib\clang\5.0.0\include
 -nostdsysteminc -ast-merge 
C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\tools\clang\test\ASTMerge\struct\Output\test.c.tmp.1.ast
 -ast-merge 
C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\tools\clang\test\ASTMerge\struct\Output\test.c.tmp.2.ast
 -fsyntax-only 
C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\test\ASTMerge\struct\test.c
 2>&1 | 
C:/Buildbot/Slave/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/llvm.obj/./bin\FileCheck.EXE
 
C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\test\ASTMerge\struct\test.c
--
Exit Code: 1

Command Output (stdout):
--
$ 
"C:/Buildbot/Slave/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/llvm.obj/./bin/clang.EXE"
 "-cc1" "-internal-isystem" 
"C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\lib\clang\5.0.0\include"
 "-nostdsysteminc" "-emit-pch" "-o" 
"C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\tools\clang\test\ASTMerge\struct\Output\test.c.tmp.1.ast"
 
"C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\test\ASTMerge\struct/Inputs/struct1.c"
$ 
"C:/Buildbot/Slave/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/llvm.obj/./bin/clang.EXE"
 "-cc1" "-internal-isystem" 
"C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\lib\clang\5.0.0\include"
 "-nostdsysteminc" "-emit-pch" "-o" 
"C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\tools\clang\test\ASTMerge\struct\Output\test.c.tmp.2.ast"
 
"C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\test\ASTMerge\struct/Inputs/struct2.c"
$ "not" 
"C:/Buildbot/Slave/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/llvm.obj/./bin/clang.EXE"
 "-cc1" "-internal-isystem" 
"C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\lib\clang\5.0.0\include"
 "-nostdsysteminc" "-ast-merge" 
"C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\tools\clang\test\ASTMerge\struct\Output\test.c.tmp.1.ast"
 "-ast-merge" 
"C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\tools\clang\test\ASTMerge\struct\Output\test.c.tmp.2.ast"
 "-fsyntax-only" 
"C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\test\ASTMerge\struct\test.c"
$ 
"C:/Buildbot/Slave/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/llvm.obj/./bin\FileCheck.EXE"
 
"C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\test\ASTMerge\struct\test.c"
# command stderr:
C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\test\ASTMerge\struct\test.c:47:11:
 error: expected string not found in input

// CHECK: struct1.c:130:7: warning: type 'struct DeepUnnamedError::(anonymous 
at [[PATH_TO_INPUTS:.+]]/struct1.c:130:7)' has incompatible definitions in 
different translation units

  ^

:125:1: note: scanning from here

S13 x13;

^


error: command failed with exit status: 1

--



Can you investigate?

Douglas Yung

> -Original Message-
> From: cfe-commits [mailto:cfe-commits-boun...@lists.llvm.org] On Behalf Of
> Gabor Horvath via cfe-commits
> Sent: Monday, April 03, 2017 4

RE: r293207 - PR0091R3: Implement parsing support for using templates as types.

2017-01-26 Thread Yung, Douglas via cfe-commits
Hi Richard,

I don't know if you have noticed, but the test you added in this commit is 
failing on both the Linux and Windows PS4 bots. The test is failing with an 
assertion failure:

Assertion failed: !A->getDeducedType().isNull() && "cannot request the size of 
an undeduced or dependent auto type", file 
C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\lib\AST\ASTContext.cpp,
 line 1884

Can you take a look?

Windows PS4 bot failure: 
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/4531
Linux PS4 bot failure: 
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/5093

Douglas Yung

> -Original Message-
> From: cfe-commits [mailto:cfe-commits-boun...@lists.llvm.org] On Behalf
> Of Richard Smith via cfe-commits
> Sent: Thursday, January 26, 2017 12:41
> To: cfe-commits@lists.llvm.org
> Subject: r293207 - PR0091R3: Implement parsing support for using
> templates as types.
> 
> Author: rsmith
> Date: Thu Jan 26 14:40:47 2017
> New Revision: 293207
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=293207&view=rev
> Log:
> PR0091R3: Implement parsing support for using templates as types.
> 
> This change adds a new type node, DeducedTemplateSpecializationType, to
> represent a type template name that has been used as a type. This is
> modeled
> around AutoType, and shares a common base class for representing a
> deduced
> placeholder type.
> 
> We allow deduced class template types in a few more places than the
> standard
> does: in conditions and for-range-declarators, and in new-type-ids.
> This is
> consistent with GCC and with discussion on the core reflector. This
> patch
> does not yet support deduced class template types being named in
> typename
> specifiers.
> 
> Added:
> cfe/trunk/test/Parser/cxx1z-class-template-argument-deduction.cpp
> Modified:
> cfe/trunk/include/clang/AST/ASTContext.h
> cfe/trunk/include/clang/AST/RecursiveASTVisitor.h
> cfe/trunk/include/clang/AST/Type.h
> cfe/trunk/include/clang/AST/TypeLoc.h
> cfe/trunk/include/clang/AST/TypeNodes.def
> cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
> cfe/trunk/include/clang/Parse/Parser.h
> cfe/trunk/include/clang/Sema/DeclSpec.h
> cfe/trunk/include/clang/Sema/Sema.h
> cfe/trunk/include/clang/Serialization/ASTBitCodes.h
> cfe/trunk/lib/AST/ASTContext.cpp
> cfe/trunk/lib/AST/ASTImporter.cpp
> cfe/trunk/lib/AST/ExprConstant.cpp
> cfe/trunk/lib/AST/ItaniumMangle.cpp
> cfe/trunk/lib/AST/MicrosoftMangle.cpp
> cfe/trunk/lib/AST/Type.cpp
> cfe/trunk/lib/AST/TypePrinter.cpp
> cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
> cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
> cfe/trunk/lib/CodeGen/CodeGenTypes.cpp
> cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp
> cfe/trunk/lib/Parse/ParseDecl.cpp
> cfe/trunk/lib/Parse/ParseDeclCXX.cpp
> cfe/trunk/lib/Parse/ParseExprCXX.cpp
> cfe/trunk/lib/Parse/Parser.cpp
> cfe/trunk/lib/Sema/SemaDecl.cpp
> cfe/trunk/lib/Sema/SemaExpr.cpp
> cfe/trunk/lib/Sema/SemaExprCXX.cpp
> cfe/trunk/lib/Sema/SemaLookup.cpp
> cfe/trunk/lib/Sema/SemaTemplate.cpp
> cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp
> cfe/trunk/lib/Sema/SemaType.cpp
> cfe/trunk/lib/Sema/TreeTransform.h
> cfe/trunk/lib/Serialization/ASTReader.cpp
> cfe/trunk/lib/Serialization/ASTWriter.cpp
> cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p5.cpp
> cfe/trunk/test/CXX/drs/dr5xx.cpp
> cfe/trunk/test/Parser/backtrack-off-by-one.cpp
> cfe/trunk/test/SemaTemplate/temp_arg.cpp
> cfe/trunk/test/SemaTemplate/typename-specifier-3.cpp
> cfe/trunk/tools/libclang/CIndex.cpp
> cfe/trunk/tools/libclang/CXType.cpp
> 
> Modified: cfe/trunk/include/clang/AST/ASTContext.h
> URL: http://llvm.org/viewvc/llvm-
> project/cfe/trunk/include/clang/AST/ASTContext.h?rev=293207&r1=293206&r
> 2=293207&view=diff
> ===
> ===
> --- cfe/trunk/include/clang/AST/ASTContext.h (original)
> +++ cfe/trunk/include/clang/AST/ASTContext.h Thu Jan 26 14:40:47 2017
> @@ -167,6 +167,8 @@ class ASTContext : public RefCountedBase
>mutable llvm::FoldingSet
>  DependentUnaryTransformTypes;
>mutable llvm::FoldingSet AutoTypes;
> +  mutable llvm::FoldingSet
> +DeducedTemplateSpecializationTypes;
>mutable llvm::FoldingSet AtomicTypes;
>llvm::FoldingSet AttributedTypes;
>mutable llvm::FoldingSet PipeTypes;
> @@ -1412,6 +1414,11 @@ public:
>/// \brief C++11 deduction pattern for 'auto &&' type.
>QualType getAutoRRefDeductType() const;
> 
> +  /// \brief C++1z deduced class template specialization type.
> +  QualType getDeducedTemplateSpecializationType(TemplateName Template,
> +QualType DeducedType,
> +bool IsDependent)
> const;

RE: r293207 - PR0091R3: Implement parsing support for using templates as types.

2017-01-27 Thread Yung, Douglas via cfe-commits
Hi Richard, I've filed this issue as PR31783.

Douglas Yung

> -Original Message-
> From: cfe-commits [mailto:cfe-commits-boun...@lists.llvm.org] On Behalf
> Of Yung, Douglas via cfe-commits
> Sent: Thursday, January 26, 2017 15:36
> To: Richard Smith
> Cc: cfe-commits@lists.llvm.org
> Subject: RE: r293207 - PR0091R3: Implement parsing support for using
> templates as types.
> 
> Hi Richard,
> 
> I don't know if you have noticed, but the test you added in this commit
> is failing on both the Linux and Windows PS4 bots. The test is failing
> with an assertion failure:
> 
> Assertion failed: !A->getDeducedType().isNull() && "cannot request the
> size of an undeduced or dependent auto type", file
> C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-
> fast\llvm.src\tools\clang\lib\AST\ASTContext.cpp, line 1884
> 
> Can you take a look?
> 
> Windows PS4 bot failure: http://lab.llvm.org:8011/builders/llvm-clang-
> lld-x86_64-scei-ps4-windows10pro-fast/builds/4531
> Linux PS4 bot failure: http://lab.llvm.org:8011/builders/llvm-clang-
> lld-x86_64-scei-ps4-ubuntu-fast/builds/5093
> 
> Douglas Yung
> 
> > -Original Message-
> > From: cfe-commits [mailto:cfe-commits-boun...@lists.llvm.org] On
> Behalf
> > Of Richard Smith via cfe-commits
> > Sent: Thursday, January 26, 2017 12:41
> > To: cfe-commits@lists.llvm.org
> > Subject: r293207 - PR0091R3: Implement parsing support for using
> > templates as types.
> >
> > Author: rsmith
> > Date: Thu Jan 26 14:40:47 2017
> > New Revision: 293207
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=293207&view=rev
> > Log:
> > PR0091R3: Implement parsing support for using templates as types.
> >
> > This change adds a new type node, DeducedTemplateSpecializationType,
> to
> > represent a type template name that has been used as a type. This is
> > modeled
> > around AutoType, and shares a common base class for representing a
> > deduced
> > placeholder type.
> >
> > We allow deduced class template types in a few more places than the
> > standard
> > does: in conditions and for-range-declarators, and in new-type-ids.
> > This is
> > consistent with GCC and with discussion on the core reflector. This
> > patch
> > does not yet support deduced class template types being named in
> > typename
> > specifiers.
> >
> > Added:
> > cfe/trunk/test/Parser/cxx1z-class-template-argument-deduction.cpp
> > Modified:
> > cfe/trunk/include/clang/AST/ASTContext.h
> > cfe/trunk/include/clang/AST/RecursiveASTVisitor.h
> > cfe/trunk/include/clang/AST/Type.h
> > cfe/trunk/include/clang/AST/TypeLoc.h
> > cfe/trunk/include/clang/AST/TypeNodes.def
> > cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
> > cfe/trunk/include/clang/Parse/Parser.h
> > cfe/trunk/include/clang/Sema/DeclSpec.h
> > cfe/trunk/include/clang/Sema/Sema.h
> > cfe/trunk/include/clang/Serialization/ASTBitCodes.h
> > cfe/trunk/lib/AST/ASTContext.cpp
> > cfe/trunk/lib/AST/ASTImporter.cpp
> > cfe/trunk/lib/AST/ExprConstant.cpp
> > cfe/trunk/lib/AST/ItaniumMangle.cpp
> > cfe/trunk/lib/AST/MicrosoftMangle.cpp
> > cfe/trunk/lib/AST/Type.cpp
> > cfe/trunk/lib/AST/TypePrinter.cpp
> > cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
> > cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
> > cfe/trunk/lib/CodeGen/CodeGenTypes.cpp
> > cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp
> > cfe/trunk/lib/Parse/ParseDecl.cpp
> > cfe/trunk/lib/Parse/ParseDeclCXX.cpp
> > cfe/trunk/lib/Parse/ParseExprCXX.cpp
> > cfe/trunk/lib/Parse/Parser.cpp
> > cfe/trunk/lib/Sema/SemaDecl.cpp
> > cfe/trunk/lib/Sema/SemaExpr.cpp
> > cfe/trunk/lib/Sema/SemaExprCXX.cpp
> > cfe/trunk/lib/Sema/SemaLookup.cpp
> > cfe/trunk/lib/Sema/SemaTemplate.cpp
> > cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp
> > cfe/trunk/lib/Sema/SemaType.cpp
> > cfe/trunk/lib/Sema/TreeTransform.h
> > cfe/trunk/lib/Serialization/ASTReader.cpp
> > cfe/trunk/lib/Serialization/ASTWriter.cpp
> > cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p5.cpp
> > cfe/trunk/test/CXX/drs/dr5xx.cpp
> > cfe/trunk/test/Parser/backtrack-off-by-one.cpp
> > cfe/trunk/test/SemaTemplate/temp_arg.cpp
> > cfe/trunk/test/SemaTemplate/typename-specifier-3.cpp
> > cfe/trunk/tools/libclang/CIndex.cpp
> > cfe/trunk/tools/libclang/CXType.cpp
> >
> >

RE: [clang-tools-extra] r308738 - [clangd] Replace ASTUnit with manual AST management.

2017-07-24 Thread Yung, Douglas via cfe-commits
Hi Ilya,

Your change seems to be causing the test 'clangd/definitions.test' to fail on 
the PS4 Windows bot. Can you take a look?

http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/11222

FAIL: Clang Tools :: clangd/definitions.test (11935 of 34225)
 TEST 'Clang Tools :: clangd/definitions.test' FAILED 

Script:
--
clangd -run-synchronously < 
C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\tools\extra\test\clangd\definitions.test
 | FileCheck 
C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\tools\extra\test\clangd\definitions.test
--
Exit Code: 1

Command Output (stdout):
--
$ "clangd" "-run-synchronously"
# command stderr:
<-- 
{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{},"trace":"off"}}

--> {"jsonrpc":"2.0","id":0,"result":{"capabilities":{

  "textDocumentSync": 1,

  "documentFormattingProvider": true,

  "documentRangeFormattingProvider": true,

  "documentOnTypeFormattingProvider": 
{"firstTriggerCharacter":"}","moreTriggerCharacter":[]},

  "codeActionProvider": true,

  "completionProvider": {"resolveProvider": false, "triggerCharacters": 
[".",">"]},

  "definitionProvider": true

}}}

<-- 
{"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"file:///main.cpp","languageId":"cpp","version":1,"text":"int
 main() {\nint a;\na;\n}\n"}}}

--> 
{"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///main.cpp","diagnostics":[{"range":{"start":
 {"line": 2, "character": 1}, "end": {"line": 2, "character": 
1}},"severity":2,"message":"expression result unused"}]}}

<-- 
{"jsonrpc":"2.0","id":1,"method":"textDocument/definition","params":{"textDocument":{"uri":"file:///main.cpp"},"position":{"line":2,"character":0}}}

--> {"jsonrpc":"2.0","id":1,"result":[{"uri": "file:///main.cpp", "range": 
{"start": {"line": 1, "character": 0}, "end": {"line": 1, "character": 5}}}]}

<-- 
{"jsonrpc":"2.0","id":1,"method":"textDocument/definition","params":{"textDocument":{"uri":"file:///main.cpp"},"position":{"line":2,"character":1}}}

--> {"jsonrpc":"2.0","id":1,"result":[{"uri": "file:///main.cpp", "range": 
{"start": {"line": 1, "character": 0}, "end": {"line": 1, "character": 5}}}]}

<-- 
{"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"uri":"file:///main.cpp","version":2},"contentChanges":[{"text":"struct
 Foo {\nint x;\n};\nint main() {\n  Foo bar = { x : 1 };\n}\n"}]}}

--> 
{"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///main.cpp","diagnostics":[{"range":{"start":
 {"line": 4, "character": 15}, "end": {"line": 4, "character": 
15}},"severity":2,"message":"use of GNU old-style field designator 
extension"}]}}

<-- 
{"jsonrpc":"2.0","id":1,"method":"textDocument/definition","params":{"textDocument":{"uri":"file:///main.cpp"},"position":{"line":4,"character":14}}}

--> {"jsonrpc":"2.0","id":1,"result":[{"uri": "file:///main.cpp", "range": 
{"start": {"line": 1, "character": 0}, "end": {"line": 1, "character": 5}}}]}

<-- 
{"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"uri":"file:///main.cpp","version":3},"contentChanges":[{"text":"struct
 Foo {\nint x;\n};\nint main() {\n  Foo baz = { .x = 2 };\n}\n"}]}}

--> 
{"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///main.cpp","diagnostics":[]}}

<-- 
{"jsonrpc":"2.0","id":1,"method":"textDocument/definition","params":{"textDocument":{"uri":"file:///main.cpp"},"position":{"line":4,"character":15}}}

--> {"jsonrpc":"2.0","id":1,"result":[{"uri": "file:///main.cpp", "range": 
{"start": {"line": 1, "character": 0}, "end": {"line": 1, "character": 5}}}]}

<-- 
{"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"uri":"file:///main.cpp","version":4},"contentChanges":[{"text":"int
 main() {\n   main();\n   return 0;\n}"}]}

--> 
{"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///main.cpp","diagnostics":[]}}

<-- 
{"jsonrpc":"2.0","id":1,"method":"textDocument/definition","params":{"textDocument":{"uri":"file:///main.cpp"},"position":{"line":1,"character":3}}}

--> {"jsonrpc":"2.0","id":1,"result":[{"uri": "file:///main.cpp", "range": 
{"start": {"line": 0, "character": 0}, "end": {"line": 3, "character": 1}}}]}

<-- 
{"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"uri":"file:///main.cpp","version":5},"contentChanges":[{"text":"struct
 Foo {\n};\nint main() {\n   Foo bar;\n   return 0;\n}\n"}]}

--> 
{"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///main.cpp","diagnostics":[]}}

<-- 
{"jsonrpc":"2.0","id":1,"method":"textDocument/definition","params":{"textDocument":{"uri":"file:///ma

RE: [clang-tools-extra] r295482 - [clang-tidy] Add -path option to clang-tidy-diff.py

2017-02-17 Thread Yung, Douglas via cfe-commits
Hi Ehsan,

Your commit has caused the PS4 Windows bot to go red. Can you take a look?

http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/5661

$ "FileCheck" "-check-prefix=CHECK" 
"C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\tools\extra\test\clang-tidy\clang-tidy-diff.cpp"
# command stderr:
C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\tools\extra\test\clang-tidy\clang-tidy-diff.cpp:17:11:
 error: expected string not found in input

// CHECK: [[@LINE-2]]:8: warning: annotate this

  ^

:1:1: note: scanning from here

YAML:1:1: error: Unrecognized escape code!

^

:1:1: note: with expression "@LINE-2" equal to "15"

YAML:1:1: error: Unrecognized escape code!

^

:1:7: note: possible intended match here

YAML:1:1: error: Unrecognized escape code!

  ^


error: command failed with exit status: 1

Douglas Yung

> -Original Message-
> From: cfe-commits [mailto:cfe-commits-boun...@lists.llvm.org] On Behalf Of
> Ehsan Akhgari via cfe-commits
> Sent: Friday, February 17, 2017 11:32
> To: cfe-commits@lists.llvm.org
> Subject: [clang-tools-extra] r295482 - [clang-tidy] Add -path option to clang-
> tidy-diff.py
> 
> Author: ehsan
> Date: Fri Feb 17 13:31:43 2017
> New Revision: 295482
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=295482&view=rev
> Log:
> [clang-tidy] Add -path option to clang-tidy-diff.py
> 
> Summary:
> This flag allows specifying a custom path for the compilation database.
> Unfortunately we can't use the -p flag like other clang-tidy tools because
> it's already taken.
> 
> Reviewers: alexfh
> 
> Subscribers: JDevlieghere, cfe-commits
> 
> Differential Revision: https://reviews.llvm.org/D29806
> 
> Modified:
> clang-tools-extra/trunk/clang-tidy/tool/clang-tidy-diff.py
> clang-tools-extra/trunk/test/clang-tidy/clang-tidy-diff.cpp
> 
> Modified: clang-tools-extra/trunk/clang-tidy/tool/clang-tidy-diff.py
> URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-
> tidy/tool/clang-tidy-diff.py?rev=295482&r1=295481&r2=295482&view=diff
> ==
> --- clang-tools-extra/trunk/clang-tidy/tool/clang-tidy-diff.py (original)
> +++ clang-tools-extra/trunk/clang-tidy/tool/clang-tidy-diff.py Fri Feb
> +++ 17 13:31:43 2017
> @@ -55,6 +55,8 @@ def main():
>help='checks filter, when not specified, use clang-tidy
> '
>'default',
>default='')
> +  parser.add_argument('-path', dest='build_path',
> +  help='Path used to read a compile command
> + database.')
>parser.add_argument('-extra-arg', dest='extra_arg',
>action='append', default=[],
>help='Additional argument to append to the compiler '
> @@ -124,6 +126,8 @@ def main():
>  command.append('-checks=' + quote + args.checks + quote)
>if args.quiet:
>  command.append('-quiet')
> +  if args.build_path is not None:
> +command.append('-p=%s' % args.build_path)
>command.extend(lines_by_file.keys())
>for arg in args.extra_arg:
>command.append('-extra-arg=%s' % arg)
> 
> Modified: clang-tools-extra/trunk/test/clang-tidy/clang-tidy-diff.cpp
> URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-
> tidy/clang-tidy-diff.cpp?rev=295482&r1=295481&r2=295482&view=diff
> ==
> --- clang-tools-extra/trunk/test/clang-tidy/clang-tidy-diff.cpp (original)
> +++ clang-tools-extra/trunk/test/clang-tidy/clang-tidy-diff.cpp Fri Feb
> +++ 17 13:31:43 2017
> @@ -2,6 +2,9 @@
>  // RUN: clang-tidy -checks=-*,modernize-use-override %t.cpp -- -std=c++11 |
> FileCheck -check-prefix=CHECK-SANITY %s  // RUN: not diff -U0 %s %t.cpp |
> %clang_tidy_diff -checks=-*,modernize-use-override -- -std=c++11 2>&1 |
> FileCheck %s  // RUN: not diff -U0 %s %t.cpp | %clang_tidy_diff -checks=-
> *,modernize-use-override -quiet -- -std=c++11 2>&1 | FileCheck -check-
> prefix=CHECK-QUIET %s
> +// RUN: mkdir -p %T/compilation-database-test/ // RUN: echo
> +'[{"directory": "%T", "command": "clang++ -o test.o -std=c++11 %t.cpp",
> +"file": "%t.cpp"}]' >
> +%T/compilation-database-test/compile_commands.json
> +// RUN: not diff -U0 %s %t.cpp | %clang_tidy_diff
> +-checks=-*,modernize-use-override -path %T/compilation-database-test
> +2>&1 | FileCheck -check-prefix=CHECK %s
>  struct A {
>virtual void f() {}
>virtual void g() {}
> 
> 
> ___
> 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: [clang-tools-extra] r296110 - [change-namepsace] make it possible to whitelist symbols so they don't get updated.

2017-02-24 Thread Yung, Douglas via cfe-commits
Hi Eric,

I don't know if you are aware, but one of the tests you added in this change is 
failing on the PS4 Windows bot. The test is " Clang Tools :: 
change-namespace/white-list.cpp". Can you please take a look?

Douglas Yung

> -Original Message-
> From: cfe-commits [mailto:cfe-commits-boun...@lists.llvm.org] On Behalf Of
> Eric Liu via cfe-commits
> Sent: Friday, February 24, 2017 3:55
> To: cfe-commits@lists.llvm.org
> Subject: [clang-tools-extra] r296110 - [change-namepsace] make it possible to
> whitelist symbols so they don't get updated.
> 
> Author: ioeric
> Date: Fri Feb 24 05:54:45 2017
> New Revision: 296110
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=296110&view=rev
> Log:
> [change-namepsace] make it possible to whitelist symbols so they don't get
> updated.
> 
> Reviewers: hokein
> 
> Reviewed By: hokein
> 
> Subscribers: cfe-commits
> 
> Differential Revision: https://reviews.llvm.org/D30328
> 
> Added:
> clang-tools-extra/trunk/test/change-namespace/Inputs/
> clang-tools-extra/trunk/test/change-namespace/Inputs/fake-std.h
> clang-tools-extra/trunk/test/change-namespace/white-list.cpp
> Modified:
> clang-tools-extra/trunk/change-namespace/ChangeNamespace.cpp
> clang-tools-extra/trunk/change-namespace/ChangeNamespace.h
> clang-tools-extra/trunk/change-namespace/tool/ClangChangeNamespace.cpp
> clang-tools-extra/trunk/unittests/change-
> namespace/ChangeNamespaceTests.cpp
> 
> Modified: clang-tools-extra/trunk/change-namespace/ChangeNamespace.cpp
> URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/change-
> namespace/ChangeNamespace.cpp?rev=296110&r1=296109&r2=296110&view=diff
> ==
> --- clang-tools-extra/trunk/change-namespace/ChangeNamespace.cpp (original)
> +++ clang-tools-extra/trunk/change-namespace/ChangeNamespace.cpp Fri Feb
> +++ 24 05:54:45 2017
> @@ -290,6 +290,7 @@ AST_MATCHER(EnumDecl, isScoped) {
> 
>  ChangeNamespaceTool::ChangeNamespaceTool(
>  llvm::StringRef OldNs, llvm::StringRef NewNs, llvm::StringRef
> FilePattern,
> +llvm::ArrayRef WhiteListedSymbolPatterns,
>  std::map *FileToReplacements,
>  llvm::StringRef FallbackStyle)
>  : FallbackStyle(FallbackStyle), FileToReplacements(*FileToReplacements),
> @@ -308,6 +309,9 @@ ChangeNamespaceTool::ChangeNamespaceTool
>}
>DiffOldNamespace = joinNamespaces(OldNsSplitted);
>DiffNewNamespace = joinNamespaces(NewNsSplitted);
> +
> +  for (const auto &Pattern : WhiteListedSymbolPatterns)
> +WhiteListedSymbolRegexes.emplace_back(Pattern);
>  }
> 
>  void ChangeNamespaceTool::registerMatchers(ast_matchers::MatchFinder *Finder)
> { @@ -736,6 +740,9 @@ void ChangeNamespaceTool::replaceQualifi
>Result.SourceManager->getSpellingLoc(End)),
>*Result.SourceManager, Result.Context->getLangOpts());
>std::string FromDeclName = FromDecl->getQualifiedNameAsString();
> +  for (llvm::Regex &RE : WhiteListedSymbolRegexes)
> +if (RE.match(FromDeclName))
> +  return;
>std::string ReplaceName =
>getShortestQualifiedNameInNamespace(FromDeclName, NewNs);
>// Checks if there is any using namespace declarations that can shorten the
> 
> Modified: clang-tools-extra/trunk/change-namespace/ChangeNamespace.h
> URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/change-
> namespace/ChangeNamespace.h?rev=296110&r1=296109&r2=296110&view=diff
> ==
> --- clang-tools-extra/trunk/change-namespace/ChangeNamespace.h (original)
> +++ clang-tools-extra/trunk/change-namespace/ChangeNamespace.h Fri Feb
> +++ 24 05:54:45 2017
> @@ -50,6 +50,7 @@ public:
>// files matching `FilePattern`.
>ChangeNamespaceTool(
>llvm::StringRef OldNs, llvm::StringRef NewNs, llvm::StringRef
> FilePattern,
> +  llvm::ArrayRef WhiteListedSymbolPatterns,
>std::map *FileToReplacements,
>llvm::StringRef FallbackStyle = "LLVM");
> 
> @@ -164,6 +165,9 @@ private:
>// CallExpr and one as DeclRefExpr), we record all DeclRefExpr's that have
>// been processed so that we don't handle them twice.
>llvm::SmallPtrSet ProcessedFuncRefs;
> +  // Patterns of symbol names whose references are not expected to be
> + updated  // when changing namespaces around them.
> +  std::vector WhiteListedSymbolRegexes;
>  };
> 
>  } // namespace change_namespace
> 
> Modified: clang-tools-extra/trunk/change-
> namespace/tool/ClangChangeNamespace.cpp
> URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/change-
> namespace/tool/ClangChangeNamespace.cpp?rev=296110&r1=296109&r2=296110&view=di
> ff
> ==
> --- clang-tools-extra/trunk/change-namespace/tool/ClangChangeNamespace.cpp
> (original)
> +++ clang-tools-extra/trunk/change-namespace/tool/ClangChangeNamespace.c
> +++ pp Fri Feb 24 05:54:45 2

RE: r296171 - Try to unbreak tests after r296166

2017-02-24 Thread Yung, Douglas via cfe-commits
Hi Nico,

The test you added is causing a failure on the PS4 Windows bot. The root of the 
cause is that the Windows version of rm does not accept wildcards 
unfortunately. To fix make it work on Windows, you likely need to specify 
exactly what files/directories you want to delete without using a wildcard:

http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/6030:

$ "rm" 
"C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\tools\clang\test\Format\Output/*"
# command stderr:
rm: cannot remove 
`C:\\Buildbot\\Slave\\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\\llvm.obj\\tools\\clang\\test\\Format\\Output/*':
 Invalid argument

http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/6031:

$ "rm" 
"C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\tools\clang\test\Format\Output/inplace*"
# command stderr:
rm: cannot remove 
`C:\\Buildbot\\Slave\\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\\llvm.obj\\tools\\clang\\test\\Format\\Output/inplace*':
 Invalid argument

Can you fix the test?

Douglas Yung

> -Original Message-
> From: cfe-commits [mailto:cfe-commits-boun...@lists.llvm.org] On Behalf Of
> Nico Weber via cfe-commits
> Sent: Friday, February 24, 2017 13:02
> To: cfe-commits@lists.llvm.org
> Subject: r296171 - Try to unbreak tests after r296166
> 
> Author: nico
> Date: Fri Feb 24 15:01:43 2017
> New Revision: 296171
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=296171&view=rev
> Log:
> Try to unbreak tests after r296166
> 
> Looks like %T isn't per-test but per-test-directory, and the rm was deleting
> temp files written by other tests in test/Format.  Limit the rm's scope a bit.
> 
> Modified:
> cfe/trunk/test/Format/inplace.cpp
> 
> Modified: cfe/trunk/test/Format/inplace.cpp
> URL: http://llvm.org/viewvc/llvm-
> project/cfe/trunk/test/Format/inplace.cpp?rev=296171&r1=296170&r2=296171&view=
> diff
> ==
> --- cfe/trunk/test/Format/inplace.cpp (original)
> +++ cfe/trunk/test/Format/inplace.cpp Fri Feb 24 15:01:43 2017
> @@ -1,6 +1,6 @@
>  // Regression test to check that clang-format does not leave behind temporary
> // files on Windows when doing in-place formatting.
> -// RUN: rm %T/*
> +// RUN: rm %T/inplace*
>  // RUN: cp %s %T/inplace.cpp
>  // RUN: clang-format -style=LLVM -i %T/inplace.cpp  // RUN: ls %T >
> %T/files.txt
> 
> 
> ___
> 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: r296171 - Try to unbreak tests after r296166

2017-02-27 Thread Yung, Douglas via cfe-commits
Thanks Nico. I think your suggestion is the right one, I am just trying to 
determine if there is a reason why we are not using that version internally 
(since our internal bot also failied for the same reason) before we recommend 
upgrading the bot.

Douglas Yung

From: Nico Weber [mailto:tha...@google.com]
Sent: Monday, February 27, 2017 15:13
To: Yung, Douglas
Cc: cfe-commits; nicolaswe...@gmx.de
Subject: Re: r296171 - Try to unbreak tests after r296166

I relanded the test in r296408. Since this deletes temp files created by the OS 
following an unpredictable pattern, exactly specifying the filename to delete 
isn't possible. Let me know if putting a functional rm on your bots is a 
problem and then we can see if we can think of something else, but fixing your 
bots's rm seems easiest to me :-)

On Sat, Feb 25, 2017 at 10:39 AM, Nico Weber 
mailto:tha...@google.com>> wrote:
Can't you just put gnuwin rm on your bot? Our Windows bots are happy with the 
test, and having to support an rm without wildcard support seems pretty 
strange. (Https://is.gd/chromeclang -> tools -> gnuwin-6.zip are the 
executables our bot uses to run llvm tests)

On Feb 24, 2017 8:13 PM, "Yung, Douglas via cfe-commits" 
mailto:cfe-commits@lists.llvm.org>> wrote:
Hi Nico,

The test you added is causing a failure on the PS4 Windows bot. The root of the 
cause is that the Windows version of rm does not accept wildcards 
unfortunately. To fix make it work on Windows, you likely need to specify 
exactly what files/directories you want to delete without using a wildcard:

http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/6030:

$ "rm" 
"C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\tools\clang\test\Format\Output/*"
# command stderr:
rm: cannot remove 
`C:\\Buildbot\\Slave\\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\\llvm.obj\\tools\\clang\\test\\Format\\Output/*':
 Invalid argument

http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/6031:

$ "rm" 
"C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\tools\clang\test\Format\Output/inplace*"
# command stderr:
rm: cannot remove 
`C:\\Buildbot\\Slave\\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\\llvm.obj\\tools\\clang\\test\\Format\\Output/inplace*':
 Invalid argument

Can you fix the test?

Douglas Yung

> -Original Message-
> From: cfe-commits 
> [mailto:cfe-commits-boun...@lists.llvm.org<mailto:cfe-commits-boun...@lists.llvm.org>]
>  On Behalf Of
> Nico Weber via cfe-commits
> Sent: Friday, February 24, 2017 13:02
> To: cfe-commits@lists.llvm.org<mailto:cfe-commits@lists.llvm.org>
> Subject: r296171 - Try to unbreak tests after r296166
>
> Author: nico
> Date: Fri Feb 24 15:01:43 2017
> New Revision: 296171
>
> URL: http://llvm.org/viewvc/llvm-project?rev=296171&view=rev
> Log:
> Try to unbreak tests after r296166
>
> Looks like %T isn't per-test but per-test-directory, and the rm was deleting
> temp files written by other tests in test/Format.  Limit the rm's scope a bit.
>
> Modified:
> cfe/trunk/test/Format/inplace.cpp
>
> Modified: cfe/trunk/test/Format/inplace.cpp
> URL: http://llvm.org/viewvc/llvm-
> project/cfe/trunk/test/Format/inplace.cpp?rev=296171&r1=296170&r2=296171&view=
> diff
> ==
> --- cfe/trunk/test/Format/inplace.cpp (original)
> +++ cfe/trunk/test/Format/inplace.cpp Fri Feb 24 15:01:43 2017
> @@ -1,6 +1,6 @@
>  // Regression test to check that clang-format does not leave behind temporary
> // files on Windows when doing in-place formatting.
> -// RUN: rm %T/*
> +// RUN: rm %T/inplace*
>  // RUN: cp %s %T/inplace.cpp
>  // RUN: clang-format -style=LLVM -i %T/inplace.cpp  // RUN: ls %T >
> %T/files.txt
>
>
> ___
> cfe-commits mailing list
> cfe-commits@lists.llvm.org<mailto:cfe-commits@lists.llvm.org>
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
___
cfe-commits mailing list
cfe-commits@lists.llvm.org<mailto: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: r296414 - Reland: [analyzer] NFC: Update test infrastructure to support multiple constraint managers

2017-02-27 Thread Yung, Douglas via cfe-commits
Hi Dominic,

Did you forget to submit something to get this patch to work?

http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/6154/steps/test/logs/stdio:

pickle.PicklingError: Can't pickle : 
it's not found as lit.TestingConfig.AnalyzerTest

Douglas Yung

> -Original Message-
> From: cfe-commits [mailto:cfe-commits-boun...@lists.llvm.org] On Behalf Of
> Dominic Chen via cfe-commits
> Sent: Monday, February 27, 2017 16:03
> To: cfe-commits@lists.llvm.org
> Subject: r296414 - Reland: [analyzer] NFC: Update test infrastructure to
> support multiple constraint managers
> 
> Author: ddcc
> Date: Mon Feb 27 18:02:36 2017
> New Revision: 296414
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=296414&view=rev
> Log:
> Reland: [analyzer] NFC: Update test infrastructure to support multiple
> constraint managers
> 
> Summary: Replace calls to %clang/%clang_cc1 with %clang_analyze_cc1 when
> invoking static analyzer, and perform runtime substitution to select the
> appropriate constraint manager, per D28952.
> 
> Reviewers: xazax.hun, NoQ, zaks.anna, dcoughlin
> 
> Subscribers: mgorny, rgov, mikhail.ramalho, a.sidorin, cfe-commits
> 
> Differential Revision: https://reviews.llvm.org/D30373
> 
> Modified:
> cfe/trunk/test/Analysis/CFContainers-invalid.c
> cfe/trunk/test/Analysis/CFContainers.mm
> cfe/trunk/test/Analysis/CFDateGC.m
> cfe/trunk/test/Analysis/CFNumber.c
> cfe/trunk/test/Analysis/CFRetainRelease_NSAssertionHandler.m
> cfe/trunk/test/Analysis/CGColorSpace.c
> cfe/trunk/test/Analysis/CheckNSError.m
> cfe/trunk/test/Analysis/DeallocMissingRelease.m
> cfe/trunk/test/Analysis/DeallocUseAfterFreeErrors.m
> cfe/trunk/test/Analysis/DynamicTypePropagation.m
> cfe/trunk/test/Analysis/Malloc+MismatchedDeallocator+NewDelete.cpp
> cfe/trunk/test/Analysis/Malloc+MismatchedDeallocator_intersections.cpp
> cfe/trunk/test/Analysis/Malloc+NewDelete_intersections.cpp
> cfe/trunk/test/Analysis/MemRegion.cpp
> cfe/trunk/test/Analysis/MismatchedDeallocator-checker-test.mm
> cfe/trunk/test/Analysis/MismatchedDeallocator-path-notes.cpp
> cfe/trunk/test/Analysis/MissingDealloc.m
> cfe/trunk/test/Analysis/NSContainers.m
> cfe/trunk/test/Analysis/NSPanel.m
> cfe/trunk/test/Analysis/NSString.m
> cfe/trunk/test/Analysis/NSWindow.m
> cfe/trunk/test/Analysis/NewDelete+MismatchedDeallocator_intersections.cpp
> cfe/trunk/test/Analysis/NewDelete-checker-test.cpp
> cfe/trunk/test/Analysis/NewDelete-custom.cpp
> cfe/trunk/test/Analysis/NewDelete-intersections.mm
> cfe/trunk/test/Analysis/NewDelete-path-notes.cpp
> cfe/trunk/test/Analysis/NewDelete-variadic.cpp
> cfe/trunk/test/Analysis/NewDeleteLeaks-PR18394.cpp
> cfe/trunk/test/Analysis/NewDeleteLeaks-PR19102.cpp
> cfe/trunk/test/Analysis/NoReturn.m
> cfe/trunk/test/Analysis/OSAtomic_mac.cpp
> cfe/trunk/test/Analysis/ObjCProperties.m
> cfe/trunk/test/Analysis/ObjCPropertiesSyntaxChecks.m
> cfe/trunk/test/Analysis/ObjCRetSigs.m
> cfe/trunk/test/Analysis/PR12905.c
> cfe/trunk/test/Analysis/PR24184.cpp
> cfe/trunk/test/Analysis/PR2599.m
> cfe/trunk/test/Analysis/PR2978.m
> cfe/trunk/test/Analysis/PR3991.m
> cfe/trunk/test/Analysis/PR7218.c
> cfe/trunk/test/Analysis/additive-folding-range-constraints.c
> cfe/trunk/test/Analysis/additive-folding.cpp
> cfe/trunk/test/Analysis/analyzeOneFunction.m
> cfe/trunk/test/Analysis/analyzer-checker-config.c
> cfe/trunk/test/Analysis/analyzer-config.c
> cfe/trunk/test/Analysis/analyzer-config.cpp
> cfe/trunk/test/Analysis/analyzer-display-progress.cpp
> cfe/trunk/test/Analysis/analyzer-display-progress.m
> cfe/trunk/test/Analysis/analyzer-enabled-checkers.c
> cfe/trunk/test/Analysis/analyzer-stats.c
> cfe/trunk/test/Analysis/array-struct-region.c
> cfe/trunk/test/Analysis/array-struct-region.cpp
> cfe/trunk/test/Analysis/array-struct.c
> cfe/trunk/test/Analysis/atomics.c
> cfe/trunk/test/Analysis/auto-obj-dtors-cfg-output.cpp
> cfe/trunk/test/Analysis/base-init.cpp
> cfe/trunk/test/Analysis/bitwise-ops.c
> cfe/trunk/test/Analysis/block-in-critical-section.cpp
> cfe/trunk/test/Analysis/blocks-no-inline.c
> cfe/trunk/test/Analysis/blocks.m
> cfe/trunk/test/Analysis/blocks.mm
> cfe/trunk/test/Analysis/bool-assignment.c
> cfe/trunk/test/Analysis/bstring.c
> cfe/trunk/test/Analysis/bstring.cpp
> cfe/trunk/test/Analysis/bug_hash_test.cpp
> cfe/trunk/test/Analysis/bug_hash_test.m
> cfe/trunk/test/Analysis/builtin-functions.cpp
> cfe/trunk/test/Analysis/call-invalidation.cpp
> cfe/trunk/test/Analysis/cast-to-struct.cpp
> cfe/trunk/test/Analysis/castexpr-callback.c
> cfe/trunk/test/Analysis/casts.c
> cfe/trunk/test/Analysis/casts.cpp
> cfe/trunk/test/Analysis/casts.m
> cfe/trunk/test/Analysis/cfg.cpp
> cfe/trunk/test/Analys

RE: r289225 - Store decls in prototypes on the declarator instead of in the AST

2016-12-13 Thread Yung, Douglas via cfe-commits
Hi Reid,

Following this change, we started seeing an assertion failure in one of our C 
tests. I have filed bug 31366 for the issue. Can you take a look?

Douglas Yung

> -Original Message-
> From: cfe-commits [mailto:cfe-commits-boun...@lists.llvm.org] On Behalf
> Of Reid Kleckner via cfe-commits
> Sent: Friday, December 09, 2016 9:14
> To: cfe-commits@lists.llvm.org
> Subject: r289225 - Store decls in prototypes on the declarator instead
> of in the AST
> 
> Author: rnk
> Date: Fri Dec  9 11:14:05 2016
> New Revision: 289225
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=289225&view=rev
> Log:
> Store decls in prototypes on the declarator instead of in the AST
> 
> This saves two pointers from FunctionDecl that were being used for some
> rare and questionable C-only functionality.  The DeclsInPrototypeScope
> ArrayRef was added in r151712 in order to parse this kind of C code:
> 
> enum e {x, y};
> int f(enum {y, x} n) {
>  return x; // should return 1, not 0
> }
> 
> The challenge is that we parse 'int f(enum {y, x} n)' it its own
> function prototype scope that gets popped before we build the
> FunctionDecl for 'f'. The original change was doing two questionable
> things:
> 
> 1. Saving all tag decls introduced in prototype scope on a TU-global
> Sema variable. This is problematic when you have cases like this, where
> 'x' and 'y' shouldn't be visible in 'f':
> void f(void (*fp)(enum { x, y } e)) { /* no x */ } This patch fixes
> that, so now 'f' can't see 'x', which is consistent with GCC.
> 
> 2. Storing the decls in FunctionDecl in ActOnFunctionDeclarator so that
> they could be used in ActOnStartOfFunctionDef. This is just an
> inefficient way to move information around. The AST lives forever, but
> the list of non-parameter decls in prototype scope is short lived.
> 
> Moving these things to the Declarator solves both of these issues.
> 
> Reviewers: rsmith
> 
> Subscribers: jmolloy, cfe-commits
> 
> Differential Revision: https://reviews.llvm.org/D27279
> 
> Added:
> cfe/trunk/test/PCH/decl-in-prototype.c
> Modified:
> cfe/trunk/include/clang/AST/Decl.h
> cfe/trunk/include/clang/Sema/DeclSpec.h
> cfe/trunk/include/clang/Sema/Sema.h
> cfe/trunk/lib/AST/ASTDumper.cpp
> cfe/trunk/lib/AST/Decl.cpp
> cfe/trunk/lib/Parse/ParseDecl.cpp
> cfe/trunk/lib/Parse/ParseExpr.cpp
> cfe/trunk/lib/Parse/ParseExprCXX.cpp
> cfe/trunk/lib/Sema/DeclSpec.cpp
> cfe/trunk/lib/Sema/SemaDecl.cpp
> cfe/trunk/lib/Sema/SemaTemplateVariadic.cpp
> cfe/trunk/lib/Sema/SemaType.cpp
> cfe/trunk/test/Misc/ast-dump-decl.c
> cfe/trunk/test/Sema/decl-in-prototype.c
> cfe/trunk/test/SemaCXX/type-definition-in-specifier.cpp
> 
> Modified: cfe/trunk/include/clang/AST/Decl.h
> URL: http://llvm.org/viewvc/llvm-
> project/cfe/trunk/include/clang/AST/Decl.h?rev=289225&r1=289224&r2=2892
> 25&view=diff
> ===
> ===
> --- cfe/trunk/include/clang/AST/Decl.h (original)
> +++ cfe/trunk/include/clang/AST/Decl.h Fri Dec  9 11:14:05 2016
> @@ -1601,11 +1601,6 @@ private:
>/// no formals.
>ParmVarDecl **ParamInfo;
> 
> -  /// DeclsInPrototypeScope - Array of pointers to NamedDecls for
> -  /// decls defined in the function prototype that are not parameters.
> E.g.
> -  /// 'enum Y' in 'void f(enum Y {AA} x) {}'.
> -  ArrayRef DeclsInPrototypeScope;
> -
>LazyDeclStmtPtr Body;
> 
>// FIXME: This can be packed into the bitfields in DeclContext.
> @@ -2050,11 +2045,6 @@ public:
>  setParams(getASTContext(), NewParamInfo);
>}
> 
> -  ArrayRef getDeclsInPrototypeScope() const {
> -return DeclsInPrototypeScope;
> -  }
> -  void setDeclsInPrototypeScope(ArrayRef NewDecls);
> -
>/// getMinRequiredArguments - Returns the minimum number of
> arguments
>/// needed to call this function. This may be fewer than the number
> of
>/// function parameters, if some of the parameters have default
> 
> Modified: cfe/trunk/include/clang/Sema/DeclSpec.h
> URL: http://llvm.org/viewvc/llvm-
> project/cfe/trunk/include/clang/Sema/DeclSpec.h?rev=289225&r1=289224&r2
> =289225&view=diff
> ===
> ===
> --- cfe/trunk/include/clang/Sema/DeclSpec.h (original)
> +++ cfe/trunk/include/clang/Sema/DeclSpec.h Fri Dec  9 11:14:05 2016
> @@ -1248,9 +1248,10 @@ struct DeclaratorChunk {
>  /// declarator.
>  unsigned NumParams;
> 
> -/// NumExceptions - This is the number of types in the dynamic-
> exception-
> -/// decl, if the function has one.
> -unsigned NumExceptions;
> +/// NumExceptionsOrDecls - This is the number of types in the
> +/// dynamic-exception-decl, if the function has one. In C, this is
> the
> +/// number of declarations in the function prototype.
> +unsigned NumExceptionsOrDecls;
> 
>  /// \brief The location of the ref-qualifier, if any.
>  ///
> @@ -1300,

RE: r301597 - [Modules] Improve diagnostics for incomplete umbrella

2017-04-27 Thread Yung, Douglas via cfe-commits
Hi Bruno,

I don’t know if you are still trying to figure out the problem here, but if you 
are, I believe the problem is that the forward slashes need to changed to 
search for either a forward slash or a backward slash since Windows will change 
them to a backslash.

Locally I can get the test to pass on my Windows machine if I change line 31 to 
the following:

// CHECK-DMOD-NEXT: [ppIncludedFile]: 
[[DMOD_SUB_OTHER_H:.*/Modules/Inputs/DependsOnModule.framework[/\\]Frameworks[/\\]SubFramework\.framework[/\\]Headers[/\\]Other\.h]]
 | name: "SubFramework/Other.h" | hash loc: [[DMOD_SUB_H]]:1:1 | isImport: 0 | 
isAngled: 0 | isModule: 0 | module: DependsOnModule.SubFramework.Other

Douglas Yung

From: Bruno Cardoso Lopes via cfe-commits 
mailto:cfe-commits@lists.llvm.org>>
Date: April 27, 2017 at 17:48:32 PDT
To: cfe-commits mailto:cfe-commits@lists.llvm.org>>
Subject: Re: r301597 - [Modules] Improve diagnostics for incomplete umbrella
Reply-To: Bruno Cardoso Lopes 
mailto:bruno.card...@gmail.com>>
This is breaking a non related test in some windows bots.

Takumi & other with windows access, can you help me figure why?

For instance:
http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/3846
http://lab.llvm.org:8011/builders/clang-x86-windows-msvc2015/builds/4379

On Thu, Apr 27, 2017 at 3:29 PM, Bruno Cardoso Lopes via cfe-commits
mailto:cfe-commits@lists.llvm.org>> wrote:

Author: bruno
Date: Thu Apr 27 17:29:14 2017
New Revision: 301597

URL: http://llvm.org/viewvc/llvm-project?rev=301597&view=rev
Log:
[Modules] Improve diagnostics for incomplete umbrella

One of the -Wincomplete-umbrella warnings diagnoses when a header is present in
the directory but it's not present in the umbrella header. Currently, this
warning only happens on top level modules; any submodule using an umbrella
header does not get this warning. Fix that by also considering the submodules.

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

rdar://problem/22623686

Added:
   cfe/trunk/test/Modules/Inputs/incomplete-umbrella/
   cfe/trunk/test/Modules/Inputs/incomplete-umbrella/Foo.framework/
   cfe/trunk/test/Modules/Inputs/incomplete-umbrella/Foo.framework/Headers/
   cfe/trunk/test/Modules/Inputs/incomplete-umbrella/Foo.framework/Headers/Bar.h
   
cfe/trunk/test/Modules/Inputs/incomplete-umbrella/Foo.framework/Headers/FooPublic.h
   cfe/trunk/test/Modules/Inputs/incomplete-umbrella/Foo.framework/Modules/
   
cfe/trunk/test/Modules/Inputs/incomplete-umbrella/Foo.framework/Modules/module.modulemap
   
cfe/trunk/test/Modules/Inputs/incomplete-umbrella/Foo.framework/Modules/module.private.modulemap
   
cfe/trunk/test/Modules/Inputs/incomplete-umbrella/Foo.framework/PrivateHeaders/
   
cfe/trunk/test/Modules/Inputs/incomplete-umbrella/Foo.framework/PrivateHeaders/Baz.h
   
cfe/trunk/test/Modules/Inputs/incomplete-umbrella/Foo.framework/PrivateHeaders/Foo.h
   cfe/trunk/test/Modules/incomplete-umbrella.m
Modified:
   cfe/trunk/lib/Lex/PPLexerChange.cpp

Modified: cfe/trunk/lib/Lex/PPLexerChange.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPLexerChange.cpp?rev=301597&r1=301596&r2=301597&view=diff
==
--- cfe/trunk/lib/Lex/PPLexerChange.cpp (original)
+++ cfe/trunk/lib/Lex/PPLexerChange.cpp Thu Apr 27 17:29:14 2017
@@ -287,6 +287,14 @@ const char *Preprocessor::getCurLexerEnd
  return EndPos;
}

+static void collectAllSubModulesWithUmbrellaHeader(
+const Module &Mod, SmallVectorImpl &SubMods) {
+  if (Mod.getUmbrellaHeader())
+SubMods.push_back(&Mod);
+  for (auto *M : Mod.submodules())
+collectAllSubModulesWithUmbrellaHeader(*M, SubMods);
+}
+
void Preprocessor::diagnoseMissingHeaderInUmbrellaDir(const Module &Mod) {
  assert(Mod.getUmbrellaHeader() && "Module must use umbrella header");
  SourceLocation StartLoc =
@@ -507,10 +515,15 @@ bool Preprocessor::HandleEndOfFile(Token
  }

  // If we are building a module that has an umbrella header, make sure that
-  // each of the headers within the directory covered by the umbrella header
-  // was actually included by the umbrella header.
-  if (Module *Mod = getCurrentModule())
-diagnoseMissingHeaderInUmbrellaDir(*Mod);
+  // each of the headers within the directory, including all submodules, is
+  // covered by the umbrella header was actually included by the umbrella
+  // header.
+  if (Module *Mod = getCurrentModule()) {
+llvm::SmallVector AllMods;
+collectAllSubModulesWithUmbrellaHeader(*Mod, AllMods);
+for (auto *M : AllMods)
+  diagnoseMissingHeaderInUmbrellaDir(*M);
+  }

  return true;
}

Added: 
cfe/trunk/test/Modules/Inputs/incomplete-umbrella/Foo.framework/Headers/Bar.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/incomplete-umbrella/Foo.framework/Headers/Bar.h?rev=301597&view=auto
==
--- 
cfe/trunk/test/Modules/Inputs/incomplete-umbrella/Fo

RE: r301707 - Adapt to LLVM API change (DINamespace no longer takes line/file info).

2017-04-28 Thread Yung, Douglas via cfe-commits
Hi Adrian,

This commit, or the previous one you made seems to be causing a failure in the 
clang test CodeGenCXX\debug-info-namespace.cpp on the ps4 Windows and Linux 
bots. It's failing when trying to match the CHECK line on line 79 of the test 
because the line it matches seems to have one extra import on the PS4 target. 
Can you take a look?

Douglas Yung

> -Original Message-
> From: cfe-commits [mailto:cfe-commits-boun...@lists.llvm.org] On Behalf Of
> Adrian Prantl via cfe-commits
> Sent: Friday, April 28, 2017 15:26
> To: cfe-commits@lists.llvm.org
> Subject: r301707 - Adapt to LLVM API change (DINamespace no longer takes
> line/file info).
> 
> Author: adrian
> Date: Fri Apr 28 17:25:53 2017
> New Revision: 301707
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=301707&view=rev
> Log:
> Adapt to LLVM API change (DINamespace no longer takes line/file info).
> 
> rdar://problem/17484998
> https://reviews.llvm.org/D32648
> 
> Modified:
> cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
> cfe/trunk/test/CodeGenCXX/debug-info-namespace.cpp
> cfe/trunk/test/Modules/ExtDebugInfo.cpp
> 
> Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
> URL: http://llvm.org/viewvc/llvm-
> project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=301707&r1=301706&r2=301707&v
> iew=diff
> ==
> --- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Fri Apr 28 17:25:53 2017
> @@ -4034,11 +4034,9 @@ CGDebugInfo::getOrCreateNameSpace(const
>if (I != NameSpaceCache.end())
>  return cast(I->second);
> 
> -  unsigned LineNo = getLineNumber(NSDecl->getLocation());
> -  llvm::DIFile *FileD = getOrCreateFile(NSDecl->getLocation());
>llvm::DIScope *Context = getDeclContextDescriptor(NSDecl);
> -  llvm::DINamespace *NS = DBuilder.createNameSpace(
> -  Context, NSDecl->getName(), FileD, LineNo, NSDecl->isInline());
> +  llvm::DINamespace *NS =
> +  DBuilder.createNameSpace(Context, NSDecl->getName(),
> + NSDecl->isInline());
>NameSpaceCache[NSDecl].reset(NS);
>return NS;
>  }
> 
> Modified: cfe/trunk/test/CodeGenCXX/debug-info-namespace.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-
> namespace.cpp?rev=301707&r1=301706&r2=301707&view=diff
> ==
> --- cfe/trunk/test/CodeGenCXX/debug-info-namespace.cpp (original)
> +++ cfe/trunk/test/CodeGenCXX/debug-info-namespace.cpp Fri Apr 28
> +++ 17:25:53 2017
> @@ -53,21 +53,27 @@ inline namespace I {  int var_i;  }  } -void B::func_fwd()
> {}
> +namespace {
> +int anonymous;
> +}
> +void B::func_fwd() {
> +  anonymous = 0;
> +}
> +
> 
>  // This should work even if 'i' and 'func' were declarations & not
> definitions,  // but it doesn't yet.
> 
>  // CHECK: [[I:![0-9]+]] = distinct !DIGlobalVariable(name: "i",{{.*}} scope:
> [[NS:![0-9]+]], -// CHECK: [[NS]] = !DINamespace(name: "B", scope: [[CTXT:![0-
> 9]+]], file: [[FOOCPP:![0-9]+]], line: 1) -// CHECK: [[FOOCPP]] =
> !DIFile(filename: "foo.cpp"
> -// CHECK: [[CTXT]] = !DINamespace(name: "A", scope: null, file: [[FILE:![0-
> 9]+]], line: 5) -// CHECK: [[FILE]] = !DIFile(filename: "{{.*}}debug-info-
> namespace.cpp",
> +// CHECK: [[NS]] = !DINamespace(name: "B", scope: [[CTXT:![0-9]+]]) //
> +CHECK: [[CTXT]] = !DINamespace(name: "A", scope: null) // CHECK:
> +[[FOOCPP:.*]] = !DIFile(filename: "foo.cpp"
>  // CHECK: [[VAR_FWD:![0-9]+]] = distinct !DIGlobalVariable(name:
> "var_fwd",{{.*}} scope: [[NS]],
>  // CHECK-SAME: line: 44
>  // CHECK-SAME: isDefinition: true
>  // CHECK: distinct !DIGlobalVariable(name: "var_i",{{.*}} scope:
> [[INLINE:![0-9]+]], -// CHECK: [[INLINE]] = !DINamespace(name: "I", scope:
> [[CTXT]], file: [[FOOCPP]], line: 46, exportSymbols: true)
> +// CHECK: [[INLINE]] = !DINamespace(name: "I", scope: [[CTXT]],
> +exportSymbols: true) // CHECK: !DINamespace(scope: null)
>  // CHECK: [[CU:![0-9]+]] = distinct !DICompileUnit(
>  // CHECK-SAME:imports: [[MODULES:![0-9]*]]
>  // CHECK: [[MODULES]] = !{[[M1:![0-9]+]], [[M2:![0-9]+]], [[M3:![0-9]+]],
> [[M4:![0-9]+]], [[M5:![0-9]+]], [[M6:![0-9]+]], [[M7:![0-9]+]], [[M8:![0-
> 9]+]], [[M9:![0-9]+]], [[M10:![0-9]+]], [[M11:![0-9]+]], [[M12:![0-9]+]],
> [[M13:![0-9]+]], [[M14:![0-9]+]], [[M15:![0-9]+]], [[M16:![0-9]+]], [[M17:![0-
> 9]+]]} @@ -106,7 +112,7 @@ void B::func_fwd() {}
>  // CHECK-SAME:  scope: [[NS]], file: [[FOOCPP]],
> line: 9
>  // CHECK: [[M15]] = !DIImportedEntity(tag: DW_TAG_imported_declaration,
> scope: [[FUNC]], entity: [[VAR_FWD:![0-9]+]]  // CHECK: [[M16]] =
> !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: [[FUNC]], entity:
> [[FUNC_FWD:![0-9]+]] -// CHECK: [[FUNC_FWD]] = distinct !DISubprogram(name:
> "func_fwd",{{.*}} line: 50,{{.*}} isDefinition: tr

RE: r284777 - Fix off-by-one error in PPCaching.cpp token annotation assertion

2016-10-20 Thread Yung, Douglas via cfe-commits
Hi Reid,

Just a heads up that the test you added fails if the compiler defaults to a 
different C++ standard. Our internal version defaults to c++11, and the test 
fails because the error "expected ';' after top level declarator" is not 
emitted.

Douglas Yung

> -Original Message-
> From: cfe-commits [mailto:cfe-commits-boun...@lists.llvm.org] On Behalf
> Of Reid Kleckner via cfe-commits
> Sent: Thursday, October 20, 2016 13:53
> To: cfe-commits@lists.llvm.org
> Subject: r284777 - Fix off-by-one error in PPCaching.cpp token
> annotation assertion
> 
> Author: rnk
> Date: Thu Oct 20 15:53:20 2016
> New Revision: 284777
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=284777&view=rev
> Log:
> Fix off-by-one error in PPCaching.cpp token annotation assertion
> 
> This assert is intended to defend against backtracking into the middle
> of a sequence of tokens that is being replaced with an annotation, but
> it's OK if we backtrack to the exact position of the start of the
> annotation sequence. Use a <= comparison instead of <.
> 
> Fixes PR25946
> 
> Added:
> cfe/trunk/test/Parser/backtrack-off-by-one.cpp
> Modified:
> cfe/trunk/lib/Lex/PPCaching.cpp
> 
> Modified: cfe/trunk/lib/Lex/PPCaching.cpp
> URL: http://llvm.org/viewvc/llvm-
> project/cfe/trunk/lib/Lex/PPCaching.cpp?rev=284777&r1=284776&r2=284777&
> view=diff
> ===
> ===
> --- cfe/trunk/lib/Lex/PPCaching.cpp (original)
> +++ cfe/trunk/lib/Lex/PPCaching.cpp Thu Oct 20 15:53:20 2016
> @@ -105,7 +105,7 @@ void Preprocessor::AnnotatePreviousCache
>for (CachedTokensTy::size_type i = CachedLexPos; i != 0; --i) {
>  CachedTokensTy::iterator AnnotBegin = CachedTokens.begin() + i-1;
>  if (AnnotBegin->getLocation() == Tok.getLocation()) {
> -  assert((BacktrackPositions.empty() || BacktrackPositions.back()
> < i) &&
> +  assert((BacktrackPositions.empty() || BacktrackPositions.back()
> + <= i) &&
>   "The backtrack pos points inside the annotated tokens!");
>// Replace the cached tokens with the single annotation token.
>if (i < CachedLexPos)
> 
> Added: cfe/trunk/test/Parser/backtrack-off-by-one.cpp
> URL: http://llvm.org/viewvc/llvm-
> project/cfe/trunk/test/Parser/backtrack-off-by-
> one.cpp?rev=284777&view=auto
> ===
> ===
> --- cfe/trunk/test/Parser/backtrack-off-by-one.cpp (added)
> +++ cfe/trunk/test/Parser/backtrack-off-by-one.cpp Thu Oct 20 15:53:20
> +++ 2016
> @@ -0,0 +1,17 @@
> +// RUN: %clang_cc1 -verify %s
> +
> +// PR25946
> +// We had an off-by-one error in an assertion when annotating A
> +below.  Our // error recovery checks if A is a constructor
> +declarator, and opens a // TentativeParsingAction. Then we attempt to
> +annotate the token at the exact // position that we want to possibly
> backtrack to, and this used to crash.
> +
> +template  class A {};
> +
> +// expected-error@+1 {{expected '{' after base class list}} template
> + class B : T // not ',' or '{'
> +// expected-error@+3 {{C++ requires a type specifier for all
> +declarations}} // expected-error@+2 {{expected ';' after top level
> +declarator}} // expected-error@+1 {{expected ';' after class}} A
> {
> +};
> 
> 
> ___
> 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: r286714 - [AVX-512] Convert the rest of the masked shift by immediate and by single element builtins over to the newly added unmasked builtins and a select.

2016-11-12 Thread Yung, Douglas via cfe-commits
Hi Craig,

One of our internal tests noticed a potential issue with your change that I 
wanted to see if you were aware of in the file avx512bwintrin.h.

Specifically, you converted _mm512_slli_epi16, _mm512_srai_epi16, 
_mm512_srli_epi16 from macros into actual functions, but the functions don't 
return anything despite having a non-void return type. I suspect this is a typo 
and that you meant to return the value computed?

For example, here is the implementation of _mm512_slli_epi16 as of r286713:

#define _mm512_slli_epi16(A, B) __extension__ ({ \
  (__m512i)__builtin_ia32_psllwi512_mask((__v32hi)(__m512i)(A), (int)(B), \
 (__v32hi)_mm512_setzero_hi(), \
 (__mmask32)-1); })

New implementation as of r286714:

static __inline__ __m512i __DEFAULT_FN_ATTRS
_mm512_slli_epi16(__m512i __A, int __B)
{
  (__m512i)__builtin_ia32_psllwi512((__v32hi)__A, __B);
}

The implementations of _mm512_srai_epi16 and _mm512_srli_epi16 are similar. Was 
this intentional?

Douglas Yung

> -Original Message-
> From: cfe-commits [mailto:cfe-commits-boun...@lists.llvm.org] On Behalf
> Of Craig Topper via cfe-commits
> Sent: Friday, November 11, 2016 23:17
> To: cfe-commits@lists.llvm.org
> Subject: r286714 - [AVX-512] Convert the rest of the masked shift by
> immediate and by single element builtins over to the newly added
> unmasked builtins and a select.
> 
> Author: ctopper
> Date: Sat Nov 12 01:16:59 2016
> New Revision: 286714
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=286714&view=rev
> Log:
> [AVX-512] Convert the rest of the masked shift by immediate and by
> single element builtins over to the newly added unmasked builtins and a
> select.
> 
> This should also fix PR30691 since the new builtins are handled like
> the legacy builtins in the backend.
> 
> Modified:
> cfe/trunk/include/clang/Basic/BuiltinsX86.def
> cfe/trunk/lib/Headers/avx512bwintrin.h
> cfe/trunk/lib/Headers/avx512fintrin.h
> cfe/trunk/lib/Headers/avx512vlintrin.h
> cfe/trunk/lib/Sema/SemaChecking.cpp
> cfe/trunk/test/CodeGen/avx512bw-builtins.c
> cfe/trunk/test/CodeGen/avx512f-builtins.c
> cfe/trunk/test/CodeGen/avx512vl-builtins.c
> 
> Modified: cfe/trunk/include/clang/Basic/BuiltinsX86.def
> URL: http://llvm.org/viewvc/llvm-
> project/cfe/trunk/include/clang/Basic/BuiltinsX86.def?rev=286714&r1=286
> 713&r2=286714&view=diff
> ===
> ===
> --- cfe/trunk/include/clang/Basic/BuiltinsX86.def (original)
> +++ cfe/trunk/include/clang/Basic/BuiltinsX86.def Sat Nov 12 01:16:59
> 2016
> @@ -1359,26 +1359,26 @@ TARGET_BUILTIN(__builtin_ia32_prorvd256_
>  TARGET_BUILTIN(__builtin_ia32_prorvq128_mask,
> "V2LLiV2LLiV2LLiV2LLiUc","","avx512vl")
>  TARGET_BUILTIN(__builtin_ia32_prorvq256_mask,
> "V4LLiV4LLiV4LLiV4LLiUc","","avx512vl")
>  TARGET_BUILTIN(__builtin_ia32_psllv32hi_mask,
> "V32sV32sV32sV32sUi","","avx512bw")
> -TARGET_BUILTIN(__builtin_ia32_psllw512_mask,
> "V32sV32sV8sV32sUi","","avx512bw")
> -TARGET_BUILTIN(__builtin_ia32_psllwi512_mask,
> "V32sV32sIiV32sUi","","avx512bw")
> +TARGET_BUILTIN(__builtin_ia32_psllw512, "V32sV32sV8s","","avx512bw")
> +TARGET_BUILTIN(__builtin_ia32_psllwi512, "V32sV32si","","avx512bw")
>  TARGET_BUILTIN(__builtin_ia32_psllv16hi_mask,
> "V16sV16sV16sV16sUs","","avx512bw,avx512vl")
>  TARGET_BUILTIN(__builtin_ia32_psllv8hi_mask,
> "V8sV8sV8sV8sUc","","avx512bw,avx512vl")
> -TARGET_BUILTIN(__builtin_ia32_pslldi512_mask,
> "V16iV16iIiV16iUs","","avx512f")
> -TARGET_BUILTIN(__builtin_ia32_psllqi512_mask,
> "V8LLiV8LLiIiV8LLiUc","","avx512f")
> +TARGET_BUILTIN(__builtin_ia32_pslldi512, "V16iV16ii","","avx512f")
> +TARGET_BUILTIN(__builtin_ia32_psllqi512, "V8LLiV8LLii","","avx512f")
>  TARGET_BUILTIN(__builtin_ia32_psrlv32hi_mask,
> "V32sV32sV32sV32sUi","","avx512bw")
>  TARGET_BUILTIN(__builtin_ia32_psrlv16hi_mask,
> "V16sV16sV16sV16sUs","","avx512bw,avx512vl")
>  TARGET_BUILTIN(__builtin_ia32_psrlv8hi_mask,
> "V8sV8sV8sV8sUc","","avx512bw,avx512vl")
> -TARGET_BUILTIN(__builtin_ia32_psrldi512_mask,
> "V16iV16iIiV16iUs","","avx512f")
> -TARGET_BUILTIN(__builtin_ia32_psrlqi512_mask,
> "V8LLiV8LLiIiV8LLiUc","","avx512f")
> +TARGET_BUILTIN(__builtin_ia32_psrldi512, "V16iV16ii","","avx512f")
> +TARGET_BUILTIN(__builtin_ia32_psrlqi512, "V8LLiV8LLii","","avx512f")
>  TARGET_BUILTIN(__builtin_ia32_psrav32hi_mask,
> "V32sV32sV32sV32sUi","","avx512bw")
>  TARGET_BUILTIN(__builtin_ia32_psrav16hi_mask,
> "V16sV16sV16sV16sUs","","avx512bw,avx512vl")
>  TARGET_BUILTIN(__builtin_ia32_psrav8hi_mask,
> "V8sV8sV8sV8sUc","","avx512bw,avx512vl")
>  TARGET_BUILTIN(__builtin_ia32_psravq128_mask,
> "V2LLiV2LLiV2LLiV2LLiUc","","avx512vl")
>  TARGET_BUILTIN(__builtin_ia32_psravq256_mask,
> "V4LLiV4LLiV4LLiV4LLiUc","","avx512vl")
> -TARGET_BUILTIN(__builtin_ia32_psraw512_mask,
> "V32sV32sV8sV32sUi","","avx512bw")
> -TARGET_BUILTIN(__builtin_ia32_psrawi512_mask,
>

RE: [clang-tools-extra] r278257 - [clang-tidy] enhance readability-else-after-return

2016-08-10 Thread Yung, Douglas via cfe-commits
Hi Kirill,

I believe your change is causing the PS4 bots to be red. Specifically, the test 
you added makes use of "throw" which doesn't work on the PS4 target since 
exceptions are disabled by default on the PS4 target. I think explicitly 
enabling exceptions should fix the test and propose the following patch:

Index: test/clang-tidy/readability-else-after-return.cpp
===
--- test/clang-tidy/readability-else-after-return.cpp   (revision 278294)
+++ test/clang-tidy/readability-else-after-return.cpp   (working copy)
@@ -1,4 +1,4 @@
-// RUN: %check_clang_tidy %s readability-else-after-return %t
+// RUN: %check_clang_tidy %s readability-else-after-return %t -- -- -std=c++11 
-fexceptions
 
 void f(int a) {
   if (a > 0)


Thoughts?

Douglas Yung

> -Original Message-
> From: cfe-commits [mailto:cfe-commits-boun...@lists.llvm.org] On Behalf
> Of Kirill Bobyrev via cfe-commits
> Sent: Wednesday, August 10, 2016 11:06
> To: cfe-commits@lists.llvm.org
> Subject: [clang-tools-extra] r278257 - [clang-tidy] enhance
> readability-else-after-return
> 
> Author: omtcyfz
> Date: Wed Aug 10 13:05:47 2016
> New Revision: 278257
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=278257&view=rev
> Log:
> [clang-tidy] enhance readability-else-after-return
> 
> `readability-else-after-return` only warns about `return` calls, but
> LLVM Coding Standars stat that `throw`, `continue`, `goto`, etc after
> `return` calls are bad, too.
> 
> Reviwers: alexfh, aaron.ballman
> 
> Differential Revision: https://reviews.llvm.org/D23265
> 
> Modified:
> clang-tools-extra/trunk/clang-
> tidy/readability/ElseAfterReturnCheck.cpp
> clang-tools-extra/trunk/docs/clang-tidy/checks/readability-else-
> after-return.rst
> clang-tools-extra/trunk/test/clang-tidy/readability-else-after-
> return.cpp
> 
> Modified: clang-tools-extra/trunk/clang-
> tidy/readability/ElseAfterReturnCheck.cpp
> URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-
> tidy/readability/ElseAfterReturnCheck.cpp?rev=278257&r1=278256&r2=27825
> 7&view=diff
> ===
> ===
> --- clang-tools-extra/trunk/clang-
> tidy/readability/ElseAfterReturnCheck.cpp (original)
> +++ clang-tools-extra/trunk/clang-
> tidy/readability/ElseAfterReturnCheck.
> +++ cpp Wed Aug 10 13:05:47 2016
> @@ -19,20 +19,29 @@ namespace tidy {
>  namespace readability {
> 
>  void ElseAfterReturnCheck::registerMatchers(MatchFinder *Finder) {
> -  // FIXME: Support continue, break and throw.
> +  const auto ControlFlowInterruptorMatcher =
> +  stmt(anyOf(returnStmt().bind("return"),
> continueStmt().bind("continue"),
> + breakStmt().bind("break"),
> + cxxThrowExpr().bind("throw")));
>Finder->addMatcher(
> -  compoundStmt(
> -  forEach(ifStmt(hasThen(stmt(anyOf(returnStmt(),
> -
> compoundStmt(has(returnStmt()),
> - hasElse(stmt().bind("else")))
> -  .bind("if"))),
> +  stmt(forEach(
> +  ifStmt(hasThen(stmt(
> + anyOf(ControlFlowInterruptorMatcher,
> +
> compoundStmt(has(ControlFlowInterruptorMatcher),
> + hasElse(stmt().bind("else")))
> +  .bind("if"))),
>this);
>  }
> 
>  void ElseAfterReturnCheck::check(const MatchFinder::MatchResult
> &Result) {
>const auto *If = Result.Nodes.getNodeAs("if");
>SourceLocation ElseLoc = If->getElseLoc();
> -  DiagnosticBuilder Diag = diag(ElseLoc, "don't use else after
> return");
> +  std::string ControlFlowInterruptor;
> +  for (const auto *BindingName : {"return", "continue", "break",
> "throw"})
> +if (Result.Nodes.getNodeAs(BindingName))
> +  ControlFlowInterruptor = BindingName;
> +
> +  DiagnosticBuilder Diag = diag(ElseLoc, "do not use 'else' after
> '%0'")
> +   << ControlFlowInterruptor;
>Diag << tooling::fixit::createRemoval(ElseLoc);
> 
>// FIXME: Removing the braces isn't always safe. Do a more careful
> analysis.
> 
> Modified: clang-tools-extra/trunk/docs/clang-tidy/checks/readability-
> else-after-return.rst
> URL: http://llvm.org/viewvc/llvm-project/clang-tools-
> extra/trunk/docs/clang-tidy/checks/readability-else-after-
> return.rst?rev=278257&r1=278256&r2=278257&view=diff
> ===
> ===
> --- clang-tools-extra/trunk/docs/clang-tidy/checks/readability-else-
> after-return.rst (original)
> +++ clang-tools-extra/trunk/docs/clang-tidy/checks/readability-else-
> afte
> +++ r-return.rst Wed Aug 10 13:05:47 2016
> @@ -3,7 +3,62 @@
>  readability-else-after-return
>  =
> 
> +`LLVM Coding Standards `_
> +advises to reduce indentation where possible and where it makes
> understanding code easier.
> +Early exit is one of the suggested enforcements of that. Plea

[PATCH] D18708: Set C99 as default C Standard for PS4 target

2016-04-01 Thread Yung, Douglas via cfe-commits
Forwarding to cfe-commits as I don't think I saw it appear there.

> dyung created this revision.
> 
> On the PS4, the default C standard is C99 which differs from the
> current default of C11. This patch makes the default C99 when targeting
> the PS4.
> 
> http://reviews.llvm.org/D18708
> 
> Files:
>   include/clang/Frontend/CompilerInvocation.h
>   lib/Frontend/CompilerInvocation.cpp
>   test/Driver/ps4-cpu-defaults.cpp
>   test/Driver/ps4-misc-defaults.cpp
> 
> Index: test/Driver/ps4-misc-defaults.cpp
> ===
> --- test/Driver/ps4-misc-defaults.cpp
> +++ test/Driver/ps4-misc-defaults.cpp
> @@ -4,3 +4,7 @@
>  // RUN: %clang -target x86_64-scei-ps4 -c %s -### 2>&1 | FileCheck %s
> // CHECK: "-target-cpu" "btver2"
>  // CHECK-NOT: exceptions
> +
> +// Check that the PS4 defaults to C99 when compiling C files // RUN:
> +%clang -target x86_64-scei-ps4 -E -x c -dM %s | FileCheck
> +-check-prefix=CHECK-CSTD %s // CHECK-CSTD: __STDC_VERSION__ 199901L
> Index: test/Driver/ps4-cpu-defaults.cpp
> ===
> --- test/Driver/ps4-cpu-defaults.cpp
> +++ test/Driver/ps4-cpu-defaults.cpp
> @@ -1,6 +0,0 @@
> -// Check that on the PS4 we default to:
> -// -target-cpu btver2 and no exceptions
> -
> -// RUN: %clang -target x86_64-scei-ps4 -c %s -### 2>&1 | FileCheck %s
> -// CHECK: "-target-cpu" "btver2"
> -// CHECK-NOT: exceptions
> Index: lib/Frontend/CompilerInvocation.cpp
> ===
> --- lib/Frontend/CompilerInvocation.cpp
> +++ lib/Frontend/CompilerInvocation.cpp
> @@ -1355,6 +1355,7 @@
>  }
> 
>  void CompilerInvocation::setLangDefaults(LangOptions &Opts, InputKind
> IK,
> + const llvm::Triple &T,
>   LangStandard::Kind LangStd) {
>// Set some properties which depend solely on the input kind; it
> would be nice
>// to move these to the language standard, and have the driver
> resolve the @@ -1387,7 +1388,11 @@
>  case IK_PreprocessedC:
>  case IK_ObjC:
>  case IK_PreprocessedObjC:
> -  LangStd = LangStandard::lang_gnu11;
> +  // The PS4 uses C99 as the default C standard.
> +  if (T.isPS4())
> +LangStd = LangStandard::lang_gnu99;
> +  else
> +LangStd = LangStandard::lang_gnu11;
>break;
>  case IK_CXX:
>  case IK_PreprocessedCXX:
> @@ -1541,7 +1546,8 @@
>LangStd = OpenCLLangStd;
>}
> 
> -  CompilerInvocation::setLangDefaults(Opts, IK, LangStd);
> +  llvm::Triple T(TargetOpts.Triple);
> +  CompilerInvocation::setLangDefaults(Opts, IK, T, LangStd);
> 
>// We abuse '-f[no-]gnu-keywords' to force overriding all GNU-
> extension
>// keywords. This behavior is provided by GCC's poorly named '-fasm'
> flag, @@ -1858,7 +1864,6 @@
>// Provide diagnostic when a given target is not expected to be an
> OpenMP
>// device or host.
>if (Opts.OpenMP && !Opts.OpenMPIsDevice) {
> -llvm::Triple T(TargetOpts.Triple);
>  switch (T.getArch()) {
>  default:
>break;
> Index: include/clang/Frontend/CompilerInvocation.h
> ===
> --- include/clang/Frontend/CompilerInvocation.h
> +++ include/clang/Frontend/CompilerInvocation.h
> @@ -153,8 +153,10 @@
>///
>/// \param Opts - The LangOptions object to set up.
>/// \param IK - The input language.
> +  /// \param T - The target triple.
>/// \param LangStd - The input language standard.
>static void setLangDefaults(LangOptions &Opts, InputKind IK,
> +   const llvm::Triple &T,
> LangStandard::Kind LangStd =
> LangStandard::lang_unspecified);
> 
>/// \brief Retrieve a module hash string that is suitable for
> uniquely
> 

Index: test/Driver/ps4-misc-defaults.cpp
===
--- test/Driver/ps4-misc-defaults.cpp
+++ test/Driver/ps4-misc-defaults.cpp
@@ -4,3 +4,7 @@
 // RUN: %clang -target x86_64-scei-ps4 -c %s -### 2>&1 | FileCheck %s
 // CHECK: "-target-cpu" "btver2"
 // CHECK-NOT: exceptions
+
+// Check that the PS4 defaults to C99 when compiling C files
+// RUN: %clang -target x86_64-scei-ps4 -E -x c -dM %s | FileCheck -check-prefix=CHECK-CSTD %s
+// CHECK-CSTD: __STDC_VERSION__ 199901L
Index: test/Driver/ps4-cpu-defaults.cpp
===
--- test/Driver/ps4-cpu-defaults.cpp
+++ test/Driver/ps4-cpu-defaults.cpp
@@ -1,6 +0,0 @@
-// Check that on the PS4 we default to:
-// -target-cpu btver2 and no exceptions
-
-// RUN: %clang -target x86_64-scei-ps4 -c %s -### 2>&1 | FileCheck %s
-// CHECK: "-target-cpu" "btver2"
-// CHECK-NOT: exceptions
Index: lib/Frontend/CompilerInvocation.cpp
===
--- lib/Frontend/CompilerInvocation.cpp
+++ lib/Front