Re: [PATCH] D12774: createUniqueFile() is documented to create the file in the temporary directory unless it's supplied an absolute path.Make sure the output filepath supplied to createUniqueFile() in

2015-09-17 Thread Vedant Kumar via cfe-commits
vsk added a subscriber: vsk.
vsk added a comment.

Could you handle the error code coming out of make_absolute? It looks like it 
calls current_path(), which can fail in interesting ways.


http://reviews.llvm.org/D12774



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


Re: [PATCH] D12921: clang-format: Support 'template<>' (no space).

2015-09-17 Thread Paul Hoad via cfe-commits
MyDeveloperDay added a subscriber: MyDeveloperDay.
MyDeveloperDay added a comment.

This looks like a good small change.

What is interesting to me is that even the twiki page about template is 
inconsistent in its style (https://en.wikipedia.org/wiki/Template_(C%2B%2B)), 
so its not like there is "one style to rule them all"  (some have spaces, some 
do not)

@djasper, I don't understand here what we mean by "cost" in your review comment 
 (performance, maintainability?), the change has unit tests to keep it honest 
and its just an additional expression on an 'if', is there something else we 
should be concerned about when submitting patches? (long term maintainability?)

It does sound a little to me like we might be want to reject it because we 
don't like this style and don't want to proliferate its continued use, and 
can't understand why anyone would do it that way.  Unfortunately that is not 
very realistic for those of us who want to introduce clang-format into a code 
base that predates clang, google and for some of us even the internet! which 
might have it own style guide which doesn't quite match clang (not quite)

In my view this finite control over every aspect of a style is what 
clang-format needs, we need clang-format to allow the individuals who maintain 
large code bases to be able to fine tune the style to meet our companies own 
documented style, then we can introduce it to automate that style. But the 
concept that we might be able to alter that style guide of our company and 
inflict a tidal wave of changes onto previously conforming code is 
unfortunately not possible.

I know this may not match llvm,clangs requirements but they are possibly the 
requirements to ensure clang-format becomes completely ubiquitous in the 
industry.

This review like my own review for similar finite control over else and catch 
(http://reviews.llvm.org/D12492) is obviously not the way that clang-format 
wants to go, we want to contribute but can't do it if our patches aren't 
included, do you have a recommendation?

Could I ask you to reconsider this review, I'm willing to help.


http://reviews.llvm.org/D12921



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


Re: [PATCH] D12921: clang-format: Support 'template<>' (no space).

2015-09-17 Thread Paul Hoad via cfe-commits
MyDeveloperDay added a comment.

Oh and we might want to run clang-format by the guys at http://cppreference.com 
seems they don't like the space either!   just saying


http://reviews.llvm.org/D12921



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


[PATCH] D12927: Using MD_invariant_group

2015-09-17 Thread Piotr Padlewski via cfe-commits
Prazek created this revision.
Prazek added reviewers: rsmith, nlewycky, majnemer.
Prazek added a subscriber: cfe-commits.

Using changes from http://reviews.llvm.org/D12926

http://reviews.llvm.org/D12927

Files:
  lib/CodeGen/CodeGenModule.cpp

Index: lib/CodeGen/CodeGenModule.cpp
===
--- lib/CodeGen/CodeGenModule.cpp
+++ lib/CodeGen/CodeGenModule.cpp
@@ -524,7 +524,7 @@
   // Check if we have to wrap MDString in MDNode.
   if (!MetaDataNode)
 MetaDataNode = llvm::MDNode::get(getLLVMContext(), MD);
-  I->setMetadata("invariant.group", MetaDataNode);
+  I->setMetadata(llvm::LLVMContext::MD_invariant_group, MetaDataNode);
 }
 
 void CodeGenModule::Error(SourceLocation loc, StringRef message) {


Index: lib/CodeGen/CodeGenModule.cpp
===
--- lib/CodeGen/CodeGenModule.cpp
+++ lib/CodeGen/CodeGenModule.cpp
@@ -524,7 +524,7 @@
   // Check if we have to wrap MDString in MDNode.
   if (!MetaDataNode)
 MetaDataNode = llvm::MDNode::get(getLLVMContext(), MD);
-  I->setMetadata("invariant.group", MetaDataNode);
+  I->setMetadata(llvm::LLVMContext::MD_invariant_group, MetaDataNode);
 }
 
 void CodeGenModule::Error(SourceLocation loc, StringRef message) {
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D12871: [OpenMP] Target directive host codegen - rebased

2015-09-17 Thread Alexey Bataev via cfe-commits
ABataev added inline comments.


Comment at: lib/CodeGen/CGOpenMPRuntime.cpp:3044-3054
@@ +3043,13 @@
+
+  if (auto *VAT = dyn_cast(ElementType.getTypePtr())) {
+auto VATInfo = CGF.getVLASize(VAT);
+Size = llvm::ConstantInt::get(
+CGM.SizeTy,
+CGM.getContext().getTypeSizeInChars(VATInfo.second).getQuantity());
+Size = CGF.Builder.CreateNUWMul(Size, VATInfo.first);
+  } else {
+uint64_t ElementTypeSize =
+CGM.getContext().getTypeSizeInChars(ElementType).getQuantity();
+Size = llvm::ConstantInt::get(CGM.SizeTy, ElementTypeSize);
+  }
+

You were using uint64_t ASTContext::getTypeSize(ElementType), but I'm talking 
about static llvm::Value *getTypeSize(CGF, ElementType), which is defined in 
CGOpenMPRuntime.cpp. It does exactly the same thing you're doing in this part 
of code.


Comment at: lib/CodeGen/CGOpenMPRuntime.cpp:3082-3128
@@ +3081,49 @@
+
+  // Generate the code to launch the target region. The pattern is the
+  // following:
+  //
+  //   ...
+  //   br IfCond (if any), omp_offload, omp_offload_fail
+  //
+  // omp_offload.try:
+  //   ; create arrays for offloading
+  //   error = __tgt_target(...)
+  //   br error, omp_offload_fail, omp_offload_end
+  //
+  // omp_offload.fail:
+  //   host_version(...)
+  //
+  // omp_offload.end:
+  //   ...
+  //
+
+  auto OffloadTryBlock = CGF.createBasicBlock("omp_offload.try");
+  auto OffloadFailBlock = CGF.createBasicBlock("omp_offload.fail");
+  auto ContBlock = CGF.createBasicBlock("omp_offload.end");
+
+  if (IfCond)
+CGF.EmitBranchOnBoolExpr(IfCond, OffloadTryBlock, OffloadFailBlock,
+ /*TrueCount=*/0);
+
+  CGF.EmitBlock(OffloadTryBlock);
+
+  unsigned PointerNumVal = BasePointers.size();
+  llvm::Value *PointerNum = CGF.Builder.getInt32(PointerNumVal);
+  llvm::Value *BasePointersArray;
+  llvm::Value *PointersArray;
+  llvm::Value *SizesArray;
+  llvm::Value *MapTypesArray;
+
+  if (PointerNumVal) {
+llvm::APInt PointerNumAP(32, PointerNumVal, /*isSigned=*/true);
+QualType PointerArrayType = CGF.getContext().getConstantArrayType(
+CGF.getContext().VoidPtrTy, PointerNumAP, ArrayType::Normal,
+/*IndexTypeQuals=*/0);
+
+BasePointersArray =
+CGF.CreateMemTemp(PointerArrayType, ".offload_baseptrs").getPointer();
+PointersArray =
+CGF.CreateMemTemp(PointerArrayType, ".offload_ptrs").getPointer();
+
+// If we don't have any VLA types, we can use a constant array for the map
+// sizes, otherwise we need to fill up the arrays as we do for the 
pointers.

You can emit an empty else block, it will be optimized by backend


Comment at: lib/CodeGen/CGStmtOpenMP.cpp:121-123
@@ -103,4 +120,5 @@
+ArgLVal.getAddress(), ArgLVal.getType()->castAs());
   auto *ExprArg =
   EmitLoadOfLValue(ArgLVal, SourceLocation()).getScalarVal();
   auto VAT = FD->getCapturedVLAType();
   VLASizeMap[VAT->getSizeExpr()] = ExprArg;

sfantao wrote:
> I am actually doing `ArgLVal.getType()` instead  `FD->getType()`. FD doesn't 
> have a reference type here.
Agree, thanks.


http://reviews.llvm.org/D12871



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


Re: [PATCH] D12921: clang-format: Support 'template<>' (no space).

2015-09-17 Thread Daniel Jasper via cfe-commits
The most important costs are: Maintenance and discoverability of options.

The point here that it this space is utterly irrelevant, it doesn't make a
readability difference ever. Most codebases are inconsistent about it
anyway and I haven't seen a style guide even talking about this.

We never intended clang-format to provide control over every aspect of
formatting. We'd rather have it support a limited set of (important) style
options really well.

This simply isn't worth it, not even the time arguing about it.

On Thu, Sep 17, 2015 at 9:37 AM, Paul Hoad  wrote:

> MyDeveloperDay added a comment.
>
> Oh and we might want to run clang-format by the guys at
> http://cppreference.com seems they don't like the space either!   just
> saying
>
>
> http://reviews.llvm.org/D12921
>
>
>
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D10370: clang-format: Implement AlwaysBreakAfterDeclarationReturnType.

2015-09-17 Thread Daniel Jasper via cfe-commits
djasper added inline comments.


Comment at: docs/ClangFormatStyleOptions.rst:221-235
@@ -220,3 +220,17 @@
 
-**AlwaysBreakAfterDefinitionReturnType** 
(``DefinitionReturnTypeBreakingStyle``)
+**AlwaysBreakAfterDeclarationReturnType** (``ReturnTypeBreakingStyle``)
+  The function declaration return type breaking style to use.
+
+  Possible values:
+
+  * ``DRTBS_None`` (in configuration: ``None``)
+Break after return type automatically.
+``PenaltyReturnTypeOnItsOwnLine`` is taken into account.
+  * ``DRTBS_All`` (in configuration: ``All``)
+Always break after the return type.
+  * ``DRTBS_TopLevel`` (in configuration: ``TopLevel``)
+Always break after the return types of top level functions.
+
+
+**AlwaysBreakAfterDefinitionReturnType** (``ReturnTypeBreakingStyle``)
   The function definition return type breaking style to use.

Same as I am arguing on some of your other patches. Fewer options are easier to 
maintain and easier to discover.


Comment at: include/clang/Format/Format.h:133-136
@@ -128,6 +132,6 @@
 
   /// \brief If \c true, always break before multiline string literals.
   ///
   /// This flag is mean to make cases where there are multiple multiline 
strings
   /// in a file look more consistent. Thus, it will only take effect if 
wrapping
   /// the string at that point leads to it being indented

Only one member in style, but parsing the configuration file should be 
backwards compatible. If both are present in the configuration file, the 
non-deprecated one should win. There is a few examples of where the 
configuration options are parsed for backwards compatibility, e.g. 
DerivePointerBinding.


Comment at: lib/Format/ContinuationIndenter.cpp:129-132
@@ -128,5 +128,6 @@
   if (Current.is(TT_FunctionDeclarationName) &&
   Style.AlwaysBreakAfterDefinitionReturnType == FormatStyle::DRTBS_None &&
+  Style.AlwaysBreakAfterDeclarationReturnType == FormatStyle::DRTBS_None &&
   State.Column < 6)
 return false;
 

You mean just the "!Line.Last->isOneOf(tok::semi, tok::comment);"? You can put 
this into a member function of AnnotatedLine maybe?


http://reviews.llvm.org/D10370



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


Re: [PATCH] D12492: [Clang-Format] Add AlwaysBreakBeforeElse and AlwaysBreakBeforeCatch Style to avoid cuddled else/catch

2015-09-17 Thread Daniel Jasper via cfe-commits
djasper added a comment.

Please upload a patch with full file context.



Comment at: docs/ClangFormatStyleOptions.rst:247
@@ -246,1 +246,3 @@
 
+**AlwaysBreakBeforeElse** (``bool``)
+  If ``true``, always break before ``else``.

Hm, I think these should be grouped in some way and interact with 
BreakBeforeBraces.

I theory, I'd like to have a lot of different flags and make BreakBeforeBraces 
select specific presents for them. However, maybe we can put all the brace 
breaking options together in some nice way (don't have a very good idea yet).

Not saying that you need to do all of this, but pulling these two options out 
from the other BreakBeforeBraces options seems a little undesirable. They 
essentially also just define what we do around braces.


http://reviews.llvm.org/D12492



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


Re: [PATCH] D12571: [Analyzer] Fix assertions in commit r246345 (pr22954).

2015-09-17 Thread pierre gousseau via cfe-commits
pgousseau added a comment.

Ping !


http://reviews.llvm.org/D12571



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


Re: [PATCH] D12492: [Clang-Format] Add AlwaysBreakBeforeElse and AlwaysBreakBeforeCatch Style to avoid cuddled else/catch

2015-09-17 Thread Paul Hoad via cfe-commits
MyDeveloperDay updated this revision to Diff 34971.
MyDeveloperDay added a comment.

full file diff


http://reviews.llvm.org/D12492

Files:
  docs/ClangFormatStyleOptions.rst
  include/clang/Format/Format.h
  lib/Format/Format.cpp
  lib/Format/UnwrappedLineParser.cpp
  tools/CMakeLists.txt
  unittests/Format/FormatTest.cpp

Index: unittests/Format/FormatTest.cpp
===
--- unittests/Format/FormatTest.cpp
+++ unittests/Format/FormatTest.cpp
@@ -9131,6 +9131,50 @@
WebKitBraceStyle);
 }
 
+TEST_F(FormatTest, AlwaysBreakBeforeElse) {
+  FormatStyle BeforeElse = getLLVMStyle();
+  BeforeElse.AlwaysBreakBeforeElse = true;
+  verifyFormat("void foo() {\n"
+   "  if (a) {\n"
+   "a();\n"
+   "  }\n"
+   "  else {\n"
+   "b();\n"
+   "  }\n"
+   "}\n",
+   BeforeElse);
+
+  verifyFormat("void foo() {\n"
+   "  if (a) {\n"
+   "a();\n"
+   "  }\n"
+   "  else if (b) {\n"
+   "b();\n"
+   "  }\n"
+   "  else {\n"
+   "b();\n"
+   "  }\n"
+   "}\n",
+   BeforeElse);
+}
+
+TEST_F(FormatTest, AlwaysBreakBeforeCatch) {
+  FormatStyle BeforeCatch = getLLVMStyle();
+  BeforeCatch.AlwaysBreakBeforeCatch = true;
+  verifyFormat("void foo() {\n"
+   "  try {\n"
+   "a();\n"
+   "  }\n"
+   "  catch (exception &) {\n"
+   "b();\n"
+   "  }\n"
+   "  catch (exception &) {\n"
+   "b();\n"
+   "  }\n"
+   "}\n",
+   BeforeCatch);
+}
+
 TEST_F(FormatTest, CatchExceptionReferenceBinding) {
   verifyFormat("void f() {\n"
"  try {\n"
Index: tools/CMakeLists.txt
===
--- tools/CMakeLists.txt
+++ tools/CMakeLists.txt
@@ -21,4 +21,5 @@
 # on top of the Clang tooling platform. We keep them in a separate repository
 # to keep the primary Clang repository small and focused.
 # It also may be included by LLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR.
-add_llvm_external_project(clang-tools-extra extra)
+#add_llvm_external_project(clang-tools-extra extra)
+add_subdirectory(extra)
Index: lib/Format/UnwrappedLineParser.cpp
===
--- lib/Format/UnwrappedLineParser.cpp
+++ lib/Format/UnwrappedLineParser.cpp
@@ -1272,8 +1272,11 @@
 --Line->Level;
   }
   if (FormatTok->Tok.is(tok::kw_else)) {
-if (Style.BreakBeforeBraces == FormatStyle::BS_Stroustrup)
+if (Style.BreakBeforeBraces == FormatStyle::BS_Stroustrup ||
+Style.AlwaysBreakBeforeElse) {
   addUnwrappedLine();
+}
+
 nextToken();
 if (FormatTok->Tok.is(tok::l_brace)) {
   CompoundStatementIndenter Indenter(this, Style, Line->Level);
@@ -1316,7 +1319,8 @@
 parseBlock(/*MustBeDeclaration=*/false);
 if (Style.BreakBeforeBraces == FormatStyle::BS_Allman ||
 Style.BreakBeforeBraces == FormatStyle::BS_GNU ||
-Style.BreakBeforeBraces == FormatStyle::BS_Stroustrup) {
+Style.BreakBeforeBraces == FormatStyle::BS_Stroustrup ||
+Style.AlwaysBreakBeforeCatch) {
   addUnwrappedLine();
 } else {
   NeedsUnwrappedLine = true;
@@ -1356,7 +1360,8 @@
 parseBlock(/*MustBeDeclaration=*/false);
 if (Style.BreakBeforeBraces == FormatStyle::BS_Allman ||
 Style.BreakBeforeBraces == FormatStyle::BS_GNU ||
-Style.BreakBeforeBraces == FormatStyle::BS_Stroustrup) {
+Style.BreakBeforeBraces == FormatStyle::BS_Stroustrup ||
+Style.AlwaysBreakBeforeCatch) {
   addUnwrappedLine();
 } else {
   NeedsUnwrappedLine = true;
Index: lib/Format/Format.cpp
===
--- lib/Format/Format.cpp
+++ lib/Format/Format.cpp
@@ -217,6 +217,8 @@
Style.AlwaysBreakAfterDefinitionReturnType);
 IO.mapOptional("AlwaysBreakBeforeMultilineStrings",
Style.AlwaysBreakBeforeMultilineStrings);
+IO.mapOptional("AlwaysBreakBeforeElse", Style.AlwaysBreakBeforeElse);
+IO.mapOptional("AlwaysBreakBeforeCatch", Style.AlwaysBreakBeforeCatch);
 IO.mapOptional("AlwaysBreakTemplateDeclarations",
Style.AlwaysBreakTemplateDeclarations);
 IO.mapOptional("BinPackArguments", Style.BinPackArguments);
@@ -357,6 +359,8 @@
   LLVMStyle.AllowShortLoopsOnASingleLine = false;
   LLVMStyle.AlwaysBreakAfterDefinitionReturnType = FormatStyle::DRTBS_None;
   LLVMStyle.AlwaysBreakBeforeMultilineStrings = false;
+  LLVMStyle.AlwaysBreakBeforeElse = false;
+  LLVMStyle.AlwaysBreakBeforeCatch = false;
   LLVMStyle.AlwaysBreakTemplateDeclarations = false;
   LLVMStyle.BinPackParameters = true;
   LLVMStyle.BinP

Re: [PATCH] D12492: [Clang-Format] Add AlwaysBreakBeforeElse and AlwaysBreakBeforeCatch Style to avoid cuddled else/catch

2015-09-17 Thread Paul Hoad via cfe-commits
MyDeveloperDay added inline comments.


Comment at: docs/ClangFormatStyleOptions.rst:247
@@ -246,1 +246,3 @@
 
+**AlwaysBreakBeforeElse** (``bool``)
+  If ``true``, always break before ``else``.

djasper wrote:
> Hm, I think these should be grouped in some way and interact with 
> BreakBeforeBraces.
> 
> I theory, I'd like to have a lot of different flags and make 
> BreakBeforeBraces select specific presents for them. However, maybe we can 
> put all the brace breaking options together in some nice way (don't have a 
> very good idea yet).
> 
> Not saying that you need to do all of this, but pulling these two options out 
> from the other BreakBeforeBraces options seems a little undesirable. They 
> essentially also just define what we do around braces.
Well I agree, ideally the BreakBeforeBraces styles should be implemented by 
setting the finite control on each element

Then code like this

if (Style.BreakBeforeBraces == FormatStyle::BS_Allman ||
Style.BreakBeforeBraces == FormatStyle::BS_GNU ||
Style.BreakBeforeBraces == FormatStyle::BS_Stroustrup ||
Style.AlwaysBreakBeforeCatch) {
 ...
}

could become

if (Style.AlwaysBreakBeforeCatch) {
...
}

This would simply require some code in the initializer that says

if (Style.BreakBeforeBraces == FormatStyle::BS_Allman ||
Style.BreakBeforeBraces == FormatStyle::BS_GNU ||
Style.BreakBeforeBraces == FormatStyle::BS_Stroustrup)
{
Style.AlwaysBreakBeforeCatch=true;
}

if (Style.BreakBeforeBraces == FormatStyle::BS_Stroustrup)
{
Style.AlwaysBreakBeforeElse=true;
}

This would allow those of us not using one of the 5 chosen styles to build our 
teams style guide via the individual capabilities

Removing all the BS_Stroustrup/Allman etc.. from the UnwrappedLineParser will 
greatly improve its readability


http://reviews.llvm.org/D12492



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


Re: [PATCH] D12689: [libc++][static linking] std streams are not initialized prior to their use in static object constructors

2015-09-17 Thread Evgeny Astigeevich via cfe-commits
eastig updated this revision to Diff 34973.
eastig added a comment.

Added tests


http://reviews.llvm.org/D12689

Files:
  include/ios
  src/iostream.cpp
  
test/std/input.output/iostream.objects/narrow.stream.objects/cerr_init.pass.cpp
  test/std/input.output/iostream.objects/narrow.stream.objects/cin_init.pass.cpp
  
test/std/input.output/iostream.objects/narrow.stream.objects/clog_init.pass.cpp
  
test/std/input.output/iostream.objects/narrow.stream.objects/cout_init.pass.cpp
  test/std/input.output/iostream.objects/wide.stream.objects/wcerr_init.pass.cpp
  test/std/input.output/iostream.objects/wide.stream.objects/wcin_init.pass.cpp
  test/std/input.output/iostream.objects/wide.stream.objects/wclog_init.pass.cpp
  test/std/input.output/iostream.objects/wide.stream.objects/wcout_init.pass.cpp

Index: test/std/input.output/iostream.objects/wide.stream.objects/wcout_init.pass.cpp
===
--- test/std/input.output/iostream.objects/wide.stream.objects/wcout_init.pass.cpp
+++ test/std/input.output/iostream.objects/wide.stream.objects/wcout_init.pass.cpp
@@ -0,0 +1,37 @@
+//===--===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===--===//
+
+#include 
+#include 
+#include 
+
+// The test checks that 'std::wcout' is the same in a static object constructor
+// and in the main function.
+// It dumps std::wcout memory in the static object constructor and compares it
+// with the memory in the main function.
+// Assumption: if there are no uses of std::wcout it must be the same.
+
+struct A {
+  char *wcout_mem_dump;
+
+  A(): wcout_mem_dump(new char[sizeof(std::wcout)]) {
+std::memcpy(wcout_mem_dump, (char *)&std::wcout, sizeof(std::wcout));
+  }
+  ~A() {
+delete [] wcout_mem_dump;
+  }
+};
+
+static A a;
+
+int main()
+{
+  assert(memcmp(a.wcout_mem_dump, (char *)&std::wcout, sizeof(std::wcout)) == 0);
+}
+
Index: test/std/input.output/iostream.objects/wide.stream.objects/wclog_init.pass.cpp
===
--- test/std/input.output/iostream.objects/wide.stream.objects/wclog_init.pass.cpp
+++ test/std/input.output/iostream.objects/wide.stream.objects/wclog_init.pass.cpp
@@ -0,0 +1,37 @@
+//===--===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===--===//
+
+#include 
+#include 
+#include 
+
+// The test checks that 'std::wclog' is the same in a static object constructor
+// and in the main function.
+// It dumps std::wclog memory in the static object constructor and compares it
+// with the memory in the main function.
+// Assumption: if there are no uses of std::wclog it must be the same.
+
+struct A {
+  char *wclog_mem_dump;
+
+  A(): wclog_mem_dump(new char[sizeof(std::wclog)]) {
+std::memcpy(wclog_mem_dump, (char *)&std::wclog, sizeof(std::wclog));
+  }
+  ~A() {
+delete [] wclog_mem_dump;
+  }
+};
+
+static A a;
+
+int main()
+{
+  assert(memcmp(a.wclog_mem_dump, (char *)&std::wclog, sizeof(std::wclog)) == 0);
+}
+
Index: test/std/input.output/iostream.objects/wide.stream.objects/wcin_init.pass.cpp
===
--- test/std/input.output/iostream.objects/wide.stream.objects/wcin_init.pass.cpp
+++ test/std/input.output/iostream.objects/wide.stream.objects/wcin_init.pass.cpp
@@ -0,0 +1,37 @@
+//===--===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===--===//
+
+#include 
+#include 
+#include 
+
+// The test checks that 'std::wcin' is the same in a static object constructor
+// and in the main function.
+// It dumps std::wcin memory in the static object constructor and compares it
+// with the memory in the main function.
+// Assumption: if there are no uses of std::wcin it must be the same.
+
+struct A {
+  char *wcin_mem_dump;
+
+  A(): wcin_mem_dump(new char[sizeof(std::wcin)]) {
+std::memcpy(wcin_mem_dump, (char *)&std::wcin, sizeof(std::wcin));
+  }
+  ~A() {
+delete [] wcin_mem_dump;
+  }
+};
+
+static A a;
+
+int main()
+{
+  assert(memcmp(a.wcin_mem_dump, (char *)&std::wcin, sizeof(std::wcin)) == 0);
+}
+
Index: test/std/input.output/iostream.o

Re: [PATCH] D12492: [Clang-Format] Add AlwaysBreakBeforeElse and AlwaysBreakBeforeCatch Style to avoid cuddled else/catch

2015-09-17 Thread Daniel Jasper via cfe-commits
djasper added a subscriber: djasper.
djasper added a comment.

The question is how all the other options should be called and how we can
group them nicely so that we don't flood the options configuration page too
much. Maybe it's time for nesting in the configuration class?


http://reviews.llvm.org/D12492



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


Re: [PATCH] D12492: [Clang-Format] Add AlwaysBreakBeforeElse and AlwaysBreakBeforeCatch Style to avoid cuddled else/catch

2015-09-17 Thread Daniel Jasper via cfe-commits
The question is how all the other options should be called and how we can
group them nicely so that we don't flood the options configuration page too
much. Maybe it's time for nesting in the configuration class?
On Sep 17, 2015 11:50 AM, "Paul Hoad"  wrote:

> MyDeveloperDay added inline comments.
>
> 
> Comment at: docs/ClangFormatStyleOptions.rst:247
> @@ -246,1 +246,3 @@
>
> +**AlwaysBreakBeforeElse** (``bool``)
> +  If ``true``, always break before ``else``.
> 
> djasper wrote:
> > Hm, I think these should be grouped in some way and interact with
> BreakBeforeBraces.
> >
> > I theory, I'd like to have a lot of different flags and make
> BreakBeforeBraces select specific presents for them. However, maybe we can
> put all the brace breaking options together in some nice way (don't have a
> very good idea yet).
> >
> > Not saying that you need to do all of this, but pulling these two
> options out from the other BreakBeforeBraces options seems a little
> undesirable. They essentially also just define what we do around braces.
> Well I agree, ideally the BreakBeforeBraces styles should be implemented
> by setting the finite control on each element
>
> Then code like this
>
> if (Style.BreakBeforeBraces == FormatStyle::BS_Allman ||
> Style.BreakBeforeBraces == FormatStyle::BS_GNU ||
> Style.BreakBeforeBraces == FormatStyle::BS_Stroustrup ||
> Style.AlwaysBreakBeforeCatch) {
>  ...
> }
>
> could become
>
> if (Style.AlwaysBreakBeforeCatch) {
> ...
> }
>
> This would simply require some code in the initializer that says
>
> if (Style.BreakBeforeBraces == FormatStyle::BS_Allman ||
> Style.BreakBeforeBraces == FormatStyle::BS_GNU ||
> Style.BreakBeforeBraces == FormatStyle::BS_Stroustrup)
> {
> Style.AlwaysBreakBeforeCatch=true;
> }
>
> if (Style.BreakBeforeBraces == FormatStyle::BS_Stroustrup)
> {
> Style.AlwaysBreakBeforeElse=true;
> }
>
> This would allow those of us not using one of the 5 chosen styles to build
> our teams style guide via the individual capabilities
>
> Removing all the BS_Stroustrup/Allman etc.. from the UnwrappedLineParser
> will greatly improve its readability
>
>
> http://reviews.llvm.org/D12492
>
>
>
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D12921: clang-format: Support 'template<>' (no space).

2015-09-17 Thread Paul Hoad via cfe-commits
MyDeveloperDay added a comment.

> The point here that it this space is utterly irrelevant


So I totally take the point but if it doesn't matter then why does clang-format 
automatically add one to my "template<>" why not simply leave it alone?

> We never intended clang-format to provide control over every aspect of 
> formatting


I know that when new people come along on an open source project they want to 
change the world, for that I apologize, we weren't here for the previous 
decisions, but maybe clang-format is turning into something that is different 
from what was originally intended, maybe it CAN become the code formatting tool 
for those teams out there that are not quite/can't  do it the google way.

> We'd rather have it support a limited set of (important) style options really 
> well


And that I understand, but for those of us whose style does not exactly meet 
one of the 5 what can WE do other than submit patches to give finer control.

I don't want to argue but I would like you (who seems to be the gatekeeper for 
clang-format) to consider.


http://reviews.llvm.org/D12921



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


Re: [PATCH] D12903: Allow the -load option in the driver and pass it through to -cc1

2015-09-17 Thread John Brawn via cfe-commits
john.brawn updated this revision to Diff 34977.
john.brawn added a comment.

Add a test.


Repository:
  rL LLVM

http://reviews.llvm.org/D12903

Files:
  include/clang/Driver/CC1Options.td
  include/clang/Driver/Options.td
  lib/Driver/Tools.cpp
  test/Driver/load.c

Index: test/Driver/load.c
===
--- /dev/null
+++ test/Driver/load.c
@@ -0,0 +1,7 @@
+// Check that all -load arguments are passed through to the -cc1 command
+
+// RUN: %clang -c %s -load foo.so -### 2>&1  | FileCheck %s 
--check-prefix=CHECK1
+// RUN: %clang -c %s -load foo.so -load bar.so -### 2>&1 | FileCheck %s 
--check-prefix=CHECK2
+
+// CHECK1: "-load" "foo.so"
+// CHECK2: "-load" "foo.so" "-load" "bar.so"
Index: lib/Driver/Tools.cpp
===
--- lib/Driver/Tools.cpp
+++ lib/Driver/Tools.cpp
@@ -5035,6 +5035,8 @@
   Args.AddAllArgs(CmdArgs, options::OPT_fcomment_block_commands);
   // Forward -fparse-all-comments to -cc1.
   Args.AddAllArgs(CmdArgs, options::OPT_fparse_all_comments);
+  // Forward -load to -cc1
+  Args.AddAllArgs(CmdArgs, options::OPT_load);
 
   // Forward -Xclang arguments to -cc1, and -mllvm arguments to the LLVM option
   // parser.
Index: include/clang/Driver/Options.td
===
--- include/clang/Driver/Options.td
+++ include/clang/Driver/Options.td
@@ -1192,6 +1192,8 @@
 def l : JoinedOrSeparate<["-"], "l">, Flags<[LinkerInput, RenderJoined]>;
 def lazy__framework : Separate<["-"], "lazy_framework">, Flags<[LinkerInput]>;
 def lazy__library : Separate<["-"], "lazy_library">, Flags<[LinkerInput]>;
+def load : Separate<["-"], "load">, Flags<[DriverOption,CC1Option]>, 
MetaVarName<"">,
+  HelpText<"Load the named plugin (dynamic shared object)">;
 def mlittle_endian : Flag<["-"], "mlittle-endian">, Flags<[DriverOption]>;
 def EL : Flag<["-"], "EL">, Alias;
 def mbig_endian : Flag<["-"], "mbig-endian">, Flags<[DriverOption]>;
Index: include/clang/Driver/CC1Options.td
===
--- include/clang/Driver/CC1Options.td
+++ include/clang/Driver/CC1Options.td
@@ -343,8 +343,6 @@
   HelpText<"Include brief documentation comments in code-completion results.">;
 def disable_free : Flag<["-"], "disable-free">,
   HelpText<"Disable freeing of memory on exit">;
-def load : Separate<["-"], "load">, MetaVarName<"">,
-  HelpText<"Load the named plugin (dynamic shared object)">;
 def plugin : Separate<["-"], "plugin">, MetaVarName<"">,
   HelpText<"Use the named plugin action instead of the default action (use 
\"help\" to list available options)">;
 def plugin_arg : JoinedAndSeparate<["-"], "plugin-arg-">,


Index: test/Driver/load.c
===
--- /dev/null
+++ test/Driver/load.c
@@ -0,0 +1,7 @@
+// Check that all -load arguments are passed through to the -cc1 command
+
+// RUN: %clang -c %s -load foo.so -### 2>&1  | FileCheck %s --check-prefix=CHECK1
+// RUN: %clang -c %s -load foo.so -load bar.so -### 2>&1 | FileCheck %s --check-prefix=CHECK2
+
+// CHECK1: "-load" "foo.so"
+// CHECK2: "-load" "foo.so" "-load" "bar.so"
Index: lib/Driver/Tools.cpp
===
--- lib/Driver/Tools.cpp
+++ lib/Driver/Tools.cpp
@@ -5035,6 +5035,8 @@
   Args.AddAllArgs(CmdArgs, options::OPT_fcomment_block_commands);
   // Forward -fparse-all-comments to -cc1.
   Args.AddAllArgs(CmdArgs, options::OPT_fparse_all_comments);
+  // Forward -load to -cc1
+  Args.AddAllArgs(CmdArgs, options::OPT_load);
 
   // Forward -Xclang arguments to -cc1, and -mllvm arguments to the LLVM option
   // parser.
Index: include/clang/Driver/Options.td
===
--- include/clang/Driver/Options.td
+++ include/clang/Driver/Options.td
@@ -1192,6 +1192,8 @@
 def l : JoinedOrSeparate<["-"], "l">, Flags<[LinkerInput, RenderJoined]>;
 def lazy__framework : Separate<["-"], "lazy_framework">, Flags<[LinkerInput]>;
 def lazy__library : Separate<["-"], "lazy_library">, Flags<[LinkerInput]>;
+def load : Separate<["-"], "load">, Flags<[DriverOption,CC1Option]>, MetaVarName<"">,
+  HelpText<"Load the named plugin (dynamic shared object)">;
 def mlittle_endian : Flag<["-"], "mlittle-endian">, Flags<[DriverOption]>;
 def EL : Flag<["-"], "EL">, Alias;
 def mbig_endian : Flag<["-"], "mbig-endian">, Flags<[DriverOption]>;
Index: include/clang/Driver/CC1Options.td
===
--- include/clang/Driver/CC1Options.td
+++ include/clang/Driver/CC1Options.td
@@ -343,8 +343,6 @@
   HelpText<"Include brief documentation comments in code-completion results.">;
 def disable_free : Flag<["-"], "disable-free">,
   HelpText<"Disable freeing of memory on exit">;
-def load : Separate<["-"], "load">, MetaVarName<"">,
-  HelpTex

r247881 - [X86][AVX512DQ] add new intrinsics

2015-09-17 Thread Asaf Badouh via cfe-commits
Author: abadouh
Date: Thu Sep 17 06:56:04 2015
New Revision: 247881

URL: http://llvm.org/viewvc/llvm-project?rev=247881&view=rev
Log:
[X86][AVX512DQ] add new intrinsics
convert i64 to FP and vice versa
reduceps & reducepd
rangeps & rangepd
all in their 512bit versions


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

Modified:
cfe/trunk/include/clang/Basic/BuiltinsX86.def
cfe/trunk/lib/Headers/avx512dqintrin.h
cfe/trunk/test/CodeGen/avx512dq-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=247881&r1=247880&r2=247881&view=diff
==
--- cfe/trunk/include/clang/Basic/BuiltinsX86.def (original)
+++ cfe/trunk/include/clang/Basic/BuiltinsX86.def Thu Sep 17 06:56:04 2015
@@ -1469,7 +1469,6 @@ TARGET_BUILTIN(__builtin_ia32_vpermt2var
 TARGET_BUILTIN(__builtin_ia32_vpermt2varq128_maskz, "V2LLiV2LLiV2LLiV2LLiUc", 
"", "avx512vl")
 TARGET_BUILTIN(__builtin_ia32_vpermt2varq256_mask, "V4LLiV4LLiV4LLiV4LLiUc", 
"", "avx512vl")
 TARGET_BUILTIN(__builtin_ia32_vpermt2varq256_maskz, "V4LLiV4LLiV4LLiV4LLiUc", 
"", "avx512vl")
-
 TARGET_BUILTIN(__builtin_ia32_pmovswb512_mask, "V32cV32sV32cUi", "", 
"avx512bw")
 TARGET_BUILTIN(__builtin_ia32_pmovuswb512_mask, "V32cV32sV32cUi", "", 
"avx512bw")
 TARGET_BUILTIN(__builtin_ia32_pmovwb512_mask, "V32cV32sV32cUi", "", "avx512bw")
@@ -1477,7 +1476,6 @@ TARGET_BUILTIN(__builtin_ia32_punpckhbw5
 TARGET_BUILTIN(__builtin_ia32_punpckhwd512_mask, "V32sV32sV32sV32sUi", "", 
"avx512bw")
 TARGET_BUILTIN(__builtin_ia32_punpcklbw512_mask, "V64cV64cV64cV64cULLi", "", 
"avx512bw")
 TARGET_BUILTIN(__builtin_ia32_punpcklwd512_mask, "V32sV32sV32sV32sUi", "", 
"avx512bw")
-
 TARGET_BUILTIN(__builtin_ia32_cvtpd2qq128_mask, "V2LLiV2dV2LLiUc", "", 
"avx512vl,avx512dq")
 TARGET_BUILTIN(__builtin_ia32_cvtpd2qq256_mask, "V4LLiV4dV4LLiUc", "", 
"avx512vl,avx512dq")
 TARGET_BUILTIN(__builtin_ia32_cvtpd2uqq128_mask, "V2LLiV2dV2LLiUc", "", 
"avx512vl,avx512dq")
@@ -1510,7 +1508,6 @@ TARGET_BUILTIN(__builtin_ia32_reducepd12
 TARGET_BUILTIN(__builtin_ia32_reducepd256_mask, "V4dV4dIiV4dUc", "", 
"avx512vl,avx512dq")
 TARGET_BUILTIN(__builtin_ia32_reduceps128_mask, "V4fV4fIiV4fUc", "", 
"avx512vl,avx512dq")
 TARGET_BUILTIN(__builtin_ia32_reduceps256_mask, "V8fV8fIiV8fUc", "", 
"avx512vl,avx512dq")
-
 TARGET_BUILTIN(__builtin_ia32_pmaddubsw128_mask, "V8sV16cV16cV8sUc", "", 
"avx512vl,avx512bw")
 TARGET_BUILTIN(__builtin_ia32_pmaddubsw256_mask, "V16sV32cV32cV16sUs", "", 
"avx512vl,avx512bw")
 TARGET_BUILTIN(__builtin_ia32_pmaddwd128_mask, "V4iV8sV8sV4iUc", "", 
"avx512vl,avx512bw")
@@ -1535,6 +1532,22 @@ TARGET_BUILTIN(__builtin_ia32_punpcklbw1
 TARGET_BUILTIN(__builtin_ia32_punpcklbw256_mask, "V32cV32cV32cV32cUi", "", 
"avx512vl,avx512bw")
 TARGET_BUILTIN(__builtin_ia32_punpcklwd128_mask, "V8sV8sV8sV8sUc", "", 
"avx512vl,avx512bw")
 TARGET_BUILTIN(__builtin_ia32_punpcklwd256_mask, "V16sV16sV16sV16sUs", "", 
"avx512vl,avx512bw")
+BUILTIN(__builtin_ia32_cvtpd2qq512_mask, "V8LLiV8dV8LLiUcIi", "")
+BUILTIN(__builtin_ia32_cvtpd2uqq512_mask, "V8LLiV8dV8LLiUcIi", "")
+BUILTIN(__builtin_ia32_cvtps2qq512_mask, "V8LLiV8fV8LLiUcIi", "")
+BUILTIN(__builtin_ia32_cvtps2uqq512_mask, "V8LLiV8fV8LLiUcIi", "")
+BUILTIN(__builtin_ia32_cvtqq2pd512_mask, "V8dV8LLiV8dUcIi", "")
+BUILTIN(__builtin_ia32_cvtqq2ps512_mask, "V8fV8LLiV8fUcIi", "")
+BUILTIN(__builtin_ia32_cvttpd2qq512_mask, "V8LLiV8dV8LLiUcIi", "")
+BUILTIN(__builtin_ia32_cvttpd2uqq512_mask, "V8LLiV8dV8LLiUcIi", "")
+BUILTIN(__builtin_ia32_cvttps2qq512_mask, "V8LLiV8fV8LLiUcIi", "")
+BUILTIN(__builtin_ia32_cvttps2uqq512_mask, "V8LLiV8fV8LLiUcIi", "")
+BUILTIN(__builtin_ia32_cvtuqq2pd512_mask, "V8dV8LLiV8dUcIi", "")
+BUILTIN(__builtin_ia32_cvtuqq2ps512_mask, "V8fV8LLiV8fUcIi", "")
+BUILTIN(__builtin_ia32_rangepd512_mask, "V8dV8dV8dIiV8dUcIi", "")
+BUILTIN(__builtin_ia32_rangeps512_mask, "V16fV16fV16fIiV16fUsIi", "")
+BUILTIN(__builtin_ia32_reducepd512_mask, "V8dV8dIiV8dUcIi", "")
+BUILTIN(__builtin_ia32_reduceps512_mask, "V16fV16fIiV16fUsIi", "")
 
 #undef BUILTIN
 #undef TARGET_BUILTIN

Modified: cfe/trunk/lib/Headers/avx512dqintrin.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx512dqintrin.h?rev=247881&r1=247880&r2=247881&view=diff
==
--- cfe/trunk/lib/Headers/avx512dqintrin.h (original)
+++ cfe/trunk/lib/Headers/avx512dqintrin.h Thu Sep 17 06:56:04 2015
@@ -237,6 +237,542 @@ _mm512_maskz_andnot_ps (__mmask16 __U, _
  (__mmask16) __U);
 }
 
+static __inline__ __m512i __DEFAULT_FN_ATTRS
+_mm512_cvtpd_epi64 (__m512d __A) {
+  return (__m512i) __builtin_ia32_cvtpd2qq512_mask ((__v8df) __A,
+(__v8di) _mm512_setzero_si512(),
+(__mmask8) -1,
+_MM_FROUND_CUR_DIRECTION);
+}
+
+static __inline__ __m512i __DEFAULT_FN_ATTRS
+_mm51

Re: [PATCH] D12903: Allow the -load option in the driver and pass it through to -cc1

2015-09-17 Thread Renato Golin via cfe-commits
rengolin added a comment.

Hi John,

Looks all right to me, but I don't want to approve without someone more 
familiar with the -load option to agree that this is not an exclusively 
internal option.

Other than that, I'm happy with it.

cheers,
--renato


Repository:
  rL LLVM

http://reviews.llvm.org/D12903



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


r247882 - Appease clang/test/CodeGen/avx512dq-builtins.c for -Asserts, for now.

2015-09-17 Thread NAKAMURA Takumi via cfe-commits
Author: chapuni
Date: Thu Sep 17 07:33:34 2015
New Revision: 247882

URL: http://llvm.org/viewvc/llvm-project?rev=247882&view=rev
Log:
Appease clang/test/CodeGen/avx512dq-builtins.c for -Asserts, for now.

Modified:
cfe/trunk/test/CodeGen/avx512dq-builtins.c

Modified: cfe/trunk/test/CodeGen/avx512dq-builtins.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/avx512dq-builtins.c?rev=247882&r1=247881&r2=247882&view=diff
==
--- cfe/trunk/test/CodeGen/avx512dq-builtins.c (original)
+++ cfe/trunk/test/CodeGen/avx512dq-builtins.c Thu Sep 17 07:33:34 2015
@@ -739,3 +739,4 @@ __m512 test_mm512_maskz_reduce_round_ps(
   return _mm512_maskz_reduce_round_ps(__U, __A, 4, 8); 
 }
 
+// REQUIRES: asserts


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


Re: [PATCH] D12633: Implement ACLE 2.0 macros of chapters 6.6 and 6.7 for [ARM] and [Aarch64] targets

2015-09-17 Thread Richard Barton via cfe-commits
richard.barton.arm added a comment.

Hi all

I am uncomfortable with this patch for a number of reasons. These macros seem 
to me to be defined by the ACLE as describing the behaviour of the combination 
of library and compiler. For example, the __STDC_IEC_599__ macro would need 
some standards compliance from the compiler in terms of optimisations on 
floating point functions, and from the libraries in terms of the behaviour of 
the fp functions there. Thus, I don't think it is safe for clang to define this 
macro for all ARM compilation regardless of which library is being used to link 
with. Perhaps I have misunderstood that one - so it would be worth running this 
past Tim directly as the __ARM_FP_FENV_ROUNDING definition comes from his 
original AArch64 patches from early 2013.

If I am right - then clang would want to adopt an approach similar to GCC's 
described here https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html 
(grep for __GCC_IEC_559) where the compiler sets a macro which presumably is 
read by a compliant c library header which then sets the ACLE macro.

However, there are multiple bug reports in the area of FP math - see 
https://llvm.org/bugs/show_bug.cgi?id=8100 - which makes me think that for 
Clang to really be ACLE compliant, we should not be defining any of these 
macros apart from __ARM_FP_FAST. Additionally a bit of research on the devs 
list suggest that LLVM does not support signaling NaNs e.g. 
http://lists.llvm.org/pipermail/llvm-dev/2014-April/071699.html and 
http://lists.llvm.org/pipermail/llvm-dev/2014-August/075749.html from last year

I suggest that the patch needs to be resubmitted without the setting of 
__ARM_FP_FENV_ROUNDING, __STDC_IEC_559 and __SUPPORT_SNAN, and that the setting 
of __ARM_FP_FENV_ROUNDING in the aarch64 target be clarified.


http://reviews.llvm.org/D12633



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


Re: [PATCH] D12761: MPI-Checker patch for Clang Static Analyzer

2015-09-17 Thread Alexander Droste via cfe-commits
Alexander_Droste marked 9 inline comments as done.
Alexander_Droste added a comment.

Thanks for the review!



Comment at: tools/clang/lib/StaticAnalyzer/Checkers/Checkers.td:524
@@ +523,3 @@
+def MPIChecker : Checker<"MPI-Checker">,
+  HelpText<"Checks MPI code written in C">,
+  DescFile<"MPIChecker.cpp">;

zaks.anna wrote:
> I'd suggest running this checker on a C++ codebase to ensure it works and 
> does not introduce regressions (crashes) and change the help text. 
I ran the checker on [[ http://gauss.cs.ucsb.edu/~aydin/CombBLAS/html/ | 
CombBLAS]].
All reports were correct and nothing crashed.  -> changed the help text


Comment at: tools/clang/lib/StaticAnalyzer/Checkers/MPI-Checker/Container.h:30
@@ +29,3 @@
+} // end of namespace: cont
+
+#endif

zaks.anna wrote:
> This code is generic; why is this part of the MPI checker?
> If you feel that the LLVM containers are missing some functionality, this 
> code should go there...
I think it would belong to ``. As this is part of libc++, how shall 
I proceed?


Comment at: 
tools/clang/lib/StaticAnalyzer/Checkers/MPI-Checker/MPIBugReporter.cpp:25
@@ +24,3 @@
+
+const std::string MPIError{"MPI Error"};
+const std::string MPIWarning{"MPI Warning"};

zaks.anna wrote:
> There is no notion of diagnostic severity (errors vs warnings) in the static 
> analyzer right now. I see you are using issue categories to allow for the 
> differentiation.
> 
> In addition to this, it would be useful to allow a user to get a report of 
> only the MPI Errors. You can split the checkers into 2 checkers, which can be 
> turned on independently. See nullability or malloc checkers for examples on 
> how to do that.
> 
> If we split the checkers, can we just have a single category? (We are very 
> conservative with the number of categories right now.)
I originally intended to additionally use warnings but then decided
to mark all reports as error types. I simply forgot to remove the warning 
constant from the code.


Comment at: 
tools/clang/lib/StaticAnalyzer/Checkers/MPI-Checker/MPIBugReporter.cpp:114
@@ +113,3 @@
+  std::string LastUser = Req.LastUser->getCalleeIdentifier()->getName();
+  std::string ErrorText{"Request '" + Req.variableName() +
+"' is already waited upon by '" + LastUser +

zaks.anna wrote:
> This assumes that the referred to event (last user) occurs in the same file. 
> I am not sure if that's always the case. The analyzer can produce cross file 
> reports even now since it "inlines" implementations from header files.
> 
> The "proper" way to refer to an earlier event for a path sensitive report is 
> through implementing a BugReporterVisitor. See SecKeychainBugVisitor in 
> MacOSKeychainAPIChecker.cpp for a simple example. 
Yes, the last user can be in another file. 
I'll look into the visitor implementation.


Comment at: 
tools/clang/lib/StaticAnalyzer/Checkers/MPI-Checker/MPICheckerPathSensitive.cpp:24
@@ +23,3 @@
+
+void MPICheckerPathSensitive::checkDoubleNonblocking(
+const clang::ento::CallEvent &CE, CheckerContext &Ctx) const {

zaks.anna wrote:
> It's a bit hard to read this because it is not clear from the interface here 
> which event we are handling (ex: pre-call).
I changed the parameter name to `PreCallEvent`.


Comment at: 
tools/clang/lib/StaticAnalyzer/Checkers/MPI-Checker/MPICheckerPathSensitive.cpp:32
@@ +31,3 @@
+  // no way to reason about symbolic region
+  if (MR->getBaseRegion()->getAs())
+return;

zaks.anna wrote:
> Why not? What is the issue with handling these?
The problem about symbolic regions is rather in `collectUsedMemRegions()` than
in `checkDoubleNonblocking()` why the guard is again used in 
`checkWaitUsage()`. 
From my understanding, it is not possible to find out for a symbolic region 
what element count and subregions (in case of an array) it has. All elements of 
a request array are supposed to be marked as waited in `checkWaitUsage()` if 
the wait function used is `MPI_Waitall()`. `MPI_Waitall()` receives an array of 
requests as an argument, in order to wait for all requests (or rather 
nonblocking operations) to complete. `collectUsedMemRegions()` iterates over 
the array to collect all single requests used. Therefore, the region is cannot 
be symbolic.


Comment at: tools/clang/lib/StaticAnalyzer/Checkers/MPI-Checker/MPITypes.h:64
@@ +63,3 @@
+// register data structure for path-sensitive analysis
+REGISTER_MAP_WITH_PROGRAMSTATE(RequestMap, const clang::ento::MemRegion *,
+   clang::mpi::Request)

zaks.anna wrote:
> Semantically, what is this map storing?
> What is the MR in the Request?
> Is LastUser added to the map for the purpose of better diagnostic? If so, 
> please, see my other path sensitive diagnostic comment.
I updated the co

Re: r247882 - Appease clang/test/CodeGen/avx512dq-builtins.c for -Asserts, for now.

2015-09-17 Thread NAKAMURA Takumi via cfe-commits
-Asserts was not culprit.

On Thu, Sep 17, 2015 at 9:35 PM NAKAMURA Takumi via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

> Author: chapuni
> Date: Thu Sep 17 07:33:34 2015
> New Revision: 247882
>
> URL: http://llvm.org/viewvc/llvm-project?rev=247882&view=rev
> Log:
> Appease clang/test/CodeGen/avx512dq-builtins.c for -Asserts, for now.
>
> Modified:
> cfe/trunk/test/CodeGen/avx512dq-builtins.c
>
> Modified: cfe/trunk/test/CodeGen/avx512dq-builtins.c
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/avx512dq-builtins.c?rev=247882&r1=247881&r2=247882&view=diff
>
> ==
> --- cfe/trunk/test/CodeGen/avx512dq-builtins.c (original)
> +++ cfe/trunk/test/CodeGen/avx512dq-builtins.c Thu Sep 17 07:33:34 2015
> @@ -739,3 +739,4 @@ __m512 test_mm512_maskz_reduce_round_ps(
>return _mm512_maskz_reduce_round_ps(__U, __A, 4, 8);
>  }
>
> +// REQUIRES: asserts
>
>
> ___
> 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: r247882 - Appease clang/test/CodeGen/avx512dq-builtins.c for -Asserts, for now.

2015-09-17 Thread Badouh, Asaf via cfe-commits
I’m working on revert the patch and fix it.
Will take a moment.

From: NAKAMURA Takumi [mailto:geek4ci...@gmail.com]
Sent: Thursday, September 17, 2015 16:04
To: cfe-commits@lists.llvm.org
Cc: Badouh, Asaf
Subject: Re: r247882 - Appease clang/test/CodeGen/avx512dq-builtins.c for 
-Asserts, for now.

-Asserts was not culprit.
On Thu, Sep 17, 2015 at 9:35 PM NAKAMURA Takumi via cfe-commits 
mailto:cfe-commits@lists.llvm.org>> wrote:
Author: chapuni
Date: Thu Sep 17 07:33:34 2015
New Revision: 247882

URL: http://llvm.org/viewvc/llvm-project?rev=247882&view=rev
Log:
Appease clang/test/CodeGen/avx512dq-builtins.c for -Asserts, for now.

Modified:
cfe/trunk/test/CodeGen/avx512dq-builtins.c

Modified: cfe/trunk/test/CodeGen/avx512dq-builtins.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/avx512dq-builtins.c?rev=247882&r1=247881&r2=247882&view=diff
==
--- cfe/trunk/test/CodeGen/avx512dq-builtins.c (original)
+++ cfe/trunk/test/CodeGen/avx512dq-builtins.c Thu Sep 17 07:33:34 2015
@@ -739,3 +739,4 @@ __m512 test_mm512_maskz_reduce_round_ps(
   return _mm512_maskz_reduce_round_ps(__U, __A, 4, 8);
 }

+// REQUIRES: asserts


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
-
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r247883 - revert r.247881 due to tests failures

2015-09-17 Thread Asaf Badouh via cfe-commits
Author: abadouh
Date: Thu Sep 17 08:09:33 2015
New Revision: 247883

URL: http://llvm.org/viewvc/llvm-project?rev=247883&view=rev
Log:
revert r.247881 due to tests failures

Modified:
cfe/trunk/include/clang/Basic/BuiltinsX86.def
cfe/trunk/lib/Headers/avx512dqintrin.h
cfe/trunk/test/CodeGen/avx512dq-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=247883&r1=247882&r2=247883&view=diff
==
--- cfe/trunk/include/clang/Basic/BuiltinsX86.def (original)
+++ cfe/trunk/include/clang/Basic/BuiltinsX86.def Thu Sep 17 08:09:33 2015
@@ -1469,6 +1469,7 @@ TARGET_BUILTIN(__builtin_ia32_vpermt2var
 TARGET_BUILTIN(__builtin_ia32_vpermt2varq128_maskz, "V2LLiV2LLiV2LLiV2LLiUc", 
"", "avx512vl")
 TARGET_BUILTIN(__builtin_ia32_vpermt2varq256_mask, "V4LLiV4LLiV4LLiV4LLiUc", 
"", "avx512vl")
 TARGET_BUILTIN(__builtin_ia32_vpermt2varq256_maskz, "V4LLiV4LLiV4LLiV4LLiUc", 
"", "avx512vl")
+
 TARGET_BUILTIN(__builtin_ia32_pmovswb512_mask, "V32cV32sV32cUi", "", 
"avx512bw")
 TARGET_BUILTIN(__builtin_ia32_pmovuswb512_mask, "V32cV32sV32cUi", "", 
"avx512bw")
 TARGET_BUILTIN(__builtin_ia32_pmovwb512_mask, "V32cV32sV32cUi", "", "avx512bw")
@@ -1476,6 +1477,7 @@ TARGET_BUILTIN(__builtin_ia32_punpckhbw5
 TARGET_BUILTIN(__builtin_ia32_punpckhwd512_mask, "V32sV32sV32sV32sUi", "", 
"avx512bw")
 TARGET_BUILTIN(__builtin_ia32_punpcklbw512_mask, "V64cV64cV64cV64cULLi", "", 
"avx512bw")
 TARGET_BUILTIN(__builtin_ia32_punpcklwd512_mask, "V32sV32sV32sV32sUi", "", 
"avx512bw")
+
 TARGET_BUILTIN(__builtin_ia32_cvtpd2qq128_mask, "V2LLiV2dV2LLiUc", "", 
"avx512vl,avx512dq")
 TARGET_BUILTIN(__builtin_ia32_cvtpd2qq256_mask, "V4LLiV4dV4LLiUc", "", 
"avx512vl,avx512dq")
 TARGET_BUILTIN(__builtin_ia32_cvtpd2uqq128_mask, "V2LLiV2dV2LLiUc", "", 
"avx512vl,avx512dq")
@@ -1508,6 +1510,7 @@ TARGET_BUILTIN(__builtin_ia32_reducepd12
 TARGET_BUILTIN(__builtin_ia32_reducepd256_mask, "V4dV4dIiV4dUc", "", 
"avx512vl,avx512dq")
 TARGET_BUILTIN(__builtin_ia32_reduceps128_mask, "V4fV4fIiV4fUc", "", 
"avx512vl,avx512dq")
 TARGET_BUILTIN(__builtin_ia32_reduceps256_mask, "V8fV8fIiV8fUc", "", 
"avx512vl,avx512dq")
+
 TARGET_BUILTIN(__builtin_ia32_pmaddubsw128_mask, "V8sV16cV16cV8sUc", "", 
"avx512vl,avx512bw")
 TARGET_BUILTIN(__builtin_ia32_pmaddubsw256_mask, "V16sV32cV32cV16sUs", "", 
"avx512vl,avx512bw")
 TARGET_BUILTIN(__builtin_ia32_pmaddwd128_mask, "V4iV8sV8sV4iUc", "", 
"avx512vl,avx512bw")
@@ -1532,22 +1535,6 @@ TARGET_BUILTIN(__builtin_ia32_punpcklbw1
 TARGET_BUILTIN(__builtin_ia32_punpcklbw256_mask, "V32cV32cV32cV32cUi", "", 
"avx512vl,avx512bw")
 TARGET_BUILTIN(__builtin_ia32_punpcklwd128_mask, "V8sV8sV8sV8sUc", "", 
"avx512vl,avx512bw")
 TARGET_BUILTIN(__builtin_ia32_punpcklwd256_mask, "V16sV16sV16sV16sUs", "", 
"avx512vl,avx512bw")
-BUILTIN(__builtin_ia32_cvtpd2qq512_mask, "V8LLiV8dV8LLiUcIi", "")
-BUILTIN(__builtin_ia32_cvtpd2uqq512_mask, "V8LLiV8dV8LLiUcIi", "")
-BUILTIN(__builtin_ia32_cvtps2qq512_mask, "V8LLiV8fV8LLiUcIi", "")
-BUILTIN(__builtin_ia32_cvtps2uqq512_mask, "V8LLiV8fV8LLiUcIi", "")
-BUILTIN(__builtin_ia32_cvtqq2pd512_mask, "V8dV8LLiV8dUcIi", "")
-BUILTIN(__builtin_ia32_cvtqq2ps512_mask, "V8fV8LLiV8fUcIi", "")
-BUILTIN(__builtin_ia32_cvttpd2qq512_mask, "V8LLiV8dV8LLiUcIi", "")
-BUILTIN(__builtin_ia32_cvttpd2uqq512_mask, "V8LLiV8dV8LLiUcIi", "")
-BUILTIN(__builtin_ia32_cvttps2qq512_mask, "V8LLiV8fV8LLiUcIi", "")
-BUILTIN(__builtin_ia32_cvttps2uqq512_mask, "V8LLiV8fV8LLiUcIi", "")
-BUILTIN(__builtin_ia32_cvtuqq2pd512_mask, "V8dV8LLiV8dUcIi", "")
-BUILTIN(__builtin_ia32_cvtuqq2ps512_mask, "V8fV8LLiV8fUcIi", "")
-BUILTIN(__builtin_ia32_rangepd512_mask, "V8dV8dV8dIiV8dUcIi", "")
-BUILTIN(__builtin_ia32_rangeps512_mask, "V16fV16fV16fIiV16fUsIi", "")
-BUILTIN(__builtin_ia32_reducepd512_mask, "V8dV8dIiV8dUcIi", "")
-BUILTIN(__builtin_ia32_reduceps512_mask, "V16fV16fIiV16fUsIi", "")
 
 #undef BUILTIN
 #undef TARGET_BUILTIN

Modified: cfe/trunk/lib/Headers/avx512dqintrin.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx512dqintrin.h?rev=247883&r1=247882&r2=247883&view=diff
==
--- cfe/trunk/lib/Headers/avx512dqintrin.h (original)
+++ cfe/trunk/lib/Headers/avx512dqintrin.h Thu Sep 17 08:09:33 2015
@@ -237,542 +237,6 @@ _mm512_maskz_andnot_ps (__mmask16 __U, _
  (__mmask16) __U);
 }
 
-static __inline__ __m512i __DEFAULT_FN_ATTRS
-_mm512_cvtpd_epi64 (__m512d __A) {
-  return (__m512i) __builtin_ia32_cvtpd2qq512_mask ((__v8df) __A,
-(__v8di) _mm512_setzero_si512(),
-(__mmask8) -1,
-_MM_FROUND_CUR_DIRECTION);
-}
-
-static __inline__ __m512i __DEFAULT_FN_ATTRS
-_mm512_mask_cvtpd_epi64 (__m512i __W, __mmask8 __U, __m512d __A) {
-  return (__m512i) __builtin_ia32_cvtpd2qq512_mask ((__v8df) __A,
-(__v8di

Re: [PATCH] D12797: Refactor LoopConvertCheck.

2015-09-17 Thread Angel Garcia via cfe-commits
angelgarcia marked 9 inline comments as done.


Comment at: clang-tidy/modernize/LoopConvertCheck.cpp:494-495
@@ -493,4 +502,2 @@
 } else {
-  if (Descriptor.DerefByConstRef)
-AutoRefType = Context->getConstType(AutoRefType);
   AutoRefType = Context->getLValueReferenceType(AutoRefType);

klimek wrote:
> I assume the change in the tests is due to the bug here? :)
I'm not sure if it was a bug or just different priorities, but that's not 
reason. "DerefByValue" is a weird case and we don't have many tests for that. 
The change is due to:

// If the initializer and variable have both the same type just use auto
// otherwise we test for const qualification of the pointed-at type.

At line 726 (somewhere inside the iterator loops logic). I removed the 
conditional because we always want to check for const qualification.




http://reviews.llvm.org/D12797



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


Re: [PATCH] D12797: Refactor LoopConvertCheck.

2015-09-17 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 34985.
angelgarcia added a comment.

Split a function and several other small changes.


http://reviews.llvm.org/D12797

Files:
  clang-tidy/modernize/LoopConvertCheck.cpp
  clang-tidy/modernize/LoopConvertCheck.h
  test/clang-tidy/modernize-loop-convert-basic.cpp

Index: test/clang-tidy/modernize-loop-convert-basic.cpp
===
--- test/clang-tidy/modernize-loop-convert-basic.cpp
+++ test/clang-tidy/modernize-loop-convert-basic.cpp
@@ -406,12 +406,12 @@
 for (const_iterator I = begin(), E = end(); I != E; ++I)
   (void) *I;
 // CHECK-MESSAGES: :[[@LINE-2]]:5: warning: use range-based for loop instead
-// CHECK-FIXES: for (auto & elem : *this)
+// CHECK-FIXES: for (const auto & elem : *this)
 
 for (const_iterator I = C::begin(), E = C::end(); I != E; ++I)
   (void) *I;
 // CHECK-MESSAGES: :[[@LINE-2]]:5: warning: use range-based for loop instead
-// CHECK-FIXES: for (auto & elem : *this)
+// CHECK-FIXES: for (const auto & elem : *this)
 
 for (const_iterator I = begin(), E = end(); I != E; ++I) {
   (void) *I;
Index: clang-tidy/modernize/LoopConvertCheck.h
===
--- clang-tidy/modernize/LoopConvertCheck.h
+++ clang-tidy/modernize/LoopConvertCheck.h
@@ -26,25 +26,42 @@
 
 private:
   struct RangeDescriptor {
+RangeDescriptor();
 bool ContainerNeedsDereference;
 bool DerefByConstRef;
 bool DerefByValue;
 bool IsTriviallyCopyable;
+std::string ContainerString;
   };
 
   void doConversion(ASTContext *Context, const VarDecl *IndexVar,
-const VarDecl *MaybeContainer, StringRef ContainerString,
-const UsageResult &Usages, const DeclStmt *AliasDecl,
-bool AliasUseRequired, bool AliasFromForInit,
-const ForStmt *TheLoop, RangeDescriptor Descriptor);
-
-  StringRef checkRejections(ASTContext *Context, const Expr *ContainerExpr,
-const ForStmt *TheLoop);
-
-  void findAndVerifyUsages(ASTContext *Context, const VarDecl *LoopVar,
-   const VarDecl *EndVar, const Expr *ContainerExpr,
-   const Expr *BoundExpr, const ForStmt *TheLoop,
-   LoopFixerKind FixerKind, RangeDescriptor Descriptor);
+const VarDecl *MaybeContainer, const UsageResult &Usages,
+const DeclStmt *AliasDecl, bool AliasUseRequired,
+bool AliasFromForInit, const ForStmt *Loop,
+RangeDescriptor Descriptor);
+
+  StringRef getContainerString(ASTContext *Context, const ForStmt *Loop,
+   const Expr *ContainerExpr);
+
+  void getArrayLoopQualifiers(ASTContext *Context,
+  const ast_matchers::BoundNodes &Nodes,
+  const Expr *ContainerExpr,
+  const UsageResult &Usages,
+  RangeDescriptor &Descriptor);
+
+  void getIteratorLoopQualifiers(ASTContext *Context,
+ const ast_matchers::BoundNodes &Nodes,
+ RangeDescriptor &Descriptor);
+
+  void determineRangeDescriptor(ASTContext *Context,
+const ast_matchers::BoundNodes &Nodes,
+const ForStmt *Loop, LoopFixerKind FixerKind,
+const Expr *ContainerExpr,
+const UsageResult &Usages,
+RangeDescriptor &Descriptor);
+
+  bool isConvertible(ASTContext *Context, const ast_matchers::BoundNodes &Nodes,
+ const ForStmt *Loop, LoopFixerKind FixerKind);
 
   std::unique_ptr TUInfo;
   Confidence::Level MinConfidence;
Index: clang-tidy/modernize/LoopConvertCheck.cpp
===
--- clang-tidy/modernize/LoopConvertCheck.cpp
+++ clang-tidy/modernize/LoopConvertCheck.cpp
@@ -395,6 +395,10 @@
   return false;
 }
 
+LoopConvertCheck::RangeDescriptor::RangeDescriptor()
+: ContainerNeedsDereference(false), DerefByConstRef(false),
+  DerefByValue(false), IsTriviallyCopyable(false) {}
+
 LoopConvertCheck::LoopConvertCheck(StringRef Name, ClangTidyContext *Context)
 : ClangTidyCheck(Name, Context), TUInfo(new TUTrackingInfo),
   MinConfidence(StringSwitch(
@@ -408,19 +412,25 @@
   Options.store(Opts, "MinConfidence", Confs[static_cast(MinConfidence)]);
 }
 
+void LoopConvertCheck::registerMatchers(MatchFinder *Finder) {
+  // Only register the matchers for C++. Because this checker is used for
+  // modernization, it is reasonable to run it on any C++ standard with the
+  // assumption the user is trying to modernize their codebase.
+  if (!getLangOpts().CPlusPlus)
+return;
+
+  Finder->addMatcher(m

Re: recordDecl() AST matcher

2015-09-17 Thread Aaron Ballman via cfe-commits
I've commit in r247885 and r247886. I will add something to the
release notes, and watch the bots to see if any tests got missed
(since I did my development on Windows).

Thank you!

~Aaron

On Wed, Sep 16, 2015 at 7:49 PM, Manuel Klimek  wrote:
> LG, ship it.
>
> On Wed, Sep 16, 2015 at 2:03 PM Aaron Ballman 
> wrote:
>>
>> Attached is an updated patch for clang-tools-extra that does not have
>> my in-progress, not-related-to-any-of-this code in it. ;-)
>>
>> ~Aaron
>>
>> On Wed, Sep 16, 2015 at 4:04 PM, Aaron Ballman 
>> wrote:
>> > Quick ping. I know this is a fairly gigantic patch, but I'm hoping for
>> > a relatively quick review turnaround because of potential merge
>> > conflicts with people doing a fair amount of work on clang-tidy
>> > lately. Everything should be pretty straight-forward (it's all just
>> > renames, no semantic changes intended aside from
>> > recordDecl/cxxRecordDecl and the narrowing matchers.
>> >
>> > ~Aaron
>> >
>> > On Tue, Sep 15, 2015 at 1:32 PM, Aaron Ballman 
>> > wrote:
>> >> Here are the complete patches to solve the issues we've discussed:
>> >>
>> >> 1) splits recordDecl into recordDecl and cxxRecordDecl
>> >> 2) adds isStruct, isUnion, isClass to identify what kind of
>> >> recordDecl() you may be looking at
>> >> 3) prefixes all of the node matchers with cxx that should have it
>> >> 4) fixes a similar issue with CUDAKernelCallExpr (the prefix needs to
>> >> be cuda instead of CUDA to distinguish the matcher name from the type
>> >> name).
>> >> 5) updates all of the documentation and code that broke.
>> >>
>> >> One patch is for changes to clang, the other is for changes to
>> >> clang-tools-extra.
>> >>
>> >> ~Aaron
>> >>
>> >> On Mon, Sep 14, 2015 at 5:49 PM, Aaron Ballman 
>> >> wrote:
>> >>> On Mon, Sep 14, 2015 at 5:47 PM, Daniel Jasper 
>> >>> wrote:
>>  Btw, I think generating them, potentially into several different
>>  headers to
>>  work around the compile time issue isn't such a bad idea.
>> >>>
>> >>> I'm not going to start with this approach, but think it may be worth
>> >>> exploring at some point. ;-)
>> >>>
>> >>> ~Aaron
>> >>>
>> 
>>  On Mon, Sep 14, 2015 at 11:45 PM, Manuel Klimek 
>>  wrote:
>> >
>> > Feel free to rename the AST nodes :)
>> >
>> >
>> > On Mon, Sep 14, 2015, 2:44 PM Daniel Jasper 
>> > wrote:
>> >>
>> >> Ok. I am happy with this then.
>> >>
>> >> (Just personally grumpy having to write
>> >> cxxRecordDecl(has(cxxConstructorDecl(..))) in the future ;-) ).
>> >>
>> >> On Mon, Sep 14, 2015 at 11:41 PM, Manuel Klimek 
>> >> wrote:
>> >>>
>> >>>
>> >>>
>> >>> On Mon, Sep 14, 2015 at 2:29 PM Aaron Ballman
>> >>> 
>> >>> wrote:
>> 
>>  On Mon, Sep 14, 2015 at 4:38 PM, Manuel Klimek
>>  
>>  wrote:
>>  >
>>  >
>>  > On Mon, Sep 14, 2015 at 12:26 PM Aaron Ballman
>>  > 
>>  > wrote:
>>  >>
>>  >> On Mon, Sep 14, 2015 at 2:45 PM, Daniel Jasper
>>  >> 
>>  >> wrote:
>>  >> > By this point, I see that change might be profitable
>>  >> > overall.
>>  >> > However,
>>  >> > lets
>>  >> > completely map this out. Changing just cxxRecordDecl() can
>>  >> > actually
>>  >> > increase
>>  >> > confusion in other areas. Right now, not a single AST
>>  >> > matcher has
>>  >> > the
>>  >> > cxx
>>  >> > prefix (although a total of 28 stand for the corresponding
>>  >> > CXX..
>>  >> > AST
>>  >> > node).
>>  >> > This is consistent and people knowing this will never try to
>>  >> > write
>>  >> > cxxConstructExpr(). As soon as people have used
>>  >> > cxxRecordDecl(),
>>  >> > the
>>  >> > chance
>>  >> > of them trying cxxConstructExpr() increases. You have spent
>>  >> > a long
>>  >> > time
>>  >> > figuring out that recordDecl means cxxRecordDecl(), which is
>>  >> > one
>>  >> > datapoint,
>>  >> > but I am not aware of anyone else having this specific
>>  >> > issue. And
>>  >> > we
>>  >> > could
>>  >> > make this less bad with better documentation, I think.
>>  >> >
>>  >> > So, for me, the questions are:
>>  >> > 1) Do we want/need this change?
>>  >>
>>  >> We definitely need *a* change because there currently is no
>>  >> way to
>>  >> match a C struct or union when compiling in C mode. I
>>  >> discovered
>>  >> this
>>  >> because I was trying to write a new checker for clang-tidy
>>  >> that
>>  >> focuses on C code and it would fail to match when compiling in
>>  >> C
>>  >> mode.
>>  >> Whether we decide to go with cxxRecordDecl vs recordDecl vs
>>  >

[clang-tools-extra] r247886 - Refactors AST matching code to use the new AST matcher names. This patch correlates to r247885 which performs the AST matcher rename in Clang.

2015-09-17 Thread Aaron Ballman via cfe-commits
Author: aaronballman
Date: Thu Sep 17 08:31:25 2015
New Revision: 247886

URL: http://llvm.org/viewvc/llvm-project?rev=247886&view=rev
Log:
Refactors AST matching code to use the new AST matcher names. This patch 
correlates to r247885 which performs the AST matcher rename in Clang.

Modified:
clang-tools-extra/trunk/clang-modernize/AddOverride/AddOverrideMatchers.cpp
clang-tools-extra/trunk/clang-modernize/LoopConvert/LoopMatchers.cpp
clang-tools-extra/trunk/clang-modernize/PassByValue/PassByValueMatchers.cpp

clang-tools-extra/trunk/clang-modernize/ReplaceAutoPtr/ReplaceAutoPtrMatchers.cpp
clang-tools-extra/trunk/clang-modernize/UseAuto/UseAutoMatchers.cpp
clang-tools-extra/trunk/clang-tidy/google/ExplicitConstructorCheck.cpp
clang-tools-extra/trunk/clang-tidy/google/OverloadedUnaryAndCheck.cpp
clang-tools-extra/trunk/clang-tidy/misc/ArgumentCommentCheck.cpp
clang-tools-extra/trunk/clang-tidy/misc/AssignOperatorSignatureCheck.cpp

clang-tools-extra/trunk/clang-tidy/misc/BoolPointerImplicitConversionCheck.cpp
clang-tools-extra/trunk/clang-tidy/misc/InaccurateEraseCheck.cpp
clang-tools-extra/trunk/clang-tidy/misc/InefficientAlgorithmCheck.cpp
clang-tools-extra/trunk/clang-tidy/misc/MoveConstructorInitCheck.cpp
clang-tools-extra/trunk/clang-tidy/misc/NoexceptMoveConstructorCheck.cpp
clang-tools-extra/trunk/clang-tidy/misc/SizeofContainerCheck.cpp
clang-tools-extra/trunk/clang-tidy/misc/StaticAssertCheck.cpp
clang-tools-extra/trunk/clang-tidy/misc/UndelegatedConstructor.cpp
clang-tools-extra/trunk/clang-tidy/misc/UniqueptrResetReleaseCheck.cpp
clang-tools-extra/trunk/clang-tidy/misc/UnusedRAIICheck.cpp
clang-tools-extra/trunk/clang-tidy/modernize/LoopConvertCheck.cpp
clang-tools-extra/trunk/clang-tidy/modernize/PassByValueCheck.cpp
clang-tools-extra/trunk/clang-tidy/modernize/ReplaceAutoPtrCheck.cpp
clang-tools-extra/trunk/clang-tidy/modernize/ShrinkToFitCheck.cpp
clang-tools-extra/trunk/clang-tidy/modernize/UseAutoCheck.cpp
clang-tools-extra/trunk/clang-tidy/modernize/UseOverrideCheck.cpp

clang-tools-extra/trunk/clang-tidy/readability/BracesAroundStatementsCheck.cpp
clang-tools-extra/trunk/clang-tidy/readability/ContainerSizeEmptyCheck.cpp
clang-tools-extra/trunk/clang-tidy/readability/FunctionSizeCheck.cpp
clang-tools-extra/trunk/clang-tidy/readability/RedundantSmartptrGetCheck.cpp
clang-tools-extra/trunk/clang-tidy/readability/RedundantStringCStrCheck.cpp
clang-tools-extra/trunk/clang-tidy/readability/SimplifyBooleanExprCheck.cpp

Modified: 
clang-tools-extra/trunk/clang-modernize/AddOverride/AddOverrideMatchers.cpp
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-modernize/AddOverride/AddOverrideMatchers.cpp?rev=247886&r1=247885&r2=247886&view=diff
==
--- clang-tools-extra/trunk/clang-modernize/AddOverride/AddOverrideMatchers.cpp 
(original)
+++ clang-tools-extra/trunk/clang-modernize/AddOverride/AddOverrideMatchers.cpp 
Thu Sep 17 08:31:25 2015
@@ -22,8 +22,8 @@ using namespace clang;
 const char *MethodId = "method";
 
 DeclarationMatcher makeCandidateForOverrideAttrMatcher() {
-  return methodDecl(hasParent(recordDecl()),
+  return cxxMethodDecl(hasParent(recordDecl()),
 isOverride(),
-unless(destructorDecl())).bind(MethodId);
+unless(cxxDestructorDecl())).bind(MethodId);
 }
 

Modified: clang-tools-extra/trunk/clang-modernize/LoopConvert/LoopMatchers.cpp
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-modernize/LoopConvert/LoopMatchers.cpp?rev=247886&r1=247885&r2=247886&view=diff
==
--- clang-tools-extra/trunk/clang-modernize/LoopConvert/LoopMatchers.cpp 
(original)
+++ clang-tools-extra/trunk/clang-modernize/LoopConvert/LoopMatchers.cpp Thu 
Sep 17 08:31:25 2015
@@ -112,10 +112,10 @@ StatementMatcher makeArrayLoopMatcher()
 ///   - If the end iterator variable 'g' is defined, it is the same as 'f'
 StatementMatcher makeIteratorLoopMatcher() {
   StatementMatcher BeginCallMatcher =
-  memberCallExpr(
+  cxxMemberCallExpr(
 argumentCountIs(0),
 callee(
-  methodDecl(hasName("begin"))
+  cxxMethodDecl(hasName("begin"))
 )
   ).bind(BeginCallName);
 
@@ -133,8 +133,8 @@ StatementMatcher makeIteratorLoopMatcher
   DeclarationMatcher EndDeclMatcher =
   varDecl(hasInitializer(anything())).bind(EndVarName);
 
-  StatementMatcher EndCallMatcher =
-  memberCallExpr(argumentCountIs(0), callee(methodDecl(hasName("end";
+  StatementMatcher EndCallMatcher = cxxMemberCallExpr(
+  argumentCountIs(0), callee(cxxMethodDecl(hasName("end";
 
   StatementMatcher IteratorBoundMatcher =
   expr(anyOf(ignoringParenImpCasts(declRefExpr(to(
@@ -148,7 +148,7 @@ StatementMat

r247887 - Update the 3.8 release notes with the breaking change information regarding AST matchers.

2015-09-17 Thread Aaron Ballman via cfe-commits
Author: aaronballman
Date: Thu Sep 17 08:47:22 2015
New Revision: 247887

URL: http://llvm.org/viewvc/llvm-project?rev=247887&view=rev
Log:
Update the 3.8 release notes with the breaking change information regarding AST 
matchers.

Modified:
cfe/trunk/docs/ReleaseNotes.rst

Modified: cfe/trunk/docs/ReleaseNotes.rst
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/ReleaseNotes.rst?rev=247887&r1=247886&r2=247887&view=diff
==
--- cfe/trunk/docs/ReleaseNotes.rst (original)
+++ cfe/trunk/docs/ReleaseNotes.rst Thu Sep 17 08:47:22 2015
@@ -114,6 +114,51 @@ this section should help get you past th
 
 -  ...
 
+AST Matchers
+
+The AST matcher functions were renamed to reflect the exact AST node names,
+which is a breaking change to AST matching code. The following matchers were
+affected:
+
+===
+Previous Matcher Name  New Matcher Name
+===
+recordDecl recordDecl and cxxRecordDecl
+ctorInitializercxxCtorInitializer
+constructorDeclcxxConstructorDecl
+destructorDecl cxxDestructorDecl
+methodDecl cxxMethodDecl
+conversionDecl cxxConversionDecl
+memberCallExpr cxxMemberCallExpr
+constructExpr  cxxConstructExpr
+unresolvedConstructExprcxxUnresolvedConstructExpr
+thisExpr   cxxThisExpr
+bindTemporaryExpr  cxxBindTemporaryExpr
+newExprcxxNewExpr
+deleteExpr cxxDeleteExpr
+defaultArgExpr cxxDefaultArgExpr
+operatorCallExpr   cxxOperatorCallExpr
+forRangeStmt   cxxForRangeStmt
+catchStmt  cxxCatchStmt
+tryStmtcxxTryStmt
+throwExpr  cxxThrowExpr
+boolLiteralcxxBoolLiteral
+nullPtrLiteralExpr cxxNullPtrLiteralExpr
+reinterpretCastExprcxxReinterpretCastExpr
+staticCastExpr cxxStaticCastExpr
+dynamicCastExprcxxDynamicCastExpr
+constCastExpr  cxxConstCastExpr
+functionalCastExpr cxxFunctionalCastExpr
+temporaryObjectExprcxxTemporaryObjectExpr
+CUDAKernalCallExpr cudaKernelCallExpr
+===
+
+recordDecl() previously matched AST nodes of type CXXRecordDecl, but now
+matches AST nodes of type RecordDecl. If a CXXRecordDecl is required, use the
+cxxRecordDecl() matcher instead.
+
+...
+
 libclang
 
 


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


Re: [PATCH] D12921: clang-format: Support 'template<>' (no space).

2015-09-17 Thread Daniel Jasper via cfe-commits
On Thu, Sep 17, 2015 at 12:17 PM, Paul Hoad 
wrote:

> MyDeveloperDay added a comment.
>
> > The point here that it this space is utterly irrelevant
>
>
> So I totally take the point but if it doesn't matter then why does
> clang-format automatically add one to my "template<>" why not simply leave
> it alone?
>

Because that is something else clang-format (almost) never does.
Consistency is beneficial.

> We never intended clang-format to provide control over every aspect of
> formatting
>
>
> I know that when new people come along on an open source project they want
> to change the world, for that I apologize, we weren't here for the previous
> decisions, but maybe clang-format is turning into something that is
> different from what was originally intended, maybe it CAN become the code
> formatting tool for those teams out there that are not quite/can't  do it
> the google way.
>

I generally agree and will gladly accept any useful formatting option. I
know I have been slow at reviewing your patches and I am sorry about that.
I was on vacation and had to catch on other stuff, but I hope we can make
progress on those.

> We'd rather have it support a limited set of (important) style options
> really well
>
>
> And that I understand, but for those of us whose style does not exactly
> meet one of the 5 what can WE do other than submit patches to give finer
> control.
>

One of the 5?? Clang-format has *many* options by now and supports many
large open-source projects and publicly available style guides. I have
personally spent a lot of time on and implemented many options that are
entirely irrelevant to both Google and LLVM.

And whether or not to add the space is something that nobody really had an
opinion. Basically every project I sampled was inconsistent, not a single
style guide said what to do. We looked around at the sources we could find
(the style guide most heavily) and made a decision. If you had brought up
good arguments that the space hurts readability (I really doubt it), you
could have made us turn the other way. The point is that this space matter
so little that it is not worth having the option.

I don't want to argue but I would like you (who seems to be the gatekeeper
> for clang-format) to consider.
>

I have considered and my opinion stands. It is not worth having this option
and it is also not worth changing that clang-format adds the space now that
it has been in use by many for 2+ years.

I am sorry if this means you cannot use clang-format for a significant
project.

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


Re: [cfe-commits] r171885 - in /cfe/trunk/www/analyzer: annotations.html available_checks.html dev_cxx.html index.html xcode.html

2015-09-17 Thread Aaron Ballman via cfe-commits
Sorry to resurrect an ancient commit, but...

On Tue, Jan 8, 2013 at 2:29 PM, Jordan Rose  wrote:
> Author: jrose
> Date: Tue Jan  8 13:29:37 2013
> New Revision: 171885
>
> URL: http://llvm.org/viewvc/llvm-project?rev=171885&view=rev
> Log:
> Various tweaks and updates to the analyzer website.
>
> Modified:
> cfe/trunk/www/analyzer/annotations.html
> cfe/trunk/www/analyzer/available_checks.html
> cfe/trunk/www/analyzer/dev_cxx.html
> cfe/trunk/www/analyzer/index.html
> cfe/trunk/www/analyzer/xcode.html
>
> Modified: cfe/trunk/www/analyzer/annotations.html



>
> Modified: cfe/trunk/www/analyzer/xcode.html
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/www/analyzer/xcode.html?rev=171885&r1=171884&r2=171885&view=diff
> ==
> --- cfe/trunk/www/analyzer/xcode.html (original)
> +++ cfe/trunk/www/analyzer/xcode.html Tue Jan  8 13:29:37 2013
> @@ -2,7 +2,7 @@
>"http://www.w3.org/TR/html4/strict.dtd";>
>  
>  
> -  Build and Analyze: running the analyzer within Xcode
> +  Running the analyzer within Xcode
>
>
>
> @@ -14,15 +14,16 @@
>  
>  
>
> -Build and Analyze: running the analyzer within Xcode
> +Running the analyzer within Xcode
>
>   cellspacing="0">
>  
>
>  What is it?
> -Build and Analyze is an Xcode feature (introduced in Xcode 3.2) 
> that
> -allows users to run the Clang Static Analyzer  -href="http://developer.apple.com/mac/library/featuredarticles/StaticAnalysis/index.html";>directly
> +
> +Since Xcode 3.2, users have been able to run the Clang Static Analyzer
> + +href="https://developer.apple.com/library/mac/documentation/ToolsLanguages/Conceptual/Xcode4UserGuide/060-Debug_Your_App/debug_app.html#//apple_ref/doc/uid/TP40010215-CH3-SW17";>directly
>  within Xcode.

This link is currently broken, and I do not know what the replacement
link should be.

> It integrates directly with the Xcode build system and
> @@ -45,23 +46,24 @@
>   single keystroke or mouse click.
>   Transparency: Works effortlessly with Xcode projects (including 
> iPhone projects).
>   Cons: Doesn't work well with non-Xcode projects. For those,
> -  consider using scan-build.
> +  consider using scan-build.
> 
>
>
> Getting Started
>
> -Xcode 3.2 is available as a free download from Apple, with  -href="http://developer.apple.com/mac/library/featuredarticles/StaticAnalysis/index.html";>instructions
>  available
> -for using Build and Analyze.
> +Xcode is available as a free download from Apple on the  +href="https://itunes.apple.com/us/app/xcode/id497799835?mt=12";>Mac
> +App Store, with  +href="https://developer.apple.com/library/mac/documentation/ToolsLanguages/Conceptual/Xcode4UserGuide/060->
>  
> Debug_Your_App/debug_app.html#//apple_ref/doc/uid/TP40010215-CH3-SW17">instructions
> +available for using the analyzer.

Same with this link.

~Aaron

On Tue, Jan 8, 2013 at 2:29 PM, Jordan Rose  wrote:
> Author: jrose
> Date: Tue Jan  8 13:29:37 2013
> New Revision: 171885
>
> URL: http://llvm.org/viewvc/llvm-project?rev=171885&view=rev
> Log:
> Various tweaks and updates to the analyzer website.
>
> Modified:
> cfe/trunk/www/analyzer/annotations.html
> cfe/trunk/www/analyzer/available_checks.html
> cfe/trunk/www/analyzer/dev_cxx.html
> cfe/trunk/www/analyzer/index.html
> cfe/trunk/www/analyzer/xcode.html
>
> Modified: cfe/trunk/www/analyzer/annotations.html
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/www/analyzer/annotations.html?rev=171885&r1=171884&r2=171885&view=diff
> ==
> --- cfe/trunk/www/analyzer/annotations.html (original)
> +++ cfe/trunk/www/analyzer/annotations.html Tue Jan  8 13:29:37 2013
> @@ -127,7 +127,10 @@
>
>  One can educate the analyzer (and others who read your code) about 
> methods or
>  functions that deviate from the Cocoa and Core Foundation conventions using 
> the
> -attributes described here.
> +attributes described here. However, you should consider using proper naming
> +conventions or the  +href="http://clang.llvm.org/docs/LanguageExtensions.html#the-objc-method-family-attribute";>objc_method_family
> +attribute, if applicable.
>
>  Attribute 'ns_returns_retained'
>  (Clang-specific)
> @@ -135,7 +138,9 @@
>  The GCC-style (Clang-specific) attribute 'ns_returns_retained' allows one 
> to
>  annotate an Objective-C method or C function as returning a retained Cocoa
>  object that the caller is responsible for releasing (via sending a
> -release message to the object).
> +release message to the object). The Foundation framework defines a
> +macro NS_RETURNS_RETAINED that is functionally equivalent to 
> the
> +one shown below.
>
>  Placing on Objective-C methods: For Objective-C methods, this
>  annotation essentially tells the analyzer to treat the method as if its name
> @@ -202,7 +207,9 @@
>  method may appear to obey the Cocoa conventions and return a retained Cocoa

[PATCH] D12933: Add a test to modernize-loop-convert.

2015-09-17 Thread Angel Garcia via cfe-commits
angelgarcia created this revision.
angelgarcia added a reviewer: alexfh.
angelgarcia added subscribers: klimek, cfe-commits.

Add the test about replacements in several arguments of the same macro call, 
now that the problem has been fixed.

http://reviews.llvm.org/D12933

Files:
  test/clang-tidy/modernize-loop-convert-extra.cpp

Index: test/clang-tidy/modernize-loop-convert-extra.cpp
===
--- test/clang-tidy/modernize-loop-convert-extra.cpp
+++ test/clang-tidy/modernize-loop-convert-extra.cpp
@@ -702,21 +702,15 @@
 printf("Value: %d\n", CONT arr[i]);
   }
 
-  // FIXME: Right now, clang-tidy does not allow to make insertions in several
-  // arguments of the same macro call. The following code:
-  // \code
-  //   for (int i = 0; i < N; ++i) {
-  //TWO_PARAM(arr[i], arr[i]);
-  //THREE_PARAM(arr[i], arr[i], arr[i]);
-  //   }
-  // \endcode
-  // Should be converted to this:
-  // \code
-  //   for (auto & elem : arr) {
-  //TWO_PARAM(elem, elem);
-  //THREE_PARAM(elem, elem, elem);
-  //   }
-  // \endcode
+  // Multiple arguments.
+  for (int i = 0; i < N; ++i) {
+TWO_PARAM(arr[i], arr[i]);
+THREE_PARAM(arr[i], arr[i], arr[i]);
+  }
+  // CHECK-MESSAGES: :[[@LINE-4]]:3: warning: use range-based for loop instead
+  // CHECK-FIXES: for (auto & elem : arr)
+  // CHECK-FIXES-NEXT: TWO_PARAM(elem, elem);
+  // CHECK-FIXES-NEXT: THREE_PARAM(elem, elem, elem);
 }
 
 } // namespace Macros


Index: test/clang-tidy/modernize-loop-convert-extra.cpp
===
--- test/clang-tidy/modernize-loop-convert-extra.cpp
+++ test/clang-tidy/modernize-loop-convert-extra.cpp
@@ -702,21 +702,15 @@
 printf("Value: %d\n", CONT arr[i]);
   }
 
-  // FIXME: Right now, clang-tidy does not allow to make insertions in several
-  // arguments of the same macro call. The following code:
-  // \code
-  //   for (int i = 0; i < N; ++i) {
-  //TWO_PARAM(arr[i], arr[i]);
-  //THREE_PARAM(arr[i], arr[i], arr[i]);
-  //   }
-  // \endcode
-  // Should be converted to this:
-  // \code
-  //   for (auto & elem : arr) {
-  //TWO_PARAM(elem, elem);
-  //THREE_PARAM(elem, elem, elem);
-  //   }
-  // \endcode
+  // Multiple arguments.
+  for (int i = 0; i < N; ++i) {
+TWO_PARAM(arr[i], arr[i]);
+THREE_PARAM(arr[i], arr[i], arr[i]);
+  }
+  // CHECK-MESSAGES: :[[@LINE-4]]:3: warning: use range-based for loop instead
+  // CHECK-FIXES: for (auto & elem : arr)
+  // CHECK-FIXES-NEXT: TWO_PARAM(elem, elem);
+  // CHECK-FIXES-NEXT: THREE_PARAM(elem, elem, elem);
 }
 
 } // namespace Macros
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D12904: fix for assertion fail for pragma weak on typedef

2015-09-17 Thread Alexander Musman via cfe-commits
amusman updated this revision to Diff 34987.
amusman added a comment.

Hi Aaron,

Thank you for review. I've updated the warning for such cases.

Regards,
Alexander


http://reviews.llvm.org/D12904

Files:
  lib/Sema/Sema.cpp
  lib/Sema/SemaDecl.cpp
  test/CodeGen/pragma-weak.c

Index: lib/Sema/Sema.cpp
===
--- lib/Sema/Sema.cpp
+++ lib/Sema/Sema.cpp
@@ -721,8 +721,15 @@
 if (WeakID.second.getUsed())
   continue;
 
-Diag(WeakID.second.getLocation(), diag::warn_weak_identifier_undeclared)
-<< WeakID.first;
+Decl *PrevDecl = LookupSingleName(TUScope, WeakID.first, SourceLocation(),
+  LookupOrdinaryName);
+if (PrevDecl != nullptr &&
+!(isa(PrevDecl) || isa(PrevDecl)))
+  Diag(WeakID.second.getLocation(), diag::warn_attribute_wrong_decl_type)
+  << "weak" << ExpectedVariableOrFunction;
+else
+  Diag(WeakID.second.getLocation(), diag::warn_weak_identifier_undeclared)
+  << WeakID.first;
   }
 
   if (LangOpts.CPlusPlus11 &&
Index: lib/Sema/SemaDecl.cpp
===
--- lib/Sema/SemaDecl.cpp
+++ lib/Sema/SemaDecl.cpp
@@ -14530,7 +14530,7 @@
 LookupOrdinaryName);
   WeakInfo W = WeakInfo(Name, NameLoc);
 
-  if (PrevDecl) {
+  if (PrevDecl && (isa(PrevDecl) || isa(PrevDecl))) {
 if (!PrevDecl->hasAttr())
   if (NamedDecl *ND = dyn_cast(PrevDecl))
 DeclApplyPragmaWeak(TUScope, ND, W);
Index: test/CodeGen/pragma-weak.c
===
--- test/CodeGen/pragma-weak.c
+++ test/CodeGen/pragma-weak.c
@@ -53,12 +53,14 @@
 #pragma weak unused // expected-warning {{weak identifier 'unused' never 
declared}}
 #pragma weak unused_alias = __unused_alias  // expected-warning {{weak 
identifier '__unused_alias' never declared}}
 
-#pragma weak td // expected-warning {{weak identifier 'td' never declared}}
+#pragma weak td // expected-warning {{weak attribute only applies to variables 
and functions}}
 typedef int td;
 
-#pragma weak td2 = __td2 // expected-warning {{weak identifier '__td2' never 
declared}}
+#pragma weak td2 = __td2 // expected-warning {{weak attribute only applies to 
variables and functions}}
 typedef int __td2;
 
+typedef int __td3;
+#pragma weak td3 = __td3 // expected-warning {{weak attribute only applies to 
variables and functions}}
 
 / test weird cases
 


Index: lib/Sema/Sema.cpp
===
--- lib/Sema/Sema.cpp
+++ lib/Sema/Sema.cpp
@@ -721,8 +721,15 @@
 if (WeakID.second.getUsed())
   continue;
 
-Diag(WeakID.second.getLocation(), diag::warn_weak_identifier_undeclared)
-<< WeakID.first;
+Decl *PrevDecl = LookupSingleName(TUScope, WeakID.first, SourceLocation(),
+  LookupOrdinaryName);
+if (PrevDecl != nullptr &&
+!(isa(PrevDecl) || isa(PrevDecl)))
+  Diag(WeakID.second.getLocation(), diag::warn_attribute_wrong_decl_type)
+  << "weak" << ExpectedVariableOrFunction;
+else
+  Diag(WeakID.second.getLocation(), diag::warn_weak_identifier_undeclared)
+  << WeakID.first;
   }
 
   if (LangOpts.CPlusPlus11 &&
Index: lib/Sema/SemaDecl.cpp
===
--- lib/Sema/SemaDecl.cpp
+++ lib/Sema/SemaDecl.cpp
@@ -14530,7 +14530,7 @@
 LookupOrdinaryName);
   WeakInfo W = WeakInfo(Name, NameLoc);
 
-  if (PrevDecl) {
+  if (PrevDecl && (isa(PrevDecl) || isa(PrevDecl))) {
 if (!PrevDecl->hasAttr())
   if (NamedDecl *ND = dyn_cast(PrevDecl))
 DeclApplyPragmaWeak(TUScope, ND, W);
Index: test/CodeGen/pragma-weak.c
===
--- test/CodeGen/pragma-weak.c
+++ test/CodeGen/pragma-weak.c
@@ -53,12 +53,14 @@
 #pragma weak unused // expected-warning {{weak identifier 'unused' never declared}}
 #pragma weak unused_alias = __unused_alias  // expected-warning {{weak identifier '__unused_alias' never declared}}
 
-#pragma weak td // expected-warning {{weak identifier 'td' never declared}}
+#pragma weak td // expected-warning {{weak attribute only applies to variables and functions}}
 typedef int td;
 
-#pragma weak td2 = __td2 // expected-warning {{weak identifier '__td2' never declared}}
+#pragma weak td2 = __td2 // expected-warning {{weak attribute only applies to variables and functions}}
 typedef int __td2;
 
+typedef int __td3;
+#pragma weak td3 = __td3 // expected-warning {{weak attribute only applies to variables and functions}}
 
 / test weird cases
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D12933: Add a test to modernize-loop-convert.

2015-09-17 Thread Alexander Kornienko via cfe-commits
alexfh accepted this revision.
alexfh added a comment.
This revision is now accepted and ready to land.

LG with a comment.



Comment at: test/clang-tidy/modernize-loop-convert-extra.cpp:705
@@ -704,16 +704,3 @@
 
-  // FIXME: Right now, clang-tidy does not allow to make insertions in several
-  // arguments of the same macro call. The following code:
-  // \code
-  //   for (int i = 0; i < N; ++i) {
-  //TWO_PARAM(arr[i], arr[i]);
-  //THREE_PARAM(arr[i], arr[i], arr[i]);
-  //   }
-  // \endcode
-  // Should be converted to this:
-  // \code
-  //   for (auto & elem : arr) {
-  //TWO_PARAM(elem, elem);
-  //THREE_PARAM(elem, elem, elem);
-  //   }
-  // \endcode
+  // Multiple arguments.
+  for (int i = 0; i < N; ++i) {

"Multiple macro arguments." would be clearer.


http://reviews.llvm.org/D12933



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


Re: [PATCH] D12933: Add a test to modernize-loop-convert.

2015-09-17 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 34993.
angelgarcia added a comment.

Done.


http://reviews.llvm.org/D12933

Files:
  test/clang-tidy/modernize-loop-convert-extra.cpp

Index: test/clang-tidy/modernize-loop-convert-extra.cpp
===
--- test/clang-tidy/modernize-loop-convert-extra.cpp
+++ test/clang-tidy/modernize-loop-convert-extra.cpp
@@ -702,21 +702,15 @@
 printf("Value: %d\n", CONT arr[i]);
   }
 
-  // FIXME: Right now, clang-tidy does not allow to make insertions in several
-  // arguments of the same macro call. The following code:
-  // \code
-  //   for (int i = 0; i < N; ++i) {
-  //TWO_PARAM(arr[i], arr[i]);
-  //THREE_PARAM(arr[i], arr[i], arr[i]);
-  //   }
-  // \endcode
-  // Should be converted to this:
-  // \code
-  //   for (auto & elem : arr) {
-  //TWO_PARAM(elem, elem);
-  //THREE_PARAM(elem, elem, elem);
-  //   }
-  // \endcode
+  // Multiple macro arguments.
+  for (int i = 0; i < N; ++i) {
+TWO_PARAM(arr[i], arr[i]);
+THREE_PARAM(arr[i], arr[i], arr[i]);
+  }
+  // CHECK-MESSAGES: :[[@LINE-4]]:3: warning: use range-based for loop instead
+  // CHECK-FIXES: for (auto & elem : arr)
+  // CHECK-FIXES-NEXT: TWO_PARAM(elem, elem);
+  // CHECK-FIXES-NEXT: THREE_PARAM(elem, elem, elem);
 }
 
 } // namespace Macros


Index: test/clang-tidy/modernize-loop-convert-extra.cpp
===
--- test/clang-tidy/modernize-loop-convert-extra.cpp
+++ test/clang-tidy/modernize-loop-convert-extra.cpp
@@ -702,21 +702,15 @@
 printf("Value: %d\n", CONT arr[i]);
   }
 
-  // FIXME: Right now, clang-tidy does not allow to make insertions in several
-  // arguments of the same macro call. The following code:
-  // \code
-  //   for (int i = 0; i < N; ++i) {
-  //TWO_PARAM(arr[i], arr[i]);
-  //THREE_PARAM(arr[i], arr[i], arr[i]);
-  //   }
-  // \endcode
-  // Should be converted to this:
-  // \code
-  //   for (auto & elem : arr) {
-  //TWO_PARAM(elem, elem);
-  //THREE_PARAM(elem, elem, elem);
-  //   }
-  // \endcode
+  // Multiple macro arguments.
+  for (int i = 0; i < N; ++i) {
+TWO_PARAM(arr[i], arr[i]);
+THREE_PARAM(arr[i], arr[i], arr[i]);
+  }
+  // CHECK-MESSAGES: :[[@LINE-4]]:3: warning: use range-based for loop instead
+  // CHECK-FIXES: for (auto & elem : arr)
+  // CHECK-FIXES-NEXT: TWO_PARAM(elem, elem);
+  // CHECK-FIXES-NEXT: THREE_PARAM(elem, elem, elem);
 }
 
 } // namespace Macros
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] r247889 - Add a test to modernize-loop-convert.

2015-09-17 Thread Angel Garcia Gomez via cfe-commits
Author: angelgarcia
Date: Thu Sep 17 09:25:39 2015
New Revision: 247889

URL: http://llvm.org/viewvc/llvm-project?rev=247889&view=rev
Log:
Add a test to modernize-loop-convert.

Summary: Add the test about replacements in several arguments of the same macro 
call, now that the problem has been fixed.

Reviewers: alexfh

Subscribers: cfe-commits, klimek

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

Modified:
clang-tools-extra/trunk/test/clang-tidy/modernize-loop-convert-extra.cpp

Modified: 
clang-tools-extra/trunk/test/clang-tidy/modernize-loop-convert-extra.cpp
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/modernize-loop-convert-extra.cpp?rev=247889&r1=247888&r2=247889&view=diff
==
--- clang-tools-extra/trunk/test/clang-tidy/modernize-loop-convert-extra.cpp 
(original)
+++ clang-tools-extra/trunk/test/clang-tidy/modernize-loop-convert-extra.cpp 
Thu Sep 17 09:25:39 2015
@@ -702,21 +702,15 @@ void messing_with_macros() {
 printf("Value: %d\n", CONT arr[i]);
   }
 
-  // FIXME: Right now, clang-tidy does not allow to make insertions in several
-  // arguments of the same macro call. The following code:
-  // \code
-  //   for (int i = 0; i < N; ++i) {
-  //TWO_PARAM(arr[i], arr[i]);
-  //THREE_PARAM(arr[i], arr[i], arr[i]);
-  //   }
-  // \endcode
-  // Should be converted to this:
-  // \code
-  //   for (auto & elem : arr) {
-  //TWO_PARAM(elem, elem);
-  //THREE_PARAM(elem, elem, elem);
-  //   }
-  // \endcode
+  // Multiple macro arguments.
+  for (int i = 0; i < N; ++i) {
+TWO_PARAM(arr[i], arr[i]);
+THREE_PARAM(arr[i], arr[i], arr[i]);
+  }
+  // CHECK-MESSAGES: :[[@LINE-4]]:3: warning: use range-based for loop instead
+  // CHECK-FIXES: for (auto & elem : arr)
+  // CHECK-FIXES-NEXT: TWO_PARAM(elem, elem);
+  // CHECK-FIXES-NEXT: THREE_PARAM(elem, elem, elem);
 }
 
 } // namespace Macros


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


Re: [PATCH] D12917: [CUDA] Allow parsing of host and device code simultaneously.

2015-09-17 Thread Jacques Pienaar via cfe-commits
jpienaar added a comment.

Nice, so this will allow parsing/AST construction with builtins from 2 
architectures but will fail to compile if a builtin for the host/device is 
called from device/host.

You mention this is not generally possible. Can you give some examples?



Comment at: include/clang/Driver/CC1Options.td:329
@@ -328,1 +328,3 @@
+def aux_triple : Separate<["-"], "aux-triple">,
+  HelpText<"Auxiliary triple.">;
 def code_completion_at : Separate<["-"], "code-completion-at">,

You use aux target in all the errors to the user so perhaps for consistency 
"Triple for aux target". It could be more self-documenting too ("Triple for aux 
target used during CUDA compilation."?) as I don't know if a lot of people 
would be able to guess what the auxiliary triple is or where it is used.


Comment at: include/clang/Frontend/CompilerInstance.h:355
@@ -350,3 +354,3 @@
 
-  /// Replace the current diagnostics engine.
+  /// Replace the current Target
   void setTarget(TargetInfo *Value);

Nit: period at the end for uniformity.


http://reviews.llvm.org/D12917



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


[clang-tools-extra] r247890 - [clang-tidy] install helper scripts

2015-09-17 Thread Alexander Kornienko via cfe-commits
Author: alexfh
Date: Thu Sep 17 09:37:26 2015
New Revision: 247890

URL: http://llvm.org/viewvc/llvm-project?rev=247890&view=rev
Log:
[clang-tidy] install helper scripts

Scripts are installed in same location as clang-fromat ones, so I think will be 
good idea to not create dedicated directory.

I checked this patch on my own build on RHEL 6.

Please check it in if it's OK, because I don't have SVN write access.

I think will be good idea to backport this patch to 3.7 release branch.

Probably same should be done for configure build.

Patch by Eugene Zelenko!

Differential revision: http://reviews.llvm.org/D12700


Modified:
clang-tools-extra/trunk/clang-tidy/tool/CMakeLists.txt
clang-tools-extra/trunk/clang-tidy/tool/Makefile

Modified: clang-tools-extra/trunk/clang-tidy/tool/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/tool/CMakeLists.txt?rev=247890&r1=247889&r2=247890&view=diff
==
--- clang-tools-extra/trunk/clang-tidy/tool/CMakeLists.txt (original)
+++ clang-tools-extra/trunk/clang-tidy/tool/CMakeLists.txt Thu Sep 17 09:37:26 
2015
@@ -21,3 +21,5 @@ target_link_libraries(clang-tidy
 install(TARGETS clang-tidy
   RUNTIME DESTINATION bin)
 
+install(PROGRAMS clang-tidy-diff.py DESTINATION share/clang)
+install(PROGRAMS run-clang-tidy.py DESTINATION share/clang)

Modified: clang-tools-extra/trunk/clang-tidy/tool/Makefile
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/tool/Makefile?rev=247890&r1=247889&r2=247890&view=diff
==
--- clang-tools-extra/trunk/clang-tidy/tool/Makefile (original)
+++ clang-tools-extra/trunk/clang-tidy/tool/Makefile Thu Sep 17 09:37:26 2015
@@ -26,3 +26,22 @@ USEDLIBS = clangTidy.a clangTidyLLVMModu
   clangEdit.a clangAST.a clangLex.a clangBasic.a
 
 include $(CLANG_LEVEL)/Makefile
+
+PROJ_sharedir := $(DESTDIR)$(PROJ_prefix)/share/clang
+
+FILESLIST := $(notdir $(wildcard $(PROJ_SRC_DIR)/*.py))
+
+SRCFILES := $(addprefix $(PROJ_SRC_DIR)/, $(FILESLIST))
+DESTFILES := $(addprefix $(PROJ_sharedir)/, $(FILESLIST))
+
+$(PROJ_sharedir):
+   $(Echo) Making install directory: $@
+   $(Verb) $(MKDIR) $@
+
+$(DESTFILES): $(SRCFILES)
+
+$(PROJ_sharedir)/%.py: $(PROJ_SRC_DIR)/%.py
+   $(Echo) Installing script file: $(notdir $<)
+   $(Verb) $(ScriptInstall) $< $(PROJ_sharedir)
+
+install-local:: $(PROJ_sharedir) $(DESTFILES)


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


Re: [PATCH] D12700: [clang-tidy] install helper scripts in CMake build

2015-09-17 Thread Alexander Kornienko via cfe-commits
alexfh added a comment.

LG. Thanks!


Repository:
  rL LLVM

http://reviews.llvm.org/D12700



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


Re: [PATCH] D12700: [clang-tidy] install helper scripts in CMake build

2015-09-17 Thread Alexander Kornienko via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL247890: [clang-tidy] install helper scripts (authored by 
alexfh).

Changed prior to commit:
  http://reviews.llvm.org/D12700?vs=34953&id=34997#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D12700

Files:
  clang-tools-extra/trunk/clang-tidy/tool/CMakeLists.txt
  clang-tools-extra/trunk/clang-tidy/tool/Makefile

Index: clang-tools-extra/trunk/clang-tidy/tool/Makefile
===
--- clang-tools-extra/trunk/clang-tidy/tool/Makefile
+++ clang-tools-extra/trunk/clang-tidy/tool/Makefile
@@ -26,3 +26,22 @@
   clangEdit.a clangAST.a clangLex.a clangBasic.a
 
 include $(CLANG_LEVEL)/Makefile
+
+PROJ_sharedir := $(DESTDIR)$(PROJ_prefix)/share/clang
+
+FILESLIST := $(notdir $(wildcard $(PROJ_SRC_DIR)/*.py))
+
+SRCFILES := $(addprefix $(PROJ_SRC_DIR)/, $(FILESLIST))
+DESTFILES := $(addprefix $(PROJ_sharedir)/, $(FILESLIST))
+
+$(PROJ_sharedir):
+   $(Echo) Making install directory: $@
+   $(Verb) $(MKDIR) $@
+
+$(DESTFILES): $(SRCFILES)
+
+$(PROJ_sharedir)/%.py: $(PROJ_SRC_DIR)/%.py
+   $(Echo) Installing script file: $(notdir $<)
+   $(Verb) $(ScriptInstall) $< $(PROJ_sharedir)
+
+install-local:: $(PROJ_sharedir) $(DESTFILES)
Index: clang-tools-extra/trunk/clang-tidy/tool/CMakeLists.txt
===
--- clang-tools-extra/trunk/clang-tidy/tool/CMakeLists.txt
+++ clang-tools-extra/trunk/clang-tidy/tool/CMakeLists.txt
@@ -21,3 +21,5 @@
 install(TARGETS clang-tidy
   RUNTIME DESTINATION bin)
 
+install(PROGRAMS clang-tidy-diff.py DESTINATION share/clang)
+install(PROGRAMS run-clang-tidy.py DESTINATION share/clang)


Index: clang-tools-extra/trunk/clang-tidy/tool/Makefile
===
--- clang-tools-extra/trunk/clang-tidy/tool/Makefile
+++ clang-tools-extra/trunk/clang-tidy/tool/Makefile
@@ -26,3 +26,22 @@
 	   clangEdit.a clangAST.a clangLex.a clangBasic.a
 
 include $(CLANG_LEVEL)/Makefile
+
+PROJ_sharedir := $(DESTDIR)$(PROJ_prefix)/share/clang
+
+FILESLIST := $(notdir $(wildcard $(PROJ_SRC_DIR)/*.py))
+
+SRCFILES := $(addprefix $(PROJ_SRC_DIR)/, $(FILESLIST))
+DESTFILES := $(addprefix $(PROJ_sharedir)/, $(FILESLIST))
+
+$(PROJ_sharedir):
+	$(Echo) Making install directory: $@
+	$(Verb) $(MKDIR) $@
+
+$(DESTFILES): $(SRCFILES)
+
+$(PROJ_sharedir)/%.py: $(PROJ_SRC_DIR)/%.py
+	$(Echo) Installing script file: $(notdir $<)
+	$(Verb) $(ScriptInstall) $< $(PROJ_sharedir)
+
+install-local:: $(PROJ_sharedir) $(DESTFILES)
Index: clang-tools-extra/trunk/clang-tidy/tool/CMakeLists.txt
===
--- clang-tools-extra/trunk/clang-tidy/tool/CMakeLists.txt
+++ clang-tools-extra/trunk/clang-tidy/tool/CMakeLists.txt
@@ -21,3 +21,5 @@
 install(TARGETS clang-tidy
   RUNTIME DESTINATION bin)
 
+install(PROGRAMS clang-tidy-diff.py DESTINATION share/clang)
+install(PROGRAMS run-clang-tidy.py DESTINATION share/clang)
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D12904: fix for assertion fail for pragma weak on typedef

2015-09-17 Thread Aaron Ballman via cfe-commits
aaron.ballman accepted this revision.
aaron.ballman added a reviewer: aaron.ballman.
aaron.ballman added a comment.
This revision is now accepted and ready to land.

LGTM with one minor nit.



Comment at: lib/Sema/Sema.cpp:729
@@ +728,3 @@
+  Diag(WeakID.second.getLocation(), diag::warn_attribute_wrong_decl_type)
+  << "weak" << ExpectedVariableOrFunction;
+else

Should be "'weak'" instead of "weak" so that the diagnostic is properly quoted 
for the user.


http://reviews.llvm.org/D12904



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


r247892 - re-apply r.247881

2015-09-17 Thread Asaf Badouh via cfe-commits
Author: abadouh
Date: Thu Sep 17 09:53:37 2015
New Revision: 247892

URL: http://llvm.org/viewvc/llvm-project?rev=247892&view=rev
Log:
re-apply r.247881
fixed the tests.

Modified:
cfe/trunk/include/clang/Basic/BuiltinsX86.def
cfe/trunk/lib/Headers/avx512dqintrin.h
cfe/trunk/test/CodeGen/avx512dq-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=247892&r1=247891&r2=247892&view=diff
==
--- cfe/trunk/include/clang/Basic/BuiltinsX86.def (original)
+++ cfe/trunk/include/clang/Basic/BuiltinsX86.def Thu Sep 17 09:53:37 2015
@@ -1469,7 +1469,6 @@ TARGET_BUILTIN(__builtin_ia32_vpermt2var
 TARGET_BUILTIN(__builtin_ia32_vpermt2varq128_maskz, "V2LLiV2LLiV2LLiV2LLiUc", 
"", "avx512vl")
 TARGET_BUILTIN(__builtin_ia32_vpermt2varq256_mask, "V4LLiV4LLiV4LLiV4LLiUc", 
"", "avx512vl")
 TARGET_BUILTIN(__builtin_ia32_vpermt2varq256_maskz, "V4LLiV4LLiV4LLiV4LLiUc", 
"", "avx512vl")
-
 TARGET_BUILTIN(__builtin_ia32_pmovswb512_mask, "V32cV32sV32cUi", "", 
"avx512bw")
 TARGET_BUILTIN(__builtin_ia32_pmovuswb512_mask, "V32cV32sV32cUi", "", 
"avx512bw")
 TARGET_BUILTIN(__builtin_ia32_pmovwb512_mask, "V32cV32sV32cUi", "", "avx512bw")
@@ -1477,7 +1476,6 @@ TARGET_BUILTIN(__builtin_ia32_punpckhbw5
 TARGET_BUILTIN(__builtin_ia32_punpckhwd512_mask, "V32sV32sV32sV32sUi", "", 
"avx512bw")
 TARGET_BUILTIN(__builtin_ia32_punpcklbw512_mask, "V64cV64cV64cV64cULLi", "", 
"avx512bw")
 TARGET_BUILTIN(__builtin_ia32_punpcklwd512_mask, "V32sV32sV32sV32sUi", "", 
"avx512bw")
-
 TARGET_BUILTIN(__builtin_ia32_cvtpd2qq128_mask, "V2LLiV2dV2LLiUc", "", 
"avx512vl,avx512dq")
 TARGET_BUILTIN(__builtin_ia32_cvtpd2qq256_mask, "V4LLiV4dV4LLiUc", "", 
"avx512vl,avx512dq")
 TARGET_BUILTIN(__builtin_ia32_cvtpd2uqq128_mask, "V2LLiV2dV2LLiUc", "", 
"avx512vl,avx512dq")
@@ -1510,7 +1508,6 @@ TARGET_BUILTIN(__builtin_ia32_reducepd12
 TARGET_BUILTIN(__builtin_ia32_reducepd256_mask, "V4dV4dIiV4dUc", "", 
"avx512vl,avx512dq")
 TARGET_BUILTIN(__builtin_ia32_reduceps128_mask, "V4fV4fIiV4fUc", "", 
"avx512vl,avx512dq")
 TARGET_BUILTIN(__builtin_ia32_reduceps256_mask, "V8fV8fIiV8fUc", "", 
"avx512vl,avx512dq")
-
 TARGET_BUILTIN(__builtin_ia32_pmaddubsw128_mask, "V8sV16cV16cV8sUc", "", 
"avx512vl,avx512bw")
 TARGET_BUILTIN(__builtin_ia32_pmaddubsw256_mask, "V16sV32cV32cV16sUs", "", 
"avx512vl,avx512bw")
 TARGET_BUILTIN(__builtin_ia32_pmaddwd128_mask, "V4iV8sV8sV4iUc", "", 
"avx512vl,avx512bw")
@@ -1535,6 +1532,22 @@ TARGET_BUILTIN(__builtin_ia32_punpcklbw1
 TARGET_BUILTIN(__builtin_ia32_punpcklbw256_mask, "V32cV32cV32cV32cUi", "", 
"avx512vl,avx512bw")
 TARGET_BUILTIN(__builtin_ia32_punpcklwd128_mask, "V8sV8sV8sV8sUc", "", 
"avx512vl,avx512bw")
 TARGET_BUILTIN(__builtin_ia32_punpcklwd256_mask, "V16sV16sV16sV16sUs", "", 
"avx512vl,avx512bw")
+BUILTIN(__builtin_ia32_cvtpd2qq512_mask, "V8LLiV8dV8LLiUcIi", "")
+BUILTIN(__builtin_ia32_cvtpd2uqq512_mask, "V8LLiV8dV8LLiUcIi", "")
+BUILTIN(__builtin_ia32_cvtps2qq512_mask, "V8LLiV8fV8LLiUcIi", "")
+BUILTIN(__builtin_ia32_cvtps2uqq512_mask, "V8LLiV8fV8LLiUcIi", "")
+BUILTIN(__builtin_ia32_cvtqq2pd512_mask, "V8dV8LLiV8dUcIi", "")
+BUILTIN(__builtin_ia32_cvtqq2ps512_mask, "V8fV8LLiV8fUcIi", "")
+BUILTIN(__builtin_ia32_cvttpd2qq512_mask, "V8LLiV8dV8LLiUcIi", "")
+BUILTIN(__builtin_ia32_cvttpd2uqq512_mask, "V8LLiV8dV8LLiUcIi", "")
+BUILTIN(__builtin_ia32_cvttps2qq512_mask, "V8LLiV8fV8LLiUcIi", "")
+BUILTIN(__builtin_ia32_cvttps2uqq512_mask, "V8LLiV8fV8LLiUcIi", "")
+BUILTIN(__builtin_ia32_cvtuqq2pd512_mask, "V8dV8LLiV8dUcIi", "")
+BUILTIN(__builtin_ia32_cvtuqq2ps512_mask, "V8fV8LLiV8fUcIi", "")
+BUILTIN(__builtin_ia32_rangepd512_mask, "V8dV8dV8dIiV8dUcIi", "")
+BUILTIN(__builtin_ia32_rangeps512_mask, "V16fV16fV16fIiV16fUsIi", "")
+BUILTIN(__builtin_ia32_reducepd512_mask, "V8dV8dIiV8dUcIi", "")
+BUILTIN(__builtin_ia32_reduceps512_mask, "V16fV16fIiV16fUsIi", "")
 
 #undef BUILTIN
 #undef TARGET_BUILTIN

Modified: cfe/trunk/lib/Headers/avx512dqintrin.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx512dqintrin.h?rev=247892&r1=247891&r2=247892&view=diff
==
--- cfe/trunk/lib/Headers/avx512dqintrin.h (original)
+++ cfe/trunk/lib/Headers/avx512dqintrin.h Thu Sep 17 09:53:37 2015
@@ -237,6 +237,542 @@ _mm512_maskz_andnot_ps (__mmask16 __U, _
  (__mmask16) __U);
 }
 
+static __inline__ __m512i __DEFAULT_FN_ATTRS
+_mm512_cvtpd_epi64 (__m512d __A) {
+  return (__m512i) __builtin_ia32_cvtpd2qq512_mask ((__v8df) __A,
+(__v8di) _mm512_setzero_si512(),
+(__mmask8) -1,
+_MM_FROUND_CUR_DIRECTION);
+}
+
+static __inline__ __m512i __DEFAULT_FN_ATTRS
+_mm512_mask_cvtpd_epi64 (__m512i __W, __mmask8 __U, __m512d __A) {
+  return (__m512i) __builtin_ia32_cvtpd2qq512_mask ((__v8df) __A,
+(__v8di) _

Re: [PATCH] D12541: [Sparc][Shave]: Empower the toolchain formerly known as SHAVE to do more.

2015-09-17 Thread Douglas Katzman via cfe-commits
dougk updated this revision to Diff 34998.
dougk marked 3 inline comments as done.
dougk added a comment.

Use the same logic as Solaris::Solaris to die in the toolchain constructor if 
getArch() is unexpected.
Also don't hardcode -EL in linker.


http://reviews.llvm.org/D12541

Files:
  lib/Driver/Driver.cpp
  lib/Driver/ToolChains.cpp
  lib/Driver/ToolChains.h
  lib/Driver/Tools.cpp
  lib/Driver/Tools.h
  test/Driver/Inputs/basic_myriad_tree/lib/gcc/sparc-myriad-elf/4.8.2/crtbegin.o
  test/Driver/shave-toolchain.c

Index: test/Driver/shave-toolchain.c
===
--- test/Driver/shave-toolchain.c
+++ test/Driver/shave-toolchain.c
@@ -1,3 +1,9 @@
+// RUN: %clang -no-canonical-prefixes -### -target sparc-myriad-rtems-elf %s \
+// RUN: -B %S/Inputs/basic_myriad_tree 2>&1 | FileCheck %s -check-prefix=LINK_WITH_RTEMS
+// LINK_WITH_RTEMS: crti.o
+// LINK_WITH_RTEMS: crtbegin.o
+// LINK_WITH_RTEMS: -lrtems
+
 // Ensure that '-target shave' picks a different compiler.
 // Also check that '-I' is turned into '-i:' for the assembler.
 
@@ -8,26 +14,26 @@
 // As such, we test only for a trailing quote in its rendering.
 // The same goes for "moviAsm".
 
-// RUN: %clang -target shave -c -### %s -isystem somewhere -Icommon -Wa,-yippee 2>&1 \
+// RUN: %clang -target shave-myriad -c -### %s -isystem somewhere -Icommon -Wa,-yippee 2>&1 \
 // RUN:   | FileCheck %s -check-prefix=MOVICOMPILE
 // MOVICOMPILE: moviCompile" "-DMYRIAD2" "-mcpu=myriad2" "-S" "-isystem" "somewhere" "-I" "common"
 // MOVICOMPILE: moviAsm" "-no6thSlotCompression" "-cv:myriad2" "-noSPrefixing" "-a"
 // MOVICOMPILE: "-yippee" "-i:somewhere" "-i:common" "-elf"
 
-// RUN: %clang -target shave -c -### %s -DEFINE_ME -UNDEFINE_ME 2>&1 \
+// RUN: %clang -target shave-myriad -c -### %s -DEFINE_ME -UNDEFINE_ME 2>&1 \
 // RUN:   | FileCheck %s -check-prefix=DEFINES
 // DEFINES: "-D" "EFINE_ME" "-U" "NDEFINE_ME"
 
-// RUN: %clang -target shave -c -### %s -Icommon -iquote quotepath -isystem syspath 2>&1 \
+// RUN: %clang -target shave-myriad -c -### %s -Icommon -iquote quotepath -isystem syspath 2>&1 \
 // RUN:   | FileCheck %s -check-prefix=INCLUDES
 // INCLUDES: "-iquote" "quotepath" "-isystem" "syspath"
 
-// RUN: %clang -target shave -c -### %s -g -fno-inline-functions \
+// RUN: %clang -target shave-myriad -c -### %s -g -fno-inline-functions \
 // RUN: -fno-inline-functions-called-once -Os -Wall -MF dep.d \
 // RUN: -ffunction-sections 2>&1 | FileCheck %s -check-prefix=PASSTHRU_OPTIONS
 // PASSTHRU_OPTIONS: "-g" "-fno-inline-functions" "-fno-inline-functions-called-once"
 // PASSTHRU_OPTIONS: "-Os" "-Wall" "-MF" "dep.d" "-ffunction-sections"
 
-// RUN: %clang -target shave -c %s -o foo.o -### -MD -MF dep.d 2>&1 \
+// RUN: %clang -target shave-myriad -c %s -o foo.o -### -MD -MF dep.d 2>&1 \
 // RUN:   | FileCheck %s -check-prefix=MDMF
 // MDMF: "-S" "-MD" "-MF" "dep.d" "-MT" "foo.o"
Index: lib/Driver/Tools.h
===
--- lib/Driver/Tools.h
+++ lib/Driver/Tools.h
@@ -794,6 +794,23 @@
 };
 } // end namespace SHAVE
 
+/// The Myriad toolchain uses tools that are in two different namespaces.
+/// The Compiler and Assembler as defined above are in the SHAVE namespace,
+/// whereas the linker, which accepts code for a mixture of Sparc and SHAVE,
+/// is in the Myriad namespace.
+namespace Myriad {
+class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool {
+public:
+  Linker(const ToolChain &TC) : GnuTool("shave::Linker", "ld", TC) {}
+  bool hasIntegratedCPP() const override { return false; }
+  bool isLinkJob() const override { return true; }
+  void ConstructJob(Compilation &C, const JobAction &JA,
+const InputInfo &Output, const InputInfoList &Inputs,
+const llvm::opt::ArgList &TCArgs,
+const char *LinkingOutput) const override;
+};
+} // end namespace Myriad
+
 } // end namespace tools
 } // end namespace driver
 } // end namespace clang
Index: lib/Driver/Tools.cpp
===
--- lib/Driver/Tools.cpp
+++ lib/Driver/Tools.cpp
@@ -9735,3 +9735,81 @@
   C.addCommand(llvm::make_unique(JA, *this, Args.MakeArgString(Exec),
   CmdArgs, Inputs));
 }
+
+void tools::Myriad::Linker::ConstructJob(Compilation &C, const JobAction &JA,
+ const InputInfo &Output,
+ const InputInfoList &Inputs,
+ const ArgList &Args,
+ const char *LinkingOutput) const {
+  const auto &TC =
+  static_cast(getToolChain());
+  const llvm::Triple &T = TC.getTriple();
+  ArgStringList CmdArgs;
+  bool UseStartfiles = !Args.hasArg(options::OPT_nostartfiles);
+
+  std::string StartFilesDir, BuiltinLibDir;
+  TC.getCompilerSupportDir(StartFilesDir);
+  TC.getBuiltinLibDir(B

Re: [PATCH] D12501: [clang-format] Obj-C dictionary literals: Fixed typecast getting put on a separate line from the key

2015-09-17 Thread Kent Sutherland via cfe-commits
ksuther added a comment.

Adding another comment in hopes of getting some visibility on this. Do I need 
to add other people as reviewers?


http://reviews.llvm.org/D12501



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


Re: [PATCH] D12489: [clang-format] Fixed missing space between Obj-C for/in and a typecast

2015-09-17 Thread Kent Sutherland via cfe-commits
ksuther added a comment.

Adding another comment in hopes of getting some visibility on this. Do I need 
to add other people as reviewers?


http://reviews.llvm.org/D12489



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


[PATCH] D12938: [ARM] Handle +t2dsp feature as an ArchExtKind in ARMTargetParser.def

2015-09-17 Thread A. Skrobov via cfe-commits
tyomitch created this revision.
tyomitch added reviewers: labrinea, rengolin.
tyomitch added a subscriber: cfe-commits.
Herald added subscribers: rengolin, aemerson.

Currently, the availability of DSP instructions (ACLE 6.4.7) is handled in a 
hand-rolled tricky condition block in lib/Basic/Targets.cpp, with a FIXME: 
attached.

http://reviews.llvm.org/D12937 moves the handling of +t2dsp over to 
ARMTargetParser.def in LLVM, to be in line with other architecture extensions.

This is the corresponding patch to clang, to clear the FIXME: and update the 
tests.

http://reviews.llvm.org/D12938

Files:
  lib/Basic/Targets.cpp
  test/CodeGen/arm-target-features.c

Index: test/CodeGen/arm-target-features.c
===
--- test/CodeGen/arm-target-features.c
+++ test/CodeGen/arm-target-features.c
@@ -1,56 +1,58 @@
 // REQUIRES: arm-registered-target
 
 // RUN: %clang_cc1 -triple thumbv7-linux-gnueabihf -target-cpu cortex-a8 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-VFP3
-// CHECK-VFP3: "target-features"="+neon,+vfp3"
+// CHECK-VFP3: "target-features"="+neon,+t2dsp,+vfp3"
 
 
 // RUN: %clang_cc1 -triple thumbv7-linux-gnueabi -target-cpu cortex-a9 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-VFP3-FP16
-// CHECK-VFP3-FP16: "target-features"="+fp16,+neon,+vfp3"
+// CHECK-VFP3-FP16: "target-features"="+fp16,+neon,+t2dsp,+vfp3"
 
 
 // RUN: %clang_cc1 -triple thumbv7-linux-gnueabihf -target-cpu cortex-a5 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-VFP4
-// CHECK-VFP4: "target-features"="+neon,+vfp4"
+// CHECK-VFP4: "target-features"="+neon,+t2dsp,+vfp4"
 
 
 // RUN: %clang_cc1 -triple thumbv7-linux-gnueabihf -target-cpu cortex-a7 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-VFP4-DIV
 // RUN: %clang_cc1 -triple thumbv7-linux-gnueabi -target-cpu cortex-a12 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-VFP4-DIV
 // RUN: %clang_cc1 -triple armv7-linux-gnueabihf -target-cpu cortex-a15 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-VFP4-DIV
 // RUN: %clang_cc1 -triple armv7-linux-gnueabihf -target-cpu cortex-a17 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-VFP4-DIV
 // RUN: %clang_cc1 -triple thumbv7s-linux-gnueabi -target-cpu swift -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-VFP4-DIV
 // RUN: %clang_cc1 -triple thumbv7-linux-gnueabihf -target-cpu krait -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-VFP4-DIV
-// CHECK-VFP4-DIV: "target-features"="+hwdiv,+hwdiv-arm,+neon,+vfp4"
+// CHECK-VFP4-DIV: "target-features"="+hwdiv,+hwdiv-arm,+neon,+t2dsp,+vfp4"
 
 
 // RUN: %clang_cc1 -triple thumbv7s-apple-ios7.0 -target-cpu cyclone -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-BASIC-V8
 // RUN: %clang_cc1 -triple armv8-linux-gnueabi -target-cpu cortex-a53 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-BASIC-V8
 // RUN: %clang_cc1 -triple thumbv8-linux-gnueabihf -target-cpu cortex-a57 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-BASIC-V8
 // RUN: %clang_cc1 -triple thumbv8-linux-gnueabihf -target-cpu cortex-a72 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-BASIC-V8
-// CHECK-BASIC-V8: "target-features"="+crc,+crypto,+fp-armv8,+hwdiv,+hwdiv-arm,+neon"
+// CHECK-BASIC-V8: "target-features"="+crc,+crypto,+fp-armv8,+hwdiv,+hwdiv-arm,+neon,+t2dsp"
 
 
 // RUN: %clang_cc1 -triple thumbv7-linux-gnueabi -target-cpu cortex-r5 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-VFP3-D16-DIV
-// CHECK-VFP3-D16-DIV: "target-features"="+d16,+hwdiv,+hwdiv-arm,+vfp3"
+// CHECK-VFP3-D16-DIV: "target-features"="+d16,+hwdiv,+hwdiv-arm,+t2dsp,+vfp3"
 
 
 // RUN: %clang_cc1 -triple armv7-linux-gnueabi -target-cpu cortex-r4f -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-VFP3-D16-THUMB-DIV
-// CHECK-VFP3-D16-THUMB-DIV: "target-features"="+d16,+hwdiv,+vfp3"
+// CHECK-VFP3-D16-THUMB-DIV: "target-features"="+d16,+hwdiv,+t2dsp,+vfp3"
 
 
 // RUN: %clang_cc1 -triple thumbv7-linux-gnueabi -target-cpu cortex-r7 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-VFP3-D16-FP16-DIV
-// CHECK-VFP3-D16-FP16-DIV: "target-features"="+d16,+fp16,+hwdiv,+hwdiv-arm,+vfp3"
+// CHECK-VFP3-D16-FP16-DIV: "target-features"="+d16,+fp16,+hwdiv,+hwdiv-arm,+t2dsp,+vfp3"
 
 
 // RUN: %clang_cc1 -triple thumbv7-linux-gnueabi -target-cpu cortex-m4 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-VFP4-D16-SP-THUMB-DIV
-// CHECK-VFP4-D16-SP-THUMB-DIV: "target-features"="+d16,+fp-only-sp,+hwdiv,+vfp4"
+// CHECK-VFP4-D16-SP-THUMB-DIV: "target-features"="+d16,+fp-only-sp,+hwdiv,+t2dsp,+vfp4"
 
 
 // RUN: %clang_cc1 -triple thumbv7-linux-gnueabi -target-cpu cortex-m7 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-VFP5-D16-THUMB-DIV
-// CHECK-VFP5-D16-THUMB-DIV: "target-features"="+d16,+fp-armv8,+hwdiv"
+// CHECK-VFP5-D16-THUMB-DIV: "target-features"="+d16,+fp-armv8,+hwdiv,+t2dsp"
 
 
 // RUN: %clang_cc1 -triple armv7-linux-gnueabi -target-cpu cortex-r4 -emit-llvm -o - %s | FileCheck

Re: [PATCH] D12903: Allow the -load option in the driver and pass it through to -cc1

2015-09-17 Thread Saleem Abdulrasool via cfe-commits
compnerd added a subscriber: compnerd.
compnerd added a comment.

While I agree that this makes the option much nicer to use, it collides with 
the -l flag.  Since it was an internal only option until this point, we should 
rename it before exposing it at the driver level.


Repository:
  rL LLVM

http://reviews.llvm.org/D12903



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


r247895 - Fix a typo.

2015-09-17 Thread Adrian Prantl via cfe-commits
Author: adrian
Date: Thu Sep 17 10:58:54 2015
New Revision: 247895

URL: http://llvm.org/viewvc/llvm-project?rev=247895&view=rev
Log:
Fix a typo.

Modified:
cfe/trunk/docs/Modules.rst

Modified: cfe/trunk/docs/Modules.rst
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/Modules.rst?rev=247895&r1=247894&r2=247895&view=diff
==
--- cfe/trunk/docs/Modules.rst (original)
+++ cfe/trunk/docs/Modules.rst Thu Sep 17 10:58:54 2015
@@ -222,7 +222,7 @@ Modules are modeled as if each submodule
 
   This behavior is currently only approximated when building a module with 
submodules. Entities within a submodule that has already been built are visible 
when building later submodules in that module. This can lead to fragile modules 
that depend on the build order used for the submodules of the module, and 
should not be relied upon. This behavior is subject to change.
 
-As an example, in C, this implies that if two structs are defined in different 
submodules with the same name, those two types are distinct types (but may be 
*compatible* types if their definitions match. In C++, two structs defined with 
the same name in different submodules are the *same* type, and must be 
equivalent under C++'s One Definition Rule.
+As an example, in C, this implies that if two structs are defined in different 
submodules with the same name, those two types are distinct types (but may be 
*compatible* types if their definitions match). In C++, two structs defined 
with the same name in different submodules are the *same* type, and must be 
equivalent under C++'s One Definition Rule.
 
 .. note::
 


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


Re: [PATCH] D12832: [Driver] Add support for Windows 10 SDK

2015-09-17 Thread Reid Kleckner via cfe-commits
rnk accepted this revision.
rnk added a comment.
This revision is now accepted and ready to land.

Looks like I forgot to submit the comments I wrote. Anyway, looks good.



Comment at: cfe/trunk/lib/Driver/MSVCToolChain.cpp:238
@@ +237,3 @@
+  continue;
+const StringRef CandidateName = llvm::sys::path::filename(DirIt->path());
+if (CandidateName > SDKVersion)

We don't usually declare local StringRefs const, even to document that the 
value does not change.


http://reviews.llvm.org/D12832



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


Re: [PATCH] D12903: Allow the -load option in the driver and pass it through to -cc1

2015-09-17 Thread John Brawn via cfe-commits
john.brawn added a comment.

In http://reviews.llvm.org/D12903#247934, @compnerd wrote:

> While I agree that this makes the option much nicer to use, it collides with 
> the -l flag.  Since it was an internal only option until this point, we 
> should rename it before exposing it at the driver level.


Yes, you're right. GCC uses -fplugin=name.so for their plugin interface, which 
seems reasonable so I'll go with that to avoid having to think up something 
myself.


Repository:
  rL LLVM

http://reviews.llvm.org/D12903



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


Re: [PATCH] D12501: [clang-format] Obj-C dictionary literals: Fixed typecast getting put on a separate line from the key

2015-09-17 Thread Daniel Jasper via cfe-commits
djasper added inline comments.


Comment at: lib/Format/TokenAnnotator.cpp:377
@@ -376,1 +376,3 @@
+(!Contexts.back().ColonIsDictLiteral ||
+ Style.Language != FormatStyle::LK_Cpp)) ||
Style.Language == FormatStyle::LK_Proto) &&

Why the language check? If it is needed, can you add a test?


http://reviews.llvm.org/D12501



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


Re: [PATCH] D12832: [Driver] Add support for Windows 10 SDK

2015-09-17 Thread Igor Kudrin via cfe-commits
ikudrin added a comment.

I found a new problem, after install WDK. I'll submit a new version in a moment.


http://reviews.llvm.org/D12832



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


Re: [PATCH] D12922: Add support for function attribute "notail"

2015-09-17 Thread Duncan P. N. Exon Smith via cfe-commits
I wonder if 'notailcall' be better, since it contains a verb (like 'noinline'). 
 I don't have a strong opinion; just putting the alternative out there.

> On 2015-Sep-16, at 19:21, Akira Hatanaka via cfe-commits 
>  wrote:
> 
> ahatanak created this revision.
> ahatanak added a reviewer: aaron.ballman.
> ahatanak added a subscriber: cfe-commits.
> 
> This patch adds support for a new function attribute "notail". The attribute 
> is used to disable tail call optimization on calls to functions marked with 
> the attribute.
> 
> This is different from the attribute proposed in D12547, which disables tail 
> call optimizations on call sites within the marked function.
> 
> http://reviews.llvm.org/D12547
> 
> http://reviews.llvm.org/D12922
> 
> Files:
>  include/clang/Basic/Attr.td
>  include/clang/Basic/AttrDocs.td
>  lib/CodeGen/CGCall.cpp
>  lib/Sema/SemaDeclAttr.cpp
>  test/CodeGen/attr-no-tail.c
> 
> Index: test/CodeGen/attr-no-tail.c
> ===
> --- /dev/null
> +++ test/CodeGen/attr-no-tail.c
> @@ -0,0 +1,25 @@
> +// RUN: %clang_cc1 -triple x86_64-apple-macosx10.7.0 %s -emit-llvm -o - | 
> FileCheck %s
> +
> +// CHECK: define i32 @callee0(i32 %a) [[ATTRNOTAIL0:#[0-9]+]] {
> +// CHECK: declare i32 @callee1(i32) [[ATTRNOTAIL1:#[0-9]+]]
> +// CHECK: declare i32 @callee2(i32) [[ATTRTAIL0:#[0-9]+]]
> +
> +int callee0(int a) __attribute__((notail)) {
> +  return a + 1;
> +}
> +
> +int callee1(int) __attribute__((notail));
> +
> +int callee2(int);
> +
> +int caller0(int a) {
> +  if (a > 0)
> +return callee0(a);
> +  if (a < 0)
> +return callee1(a);
> +  return callee2(a);
> +}
> +
> +// CHECK: attributes [[ATTRNOTAIL0]] = { {{.*}}notail{{.*}} }
> +// CHECK: attributes [[ATTRNOTAIL1]] = { {{.*}}notail{{.*}} }
> +// CHECK-NOT: attributes [[ATTRTAIL0]] = { {{.*}}notail{{.*}} }
> Index: lib/Sema/SemaDeclAttr.cpp
> ===
> --- lib/Sema/SemaDeclAttr.cpp
> +++ lib/Sema/SemaDeclAttr.cpp
> @@ -4878,6 +4878,9 @@
>   case AttributeList::AT_ReturnsTwice:
> handleSimpleAttribute(S, D, Attr);
> break;
> +  case AttributeList::AT_NoTail:
> +handleSimpleAttribute(S, D, Attr);
> +break;
>   case AttributeList::AT_Used:
> handleUsedAttr(S, D, Attr);
> break;
> Index: lib/CodeGen/CGCall.cpp
> ===
> --- lib/CodeGen/CGCall.cpp
> +++ lib/CodeGen/CGCall.cpp
> @@ -1414,6 +1414,8 @@
>   FuncAttrs.addAttribute(llvm::Attribute::NoReturn);
> if (TargetDecl->hasAttr())
>   FuncAttrs.addAttribute(llvm::Attribute::NoDuplicate);
> +if (TargetDecl->hasAttr())
> +  FuncAttrs.addAttribute(llvm::Attribute::NoTail);
> 
> if (const FunctionDecl *Fn = dyn_cast(TargetDecl)) {
>   const FunctionProtoType *FPT = 
> Fn->getType()->getAs();
> Index: include/clang/Basic/AttrDocs.td
> ===
> --- include/clang/Basic/AttrDocs.td
> +++ include/clang/Basic/AttrDocs.td
> @@ -1612,3 +1612,10 @@
> arguments, with arbitrary offsets.
>   }];
> }
> +
> +def NoTailDocs : Documentation {
> +  let Category = DocCatFunction;
> +  let Content = [{
> +Tail call optimization is not performed on calls to a function marked 
> ``notail``.
> +  }];
> +}
> Index: include/clang/Basic/Attr.td
> ===
> --- include/clang/Basic/Attr.td
> +++ include/clang/Basic/Attr.td
> @@ -1020,6 +1020,12 @@
>   let Documentation = [Undocumented];
> }
> 
> +def NoTail : InheritableAttr {
> +  let Spellings = [GNU<"notail">, CXX11<"clang", "notail">];
> +  let Subjects = SubjectList<[Function, ObjCMethod]>;
> +  let Documentation = [NoTailDocs];
> +}
> +
> def NoThrow : InheritableAttr {
>   let Spellings = [GCC<"nothrow">, Declspec<"nothrow">];
>   let Documentation = [Undocumented];
> 
> 
> ___
> 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: [PATCH] D12922: Add support for function attribute "notail"

2015-09-17 Thread Duncan P. N. Exon Smith via cfe-commits
dexonsmith added a subscriber: dexonsmith.
dexonsmith added a comment.

I wonder if 'notailcall' be better, since it contains a verb (like 'noinline'). 
 I don't have a strong opinion; just putting the alternative out there.


http://reviews.llvm.org/D12922



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


Re: [PATCH] D12541: [Sparc][Shave]: Empower the toolchain formerly known as SHAVE to do more.

2015-09-17 Thread James Y Knight via cfe-commits
jyknight accepted this revision.
jyknight added a comment.
This revision is now accepted and ready to land.

Other than minor comments, lgtm.



Comment at: lib/Driver/ToolChains.cpp:3937
@@ +3936,3 @@
+  default:
+llvm_unreachable("Unsupported architecture");
+  case llvm::Triple::sparc:

I think you want something like:
 D.Diag(diag::err_target_unsupported_arch) << Triple.getArchName() << "myriad"
since it is expected to be reachable via commandline args.


Comment at: test/Driver/shave-toolchain.c:2
@@ +1,3 @@
+// RUN: %clang -no-canonical-prefixes -### -target sparc-myriad-rtems-elf %s \
+// RUN: -B %S/Inputs/basic_myriad_tree 2>&1 | FileCheck %s 
-check-prefix=LINK_WITH_RTEMS
+// LINK_WITH_RTEMS: crti.o

Maybe some more check lines on this command, to verify that 
getCompilerSupportDir and getBuiltinLinkDir are returning useful values.


http://reviews.llvm.org/D12541



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


Re: [PATCH] D11693: clang-format: Support generalized lambda captures.

2015-09-17 Thread Daniel Jasper via cfe-commits
djasper added inline comments.


Comment at: lib/Format/UnwrappedLineParser.cpp:1060-1061
@@ +1059,4 @@
+  nextToken();
+  while (!eof()) {
+// FIXME: Once we have an expression parser in the UnwrappedLineParser,
+// replace this by using parseAssigmentExpression() inside. See also

Again, please remove the FIXME. We aren't going to have an expression parser 
here (anytime soon) and shouldn't add (more) comments that make people think 
otherwise.


Comment at: lib/Format/UnwrappedLineParser.cpp:1064
@@ +1063,3 @@
+// parseBracedList. For now, parsing matching braces ([], (), {}) is
+// good enough.
+if (FormatTok->is(tok::l_paren)) {

Ah, parseAngle doesn't exist here. I was thinking about the TokenAnnotator.

I don't understand your comment about mid-stream. This is precisely about the 
case where the input is corrupt so that clang-format can recover and doesn't 
just parse the reset of the file input the lambda introducer.


http://reviews.llvm.org/D11693



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


r247900 - createOutputFile should set Error to something if it returns null.

2015-09-17 Thread Douglas Katzman via cfe-commits
Author: dougk
Date: Thu Sep 17 11:45:12 2015
New Revision: 247900

URL: http://llvm.org/viewvc/llvm-project?rev=247900&view=rev
Log:
createOutputFile should set Error to something if it returns null.

This is not portably unit-testable because the only visible
effect is a change from one random message string to another.

Modified:
cfe/trunk/lib/Frontend/CompilerInstance.cpp

Modified: cfe/trunk/lib/Frontend/CompilerInstance.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInstance.cpp?rev=247900&r1=247899&r2=247900&view=diff
==
--- cfe/trunk/lib/Frontend/CompilerInstance.cpp (original)
+++ cfe/trunk/lib/Frontend/CompilerInstance.cpp Thu Sep 17 11:45:12 2015
@@ -641,8 +641,10 @@ std::unique_ptr
   llvm::sys::fs::status(OutputPath, Status);
   if (llvm::sys::fs::exists(Status)) {
 // Fail early if we can't write to the final destination.
-if (!llvm::sys::fs::can_write(OutputPath))
+if (!llvm::sys::fs::can_write(OutputPath)) {
+  Error = std::make_error_code(std::errc::operation_not_permitted);
   return nullptr;
+}
 
 // Don't use a temporary if the output is a special file. This handles
 // things like '-o /dev/null'


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


Re: [PATCH] D12832: [Driver] Add support for Windows 10 SDK

2015-09-17 Thread Igor Kudrin via cfe-commits
ikudrin marked an inline comment as done.
ikudrin added a comment.

http://reviews.llvm.org/D12832



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


Re: [PATCH] D12832: [Driver] Add support for Windows 10 SDK

2015-09-17 Thread Igor Kudrin via cfe-commits
ikudrin updated this revision to Diff 35013.
ikudrin added a comment.

Skip directories like C:\Program Files (x86)\Windows Kits\10\Include\wdf, which 
come from WDK installation, when looking for SDK version. Now, we detect 
directories even better than vsvars32.bat in that situation.


http://reviews.llvm.org/D12832

Files:
  cfe/trunk/lib/Driver/MSVCToolChain.cpp
  cfe/trunk/lib/Driver/ToolChains.h

Index: cfe/trunk/lib/Driver/ToolChains.h
===
--- cfe/trunk/lib/Driver/ToolChains.h
+++ cfe/trunk/lib/Driver/ToolChains.h
@@ -838,7 +838,9 @@
   const llvm::opt::ArgList &DriverArgs,
   llvm::opt::ArgStringList &CC1Args) const override;
 
-  bool getWindowsSDKDir(std::string &path, int &major, int &minor) const;
+  bool getWindowsSDKDir(std::string &path, int &major,
+std::string &windowsSDKIncludeVersion,
+std::string &windowsSDKLibVersion) const;
   bool getWindowsSDKLibraryPath(std::string &path) const;
   /// \brief Check if Universal CRT should be used if available
   bool useUniversalCRT(std::string &visualStudioDir) const;
@@ -856,7 +858,9 @@
   void AddSystemIncludeWithSubfolder(const llvm::opt::ArgList &DriverArgs,
  llvm::opt::ArgStringList &CC1Args,
  const std::string &folder,
- const char *subfolder) const;
+ const Twine &subfolder1,
+ const Twine &subfolder2 = "",
+ const Twine &subfolder3 = "") const;
 
   Tool *buildLinker() const override;
   Tool *buildAssembler() const override;
Index: cfe/trunk/lib/Driver/MSVCToolChain.cpp
===
--- cfe/trunk/lib/Driver/MSVCToolChain.cpp
+++ cfe/trunk/lib/Driver/MSVCToolChain.cpp
@@ -220,27 +220,88 @@
   }
 }
 
+// Find the most recent version of Universal CRT or Windows 10 SDK.
+// vcvarsqueryregistry.bat from Visual Studio 2015 sorts entries in the include
+// directory by name and uses the last one of the list.
+// So we compare entry names lexicographically to find the greatest one.
+static bool getWindows10SDKVersion(const std::string &SDKPath,
+   std::string &SDKVersion) {
+  SDKVersion.clear();
+
+  std::error_code EC;
+  llvm::SmallString<128> IncludePath(SDKPath);
+  llvm::sys::path::append(IncludePath, "Include");
+  for (llvm::sys::fs::directory_iterator DirIt(IncludePath, EC), DirEnd;
+   DirIt != DirEnd && !EC; DirIt.increment(EC)) {
+if (!llvm::sys::fs::is_directory(DirIt->path()))
+  continue;
+StringRef CandidateName = llvm::sys::path::filename(DirIt->path());
+// If WDK is installed, there could be subfolders like "wdf" in the
+// "Include" directory.
+// Allow only directories which names start with "10.".
+if (!CandidateName.startswith("10."))
+  continue;
+if (CandidateName > SDKVersion)
+  SDKVersion = CandidateName;
+  }
+
+  return !SDKVersion.empty();
+}
+
 /// \brief Get Windows SDK installation directory.
-bool MSVCToolChain::getWindowsSDKDir(std::string &path, int &major,
- int &minor) const {
-  std::string sdkVersion;
+bool MSVCToolChain::getWindowsSDKDir(std::string &Path, int &Major,
+ std::string &WindowsSDKIncludeVersion,
+ std::string &WindowsSDKLibVersion) const {
+  std::string RegistrySDKVersion;
   // Try the Windows registry.
-  bool hasSDKDir = getSystemRegistryString(
-  "SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\$VERSION",
-  "InstallationFolder", path, &sdkVersion);
-  if (!sdkVersion.empty())
-std::sscanf(sdkVersion.c_str(), "v%d.%d", &major, &minor);
-  return hasSDKDir && !path.empty();
+  if (!getSystemRegistryString(
+  "SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\$VERSION",
+  "InstallationFolder", Path, &RegistrySDKVersion))
+return false;
+  if (Path.empty() || RegistrySDKVersion.empty())
+return false;
+
+  WindowsSDKIncludeVersion.clear();
+  WindowsSDKLibVersion.clear();
+  Major = 0;
+  std::sscanf(RegistrySDKVersion.c_str(), "v%d.", &Major);
+  if (Major <= 7)
+return true;
+  if (Major == 8) {
+// Windows SDK 8.x installs libraries in a folder whose names depend on the
+// version of the OS you're targeting.  By default choose the newest, which
+// usually corresponds to the version of the OS you've installed the SDK on.
+const char *Tests[] = {"winv6.3", "win8", "win7"};
+for (const char *Test : Tests) {
+  llvm::SmallString<128> TestPath(Path);
+  llvm::sys::path::append(TestPath, "Lib", Test);
+  if (llvm::sys::fs::exists(TestPath.c_str())) {
+WindowsSDKLibVersion = Test;
+break;
+  }
+}
+return !WindowsSDKLibVersion.empt

r247902 - Use the MSVC SEH personalities on Mingw

2015-09-17 Thread Reid Kleckner via cfe-commits
Author: rnk
Date: Thu Sep 17 12:04:13 2015
New Revision: 247902

URL: http://llvm.org/viewvc/llvm-project?rev=247902&view=rev
Log:
Use the MSVC SEH personalities on Mingw

Mingw generally wraps an old copy of msvcrt.dll which has these
personalities, so things should work out, or so I hear. I haven't tested
it.

Modified:
cfe/trunk/lib/CodeGen/CGException.cpp
cfe/trunk/test/CodeGen/exceptions-seh-new.c

Modified: cfe/trunk/lib/CodeGen/CGException.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGException.cpp?rev=247902&r1=247901&r2=247902&view=diff
==
--- cfe/trunk/lib/CodeGen/CGException.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGException.cpp Thu Sep 17 12:04:13 2015
@@ -189,14 +189,16 @@ const EHPersonality &EHPersonality::get(
   const llvm::Triple &T = CGM.getTarget().getTriple();
   const LangOptions &L = CGM.getLangOpts();
 
+  // Functions using SEH get an SEH personality.
+  if (FD && FD->usesSEHTry())
+return getSEHPersonalityMSVC(T);
+
   // Try to pick a personality function that is compatible with MSVC if we're
   // not compiling Obj-C. Obj-C users better have an Obj-C runtime that 
supports
   // the GCC-style personality function.
   if (T.isWindowsMSVCEnvironment() && !L.ObjC1) {
 if (L.SjLjExceptions)
   return EHPersonality::GNU_CPlusPlus_SJLJ;
-else if (FD && FD->usesSEHTry())
-  return getSEHPersonalityMSVC(T);
 else
   return EHPersonality::MSVC_CxxFrameHandler3;
   }

Modified: cfe/trunk/test/CodeGen/exceptions-seh-new.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/exceptions-seh-new.c?rev=247902&r1=247901&r2=247902&view=diff
==
--- cfe/trunk/test/CodeGen/exceptions-seh-new.c (original)
+++ cfe/trunk/test/CodeGen/exceptions-seh-new.c Thu Sep 17 12:04:13 2015
@@ -2,6 +2,10 @@
 // RUN: | FileCheck %s --check-prefix=CHECK --check-prefix=X64
 // RUN: %clang_cc1 %s -triple i686-pc-win32 -fms-extensions -fnew-ms-eh 
-emit-llvm -o - \
 // RUN: | FileCheck %s --check-prefix=CHECK --check-prefix=X86
+// RUN: %clang_cc1 %s -triple i686-pc-windows-gnu -fms-extensions -fnew-ms-eh 
-emit-llvm -o - \
+// RUN: | FileCheck %s --check-prefix=X86-GNU
+// RUN: %clang_cc1 %s -triple x86_64-pc-windows-gnu -fms-extensions 
-fnew-ms-eh -emit-llvm -o - \
+// RUN: | FileCheck %s --check-prefix=X64-GNU
 
 void try_body(int numerator, int denominator, int *myres) {
   *myres = numerator / denominator;
@@ -55,6 +59,12 @@ int safe_div(int numerator, int denomina
 // X86: store i32 %{{.*}}, i32*
 // X86: ret i32 1
 
+// Mingw uses msvcrt, so it can also use _except_handler3.
+// X86-GNU-LABEL: define i32 @safe_div(i32 %numerator, i32 %denominator, i32* 
%res)
+// X86-GNU-SAME:  personality i8* bitcast (i32 (...)* @_except_handler3 to 
i8*)
+// X64-GNU-LABEL: define i32 @safe_div(i32 %numerator, i32 %denominator, i32* 
%res)
+// X64-GNU-SAME:  personality i8* bitcast (i32 (...)* 
@__C_specific_handler to i8*)
+
 void j(void);
 
 int filter_expr_capture(void) {


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


Re: [PATCH] D12903: Add -fplugin=name.so option to the driver

2015-09-17 Thread John Brawn via cfe-commits
john.brawn retitled this revision from "Allow the -load option in the driver 
and pass it through to -cc1" to "Add -fplugin=name.so option to the driver".
john.brawn updated the summary for this revision.
john.brawn updated this revision to Diff 35014.
john.brawn added a comment.

Rename option from -load to -fplugin.


Repository:
  rL LLVM

http://reviews.llvm.org/D12903

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

Index: test/Driver/fplugin.c
===
--- /dev/null
+++ test/Driver/fplugin.c
@@ -0,0 +1,7 @@
+// Check that all -fplugin arguments are converted to -load
+
+// RUN: %clang -c %s -fplugin=foo.so -### 2>&1 | FileCheck %s 
--check-prefix=CHECK1
+// RUN: %clang -c %s -fplugin=foo.so -fplugin=bar.so -### 2>&1 | FileCheck %s 
--check-prefix=CHECK2
+
+// CHECK1: "-load" "foo.so"
+// CHECK2: "-load" "foo.so" "-load" "bar.so"
Index: lib/Driver/Tools.cpp
===
--- lib/Driver/Tools.cpp
+++ lib/Driver/Tools.cpp
@@ -5036,6 +5036,13 @@
   // Forward -fparse-all-comments to -cc1.
   Args.AddAllArgs(CmdArgs, options::OPT_fparse_all_comments);
 
+  // Turn -fplugin=name.so into -load name.so
+  for (const Arg *A : Args.filtered(options::OPT_fplugin)) {
+CmdArgs.push_back("-load");
+CmdArgs.push_back(A->getValue());
+A->claim();
+  }
+
   // Forward -Xclang arguments to -cc1, and -mllvm arguments to the LLVM option
   // parser.
   Args.AddAllArgValues(CmdArgs, options::OPT_Xclang);
Index: include/clang/Driver/Options.td
===
--- include/clang/Driver/Options.td
+++ include/clang/Driver/Options.td
@@ -949,6 +949,8 @@
 def fno_pic : Flag<["-"], "fno-pic">, Group;
 def fpie : Flag<["-"], "fpie">, Group;
 def fno_pie : Flag<["-"], "fno-pie">, Group;
+def fplugin : Joined<["-"], "fplugin=">, Group, 
Flags<[DriverOption]>, MetaVarName<"">,
+  HelpText<"Load the named plugin (dynamic shared object)">;
 def fprofile_arcs : Flag<["-"], "fprofile-arcs">, Group;
 def fno_profile_arcs : Flag<["-"], "fno-profile-arcs">, Group;
 def framework : Separate<["-"], "framework">, Flags<[LinkerInput]>;


Index: test/Driver/fplugin.c
===
--- /dev/null
+++ test/Driver/fplugin.c
@@ -0,0 +1,7 @@
+// Check that all -fplugin arguments are converted to -load
+
+// RUN: %clang -c %s -fplugin=foo.so -### 2>&1 | FileCheck %s --check-prefix=CHECK1
+// RUN: %clang -c %s -fplugin=foo.so -fplugin=bar.so -### 2>&1 | FileCheck %s --check-prefix=CHECK2
+
+// CHECK1: "-load" "foo.so"
+// CHECK2: "-load" "foo.so" "-load" "bar.so"
Index: lib/Driver/Tools.cpp
===
--- lib/Driver/Tools.cpp
+++ lib/Driver/Tools.cpp
@@ -5036,6 +5036,13 @@
   // Forward -fparse-all-comments to -cc1.
   Args.AddAllArgs(CmdArgs, options::OPT_fparse_all_comments);
 
+  // Turn -fplugin=name.so into -load name.so
+  for (const Arg *A : Args.filtered(options::OPT_fplugin)) {
+CmdArgs.push_back("-load");
+CmdArgs.push_back(A->getValue());
+A->claim();
+  }
+
   // Forward -Xclang arguments to -cc1, and -mllvm arguments to the LLVM option
   // parser.
   Args.AddAllArgValues(CmdArgs, options::OPT_Xclang);
Index: include/clang/Driver/Options.td
===
--- include/clang/Driver/Options.td
+++ include/clang/Driver/Options.td
@@ -949,6 +949,8 @@
 def fno_pic : Flag<["-"], "fno-pic">, Group;
 def fpie : Flag<["-"], "fpie">, Group;
 def fno_pie : Flag<["-"], "fno-pie">, Group;
+def fplugin : Joined<["-"], "fplugin=">, Group, Flags<[DriverOption]>, MetaVarName<"">,
+  HelpText<"Load the named plugin (dynamic shared object)">;
 def fprofile_arcs : Flag<["-"], "fprofile-arcs">, Group;
 def fno_profile_arcs : Flag<["-"], "fno-profile-arcs">, Group;
 def framework : Separate<["-"], "framework">, Flags<[LinkerInput]>;
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D12917: [CUDA] Allow parsing of host and device code simultaneously.

2015-09-17 Thread Artem Belevich via cfe-commits
tra updated this revision to Diff 35015.
tra marked an inline comment as done.
tra added a comment.

cosmetic fixes.


http://reviews.llvm.org/D12917

Files:
  include/clang/AST/ASTContext.h
  include/clang/Basic/Builtins.h
  include/clang/Driver/CC1Options.td
  include/clang/Frontend/CompilerInstance.h
  include/clang/Frontend/FrontendOptions.h
  include/clang/Lex/Preprocessor.h
  lib/AST/ASTContext.cpp
  lib/Basic/Builtins.cpp
  lib/CodeGen/CGBuiltin.cpp
  lib/Frontend/CompilerInstance.cpp
  lib/Frontend/CompilerInvocation.cpp
  lib/Frontend/InitPreprocessor.cpp
  lib/Lex/Preprocessor.cpp
  lib/Sema/SemaDecl.cpp
  test/SemaCUDA/builtins.cu

Index: test/SemaCUDA/builtins.cu
===
--- test/SemaCUDA/builtins.cu
+++ test/SemaCUDA/builtins.cu
@@ -1,36 +1,31 @@
-// Tests that target-specific builtins have appropriate host/device
-// attributes and that CUDA call restrictions are enforced. Also
-// verify that non-target builtins can be used from both host and
-// device functions.
+// Tests that host and target builtins can be used in the same TU,
+// have appropriate host/device attributes and that CUDA call
+// restrictions are enforced. Also verify that non-target builtins can
+// be used from both host and device functions.
 //
 // REQUIRES: x86-registered-target
 // REQUIRES: nvptx-registered-target
 // RUN: %clang_cc1 -triple x86_64-unknown-unknown \
+// RUN: -aux-triple nvptx64-unknown-cuda \
 // RUN: -fcuda-target-overloads -fsyntax-only -verify %s
 // RUN: %clang_cc1 -triple nvptx64-unknown-cuda -fcuda-is-device \
+// RUN: -aux-triple x86_64-unknown-unknown \
 // RUN: -fcuda-target-overloads -fsyntax-only -verify %s
 
+#if !(defined(__amd64__) && defined(__PTX__))
+#error "Expected to see preprocessor macros from both sides of compilation."
+#endif
 
-#ifdef __CUDA_ARCH__
-// Device-side builtins are not allowed to be called from host functions.
 void hf() {
-  int x = __builtin_ptx_read_tid_x(); // expected-note  {{'__builtin_ptx_read_tid_x' declared here}}
+  int x = __builtin_ia32_rdtsc();
+  int y = __builtin_ptx_read_tid_x(); // expected-note  {{'__builtin_ptx_read_tid_x' declared here}}
   // expected-error@-1 {{reference to __device__ function '__builtin_ptx_read_tid_x' in __host__ function}}
   x = __builtin_abs(1);
 }
+
 __attribute__((device)) void df() {
   int x = __builtin_ptx_read_tid_x();
+  int y = __builtin_ia32_rdtsc(); // expected-error {{reference to __host__ function '__builtin_ia32_rdtsc' in __device__ function}}
+  // expected-note@20 {{'__builtin_ia32_rdtsc' declared here}}
   x = __builtin_abs(1);
 }
-#else
-// Host-side builtins are not allowed to be called from device functions.
-__attribute__((device)) void df() {
-  int x = __builtin_ia32_rdtsc();   // expected-note {{'__builtin_ia32_rdtsc' declared here}}
-  // expected-error@-1 {{reference to __host__ function '__builtin_ia32_rdtsc' in __device__ function}}
-  x = __builtin_abs(1);
-}
-void hf() {
-  int x = __builtin_ia32_rdtsc();
-  x = __builtin_abs(1);
-}
-#endif
Index: lib/Sema/SemaDecl.cpp
===
--- lib/Sema/SemaDecl.cpp
+++ lib/Sema/SemaDecl.cpp
@@ -11293,11 +11293,11 @@
 if (getLangOpts().CUDA && getLangOpts().CUDATargetOverloads &&
 Context.BuiltinInfo.isTSBuiltin(BuiltinID) &&
 !FD->hasAttr() && !FD->hasAttr()) {
-  // Target-specific builtins are assumed to be intended for use
-  // in this particular CUDA compilation mode and should have
-  // appropriate attribute set so we can enforce CUDA function
-  // call restrictions.
-  if (getLangOpts().CUDAIsDevice)
+  // Assign appropriate attribute depending on CUDA compilation
+  // mode and the target builtin belongs to. E.g. during host
+  // compilation, aux builtins are __device__, the rest are __host__.
+  if (getLangOpts().CUDAIsDevice !=
+  Context.BuiltinInfo.isAuxBuiltinID(BuiltinID))
 FD->addAttr(CUDADeviceAttr::CreateImplicit(Context, FD->getLocation()));
   else
 FD->addAttr(CUDAHostAttr::CreateImplicit(Context, FD->getLocation()));
Index: lib/Lex/Preprocessor.cpp
===
--- lib/Lex/Preprocessor.cpp
+++ lib/Lex/Preprocessor.cpp
@@ -62,20 +62,19 @@
IdentifierInfoLookup *IILookup, bool OwnsHeaders,
TranslationUnitKind TUKind)
 : PPOpts(PPOpts), Diags(&diags), LangOpts(opts), Target(nullptr),
-  FileMgr(Headers.getFileMgr()), SourceMgr(SM),
-  ScratchBuf(new ScratchBuffer(SourceMgr)),HeaderInfo(Headers),
+  AuxTarget(nullptr), FileMgr(Headers.getFileMgr()), SourceMgr(SM),
+  ScratchBuf(new ScratchBuffer(SourceMgr)), HeaderInfo(Headers),
   TheModuleLoader(TheModuleLoader), ExternalSource(nullptr),
   Identifiers(opts, IILookup),
   PragmaHandlers(new Pragma

Re: [PATCH] D12917: [CUDA] Allow parsing of host and device code simultaneously.

2015-09-17 Thread Artem Belevich via cfe-commits
tra marked an inline comment as done.
tra added a comment.

In http://reviews.llvm.org/D12917#247868, @jpienaar wrote:

> Nice, so this will allow parsing/AST construction with builtins from 2 
> architectures but will fail to compile if a builtin for the host/device is 
> called from device/host.


It CUDA target call checks are in effect, we'll get a usual error that H->D or 
D->H call is illegal. If we're compiling with 
-fcuda-disable-target-call-checks, then we'll fail during codegen phase 
complaining that builtin has not been implemented.

> You mention this is not generally possible. Can you give some examples?


It's mostly related to mixing include files and preprocessor macros from 
multiple targets.
If an include is written to conditionally provide mutually exclusive constructs 
for targets A and B, then compiling for A with -aux-triple B will produce 
something uncompilable. For instance following include will fail due to 
redefinition of foo() if compiled with -triple x86_64 -aux-triple nvptx64

  #ifdef __amd64__
  int foo() {return 1;}
  #endif
  #ifdef __PTX__
  int foo() {return 2;}
  #endif



Comment at: include/clang/Driver/CC1Options.td:329
@@ -328,1 +328,3 @@
+def aux_triple : Separate<["-"], "aux-triple">,
+  HelpText<"Auxiliary triple.">;
 def code_completion_at : Separate<["-"], "code-completion-at">,

jpienaar wrote:
> You use aux target in all the errors to the user so perhaps for consistency 
> "Triple for aux target". It could be more self-documenting too ("Triple for 
> aux target used during CUDA compilation."?) as I don't know if a lot of 
> people would be able to guess what the auxiliary triple is or where it is 
> used.
Changed to "Auxiliary target triple." While CUDA uses the aux target triple for 
preprocessor macros and builtins, nothing stops anyone else using this 
information for other purposes, so I kept the name and the comment generic.


http://reviews.llvm.org/D12917



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


Re: [PATCH] D12501: [clang-format] Obj-C dictionary literals: Fixed typecast getting put on a separate line from the key

2015-09-17 Thread Kent Sutherland via cfe-commits
ksuther added inline comments.


Comment at: lib/Format/TokenAnnotator.cpp:377
@@ -376,1 +376,3 @@
+(!Contexts.back().ColonIsDictLiteral ||
+ Style.Language != FormatStyle::LK_Cpp)) ||
Style.Language == FormatStyle::LK_Proto) &&

djasper wrote:
> Why the language check? If it is needed, can you add a test?
The language check is so that this only applies to Objective-C literals. 
Protocol Buffers already have a test suite that tests the conditional here 
(FormatTestProto.cpp). The reason for the check is that the tree for 
Objective-C literals and Protocol Buffers looks the same in this situation, but 
the format behavior needs to differ.


http://reviews.llvm.org/D12501



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


r247912 - [CMake] Add install-clang target to install just the clang executable

2015-09-17 Thread Chris Bieneman via cfe-commits
Author: cbieneman
Date: Thu Sep 17 13:30:20 2015
New Revision: 247912

URL: http://llvm.org/viewvc/llvm-project?rev=247912&view=rev
Log:
[CMake] Add install-clang target to install just the clang executable

For the llvm-tools we're generating install-${tool} targets which are very 
useful. We should have one for clang too.

Modified:
cfe/trunk/tools/driver/CMakeLists.txt

Modified: cfe/trunk/tools/driver/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/driver/CMakeLists.txt?rev=247912&r1=247911&r2=247912&view=diff
==
--- cfe/trunk/tools/driver/CMakeLists.txt (original)
+++ cfe/trunk/tools/driver/CMakeLists.txt Thu Sep 17 13:30:20 2015
@@ -79,7 +79,13 @@ set_property(DIRECTORY APPEND
   PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${clang_cl})
 
 install(TARGETS clang
-  RUNTIME DESTINATION bin)
+  RUNTIME DESTINATION bin
+  COMPONENT clang)
+add_custom_target(install-clang
+  DEPENDS clang
+  COMMAND "${CMAKE_COMMAND}"
+  -DCMAKE_INSTALL_COMPONENT=clang
+  -P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
 
 # Create the clang++ and clang-cl symlinks at installation time.
 install(SCRIPT clang_symlink.cmake 
-DCMAKE_INSTALL_PREFIX=\"${CMAKE_INSTALL_PREFIX}\")


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


Re: [PATCH] D12916: [Static Analyzer] Use generics related information to infer dynamic types.

2015-09-17 Thread Anna Zaks via cfe-commits
zaks.anna added inline comments.


Comment at: lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp:871
@@ +870,3 @@
+  if (RetRegion) {
+State = setDynamicTypeInfo(State, RetRegion, ResultType,
+   /*CanBeSubclass=*/true);

Would it be possible for this to reset the type to a less specific type? (What 
happens if the method was inlined and we already inferred the value of the 
returned symbolic region.)
Same question for where we update the type in  dynamicTypePropagationOnCasts.

This also introduces a situation where both tables track the type. Maybe we 
should add a TODO here?




http://reviews.llvm.org/D12916



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


Re: [PATCH] D12916: [Static Analyzer] Use generics related information to infer dynamic types.

2015-09-17 Thread Gábor Horváth via cfe-commits
xazax.hun updated this revision to Diff 35027.
xazax.hun added a comment.

Addressed the comments.


http://reviews.llvm.org/D12916

Files:
  lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp
  test/Analysis/DynamicTypePropagation.m

Index: test/Analysis/DynamicTypePropagation.m
===
--- test/Analysis/DynamicTypePropagation.m
+++ test/Analysis/DynamicTypePropagation.m
@@ -1,5 +1,4 @@
 // RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.osx.cocoa.ObjCGenerics -verify %s
-// XFAIL: *
 
 #if !__has_feature(objc_generics)
 #  error Compiler does not support Objective-C generics?
Index: lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp
===
--- lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp
+++ lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp
@@ -665,38 +665,36 @@
 /// Get the returned ObjCObjectPointerType by a method based on the tracked type
 /// information, or null pointer when the returned type is not an
 /// ObjCObjectPointerType.
-static const ObjCObjectPointerType *getReturnTypeForMethod(
+static QualType getReturnTypeForMethod(
 const ObjCMethodDecl *Method, ArrayRef TypeArgs,
 const ObjCObjectPointerType *SelfType, ASTContext &C) {
   QualType StaticResultType = Method->getReturnType();
 
   // Is the return type declared as instance type?
   if (StaticResultType == C.getObjCInstanceType())
-return SelfType;
+return QualType(SelfType, 0);
 
   // Check whether the result type depends on a type parameter.
   if (!isObjCTypeParamDependent(StaticResultType))
-return nullptr;
+return QualType();
 
   QualType ResultType = StaticResultType.substObjCTypeArgs(
   C, TypeArgs, ObjCSubstitutionContext::Result);
 
-  return ResultType->getAs();
+  return ResultType;
 }
 
 /// Validate that the return type of a message expression is used correctly.
 /// Returns true in case an error is detected.
 bool DynamicTypePropagation::isReturnValueMisused(
 const ObjCMessageExpr *MessageExpr,
-const ObjCObjectPointerType *SeflType, SymbolRef Sym,
+const ObjCObjectPointerType *ResultPtrType, SymbolRef Sym,
 const ObjCMethodDecl *Method, ArrayRef TypeArgs,
 bool SubscriptOrProperty, CheckerContext &C) const {
-  ASTContext &ASTCtxt = C.getASTContext();
-  const auto *ResultPtrType =
-  getReturnTypeForMethod(Method, TypeArgs, SeflType, ASTCtxt);
   if (!ResultPtrType)
 return false;
 
+  ASTContext &ASTCtxt = C.getASTContext();
   const Stmt *Parent =
   C.getCurrentAnalysisDeclContext()->getParentMap().getParent(MessageExpr);
   if (SubscriptOrProperty) {
@@ -861,20 +859,37 @@
   if (!TypeArgs)
 return;
 
-  if (isReturnValueMisused(MessageExpr, *TrackedType, RecSym, Method, *TypeArgs,
-   M.getMessageKind() != OCM_Message, C))
+  QualType ResultType =
+  getReturnTypeForMethod(Method, *TypeArgs, *TrackedType, ASTCtxt);
+  // The static type is the same as the deduced type.
+  if (ResultType.isNull())
+return;
+
+  const MemRegion *RetRegion = M.getReturnValue().getAsRegion();
+  ExplodedNode *Pred = C.getPredecessor();
+  if (RetRegion && !State->get(RetRegion)) {
+// TODO: we have duplicated information in DynamicTypeMap and
+// MostSpecializedTypeArgsMap. We should only store anything in the later if
+// the stored data differs from the one stored in the former.
+State = setDynamicTypeInfo(State, RetRegion, ResultType,
+   /*CanBeSubclass=*/true);
+Pred = C.addTransition(State);
+  }
+
+  const auto *ResultPtrType = ResultType->getAs();
+
+  if (isReturnValueMisused(MessageExpr, ResultPtrType, RecSym, Method,
+   *TypeArgs, M.getMessageKind() != OCM_Message, C))
 return;
 
-  const auto *ResultPtrType =
-  getReturnTypeForMethod(Method, *TypeArgs, *TrackedType, ASTCtxt);
   if (!ResultPtrType || ResultPtrType->isUnspecialized())
 return;
 
   // When the result is a specialized type and it is not tracked yet, track it
   // for the result symbol.
   if (!State->get(RetSym)) {
 State = State->set(RetSym, ResultPtrType);
-C.addTransition(State);
+C.addTransition(State, Pred);
   }
 }
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D12916: [Static Analyzer] Use generics related information to infer dynamic types.

2015-09-17 Thread Gábor Horváth via cfe-commits
xazax.hun marked an inline comment as done.


Comment at: lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp:871
@@ +870,3 @@
+  if (RetRegion && !State->get(RetRegion)) {
+// TODO: we have duplicated information in DynamicTypeMap and
+// MostSpecializedTypeArgsMap. We should only store anything in the later 
if

You are right, I am added the check and the comment.
The dynamicTypePropagationOnCasts should not cause any trouble, it only updates 
the dynamic type map, when there is new and better information available. See 
getBetterObjCType function.

We do not need to call getBetterObjCType here, because if there were no 
information yet, we will populate the table, if a function was inlined and 
there is a cast before return getBetterObjCType was already called there, so it 
is safe to just skip updating the DynamicTypeMap.


http://reviews.llvm.org/D12916



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


Re: [PATCH] D12921: clang-format: Support 'template<>' (no space).

2015-09-17 Thread strager via cfe-commits
strager added a comment.

Should we remove `ObjCSpaceBeforeProtocolList`? It has the same problem as the 
`SpaceAfterTemplateKeyword` I am introducing.


http://reviews.llvm.org/D12921



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


Re: [PATCH] D12921: clang-format: Support 'template<>' (no space).

2015-09-17 Thread Daniel Jasper via cfe-commits
Lets says this: I am not happy about it and wouldn't allow it if it was
added now. However, *removing* it actually has additional costs, so I am
not inclined to do so now.

On Thu, Sep 17, 2015 at 9:52 PM, strager  wrote:

> strager added a comment.
>
> Should we remove `ObjCSpaceBeforeProtocolList`? It has the same problem as
> the `SpaceAfterTemplateKeyword` I am introducing.
>
>
> http://reviews.llvm.org/D12921
>
>
>
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D12927: Using MD_invariant_group

2015-09-17 Thread Richard Smith via cfe-commits
rsmith accepted this revision.
rsmith added a comment.
This revision is now accepted and ready to land.

LGTM


http://reviews.llvm.org/D12927



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


r247924 - [Shave]: Drive sparc-myriad-elf-ld directly rather than via gcc.

2015-09-17 Thread Douglas Katzman via cfe-commits
Author: dougk
Date: Thu Sep 17 14:56:40 2015
New Revision: 247924

URL: http://llvm.org/viewvc/llvm-project?rev=247924&view=rev
Log:
[Shave]: Drive sparc-myriad-elf-ld directly rather than via gcc.

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

Added:
cfe/trunk/test/Driver/Inputs/basic_myriad_tree/
cfe/trunk/test/Driver/Inputs/basic_myriad_tree/lib/
cfe/trunk/test/Driver/Inputs/basic_myriad_tree/lib/gcc/
cfe/trunk/test/Driver/Inputs/basic_myriad_tree/lib/gcc/sparc-myriad-elf/

cfe/trunk/test/Driver/Inputs/basic_myriad_tree/lib/gcc/sparc-myriad-elf/4.8.2/

cfe/trunk/test/Driver/Inputs/basic_myriad_tree/lib/gcc/sparc-myriad-elf/4.8.2/crtbegin.o
Modified:
cfe/trunk/lib/Driver/Driver.cpp
cfe/trunk/lib/Driver/ToolChains.cpp
cfe/trunk/lib/Driver/ToolChains.h
cfe/trunk/lib/Driver/Tools.cpp
cfe/trunk/lib/Driver/Tools.h
cfe/trunk/test/Driver/shave-toolchain.c

Modified: cfe/trunk/lib/Driver/Driver.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=247924&r1=247923&r2=247924&view=diff
==
--- cfe/trunk/lib/Driver/Driver.cpp (original)
+++ cfe/trunk/lib/Driver/Driver.cpp Thu Sep 17 14:56:40 2015
@@ -2262,15 +2262,14 @@ const ToolChain &Driver::getToolChain(co
   case llvm::Triple::xcore:
 TC = new toolchains::XCoreToolChain(*this, Target, Args);
 break;
-  case llvm::Triple::shave:
-TC = new toolchains::SHAVEToolChain(*this, Target, Args);
-break;
   case llvm::Triple::wasm32:
   case llvm::Triple::wasm64:
 TC = new toolchains::WebAssembly(*this, Target, Args);
 break;
   default:
-if (Target.isOSBinFormatELF())
+if (Target.getVendor() == llvm::Triple::Myriad)
+  TC = new toolchains::MyriadToolChain(*this, Target, Args);
+else if (Target.isOSBinFormatELF())
   TC = new toolchains::Generic_ELF(*this, Target, Args);
 else if (Target.isOSBinFormatMachO())
   TC = new toolchains::MachO(*this, Target, Args);

Modified: cfe/trunk/lib/Driver/ToolChains.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=247924&r1=247923&r2=247924&view=diff
==
--- cfe/trunk/lib/Driver/ToolChains.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains.cpp Thu Sep 17 14:56:40 2015
@@ -1170,7 +1170,8 @@ static llvm::StringRef getGCCToolchainDi
 /// necessary because the driver doesn't store the final version of the target
 /// triple.
 void Generic_GCC::GCCInstallationDetector::init(
-const Driver &D, const llvm::Triple &TargetTriple, const ArgList &Args) {
+const Driver &D, const llvm::Triple &TargetTriple, const ArgList &Args,
+const ArrayRef ExtraTripleAliases) {
   llvm::Triple BiarchVariantTriple = TargetTriple.isArch32Bit()
  ? TargetTriple.get64BitArchVariant()
  : TargetTriple.get32BitArchVariant();
@@ -1218,6 +1219,8 @@ void Generic_GCC::GCCInstallationDetecto
   const std::string LibDir = Prefix + Suffix.str();
   if (!llvm::sys::fs::exists(LibDir))
 continue;
+  for (const StringRef Candidate : ExtraTripleAliases) // Try these first.
+ScanLibDirForGCCTriple(TargetTriple, Args, LibDir, Candidate);
   for (const StringRef Candidate : CandidateTripleAliases)
 ScanLibDirForGCCTriple(TargetTriple, Args, LibDir, Candidate);
 }
@@ -3920,9 +3923,33 @@ void XCoreToolChain::AddCXXStdlibLibArgs
   // We don't output any lib args. This is handled by xcc.
 }
 
-// SHAVEToolChain does not call Clang's C compiler.
-// We override SelectTool to avoid testing ShouldUseClangCompiler().
-Tool *SHAVEToolChain::SelectTool(const JobAction &JA) const {
+MyriadToolChain::MyriadToolChain(const Driver &D, const llvm::Triple &Triple,
+ const ArgList &Args)
+: Generic_GCC(D, Triple, Args) {
+  // If a target of 'sparc-myriad-elf' is specified to clang, it wants to use
+  // 'sparc-myriad--elf' (note the unknown OS) as the canonical triple.
+  // This won't work to find gcc. Instead we give the installation detector an
+  // extra triple, which is preferable to further hacks of the logic that at
+  // present is based solely on getArch(). In particular, it would be wrong to
+  // choose the myriad installation when targeting a non-myriad sparc install.
+  switch (Triple.getArch()) {
+  default:
+D.Diag(diag::err_target_unsupported_arch) << Triple.getArchName() << 
"myriad";
+  case llvm::Triple::sparc:
+  case llvm::Triple::sparcel:
+  case llvm::Triple::shave:
+GCCInstallation.init(D, Triple, Args, {"sparc-myriad-elf"});
+  }
+}
+
+MyriadToolChain::~MyriadToolChain() {}
+
+// MyriadToolChain handles several triples:
+//  {shave,sparc{,el}}-myriad-{rtems,unknown}-elf
+Tool *MyriadToolChain::SelectTool

Re: [PATCH] D12541: [Sparc][Shave]: Empower the toolchain formerly known as SHAVE to do more.

2015-09-17 Thread Douglas Katzman via cfe-commits
This revision was automatically updated to reflect the committed changes.
dougk marked 2 inline comments as done.
Closed by commit rL247924: [Shave]: Drive sparc-myriad-elf-ld directly rather 
than via gcc. (authored by dougk).

Changed prior to commit:
  http://reviews.llvm.org/D12541?vs=34998&id=35028#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D12541

Files:
  cfe/trunk/lib/Driver/Driver.cpp
  cfe/trunk/lib/Driver/ToolChains.cpp
  cfe/trunk/lib/Driver/ToolChains.h
  cfe/trunk/lib/Driver/Tools.cpp
  cfe/trunk/lib/Driver/Tools.h
  
cfe/trunk/test/Driver/Inputs/basic_myriad_tree/lib/gcc/sparc-myriad-elf/4.8.2/crtbegin.o
  cfe/trunk/test/Driver/shave-toolchain.c

Index: cfe/trunk/test/Driver/shave-toolchain.c
===
--- cfe/trunk/test/Driver/shave-toolchain.c
+++ cfe/trunk/test/Driver/shave-toolchain.c
@@ -1,3 +1,16 @@
+// RUN: %clang -no-canonical-prefixes -### -target sparc-myriad-rtems-elf %s \
+// RUN: -B %S/Inputs/basic_myriad_tree 2>&1 | FileCheck %s -check-prefix=LINK_WITH_RTEMS
+// LINK_WITH_RTEMS: Inputs/basic_myriad_tree/lib/gcc/sparc-myriad-elf/4.8.2/crti.o
+// LINK_WITH_RTEMS: Inputs/basic_myriad_tree/lib/gcc/sparc-myriad-elf/4.8.2/crtbegin.o
+// LINK_WITH_RTEMS: "-L{{.*}}Inputs/basic_myriad_tree/lib/gcc/sparc-myriad-elf/4.8.2/../../../../sparc-myriad-elf/lib"
+// LINK_WITH_RTEMS: "-L{{.*}}Inputs/basic_myriad_tree/lib/gcc/sparc-myriad-elf/4.8.2"
+// LINK_WITH_RTEMS: "--start-group" "-lc" "-lrtemscpu" "-lrtemsbsp" "--end-group" "-lgcc"
+// LINK_WITH_RTEMS: Inputs/basic_myriad_tree/lib/gcc/sparc-myriad-elf/4.8.2/crtend.o
+// LINK_WITH_RTEMS: Inputs/basic_myriad_tree/lib/gcc/sparc-myriad-elf/4.8.2/crtn.o
+
+// RUN: %clang -### -target what-myriad %s 2>&1 | FileCheck %s -check-prefix=BAD_ARCH
+// BAD_ARCH: the target architecture 'what' is not supported by the target 'myriad'
+
 // Ensure that '-target shave' picks a different compiler.
 // Also check that '-I' is turned into '-i:' for the assembler.
 
@@ -8,26 +21,26 @@
 // As such, we test only for a trailing quote in its rendering.
 // The same goes for "moviAsm".
 
-// RUN: %clang -target shave -c -### %s -isystem somewhere -Icommon -Wa,-yippee 2>&1 \
+// RUN: %clang -target shave-myriad -c -### %s -isystem somewhere -Icommon -Wa,-yippee 2>&1 \
 // RUN:   | FileCheck %s -check-prefix=MOVICOMPILE
 // MOVICOMPILE: moviCompile" "-DMYRIAD2" "-mcpu=myriad2" "-S" "-isystem" "somewhere" "-I" "common"
 // MOVICOMPILE: moviAsm" "-no6thSlotCompression" "-cv:myriad2" "-noSPrefixing" "-a"
 // MOVICOMPILE: "-yippee" "-i:somewhere" "-i:common" "-elf"
 
-// RUN: %clang -target shave -c -### %s -DEFINE_ME -UNDEFINE_ME 2>&1 \
+// RUN: %clang -target shave-myriad -c -### %s -DEFINE_ME -UNDEFINE_ME 2>&1 \
 // RUN:   | FileCheck %s -check-prefix=DEFINES
 // DEFINES: "-D" "EFINE_ME" "-U" "NDEFINE_ME"
 
-// RUN: %clang -target shave -c -### %s -Icommon -iquote quotepath -isystem syspath 2>&1 \
+// RUN: %clang -target shave-myriad -c -### %s -Icommon -iquote quotepath -isystem syspath 2>&1 \
 // RUN:   | FileCheck %s -check-prefix=INCLUDES
 // INCLUDES: "-iquote" "quotepath" "-isystem" "syspath"
 
-// RUN: %clang -target shave -c -### %s -g -fno-inline-functions \
+// RUN: %clang -target shave-myriad -c -### %s -g -fno-inline-functions \
 // RUN: -fno-inline-functions-called-once -Os -Wall -MF dep.d \
 // RUN: -ffunction-sections 2>&1 | FileCheck %s -check-prefix=PASSTHRU_OPTIONS
 // PASSTHRU_OPTIONS: "-g" "-fno-inline-functions" "-fno-inline-functions-called-once"
 // PASSTHRU_OPTIONS: "-Os" "-Wall" "-MF" "dep.d" "-ffunction-sections"
 
-// RUN: %clang -target shave -c %s -o foo.o -### -MD -MF dep.d 2>&1 \
+// RUN: %clang -target shave-myriad -c %s -o foo.o -### -MD -MF dep.d 2>&1 \
 // RUN:   | FileCheck %s -check-prefix=MDMF
 // MDMF: "-S" "-MD" "-MF" "dep.d" "-MT" "foo.o"
Index: cfe/trunk/lib/Driver/ToolChains.h
===
--- cfe/trunk/lib/Driver/ToolChains.h
+++ cfe/trunk/lib/Driver/ToolChains.h
@@ -101,7 +101,8 @@
   public:
 GCCInstallationDetector() : IsValid(false) {}
 void init(const Driver &D, const llvm::Triple &TargetTriple,
-  const llvm::opt::ArgList &Args);
+  const llvm::opt::ArgList &Args,
+  const ArrayRef ExtraTripleAliases = {});
 
 /// \brief Check whether we detected a valid GCC install.
 bool isValid() const { return IsValid; }
@@ -918,21 +919,23 @@
llvm::opt::ArgStringList &CmdArgs) const override;
 };
 
-/// SHAVEToolChain - A tool chain using the compiler installed by the
-/// Movidius SDK into MV_TOOLS_DIR (which we assume will be copied to llvm's
-/// installation dir) to perform all subcommands.
-class LLVM_LIBRARY_VISIBILITY SHAVEToolChain : public Generic_GCC {
-public:
-  SHAVEToolChain(const Driver &D, const llvm::Triple &Triple,
- const llvm::opt::ArgList &Args);
-  ~SHAVEToolChain() override;
+/// MyriadToolChain 

Re: [PATCH] D12917: [CUDA] Allow parsing of host and device code simultaneously.

2015-09-17 Thread Eric Christopher via cfe-commits
echristo added a comment.

One inline request and one inline comment, otherwise looks pretty good!

Thanks :)

-eric



Comment at: include/clang/Frontend/CompilerInstance.h:355
@@ -350,3 +354,3 @@
 
-  /// Replace the current diagnostics engine.
+  /// Replace the current Target.
   void setTarget(TargetInfo *Value);

Go ahead and just commit this separately please. :)


Comment at: lib/Frontend/CompilerInstance.cpp:84-89
@@ -83,1 +83,8 @@
+
+  // Create TargetInfo for the other side of CUDA compilation.
+  if (getLangOpts().CUDA && !getFrontendOpts().AuxTriple.empty()) {
+std::shared_ptr TO(new TargetOptions);
+TO->Triple = getFrontendOpts().AuxTriple;
+AuxTarget = TargetInfo::CreateTargetInfo(getDiagnostics(), TO);
+  }
 }

Seems like an icky place to do this, perhaps where we create the Target?


http://reviews.llvm.org/D12917



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


Re: [PATCH] D11693: clang-format: Support generalized lambda captures.

2015-09-17 Thread strager via cfe-commits
strager marked 2 inline comments as done.


Comment at: lib/Format/UnwrappedLineParser.cpp:1060-1061
@@ +1059,4 @@
+  nextToken();
+  while (!eof()) {
+// FIXME: Once we have an expression parser in the UnwrappedLineParser,
+// replace this by using parseAssigmentExpression() inside. See also

djasper wrote:
> Again, please remove the FIXME. We aren't going to have an expression parser 
> here (anytime soon) and shouldn't add (more) comments that make people think 
> otherwise.
> We aren't going to have an expression parser here (anytime soon) and 
> shouldn't add (more) comments that make people think otherwise.

If there is enough need for the function, perhaps it will be written.

I don't think the comment implies some code will be written soon.


Comment at: lib/Format/UnwrappedLineParser.cpp:1064
@@ +1063,3 @@
+// parseBracedList. For now, parsing matching braces ([], (), {}) is
+// good enough.
+if (FormatTok->is(tok::l_paren)) {

djasper wrote:
> Ah, parseAngle doesn't exist here. I was thinking about the TokenAnnotator.
> 
> I don't understand your comment about mid-stream. This is precisely about the 
> case where the input is corrupt so that clang-format can recover and doesn't 
> just parse the reset of the file input the lambda introducer.
> This is precisely about the case where the input is corrupt so that 
> clang-format can recover and doesn't just parse the reset of the file input 
> the lambda introducer.

If I write this test:

```
verifyFormat("return [}] {};\n");
```

I get this output:

```
/Users/strager/Projects/llvm/tools/clang/unittests/Format/FormatTest.cpp:42: 
Failure
Value of: IncompleteFormat
  Actual: true
Expected: ExpectedIncompleteFormat
Which is: false
return [}] {};



/Users/strager/Projects/llvm/tools/clang/unittests/Format/FormatTest.cpp:65: 
Failure
Value of: format(test::messUp(Code), Style)
  Actual: "return [\n}] {};\n"
Expected: Code.str()
Which is: "return [}] {};\n"
```

How can I fix this?


http://reviews.llvm.org/D11693



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


r247926 - [Shave]: Rename test file from 'shave-' to 'myriad-'

2015-09-17 Thread Douglas Katzman via cfe-commits
Author: dougk
Date: Thu Sep 17 15:00:09 2015
New Revision: 247926

URL: http://llvm.org/viewvc/llvm-project?rev=247926&view=rev
Log:
[Shave]: Rename test file from 'shave-' to 'myriad-'

Added:
cfe/trunk/test/Driver/myriad-toolchain.c
  - copied, changed from r247924, cfe/trunk/test/Driver/shave-toolchain.c
Removed:
cfe/trunk/test/Driver/shave-toolchain.c

Copied: cfe/trunk/test/Driver/myriad-toolchain.c (from r247924, 
cfe/trunk/test/Driver/shave-toolchain.c)
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/myriad-toolchain.c?p2=cfe/trunk/test/Driver/myriad-toolchain.c&p1=cfe/trunk/test/Driver/shave-toolchain.c&r1=247924&r2=247926&rev=247926&view=diff
==
(empty)

Removed: cfe/trunk/test/Driver/shave-toolchain.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/shave-toolchain.c?rev=247925&view=auto
==
--- cfe/trunk/test/Driver/shave-toolchain.c (original)
+++ cfe/trunk/test/Driver/shave-toolchain.c (removed)
@@ -1,46 +0,0 @@
-// RUN: %clang -no-canonical-prefixes -### -target sparc-myriad-rtems-elf %s \
-// RUN: -B %S/Inputs/basic_myriad_tree 2>&1 | FileCheck %s 
-check-prefix=LINK_WITH_RTEMS
-// LINK_WITH_RTEMS: 
Inputs/basic_myriad_tree/lib/gcc/sparc-myriad-elf/4.8.2/crti.o
-// LINK_WITH_RTEMS: 
Inputs/basic_myriad_tree/lib/gcc/sparc-myriad-elf/4.8.2/crtbegin.o
-// LINK_WITH_RTEMS: 
"-L{{.*}}Inputs/basic_myriad_tree/lib/gcc/sparc-myriad-elf/4.8.2/../../../../sparc-myriad-elf/lib"
-// LINK_WITH_RTEMS: 
"-L{{.*}}Inputs/basic_myriad_tree/lib/gcc/sparc-myriad-elf/4.8.2"
-// LINK_WITH_RTEMS: "--start-group" "-lc" "-lrtemscpu" "-lrtemsbsp" 
"--end-group" "-lgcc"
-// LINK_WITH_RTEMS: 
Inputs/basic_myriad_tree/lib/gcc/sparc-myriad-elf/4.8.2/crtend.o
-// LINK_WITH_RTEMS: 
Inputs/basic_myriad_tree/lib/gcc/sparc-myriad-elf/4.8.2/crtn.o
-
-// RUN: %clang -### -target what-myriad %s 2>&1 | FileCheck %s 
-check-prefix=BAD_ARCH
-// BAD_ARCH: the target architecture 'what' is not supported by the target 
'myriad'
-
-// Ensure that '-target shave' picks a different compiler.
-// Also check that '-I' is turned into '-i:' for the assembler.
-
-// Note that since we don't know where movi tools are installed,
-// the driver may or may not find a full path to them.
-// That is, the 0th argument will be "/path/to/my/moviCompile"
-// or just "moviCompile" depending on whether moviCompile is found.
-// As such, we test only for a trailing quote in its rendering.
-// The same goes for "moviAsm".
-
-// RUN: %clang -target shave-myriad -c -### %s -isystem somewhere -Icommon 
-Wa,-yippee 2>&1 \
-// RUN:   | FileCheck %s -check-prefix=MOVICOMPILE
-// MOVICOMPILE: moviCompile" "-DMYRIAD2" "-mcpu=myriad2" "-S" "-isystem" 
"somewhere" "-I" "common"
-// MOVICOMPILE: moviAsm" "-no6thSlotCompression" "-cv:myriad2" "-noSPrefixing" 
"-a"
-// MOVICOMPILE: "-yippee" "-i:somewhere" "-i:common" "-elf"
-
-// RUN: %clang -target shave-myriad -c -### %s -DEFINE_ME -UNDEFINE_ME 2>&1 \
-// RUN:   | FileCheck %s -check-prefix=DEFINES
-// DEFINES: "-D" "EFINE_ME" "-U" "NDEFINE_ME"
-
-// RUN: %clang -target shave-myriad -c -### %s -Icommon -iquote quotepath 
-isystem syspath 2>&1 \
-// RUN:   | FileCheck %s -check-prefix=INCLUDES
-// INCLUDES: "-iquote" "quotepath" "-isystem" "syspath"
-
-// RUN: %clang -target shave-myriad -c -### %s -g -fno-inline-functions \
-// RUN: -fno-inline-functions-called-once -Os -Wall -MF dep.d \
-// RUN: -ffunction-sections 2>&1 | FileCheck %s -check-prefix=PASSTHRU_OPTIONS
-// PASSTHRU_OPTIONS: "-g" "-fno-inline-functions" 
"-fno-inline-functions-called-once"
-// PASSTHRU_OPTIONS: "-Os" "-Wall" "-MF" "dep.d" "-ffunction-sections"
-
-// RUN: %clang -target shave-myriad -c %s -o foo.o -### -MD -MF dep.d 2>&1 \
-// RUN:   | FileCheck %s -check-prefix=MDMF
-// MDMF: "-S" "-MD" "-MF" "dep.d" "-MT" "foo.o"


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


r247930 - Fixed the comment to match reality.

2015-09-17 Thread Artem Belevich via cfe-commits
Author: tra
Date: Thu Sep 17 15:19:33 2015
New Revision: 247930

URL: http://llvm.org/viewvc/llvm-project?rev=247930&view=rev
Log:
Fixed the comment to match reality.

Modified:
cfe/trunk/include/clang/Frontend/CompilerInstance.h

Modified: cfe/trunk/include/clang/Frontend/CompilerInstance.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/CompilerInstance.h?rev=247930&r1=247929&r2=247930&view=diff
==
--- cfe/trunk/include/clang/Frontend/CompilerInstance.h (original)
+++ cfe/trunk/include/clang/Frontend/CompilerInstance.h Thu Sep 17 15:19:33 2015
@@ -348,7 +348,7 @@ public:
 return *Target;
   }
 
-  /// Replace the current diagnostics engine.
+  /// Replace the current Target.
   void setTarget(TargetInfo *Value);
 
   /// }


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


r247932 - Try to unbreak windows compiler after r247926.

2015-09-17 Thread Douglas Katzman via cfe-commits
Author: dougk
Date: Thu Sep 17 15:25:09 2015
New Revision: 247932

URL: http://llvm.org/viewvc/llvm-project?rev=247932&view=rev
Log:
Try to unbreak windows compiler after r247926.

It might not like {} implicitly cast to an Arrayref.
That's the theory, since I can't test it.

Modified:
cfe/trunk/lib/Driver/ToolChains.h

Modified: cfe/trunk/lib/Driver/ToolChains.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.h?rev=247932&r1=247931&r2=247932&view=diff
==
--- cfe/trunk/lib/Driver/ToolChains.h (original)
+++ cfe/trunk/lib/Driver/ToolChains.h Thu Sep 17 15:25:09 2015
@@ -102,7 +102,8 @@ public:
 GCCInstallationDetector() : IsValid(false) {}
 void init(const Driver &D, const llvm::Triple &TargetTriple,
   const llvm::opt::ArgList &Args,
-  const ArrayRef ExtraTripleAliases = {});
+  const ArrayRef ExtraTripleAliases =
+  ArrayRef());
 
 /// \brief Check whether we detected a valid GCC install.
 bool isValid() const { return IsValid; }


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


r247933 - Using MD_invariant_group

2015-09-17 Thread Piotr Padlewski via cfe-commits
Author: prazek
Date: Thu Sep 17 15:25:46 2015
New Revision: 247933

URL: http://llvm.org/viewvc/llvm-project?rev=247933&view=rev
Log:
Using MD_invariant_group

http://reviews.llvm.org/D12927

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

Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=247933&r1=247932&r2=247933&view=diff
==
--- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Thu Sep 17 15:25:46 2015
@@ -524,7 +524,7 @@ void CodeGenModule::DecorateInstructionW
   // Check if we have to wrap MDString in MDNode.
   if (!MetaDataNode)
 MetaDataNode = llvm::MDNode::get(getLLVMContext(), MD);
-  I->setMetadata("invariant.group", MetaDataNode);
+  I->setMetadata(llvm::LLVMContext::MD_invariant_group, MetaDataNode);
 }
 
 void CodeGenModule::Error(SourceLocation loc, StringRef message) {


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


Re: r247932 - Try to unbreak windows compiler after r247926.

2015-09-17 Thread David Blaikie via cfe-commits
On Thu, Sep 17, 2015 at 1:25 PM, Douglas Katzman via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

> Author: dougk
> Date: Thu Sep 17 15:25:09 2015
> New Revision: 247932
>
> URL: http://llvm.org/viewvc/llvm-project?rev=247932&view=rev
> Log:
> Try to unbreak windows compiler after r247926.
>
> It might not like {} implicitly cast to an Arrayref.
> That's the theory, since I can't test it.
>

ArrayRef can be implicitly constructed from None:

ArrayRef ExtraTripleAliases = None

should do the trick

(oh, and top-level const as you've got there isn't commonly used in LLVM
(certainly not in function declarations where it's meaningless) so perhaps
you could drop that)


>
> Modified:
> cfe/trunk/lib/Driver/ToolChains.h
>
> Modified: cfe/trunk/lib/Driver/ToolChains.h
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.h?rev=247932&r1=247931&r2=247932&view=diff
>
> ==
> --- cfe/trunk/lib/Driver/ToolChains.h (original)
> +++ cfe/trunk/lib/Driver/ToolChains.h Thu Sep 17 15:25:09 2015
> @@ -102,7 +102,8 @@ public:
>  GCCInstallationDetector() : IsValid(false) {}
>  void init(const Driver &D, const llvm::Triple &TargetTriple,
>const llvm::opt::ArgList &Args,
> -  const ArrayRef ExtraTripleAliases = {});
> +  const ArrayRef ExtraTripleAliases =
> +  ArrayRef());
>
>  /// \brief Check whether we detected a valid GCC install.
>  bool isValid() const { return IsValid; }
>
>
> ___
> 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: [PATCH] D1623: Support __builtin_ms_va_list.

2015-09-17 Thread Charles Davis via cfe-commits
cdavis5x added a comment.

Ping...


http://reviews.llvm.org/D1623



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


Re: [PATCH] D12917: [CUDA] Allow parsing of host and device code simultaneously.

2015-09-17 Thread Artem Belevich via cfe-commits
tra updated this revision to Diff 35031.
tra marked an inline comment as done.
tra added a comment.

Updated to address Eric's comments.


http://reviews.llvm.org/D12917

Files:
  include/clang/AST/ASTContext.h
  include/clang/Basic/Builtins.h
  include/clang/Driver/CC1Options.td
  include/clang/Frontend/CompilerInstance.h
  include/clang/Frontend/FrontendOptions.h
  include/clang/Lex/Preprocessor.h
  lib/AST/ASTContext.cpp
  lib/Basic/Builtins.cpp
  lib/CodeGen/CGBuiltin.cpp
  lib/Frontend/CompilerInstance.cpp
  lib/Frontend/CompilerInvocation.cpp
  lib/Frontend/InitPreprocessor.cpp
  lib/Lex/Preprocessor.cpp
  lib/Sema/SemaDecl.cpp
  test/SemaCUDA/builtins.cu

Index: test/SemaCUDA/builtins.cu
===
--- test/SemaCUDA/builtins.cu
+++ test/SemaCUDA/builtins.cu
@@ -1,36 +1,31 @@
-// Tests that target-specific builtins have appropriate host/device
-// attributes and that CUDA call restrictions are enforced. Also
-// verify that non-target builtins can be used from both host and
-// device functions.
+// Tests that host and target builtins can be used in the same TU,
+// have appropriate host/device attributes and that CUDA call
+// restrictions are enforced. Also verify that non-target builtins can
+// be used from both host and device functions.
 //
 // REQUIRES: x86-registered-target
 // REQUIRES: nvptx-registered-target
 // RUN: %clang_cc1 -triple x86_64-unknown-unknown \
+// RUN: -aux-triple nvptx64-unknown-cuda \
 // RUN: -fcuda-target-overloads -fsyntax-only -verify %s
 // RUN: %clang_cc1 -triple nvptx64-unknown-cuda -fcuda-is-device \
+// RUN: -aux-triple x86_64-unknown-unknown \
 // RUN: -fcuda-target-overloads -fsyntax-only -verify %s
 
+#if !(defined(__amd64__) && defined(__PTX__))
+#error "Expected to see preprocessor macros from both sides of compilation."
+#endif
 
-#ifdef __CUDA_ARCH__
-// Device-side builtins are not allowed to be called from host functions.
 void hf() {
-  int x = __builtin_ptx_read_tid_x(); // expected-note  {{'__builtin_ptx_read_tid_x' declared here}}
+  int x = __builtin_ia32_rdtsc();
+  int y = __builtin_ptx_read_tid_x(); // expected-note  {{'__builtin_ptx_read_tid_x' declared here}}
   // expected-error@-1 {{reference to __device__ function '__builtin_ptx_read_tid_x' in __host__ function}}
   x = __builtin_abs(1);
 }
+
 __attribute__((device)) void df() {
   int x = __builtin_ptx_read_tid_x();
+  int y = __builtin_ia32_rdtsc(); // expected-error {{reference to __host__ function '__builtin_ia32_rdtsc' in __device__ function}}
+  // expected-note@20 {{'__builtin_ia32_rdtsc' declared here}}
   x = __builtin_abs(1);
 }
-#else
-// Host-side builtins are not allowed to be called from device functions.
-__attribute__((device)) void df() {
-  int x = __builtin_ia32_rdtsc();   // expected-note {{'__builtin_ia32_rdtsc' declared here}}
-  // expected-error@-1 {{reference to __host__ function '__builtin_ia32_rdtsc' in __device__ function}}
-  x = __builtin_abs(1);
-}
-void hf() {
-  int x = __builtin_ia32_rdtsc();
-  x = __builtin_abs(1);
-}
-#endif
Index: lib/Sema/SemaDecl.cpp
===
--- lib/Sema/SemaDecl.cpp
+++ lib/Sema/SemaDecl.cpp
@@ -11293,11 +11293,11 @@
 if (getLangOpts().CUDA && getLangOpts().CUDATargetOverloads &&
 Context.BuiltinInfo.isTSBuiltin(BuiltinID) &&
 !FD->hasAttr() && !FD->hasAttr()) {
-  // Target-specific builtins are assumed to be intended for use
-  // in this particular CUDA compilation mode and should have
-  // appropriate attribute set so we can enforce CUDA function
-  // call restrictions.
-  if (getLangOpts().CUDAIsDevice)
+  // Assign appropriate attribute depending on CUDA compilation
+  // mode and the target builtin belongs to. E.g. during host
+  // compilation, aux builtins are __device__, the rest are __host__.
+  if (getLangOpts().CUDAIsDevice !=
+  Context.BuiltinInfo.isAuxBuiltinID(BuiltinID))
 FD->addAttr(CUDADeviceAttr::CreateImplicit(Context, FD->getLocation()));
   else
 FD->addAttr(CUDAHostAttr::CreateImplicit(Context, FD->getLocation()));
Index: lib/Lex/Preprocessor.cpp
===
--- lib/Lex/Preprocessor.cpp
+++ lib/Lex/Preprocessor.cpp
@@ -62,20 +62,19 @@
IdentifierInfoLookup *IILookup, bool OwnsHeaders,
TranslationUnitKind TUKind)
 : PPOpts(PPOpts), Diags(&diags), LangOpts(opts), Target(nullptr),
-  FileMgr(Headers.getFileMgr()), SourceMgr(SM),
-  ScratchBuf(new ScratchBuffer(SourceMgr)),HeaderInfo(Headers),
+  AuxTarget(nullptr), FileMgr(Headers.getFileMgr()), SourceMgr(SM),
+  ScratchBuf(new ScratchBuffer(SourceMgr)), HeaderInfo(Headers),
   TheModuleLoader(TheModuleLoader), ExternalSource(nullptr),
   Identifiers(opts, IILookup),
   Pragm

Re: [PATCH] D12917: [CUDA] Allow parsing of host and device code simultaneously.

2015-09-17 Thread Artem Belevich via cfe-commits
tra marked 2 inline comments as done.


Comment at: lib/Frontend/CompilerInstance.cpp:82-87
@@ -84,6 +81,8 @@
+void CompilerInstance::setTarget(TargetInfo *Value) { Target = Value; }
+void CompilerInstance::setAuxTarget(TargetInfo *Value) { AuxTarget = Value; }
 
 void CompilerInstance::setFileManager(FileManager *Value) {
   FileMgr = Value;
   if (Value)
 VirtualFileSystem = Value->getVirtualFileSystem();
   else

Added separate setter method for AuxTarget and moved TargetInfo creation to 
CompilerInstance::ExecuteAction as you've suggested.


http://reviews.llvm.org/D12917



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


Re: [PATCH] D1623: Support __builtin_ms_va_list.

2015-09-17 Thread Reid Kleckner via cfe-commits
rnk accepted this revision.
rnk added a comment.
This revision is now accepted and ready to land.

I think this is ready.


http://reviews.llvm.org/D1623



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


Re: [PATCH] D12917: [CUDA] Allow parsing of host and device code simultaneously.

2015-09-17 Thread Eric Christopher via cfe-commits
echristo accepted this revision.
echristo added a comment.
This revision is now accepted and ready to land.

Works for me. Thanks!

-eric


http://reviews.llvm.org/D12917



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


r247941 - Support __builtin_ms_va_list.

2015-09-17 Thread Charles Davis via cfe-commits
Author: cdavis
Date: Thu Sep 17 15:55:33 2015
New Revision: 247941

URL: http://llvm.org/viewvc/llvm-project?rev=247941&view=rev
Log:
Support __builtin_ms_va_list.

Summary:
This change adds support for `__builtin_ms_va_list`, a GCC extension for
variadic `ms_abi` functions. The existing `__builtin_va_list` support is
inadequate for this because `va_list` is defined differently in the Win64
ABI vs. the System V/AMD64 ABI.

Depends on D1622.

Reviewers: rsmith, rnk, rjmccall

CC: cfe-commits

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

Added:
cfe/trunk/test/Sema/varargs-win64.c
cfe/trunk/test/Sema/varargs-x86-32.c
Modified:
cfe/trunk/include/clang/AST/ASTContext.h
cfe/trunk/include/clang/AST/Expr.h
cfe/trunk/include/clang/Basic/BuiltinsX86.def
cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
cfe/trunk/include/clang/Basic/TargetInfo.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/ASTDiagnostic.cpp
cfe/trunk/lib/Basic/TargetInfo.cpp
cfe/trunk/lib/Basic/Targets.cpp
cfe/trunk/lib/CodeGen/ABIInfo.h
cfe/trunk/lib/CodeGen/CGBuiltin.cpp
cfe/trunk/lib/CodeGen/CGCall.cpp
cfe/trunk/lib/CodeGen/CGExprAgg.cpp
cfe/trunk/lib/CodeGen/CGExprComplex.cpp
cfe/trunk/lib/CodeGen/CGExprScalar.cpp
cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
cfe/trunk/lib/CodeGen/CodeGenFunction.h
cfe/trunk/lib/CodeGen/TargetInfo.cpp
cfe/trunk/lib/Sema/Sema.cpp
cfe/trunk/lib/Sema/SemaChecking.cpp
cfe/trunk/lib/Sema/SemaExpr.cpp
cfe/trunk/lib/Serialization/ASTReader.cpp
cfe/trunk/lib/Serialization/ASTReaderStmt.cpp
cfe/trunk/lib/Serialization/ASTWriter.cpp
cfe/trunk/lib/Serialization/ASTWriterStmt.cpp
cfe/trunk/test/CodeGen/ms_abi.c
cfe/trunk/test/PCH/Inputs/va_arg.h
cfe/trunk/test/PCH/va_arg.c
cfe/trunk/test/PCH/va_arg.cpp
cfe/trunk/test/PCH/va_arg.h
cfe/trunk/test/Sema/varargs-x86-64.c
cfe/trunk/test/SemaTemplate/instantiate-expr-3.cpp

Modified: cfe/trunk/include/clang/AST/ASTContext.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ASTContext.h?rev=247941&r1=247940&r2=247941&view=diff
==
--- cfe/trunk/include/clang/AST/ASTContext.h (original)
+++ cfe/trunk/include/clang/AST/ASTContext.h Thu Sep 17 15:55:33 2015
@@ -216,6 +216,9 @@ class ASTContext : public RefCountedBase
   /// __builtin_va_list type.
   mutable TypedefDecl *BuiltinVaListDecl;
 
+  /// The typedef for the predefined \c __builtin_ms_va_list type.
+  mutable TypedefDecl *BuiltinMSVaListDecl;
+
   /// \brief The typedef for the predefined \c id type.
   mutable TypedefDecl *ObjCIdDecl;
   
@@ -1579,6 +1582,15 @@ public:
   /// for some targets.
   Decl *getVaListTagDecl() const;
 
+  /// Retrieve the C type declaration corresponding to the predefined
+  /// \c __builtin_ms_va_list type.
+  TypedefDecl *getBuiltinMSVaListDecl() const;
+
+  /// Retrieve the type of the \c __builtin_ms_va_list type.
+  QualType getBuiltinMSVaListType() const {
+return getTypeDeclType(getBuiltinMSVaListDecl());
+  }
+
   /// \brief Return a type with additional \c const, \c volatile, or
   /// \c restrict qualifiers.
   QualType getCVRQualifiedType(QualType T, unsigned CVR) const {

Modified: cfe/trunk/include/clang/AST/Expr.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Expr.h?rev=247941&r1=247940&r2=247941&view=diff
==
--- cfe/trunk/include/clang/AST/Expr.h (original)
+++ cfe/trunk/include/clang/AST/Expr.h Thu Sep 17 15:55:33 2015
@@ -3699,33 +3699,35 @@ public:
   }
 };
 
-/// VAArgExpr, used for the builtin function __builtin_va_arg.
+/// Represents a call to the builtin function \c __builtin_va_arg.
 class VAArgExpr : public Expr {
   Stmt *Val;
-  TypeSourceInfo *TInfo;
+  llvm::PointerIntPair TInfo;
   SourceLocation BuiltinLoc, RParenLoc;
 public:
-  VAArgExpr(SourceLocation BLoc, Expr* e, TypeSourceInfo *TInfo,
-SourceLocation RPLoc, QualType t)
-: Expr(VAArgExprClass, t, VK_RValue, OK_Ordinary,
-   t->isDependentType(), false,
-   (TInfo->getType()->isInstantiationDependentType() ||
-e->isInstantiationDependent()),
-   (TInfo->getType()->containsUnexpandedParameterPack() ||
-e->containsUnexpandedParameterPack())),
-  Val(e), TInfo(TInfo),
-  BuiltinLoc(BLoc),
-  RParenLoc(RPLoc) { }
+  VAArgExpr(SourceLocation BLoc, Expr *e, TypeSourceInfo *TInfo,
+SourceLocation RPLoc, QualType t, bool IsMS)
+  : Expr(VAArgExprClass, t, VK_RValue, OK_Ordinary, t->isDependentType(),
+ false, (TInfo->getType()->isInstantiationDependentType() ||
+ e->isInstantiationDependent()),
+ (TInfo->getType()->containsUnexpandedParameterPack() |

[PATCH] D12945: [PATCH] Add checker for objects that should not be value types

2015-09-17 Thread Aaron Ballman via cfe-commits
aaron.ballman created this revision.
aaron.ballman added reviewers: alexfh, klimek.
aaron.ballman added a subscriber: cfe-commits.

Some object types are not meant to be used as a value type in all 
circumstances, but the language (mainly C) does not provide facilities for 
marking these types as noncopyable. For instance, you should never pass a FILE 
object by value, but only by pointer. This seems to fall into two category of 
types:

A FILE type should never be declared by value (whether as a local, a field, or 
a parameter) and such a pointer should never be dereferenced.
Some POSIX types, like pthread_mutex_t can be declared by value as a variable 
or field, but should not be declared by value as a parameter, and such a 
pointer should never be dereferenced.

This patch adds a checker (misc-non-copyable-objects, but a better moniker 
would not make me sad) to catch code that does this accidentally. This 
corresponds (at least for treatment of FILE) to: 
https://www.securecoding.cert.org/confluence/display/c/FIO38-C.+Do+not+copy+a+FILE+object

~Aaron

http://reviews.llvm.org/D12945

Files:
  clang-tidy/misc/CMakeLists.txt
  clang-tidy/misc/MiscTidyModule.cpp
  clang-tidy/misc/NonCopyableObjects.cpp
  clang-tidy/misc/NonCopyableObjects.h
  test/clang-tidy/misc-non-copyable-objects.c
  test/clang-tidy/misc-non-copyable-objects.cpp

Index: test/clang-tidy/misc-non-copyable-objects.cpp
===
--- test/clang-tidy/misc-non-copyable-objects.cpp
+++ test/clang-tidy/misc-non-copyable-objects.cpp
@@ -0,0 +1,26 @@
+// RUN: %python %S/check_clang_tidy.py %s misc-non-copyable-objects %t
+
+namespace std {
+typedef struct FILE {} FILE;
+}
+using namespace std;
+
+// CHECK-MESSAGES: :[[@LINE+1]]:18: warning: 'f' declared as type 'FILE'; did you mean 'FILE *'?
+void g(std::FILE f);
+
+struct S {
+  // CHECK-MESSAGES: :[[@LINE+1]]:10: warning: 'f' declared as type 'FILE'; did you mean 'FILE *'?
+  ::FILE f;
+};
+
+void func(FILE *f) {
+  // CHECK-MESSAGES: :[[@LINE+1]]:13: warning: 'f1' declared as type 'FILE'; did you mean 'FILE *'?
+  std::FILE f1; // match
+  // CHECK-MESSAGES: :[[@LINE+2]]:10: warning: 'f2' declared as type 'FILE'; did you mean 'FILE *'?
+  // CHECK-MESSAGES: :[[@LINE+1]]:15: warning: expression has suspicious type 'FILE'
+  ::FILE f2 = *f; // match, match
+  // CHECK-MESSAGES: :[[@LINE+1]]:15: warning: 'f3' declared as type 'FILE'; did you mean 'FILE *'?
+  struct FILE f3; // match
+  // CHECK-MESSAGES: :[[@LINE+1]]:16: warning: expression has suspicious type 'FILE'
+  (void)sizeof(*f); // match
+}
Index: test/clang-tidy/misc-non-copyable-objects.c
===
--- test/clang-tidy/misc-non-copyable-objects.c
+++ test/clang-tidy/misc-non-copyable-objects.c
@@ -0,0 +1,43 @@
+// RUN: %python %S/check_clang_tidy.py %s misc-non-copyable-objects %t
+
+typedef struct FILE {} FILE;
+typedef struct pthread_cond_t {} pthread_cond_t;
+typedef int pthread_mutex_t;
+
+// CHECK-MESSAGES: :[[@LINE+1]]:13: warning: 'f' declared as type 'FILE'; did you mean 'FILE *'?
+void g(FILE f);
+// CHECK-MESSAGES: :[[@LINE+1]]:24: warning: 'm' declared as type 'pthread_mutex_t'; did you mean 'pthread_mutex_t *'?
+void h(pthread_mutex_t m);
+// CHECK-MESSAGES: :[[@LINE+1]]:23: warning: 'c' declared as type 'pthread_cond_t'; did you mean 'pthread_cond_t *'?
+void i(pthread_cond_t c);
+
+struct S {
+  pthread_cond_t c; // ok
+  // CHECK-MESSAGES: :[[@LINE+1]]:8: warning: 'f' declared as type 'FILE'; did you mean 'FILE *'?
+  FILE f;
+};
+
+void func(FILE *f) {
+  // CHECK-MESSAGES: :[[@LINE+1]]:8: warning: 'f1' declared as type 'FILE'; did you mean 'FILE *'?
+  FILE f1; // match
+  // CHECK-MESSAGES: :[[@LINE+2]]:8: warning: 'f2' declared as type 'FILE'; did you mean 'FILE *'?
+  // CHECK-MESSAGES: :[[@LINE+1]]:13: warning: expression has suspicious type 'FILE'
+  FILE f2 = *f;
+  // CHECK-MESSAGES: :[[@LINE+1]]:15: warning: 'f3' declared as type 'FILE'; did you mean 'FILE *'?
+  struct FILE f3;
+  // CHECK-MESSAGES: :[[@LINE+1]]:16: warning: expression has suspicious type 'FILE'
+  (void)sizeof(*f);
+  (void)sizeof(FILE);
+  // CHECK-MESSAGES: :[[@LINE+1]]:5: warning: expression has suspicious type 'FILE'
+  g(*f);
+
+  pthread_mutex_t m; // ok
+  h(m); // ok
+
+  pthread_cond_t c; // ok
+  i(c); // ok
+
+  pthread_mutex_t *m1 = &m; // ok
+  // CHECK-MESSAGES: :[[@LINE+1]]:5: warning: expression has suspicious type 'pthread_mutex_t'
+  h(*m1);
+}
Index: clang-tidy/misc/NonCopyableObjects.h
===
--- clang-tidy/misc/NonCopyableObjects.h
+++ clang-tidy/misc/NonCopyableObjects.h
@@ -0,0 +1,31 @@
+//===--- NonCopyableObjects.h - clang-tidy---*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.

Re: [PATCH] D1623: Support __builtin_ms_va_list.

2015-09-17 Thread Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL247941: Support __builtin_ms_va_list. (authored by cdavis).

Changed prior to commit:
  http://reviews.llvm.org/D1623?vs=34728&id=35036#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D1623

Files:
  cfe/trunk/include/clang/AST/ASTContext.h
  cfe/trunk/include/clang/AST/Expr.h
  cfe/trunk/include/clang/Basic/BuiltinsX86.def
  cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
  cfe/trunk/include/clang/Basic/TargetInfo.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/ASTDiagnostic.cpp
  cfe/trunk/lib/Basic/TargetInfo.cpp
  cfe/trunk/lib/Basic/Targets.cpp
  cfe/trunk/lib/CodeGen/ABIInfo.h
  cfe/trunk/lib/CodeGen/CGBuiltin.cpp
  cfe/trunk/lib/CodeGen/CGCall.cpp
  cfe/trunk/lib/CodeGen/CGExprAgg.cpp
  cfe/trunk/lib/CodeGen/CGExprComplex.cpp
  cfe/trunk/lib/CodeGen/CGExprScalar.cpp
  cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
  cfe/trunk/lib/CodeGen/CodeGenFunction.h
  cfe/trunk/lib/CodeGen/TargetInfo.cpp
  cfe/trunk/lib/Sema/Sema.cpp
  cfe/trunk/lib/Sema/SemaChecking.cpp
  cfe/trunk/lib/Sema/SemaExpr.cpp
  cfe/trunk/lib/Serialization/ASTReader.cpp
  cfe/trunk/lib/Serialization/ASTReaderStmt.cpp
  cfe/trunk/lib/Serialization/ASTWriter.cpp
  cfe/trunk/lib/Serialization/ASTWriterStmt.cpp
  cfe/trunk/test/CodeGen/ms_abi.c
  cfe/trunk/test/PCH/Inputs/va_arg.h
  cfe/trunk/test/PCH/va_arg.c
  cfe/trunk/test/PCH/va_arg.cpp
  cfe/trunk/test/PCH/va_arg.h
  cfe/trunk/test/Sema/varargs-win64.c
  cfe/trunk/test/Sema/varargs-x86-32.c
  cfe/trunk/test/Sema/varargs-x86-64.c
  cfe/trunk/test/SemaTemplate/instantiate-expr-3.cpp

Index: cfe/trunk/lib/Serialization/ASTWriterStmt.cpp
===
--- cfe/trunk/lib/Serialization/ASTWriterStmt.cpp
+++ cfe/trunk/lib/Serialization/ASTWriterStmt.cpp
@@ -771,6 +771,7 @@
   Writer.AddTypeSourceInfo(E->getWrittenTypeInfo(), Record);
   Writer.AddSourceLocation(E->getBuiltinLoc(), Record);
   Writer.AddSourceLocation(E->getRParenLoc(), Record);
+  Record.push_back(E->isMicrosoftABI());
   Code = serialization::EXPR_VA_ARG;
 }
 
Index: cfe/trunk/lib/Serialization/ASTWriter.cpp
===
--- cfe/trunk/lib/Serialization/ASTWriter.cpp
+++ cfe/trunk/lib/Serialization/ASTWriter.cpp
@@ -4084,6 +4084,8 @@
  PREDEF_DECL_OBJC_INSTANCETYPE_ID);
   RegisterPredefDecl(Context.BuiltinVaListDecl, PREDEF_DECL_BUILTIN_VA_LIST_ID);
   RegisterPredefDecl(Context.VaListTagDecl, PREDEF_DECL_VA_LIST_TAG);
+  RegisterPredefDecl(Context.BuiltinMSVaListDecl,
+ PREDEF_DECL_BUILTIN_MS_VA_LIST_ID);
   RegisterPredefDecl(Context.ExternCContext, PREDEF_DECL_EXTERN_C_CONTEXT_ID);
 
   // Build a record containing all of the tentative definitions in this file, in
Index: cfe/trunk/lib/Serialization/ASTReaderStmt.cpp
===
--- cfe/trunk/lib/Serialization/ASTReaderStmt.cpp
+++ cfe/trunk/lib/Serialization/ASTReaderStmt.cpp
@@ -830,6 +830,7 @@
   E->setWrittenTypeInfo(GetTypeSourceInfo(Record, Idx));
   E->setBuiltinLoc(ReadSourceLocation(Record, Idx));
   E->setRParenLoc(ReadSourceLocation(Record, Idx));
+  E->setIsMicrosoftABI(Record[Idx++]);
 }
 
 void ASTStmtReader::VisitAddrLabelExpr(AddrLabelExpr *E) {
Index: cfe/trunk/lib/Serialization/ASTReader.cpp
===
--- cfe/trunk/lib/Serialization/ASTReader.cpp
+++ cfe/trunk/lib/Serialization/ASTReader.cpp
@@ -6270,6 +6270,9 @@
   case PREDEF_DECL_VA_LIST_TAG:
 return Context.getVaListTagDecl();
 
+  case PREDEF_DECL_BUILTIN_MS_VA_LIST_ID:
+return Context.getBuiltinMSVaListDecl();
+
   case PREDEF_DECL_EXTERN_C_CONTEXT_ID:
 return Context.getExternCContextDecl();
   }
Index: cfe/trunk/lib/CodeGen/TargetInfo.cpp
===
--- cfe/trunk/lib/CodeGen/TargetInfo.cpp
+++ cfe/trunk/lib/CodeGen/TargetInfo.cpp
@@ -61,6 +61,11 @@
   /*ByRef*/ false, Realign);
 }
 
+Address ABIInfo::EmitMSVAArg(CodeGenFunction &CGF, Address VAListAddr,
+ QualType Ty) const {
+  return Address::invalid();
+}
+
 ABIInfo::~ABIInfo() {}
 
 static CGCXXABI::RecordArgABI getRecordArgABI(const RecordType *RT,
@@ -1734,6 +1739,8 @@
 
   Address EmitVAArg(CodeGenFunction &CGF, Address VAListAddr,
 QualType Ty) const override;
+  Address EmitMSVAArg(CodeGenFunction &CGF, Address VAListAddr,
+  QualType Ty) const override;
 
   bool has64BitPointers() const {
 return Has64BitPointers;
@@ -3266,6 +3273,14 @@
   return ResAddr;
 }
 
+Address X86_64ABIInfo::EmitMSVAArg(CodeGenFunction &CGF, Address VAListAddr,
+   QualType Ty) const {
+  return emit

r247948 - [Myriad]: add "/include" to standard search path

2015-09-17 Thread Douglas Katzman via cfe-commits
Author: dougk
Date: Thu Sep 17 16:20:16 2015
New Revision: 247948

URL: http://llvm.org/viewvc/llvm-project?rev=247948&view=rev
Log:
[Myriad]: add "/include" to standard search path

Modified:
cfe/trunk/lib/Driver/ToolChains.cpp
cfe/trunk/lib/Driver/ToolChains.h
cfe/trunk/test/Driver/myriad-toolchain.c

Modified: cfe/trunk/lib/Driver/ToolChains.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=247948&r1=247947&r2=247948&view=diff
==
--- cfe/trunk/lib/Driver/ToolChains.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains.cpp Thu Sep 17 16:20:16 2015
@@ -3944,6 +3944,12 @@ MyriadToolChain::MyriadToolChain(const D
 
 MyriadToolChain::~MyriadToolChain() {}
 
+void MyriadToolChain::AddClangSystemIncludeArgs(const ArgList &DriverArgs,
+ArgStringList &CC1Args) const {
+  if (!DriverArgs.hasArg(options::OPT_nostdinc))
+addSystemInclude(DriverArgs, CC1Args, getDriver().SysRoot + "/include");
+}
+
 // MyriadToolChain handles several triples:
 //  {shave,sparc{,el}}-myriad-{rtems,unknown}-elf
 Tool *MyriadToolChain::SelectTool(const JobAction &JA) const {

Modified: cfe/trunk/lib/Driver/ToolChains.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.h?rev=247948&r1=247947&r2=247948&view=diff
==
--- cfe/trunk/lib/Driver/ToolChains.h (original)
+++ cfe/trunk/lib/Driver/ToolChains.h Thu Sep 17 16:20:16 2015
@@ -928,6 +928,9 @@ public:
   const llvm::opt::ArgList &Args);
   ~MyriadToolChain() override;
 
+  void
+  AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
+llvm::opt::ArgStringList &CC1Args) const override;
   Tool *SelectTool(const JobAction &JA) const override;
   void getCompilerSupportDir(std::string &Dir) const;
   void getBuiltinLibDir(std::string &Dir) const;

Modified: cfe/trunk/test/Driver/myriad-toolchain.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/myriad-toolchain.c?rev=247948&r1=247947&r2=247948&view=diff
==
--- cfe/trunk/test/Driver/myriad-toolchain.c (original)
+++ cfe/trunk/test/Driver/myriad-toolchain.c Thu Sep 17 16:20:16 2015
@@ -8,6 +8,15 @@
 // LINK_WITH_RTEMS: 
Inputs/basic_myriad_tree/lib/gcc/sparc-myriad-elf/4.8.2/crtend.o
 // LINK_WITH_RTEMS: 
Inputs/basic_myriad_tree/lib/gcc/sparc-myriad-elf/4.8.2/crtn.o
 
+// RUN: %clang -### -E -target sparc-myriad --sysroot=/yow %s 2>&1 \
+// RUN:   | FileCheck %s -check-prefix=SLASH_INCLUDE
+// SLASH_INCLUDE: "-isysroot" "/yow" "-internal-isystem" "/yow/include"
+
+// RUN: %clang -### -E -target sparc-myriad --sysroot=/yow %s -nostdinc 2>&1 \
+// RUN:   | FileCheck %s -check-prefix=NO_SLASH_INCLUDE
+// NO_SLASH_INCLUDE: "-isysroot" "/yow"
+// NO_SLASH_INCLUDE-NOT: "-internal-isystem" "/yow/include"
+
 // RUN: %clang -### -target what-myriad %s 2>&1 | FileCheck %s 
-check-prefix=BAD_ARCH
 // BAD_ARCH: the target architecture 'what' is not supported by the target 
'myriad'
 


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


Re: [PATCH] D10370: clang-format: Implement AlwaysBreakAfterDeclarationReturnType.

2015-09-17 Thread strager via cfe-commits
strager added inline comments.


Comment at: docs/ClangFormatStyleOptions.rst:221-235
@@ -220,3 +220,17 @@
 
-**AlwaysBreakAfterDefinitionReturnType** 
(``DefinitionReturnTypeBreakingStyle``)
+**AlwaysBreakAfterDeclarationReturnType** (``ReturnTypeBreakingStyle``)
+  The function declaration return type breaking style to use.
+
+  Possible values:
+
+  * ``DRTBS_None`` (in configuration: ``None``)
+Break after return type automatically.
+``PenaltyReturnTypeOnItsOwnLine`` is taken into account.
+  * ``DRTBS_All`` (in configuration: ``All``)
+Always break after the return type.
+  * ``DRTBS_TopLevel`` (in configuration: ``TopLevel``)
+Always break after the return types of top level functions.
+
+
+**AlwaysBreakAfterDefinitionReturnType** (``ReturnTypeBreakingStyle``)
   The function definition return type breaking style to use.

djasper wrote:
> Same as I am arguing on some of your other patches. Fewer options are easier 
> to maintain and easier to discover.
I think having separate options for separate cases is easier to maintain.

Current method (separate option):

```
  FormatStyle::ReturnTypeBreakingStyle BreakStyle =
  Line.mightBeFunctionDefinition()
  ? Style.AlwaysBreakAfterDefinitionReturnType
  : Style.AlwaysBreakAfterDeclarationReturnType;
  if ((BreakStyle == FormatStyle::DRTBS_All ||
   (BreakStyle == FormatStyle::DRTBS_TopLevel && Line.Level == 0)))
Current->MustBreakBefore = true;
```

Proposed method:

```
  auto BreakStyle = Style.AlwaysBreakAfterReturnType;
  if (BreakStyle == FormatStyle::DRTBS_All ||
  (BreakStyle == FormatStyle::DRTBS_TopLevel && Line.Level == 0) ||
  (!Line->mightBeFunctionDefinition() &&
   (BreakStyle == FormatStyle::DRTBS_AllDeclarations) ||
   (BreakStyle == FormatStyle::DRTBS_TopLevelDeclarations &&
Line.Level == 0)))
Current->MustBreakBefore = true;
```


http://reviews.llvm.org/D10370



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


Re: [PATCH] D10370: clang-format: Implement AlwaysBreakAfterDeclarationReturnType.

2015-09-17 Thread strager via cfe-commits
strager updated this revision to Diff 35038.
strager added a comment.

Fix missing IsDefinition check in ContinuationIndenter::canBreak.


http://reviews.llvm.org/D10370

Files:
  docs/ClangFormatStyleOptions.rst
  include/clang/Format/Format.h
  lib/Format/ContinuationIndenter.cpp
  lib/Format/Format.cpp
  lib/Format/TokenAnnotator.cpp
  lib/Format/TokenAnnotator.h
  unittests/Format/FormatTest.cpp

Index: unittests/Format/FormatTest.cpp
===
--- unittests/Format/FormatTest.cpp
+++ unittests/Format/FormatTest.cpp
@@ -4658,6 +4658,44 @@
"  \"c\";");
 }
 
+TEST_F(FormatTest, DeclarationReturnTypeBreakingStyle) {
+  FormatStyle Style = getLLVMStyle();
+  Style.AlwaysBreakAfterDeclarationReturnType = FormatStyle::DRTBS_TopLevel;
+  verifyFormat("class C {\n"
+   "  int f();\n"
+   "};\n"
+   "int\n"
+   "f();",
+   Style);
+  Style.AlwaysBreakAfterDeclarationReturnType = FormatStyle::DRTBS_All;
+  verifyFormat("class C {\n"
+   "  int\n"
+   "  f();\n"
+   "};\n"
+   "int\n"
+   "f();",
+   Style);
+  verifyFormat("const char *f(void) { return \"\"; }\n"
+   "const char *\n"
+   "bar(void);\n",
+   Style);
+  verifyFormat("template  T *f(T &c) { return NULL; }\n"
+   "template \n"
+   "T *\n"
+   "f(T &c);\n",
+   Style);
+  Style.BreakBeforeBraces = FormatStyle::BS_Stroustrup;
+  verifyFormat("const char *f(void) { return \"\"; }\n"
+   "const char *\n"
+   "bar(void);\n",
+   Style);
+  verifyFormat("template  T *f(T &c) { return NULL; }\n"
+   "template \n"
+   "T *\n"
+   "f(T &c);\n",
+   Style);
+}
+
 TEST_F(FormatTest, DefinitionReturnTypeBreakingStyle) {
   FormatStyle Style = getLLVMStyle();
   Style.AlwaysBreakAfterDefinitionReturnType = FormatStyle::DRTBS_TopLevel;
@@ -4738,6 +4776,46 @@
Style);
 }
 
+TEST_F(FormatTest, AlwaysBreakAfterDeclarationAndDefinitionReturnTypeMixed) {
+  FormatStyle AfterType = getLLVMStyle();
+  AfterType.AlwaysBreakAfterDeclarationReturnType = FormatStyle::DRTBS_None;
+  AfterType.AlwaysBreakAfterDefinitionReturnType = FormatStyle::DRTBS_None;
+  verifyFormat("void f(void) {\n" // No break here.
+   "  f();\n"
+   "  f();\n"
+   "}\n"
+   "void bar(void);\n", // No break here.
+   AfterType);
+  AfterType.AlwaysBreakAfterDeclarationReturnType = FormatStyle::DRTBS_All;
+  AfterType.AlwaysBreakAfterDefinitionReturnType = FormatStyle::DRTBS_None;
+  verifyFormat("void f(void) {\n" // No break here.
+   "  f();\n"
+   "  f();\n"
+   "}\n"
+   "void\n"
+   "bar(void);\n", // Break here.
+   AfterType);
+  AfterType.AlwaysBreakAfterDeclarationReturnType = FormatStyle::DRTBS_None;
+  AfterType.AlwaysBreakAfterDefinitionReturnType = FormatStyle::DRTBS_All;
+  verifyFormat("void\n"
+   "f(void) {\n" // Break here.
+   "  f();\n"
+   "  f();\n"
+   "}\n"
+   "void bar(void);\n", // No break here.
+   AfterType);
+  AfterType.AlwaysBreakAfterDeclarationReturnType = FormatStyle::DRTBS_All;
+  AfterType.AlwaysBreakAfterDefinitionReturnType = FormatStyle::DRTBS_All;
+  verifyFormat("void\n"
+   "f(void) {\n" // Break here.
+   "  f();\n"
+   "  f();\n"
+   "}\n"
+   "void\n"
+   "bar(void);\n", // Break here.
+   AfterType);
+}
+
 TEST_F(FormatTest, AlwaysBreakBeforeMultilineStrings) {
   FormatStyle NoBreak = getLLVMStyle();
   NoBreak.AlwaysBreakBeforeMultilineStrings = false;
@@ -9409,6 +9487,15 @@
   CHECK_PARSE("BreakBeforeBraces: GNU", BreakBeforeBraces, FormatStyle::BS_GNU);
   CHECK_PARSE("BreakBeforeBraces: WebKit", BreakBeforeBraces, FormatStyle::BS_WebKit);
 
+  Style.AlwaysBreakAfterDeclarationReturnType = FormatStyle::DRTBS_All;
+  CHECK_PARSE("AlwaysBreakAfterDeclarationReturnType: None",
+  AlwaysBreakAfterDeclarationReturnType, FormatStyle::DRTBS_None);
+  CHECK_PARSE("AlwaysBreakAfterDeclarationReturnType: All",
+  AlwaysBreakAfterDeclarationReturnType, FormatStyle::DRTBS_All);
+  CHECK_PARSE("AlwaysBreakAfterDeclarationReturnType: TopLevel",
+  AlwaysBreakAfterDeclarationReturnType,
+  FormatStyle::DRTBS_TopLevel);
+
   Style.AlwaysBreakAfterDefinitionReturnType = FormatStyle::DRTBS_All;
   CHECK_PARSE("AlwaysBreakAfterDefinitionReturnType: None",
   AlwaysBreakAfterDefinitionReturnType, FormatStyle::DRTBS_None);
Index: lib/Format/TokenAnnotator.h
===
--- lib/For

LLVM buildmaster will be restarted tonight

2015-09-17 Thread Galina Kistanova via cfe-commits
Hello everyone,

LLVM buildmaster will be restarted after 6 PM Pacific time today.

Thanks

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


Re: [PATCH] D12379: Fix the bugs in the mapDiagnosticRanges (Still in progress)

2015-09-17 Thread Zhengkai Wu via cfe-commits
zhengkai marked 2 inline comments as done.


Comment at: lib/Frontend/DiagnosticRenderer.cpp:455
@@ -419,1 +454,3 @@
 
+static bool checkLocForMacroArgExpansion(SourceLocation Loc,
+ const SourceManager &SM,

Because the function isMacroArgExpansion doesn't check if all locations are in 
the same argument location,


http://reviews.llvm.org/D12379



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


Re: [PATCH] D10881: [Sema] Catch a case when 'volatile' qualifier is dropped while binding

2015-09-17 Thread ~paul via cfe-commits
cynecx added a comment.

Hi :),

First of all, I would like to say that I am new into all the clang stuff 
(software architecture/internal concepts) but I wanted to start hacking clang 
so I went here to check out some ##trivial## clang bugs to fix so I can learn 
internal stuff about clang, with internal stuff I mean how AST/Sema are 
implemented and kinda these things.

So basically, I tried all the day long to find a better approach as @rjmccall 
explained that the key issue is that you can't copy-construct a ##W## from a 
##volatile W&##. The issue might be in ##SemaInit.cpp## -> 
##ResolveConstructorOverload## because when the ##NamedDecl*## loop reaches the 
##const S&## constructor it doesn't know that it's actually copy-constructed so 
it's not setting ##SuppressUserConversions## to ##true##. This has the effect 
that ##AddTemplateOverloadCandidate## also includes user-conversion functions, 
so in this case: ##S(volatile W)## and this is actually what causes the 
infinity loop: ##PerformCopyInitialization -> InitializationSequence::Perform 
->CompleteConstructorCall -> GatherArgumentsForCall -> ...##.
While debugging I basically changed the ##SuppressUserConversions## variable to 
true for the ##W (const S&)## constructor and this solved the infinity-loop 
problem and produced a gcc similar diagnostic message:

  simplified.cpp:13:7: error: no matching constructor for initialization of 'W'
S s(*w);
^~
  simplified.cpp:3:8: note: candidate constructor (the implicit copy 
constructor) not viable: 1st argument ('volatile W')
would lose volatile qualifier
  struct W {
 ^
  simplified.cpp:3:8: note: candidate constructor (the implicit move 
constructor) not viable: 1st argument ('volatile W')
would lose volatile qualifier
  struct W {
 ^
  simplified.cpp:4:3: note: candidate constructor not viable: no known 
conversion from 'volatile W' to 'const S &' for
1st argument
W( const S& ) {}
^
  simplified.cpp:8:15: note: passing argument to parameter here
S(volatile W) {}

It would be nice if anyone could check if this is a right approach for fixing 
this issue.
Thank you.


http://reviews.llvm.org/D10881



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


Re: [PATCH] D12916: [Static Analyzer] Use generics related information to infer dynamic types.

2015-09-17 Thread Anna Zaks via cfe-commits
zaks.anna added inline comments.


Comment at: lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp:871
@@ +870,3 @@
+  if (RetRegion && !State->get(RetRegion)) {
+// TODO: we have duplicated information in DynamicTypeMap and
+// MostSpecializedTypeArgsMap. We should only store anything in the later 
if

xazax.hun wrote:
> You are right, I am added the check and the comment.
> The dynamicTypePropagationOnCasts should not cause any trouble, it only 
> updates the dynamic type map, when there is new and better information 
> available. See getBetterObjCType function.
> 
> We do not need to call getBetterObjCType here, because if there were no 
> information yet, we will populate the table, if a function was inlined and 
> there is a cast before return getBetterObjCType was already called there, so 
> it is safe to just skip updating the DynamicTypeMap.
> We do not need to call getBetterObjCType here, because if there were no 
> information yet, we will populate the table, if a > function was inlined and 
> there is a cast before return getBetterObjCType was already called there, so 
> it is safe to just 
> skip updating the DynamicTypeMap.

You should explain this in the comment.


http://reviews.llvm.org/D12916



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


r247959 - clang/test/Driver/myriad-toolchain.c: Tweak for DOSish path.

2015-09-17 Thread NAKAMURA Takumi via cfe-commits
Author: chapuni
Date: Thu Sep 17 20:02:50 2015
New Revision: 247959

URL: http://llvm.org/viewvc/llvm-project?rev=247959&view=rev
Log:
clang/test/Driver/myriad-toolchain.c: Tweak for DOSish path.

Modified:
cfe/trunk/test/Driver/myriad-toolchain.c

Modified: cfe/trunk/test/Driver/myriad-toolchain.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/myriad-toolchain.c?rev=247959&r1=247958&r2=247959&view=diff
==
--- cfe/trunk/test/Driver/myriad-toolchain.c (original)
+++ cfe/trunk/test/Driver/myriad-toolchain.c Thu Sep 17 20:02:50 2015
@@ -2,7 +2,7 @@
 // RUN: -B %S/Inputs/basic_myriad_tree 2>&1 | FileCheck %s 
-check-prefix=LINK_WITH_RTEMS
 // LINK_WITH_RTEMS: 
Inputs/basic_myriad_tree/lib/gcc/sparc-myriad-elf/4.8.2/crti.o
 // LINK_WITH_RTEMS: 
Inputs/basic_myriad_tree/lib/gcc/sparc-myriad-elf/4.8.2/crtbegin.o
-// LINK_WITH_RTEMS: 
"-L{{.*}}Inputs/basic_myriad_tree/lib/gcc/sparc-myriad-elf/4.8.2/../../../../sparc-myriad-elf/lib"
+// LINK_WITH_RTEMS: 
"-L{{.*}}Inputs/basic_myriad_tree/lib/gcc/sparc-myriad-elf/4.8.2/../../..{{/|}}../sparc-myriad-elf/lib"
 // LINK_WITH_RTEMS: 
"-L{{.*}}Inputs/basic_myriad_tree/lib/gcc/sparc-myriad-elf/4.8.2"
 // LINK_WITH_RTEMS: "--start-group" "-lc" "-lrtemscpu" "-lrtemsbsp" 
"--end-group" "-lgcc"
 // LINK_WITH_RTEMS: 
Inputs/basic_myriad_tree/lib/gcc/sparc-myriad-elf/4.8.2/crtend.o


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


Re: [PATCH] D12761: MPI-Checker patch for Clang Static Analyzer

2015-09-17 Thread Anna Zaks via cfe-commits
zaks.anna added a comment.

> > It's more user friendly to report this issue at the last point where the 
> > request is available rather than the last line of the function.

> 

> >  This looks similar to leak report checking. Is it?

> 

> 

> Yes, that's not very common but possible.

>  Does this change involve the use of a BugReporterVisitor?!


You should register/report the diagnostic at check::DeadSymbols event instead 
of check:: EndFunction; that way the error will be reported earlier.

> You're right, it's very similar.





http://reviews.llvm.org/D12761



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


Re: [PATCH] D12906: [RFC] Bug identification("issue_hash") change for CmpRuns.py

2015-09-17 Thread Anna Zaks via cfe-commits
zaks.anna added a comment.

This new patch does not seem to build on top of http://reviews.llvm.org/D10305 
but is an alternative way of generating the hash that reuses a lot of the 
building blocks from the other patch. What is the reason for that?

(It also addresses your comment to this patch and creates the GetIssueHash 
subroutine as well as addresses my comment and uses the computed hash in 
issue_hash, which is used by CmpRuns. Thanks!)


http://reviews.llvm.org/D12906



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


Re: [PATCH] D12119: Analyzer: Fix a crasher in UbigraphViz

2015-09-17 Thread Anna Zaks via cfe-commits
zaks.anna added a comment.

I see, Maybe we should add a new test file to test this instead of adding it to 
an existing test.


http://reviews.llvm.org/D12119



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


Re: [PATCH] D12119: Analyzer: Fix a crasher in UbigraphViz

2015-09-17 Thread Anna Zaks via cfe-commits
zaks.anna accepted this revision.
zaks.anna added a comment.
This revision is now accepted and ready to land.

Otherwise, LGTM.


http://reviews.llvm.org/D12119



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


  1   2   >