]> granicus.if.org Git - clang/log
clang
8 years agoRevert "Reapply "[ProfileData] (clang) Use Error in InstrProf and Coverage, NFC""
Chandler Carruth [Sat, 14 May 2016 05:39:45 +0000 (05:39 +0000)]
Revert "Reapply "[ProfileData] (clang) Use Error in InstrProf and Coverage, NFC""

This reverts commit r269492 as the corresponding LLVM commit was
reverted due to lots of warnings. See the review thread for the original
LLVM commit (r269491) for details.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269549 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdded support to the ASTImporter for C++ constructor initializers.
Sean Callanan [Sat, 14 May 2016 05:20:31 +0000 (05:20 +0000)]
Added support to the ASTImporter for C++ constructor initializers.

Thanks to Aleksei Sidorin for review and advice.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269546 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoWhen typo-correcting a using-declaration, actually correct the name of the
Richard Smith [Sat, 14 May 2016 01:58:49 +0000 (01:58 +0000)]
When typo-correcting a using-declaration, actually correct the name of the
UsingDecl (so that redeclaration lookup can find it).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269530 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix some typos.
Richard Smith [Sat, 14 May 2016 01:21:40 +0000 (01:21 +0000)]
Fix some typos.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269528 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[AVX512] Update pshufd type strings to match the backend. Also mark the immediate...
Craig Topper [Sat, 14 May 2016 00:49:36 +0000 (00:49 +0000)]
[AVX512] Update pshufd type strings to match the backend. Also mark the immediate as an ICE instead of marking the previous vector as const.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269527 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[VFS] Add level() method to vfs::recursive_directory_iterator
Bruno Cardoso Lopes [Sat, 14 May 2016 00:00:18 +0000 (00:00 +0000)]
[VFS] Add level() method to vfs::recursive_directory_iterator

Unlike sys::fs::recursive_directory_iterator,
vfs::recursive_directory_iterator does not implement the level() method,
which tells how deep in the directory tree the current iterator is. This
is needed in the vfs::recursive_directory_iterator so that future
improvements to the crash reproducer will be able to properly access
header for umbrellas when looking into the VFS.

rdar://problem/25880368

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269520 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoGet default -fms-compatibility-version from cl.exe's version
Adrian McCarthy [Fri, 13 May 2016 23:20:11 +0000 (23:20 +0000)]
Get default -fms-compatibility-version from cl.exe's version

-fms-compatibility-version was defaulting to 18 (VS 2013), which is a pain if your environment is pointing to version 19 (VS 2015) libraries.

If cl.exe can be found, this patch uses its version number as the default instead. It re-uses the existing code to find the Visual Studio binaries folder and WinAPI methods to check its version. You can still explicitly specify a compatibility version on the command line. If you don't have cl.exe, this should be a no-op and you'll get the old default of 18.

This affected the tests, which assumed that if you didn't specific a version, that it would default to 18, but this won't be true for all machines. So a couple test cases had to be eliminated and a couple others had to be tweaked to allow for various outputs.

Addresses: https://llvm.org/bugs/show_bug.cgi?id=27215

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269515 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ModuleMap][CrashReproducer] Collect headers from inner frameworks
Bruno Cardoso Lopes [Fri, 13 May 2016 22:21:51 +0000 (22:21 +0000)]
[ModuleMap][CrashReproducer] Collect headers from inner frameworks

(1) Collect headers under inner frameworks (frameworks inside other
other frameworks).
(2) Make sure we also collect the right header files inside them.

More info on (2):

Consider a dummy framework module B, with header Frameworks/B/B.h. Now
consider that another framework A, with header Frameworks/A/A.h, has a
layout with a inner framework Frameworks/A/Frameworks/B/B.h, where the
"B/B.h" part is a symlink for Frameworks/B/B.h. Also assume that
Frameworks/A/A.h includes <B/B.h>.

When parsing header Frameworks/A/A.h, framework module lookup is
performed in search for B, and it happens that
"Frameworks/A/Frameworks/B/B.h" path is registered in the module instead
of real "Frameworks/B/B.h". This occurs because
"Frameworks/A/Frameworks/B/B.h" is scanned first by the FileManager,
when looking for inner framework modules under Frameworks/A/Frameworks.
This makes Frameworks/A/Frameworks/B/B.h the default cached named inside
the FileManager for the B.h file UID.

This leads to modules being built without consistent paths to underlying
header files. This is usually not a problem in regular compilation flow,
but it's an issue when running the crash reproducer. The issue is that
clangs collect "Frameworks/A/Frameworks/B/B.h" but not
"Frameworks/B/B.h" into the VFS, leading to err_mmap_umbrella_clash. So
make sure we also collect the original header.

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

rdar://problem/25880368

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269502 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoReapply "[ProfileData] (clang) Use Error in InstrProf and Coverage, NFC"
Vedant Kumar [Fri, 13 May 2016 21:51:02 +0000 (21:51 +0000)]
Reapply "[ProfileData] (clang) Use Error in InstrProf and Coverage, NFC"

Sync up with "(llvm) Use Error in InstrProf and Coverage".

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269492 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoARM-MachO: stop claiming to be EABI
Tim Northover [Fri, 13 May 2016 21:26:45 +0000 (21:26 +0000)]
ARM-MachO: stop claiming to be EABI

Embedded ARM MachO targets are AAPCS but not full EABI (we don't use
__aeabi_whatever and the functions are allowed to be hard-float).

Turns out there was already a test for this, but its original purpose had
become corrupted over the years.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269487 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRevert "[ProfileData] (clang) Use Error in InstrProf and Coverage, NFC"
Vedant Kumar [Fri, 13 May 2016 20:10:22 +0000 (20:10 +0000)]
Revert "[ProfileData] (clang) Use Error in InstrProf and Coverage, NFC"

This reverts commit r269463. It fails two llvm-profdata tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269468 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[MS ABI] Delegating constructors should not assume they are most derived
David Majnemer [Fri, 13 May 2016 20:05:09 +0000 (20:05 +0000)]
[MS ABI] Delegating constructors should not assume they are most derived

A constructor needs to know whether or not it is most derived in order
to determine if it is responsible for virtual bases.  Delegating
constructors assumed they were most derived.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269465 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ProfileData] (clang) Use Error in InstrProf and Coverage, NFC
Vedant Kumar [Fri, 13 May 2016 20:01:34 +0000 (20:01 +0000)]
[ProfileData] (clang) Use Error in InstrProf and Coverage, NFC

Sync up with "(llvm) Use Error in InstrProf and Coverage".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269463 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd an AST matcher for CastExpr kind
Etienne Bergeron [Fri, 13 May 2016 19:36:55 +0000 (19:36 +0000)]
Add an AST matcher for CastExpr kind

Summary:
This AST matcher will match a given CastExpr kind.
It's an narrowing matcher on CastExpr.

Reviewers: klimek, alexfh, sbenza, aaron.ballman

Subscribers: Prazek, jroelofs, aaron.ballman, klimek, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269460 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoUse marginally more appropriate functions to detect if we should declare an
Richard Smith [Fri, 13 May 2016 18:48:05 +0000 (18:48 +0000)]
Use marginally more appropriate functions to detect if we should declare an
implicit copy constructor/assignment, and other minor cleanups. No
functionality change intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269457 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix module map typo in r269347.
Richard Smith [Fri, 13 May 2016 17:28:51 +0000 (17:28 +0000)]
Fix module map typo in r269347.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269440 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRevert "[OpenCL] Add supported OpenCL extensions to target info."
Yaxun Liu [Fri, 13 May 2016 17:16:26 +0000 (17:16 +0000)]
Revert "[OpenCL] Add supported OpenCL extensions to target info."

Revert r269431 due to build failure caused by warning msg:

  llvm/tools/clang/lib/Basic/Targets.cpp:2090:9: error: 'setSupportedOpenCLOpts' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
   void setSupportedOpenCLOpts() {

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269435 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[OpenCL] Add supported OpenCL extensions to target info.
Yaxun Liu [Fri, 13 May 2016 15:44:37 +0000 (15:44 +0000)]
[OpenCL] Add supported OpenCL extensions to target info.

Add supported OpenCL extensions to target info. It serves as default values to save the users of the burden setting each supported extensions and optional core features in command line.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269431 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoPrune four superfluous ExternalSemaSource.h includes and one forward declaration...
Yaron Keren [Fri, 13 May 2016 14:53:19 +0000 (14:53 +0000)]
Prune four superfluous ExternalSemaSource.h includes and one forward declaration in Sema.h
where ExternalSemaSource.h was already included due to ExternalSemaSource:: member uses.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269423 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[CodeGen] Clang does not choose aapcs-vfp calling convention for ARM bare metal targe...
Oleg Ranevskyy [Fri, 13 May 2016 14:45:57 +0000 (14:45 +0000)]
[CodeGen] Clang does not choose aapcs-vfp calling convention for ARM bare metal target with hard float (EABIHF)

Summary:
Clang does not detect `aapcs-vfp` for the EABIHF environment. The reason is that only GNUEABIHF is considered while choosing calling convention, EABIHF is ignored.

This causes clang to use `aapcs` for EABIHF and add the `arm_aapcscc` specifier to functions in generated IR.

The modified `arm-cc.c` test checks that no calling convention specifier is added to functions for EABIHF, which means the default one is used (`CallingConv::ARM_AAPCS_VFP`).

Reviewers: rengolin, compnerd, t.p.northover

Subscribers: aemerson, rengolin, asl, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269419 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[AST] Add missing const qualifiers to AstContext in Type.cpp
Etienne Bergeron [Fri, 13 May 2016 14:31:44 +0000 (14:31 +0000)]
[AST] Add missing const qualifiers to AstContext in Type.cpp

Summary:
Add some missing const qualifiers to AstContext.
The ASTContext can't be modified with accessors.

There is no behavior change. This patch is cleanup only.

Reviewers: rsmith

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269418 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoSimplify getLinuxDynamicLinker() by using a common variable for the triple. NFC.
Vasileios Kalintiris [Fri, 13 May 2016 12:34:14 +0000 (12:34 +0000)]
Simplify getLinuxDynamicLinker() by using a common variable for the triple. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269412 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[mips] Consult triple's vendor field before using musl's interpreter.
Vasileios Kalintiris [Fri, 13 May 2016 12:13:13 +0000 (12:13 +0000)]
[mips] Consult triple's vendor field before using musl's interpreter.

This should affect only the mips-mti-linux toolchain.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269411 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ms][dll] #27212: Generating of implicit special members should take into account...
Dmitry Polukhin [Fri, 13 May 2016 09:03:56 +0000 (09:03 +0000)]
[ms][dll] #27212: Generating of implicit special members should take into account MSVC compatibility version

Clang creates implicit move constructor/assign operator in all cases if
there is std=c++11. But MSVC supports such generation starting from
version 1900 only. As result we have some binary incompatibility.

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

Patch by Andrew V. Tischenko

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269400 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd support for derived class special members hiding functions brought in from
Richard Smith [Fri, 13 May 2016 06:47:56 +0000 (06:47 +0000)]
Add support for derived class special members hiding functions brought in from
a base class via a using-declaration. If a class has a using-declaration
declaring either a constructor or an assignment operator, eagerly declare its
special members in case they need to displace a shadow declaration from a
using-declaration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269398 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoExtend this test to also be valid in C++14.
Richard Smith [Fri, 13 May 2016 06:42:55 +0000 (06:42 +0000)]
Extend this test to also be valid in C++14.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269397 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ObjC][CodeGen] Remove an assert that is no longer correct.
Akira Hatanaka [Fri, 13 May 2016 01:21:23 +0000 (01:21 +0000)]
[ObjC][CodeGen] Remove an assert that is no longer correct.

clang asserts when compiling the following code because r231508 made
changes to promote constant temporary arrays and records to globals
with constant initializers:

std::vector<NSString*> strs = {@"a", @"b"};

This commit changes the code to return early if the object returned by
createReferenceTemporary is a global variable with an initializer.

rdar://problem/25504992
rdar://problem/25955179

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269385 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoPreserve the FoundDecl properly in constructor overload resolution. No
Richard Smith [Thu, 12 May 2016 23:45:49 +0000 (23:45 +0000)]
Preserve the FoundDecl properly in constructor overload resolution. No
functionality change; this information is not yet in use.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269382 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix Clang-tidy modernize-use-bool-literals in generated code.
Eugene Zelenko [Thu, 12 May 2016 22:27:08 +0000 (22:27 +0000)]
Fix Clang-tidy modernize-use-bool-literals in generated code.

Reduce space in empty constructors and between data members and first public section.

Fix some Include What You Use warnings.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269371 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRefactor constant expression evaluation of CXXConstructExpr to reduce duplication...
Richard Smith [Thu, 12 May 2016 22:16:28 +0000 (22:16 +0000)]
Refactor constant expression evaluation of CXXConstructExpr to reduce duplication between array and class initialization.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269367 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[AST] Move operations enum to a definition file.
Etienne Bergeron [Thu, 12 May 2016 20:58:56 +0000 (20:58 +0000)]
[AST] Move operations enum to a definition file.

Summary:
This patch moves the enum definitions to a definition (.def) file.

These modifications provide way to list enumerators of a given type.

As an example, this allow parsing of "kinds" in the dynamic matchers.
see: http://reviews.llvm.org/D19871
The dynamic matcher "ofKind" also required this patch to be fixed.

Reviewers: klimek, aaron.ballman, rsmith

Subscribers: klimek, sbenza, alexfh, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269347 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Tooling] Fix broken dependency for shared build
Etienne Bergeron [Thu, 12 May 2016 19:51:18 +0000 (19:51 +0000)]
[Tooling] Fix broken dependency for shared build

Summary:
There virtual destructor can't be found and cause a compilation error
on a shared build.

To repro: [Release + Shared]
```
-DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON
```

Which produce this error:
```
tools/clang/unittests/Tooling/CMakeFiles/ToolingTests.dir/ToolingTest.cpp.o: In function `clang::tooling::newFrontendActionFactory_CreatesFrontendActionFactoryFromType_Test::TestBody()':
ToolingTest.cpp:(.text._ZN5clang7tooling66newFrontendActionFactory_CreatesFrontendActionFactoryFromType_Test8TestBodyEv+0x49): undefined reference to `clang::SyntaxOnlyAction::~SyntaxOnlyAction()'
```

Reviewers: alexfh

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269334 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[VFS] Reapply #2: Reconstruct the VFS overlay tree for more accurate lookup
Bruno Cardoso Lopes [Thu, 12 May 2016 19:13:07 +0000 (19:13 +0000)]
[VFS] Reapply #2: Reconstruct the VFS overlay tree for more accurate lookup

Reapply r269100 and r269270, reverted due to
https://llvm.org/bugs/show_bug.cgi?id=27725. Isolate the testcase that
corresponds to the new feature side of this commit and skip it on
windows hosts until we find why it does not work on these platforms.

Original commit message:

The way we currently build the internal VFS overlay representation leads
to inefficient path search and might yield wrong answers when asked for
recursive or regular directory iteration.

Currently, when reading an YAML file, each YAML root entry is placed
inside a new root in the filesystem overlay. In the crash reproducer, a
simple "@import Foundation" currently maps to 43 roots, and when looking
up paths, we traverse a directory tree for each of these different
roots, until we find a match (or don't). This has two consequences:

- It's slow.
- Directory iteration gives incomplete results since it only return
results within one root - since contents of the same directory can be
declared inside different roots, the result isn't accurate.

This is in part fault of the way we currently write out the YAML file
when emitting the crash reproducer - we could generate only one root and
that would make it fast and correct again. However, we should not rely
on how the client writes the YAML, but provide a good internal
representation regardless.

Build a proper virtual directory tree out of the YAML representation,
allowing faster search and proper iteration. Besides the crash
reproducer, this potentially benefits other VFS clients.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269327 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Unittests] Reverse the order of arguments for correct debug output
Bruno Cardoso Lopes [Thu, 12 May 2016 19:13:04 +0000 (19:13 +0000)]
[Unittests] Reverse the order of arguments for correct debug output

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269326 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ubsan] Add -fsanitize-undefined-strip-path-components=N
Filipe Cabecinhas [Thu, 12 May 2016 16:51:36 +0000 (16:51 +0000)]
[ubsan] Add -fsanitize-undefined-strip-path-components=N

Summary:
This option allows the user to control how much of the file name is
emitted by UBSan. Tuning this option allows one to save space in the
resulting binary, which is helpful for restricted execution
environments.

With a positive N, UBSan skips the first N path components.
With a negative N, UBSan only keeps the last N path components.

Reviewers: rsmith

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269309 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[OpenCL] Output OpenCL version in diagnostics.
Anastasia Stulova [Thu, 12 May 2016 16:28:25 +0000 (16:28 +0000)]
[OpenCL] Output OpenCL version in diagnostics.

Diagnostics should note version dependent issues by giving
a hint about current version being compiled for.

This patch changes diagnostics of static storage class specifier
and generic type qualifier to specify OpenCL version as well as
converts other diagnostics to match the style.

Patch by Vedran Miletic!

Review: http://reviews.llvm.org/D19780

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269305 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoclang-format: [JS] respect clang-format off when requoting strings.
Martin Probst [Thu, 12 May 2016 11:20:32 +0000 (11:20 +0000)]
clang-format: [JS] respect clang-format off when requoting strings.

Reviewers: djasper

Subscribers: klimek, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269282 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Driver] Squash misleading indentation warning.
Marcin Koscielnicki [Thu, 12 May 2016 10:27:59 +0000 (10:27 +0000)]
[Driver] Squash misleading indentation warning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269279 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRevert "[VFS] Reapply r269100: Reconstruct the VFS overlay tree for more accurate...
Bruno Cardoso Lopes [Thu, 12 May 2016 04:43:27 +0000 (04:43 +0000)]
Revert "[VFS] Reapply r269100: Reconstruct the VFS overlay tree for more accurate lookup"

Reverts r269270, buildbots still failing:
http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/12119
http://bb.pgr.jp/builders/ninja-clang-i686-msc19-R/builds/2847

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269276 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd an AST matcher for string-literal length
Etienne Bergeron [Thu, 12 May 2016 04:20:04 +0000 (04:20 +0000)]
Add an AST matcher for string-literal length

Summary:
This patch is adding support for a matcher to check string literal length.

This matcher is used in clang-tidy checkers and is part of this refactoring:
  see: http://reviews.llvm.org/D19841

Reviewers: sbenza, klimek, aaron.ballman

Subscribers: alexfh, klimek, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269274 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[MS ABI] Don't crash when zero-initializing a vbase which contains a vbase
David Majnemer [Thu, 12 May 2016 03:51:52 +0000 (03:51 +0000)]
[MS ABI] Don't crash when zero-initializing a vbase which contains a vbase

Bases can be zero-initialized: the storage is zero-initialized before
the base constructor is run.
The MS ABI has a quirk where base VBPtrs are not installed by the
base constructor but by the most derived class.  In particular, they are
installed before the base constructor is run.
The derived constructor must be careful to zero-initialize only the bits
of the class which haven't already been populated by virtual base
pointers.

While we correctly avoided this scenario, we didn't handle the case
where the base class has virtual bases which have virtual bases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269271 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[VFS] Reapply r269100: Reconstruct the VFS overlay tree for more accurate lookup
Bruno Cardoso Lopes [Thu, 12 May 2016 03:23:36 +0000 (03:23 +0000)]
[VFS] Reapply r269100: Reconstruct the VFS overlay tree for more accurate lookup

The way we currently build the internal VFS overlay representation leads
to inefficient path search and might yield wrong answers when asked for
recursive or regular directory iteration.

Currently, when reading an YAML file, each YAML root entry is placed
inside a new root in the filesystem overlay. In the crash reproducer, a
simple "@import Foundation" currently maps to 43 roots, and when looking
up paths, we traverse a directory tree for each of these different
roots, until we find a match (or don't). This has two consequences:

- It's slow.
- Directory iteration gives incomplete results since it only return
results within one root - since contents of the same directory can be
declared inside different roots, the result isn't accurate.

This is in part fault of the way we currently write out the YAML file
when emitting the crash reproducer - we could generate only one root and
that would make it fast and correct again. However, we should not rely
on how the client writes the YAML, but provide a good internal
representation regardless.

This patch builds a proper virtual directory tree out of the YAML
representation, allowing faster search and proper iteration. Besides the
crash reproducer, this potentially benefits other VFS clients.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269270 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[tooling] Remove redundant inline keyword
Etienne Bergeron [Thu, 12 May 2016 00:22:28 +0000 (00:22 +0000)]
[tooling] Remove redundant inline keyword

Summary:
The inline keywords are redundant.
Introduce by this commit to try to fix broken build bots:
  http://reviews.llvm.org/D20180

Tested on Debug and Release build [linux].
Tested on Release + Shared (-DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON) [linux]
Tested on Release [windows]

Reviewers: alexfh

Subscribers: cfe-commits, klimek

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269257 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFixed msvc warnings
Simon Pilgrim [Wed, 11 May 2016 21:55:37 +0000 (21:55 +0000)]
Fixed msvc warnings

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269242 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[VFS][Unittests] Make dir iteration tests depend only on content
Bruno Cardoso Lopes [Wed, 11 May 2016 20:58:47 +0000 (20:58 +0000)]
[VFS][Unittests] Make dir iteration tests depend only on content

Do not rely on any specific order while comparing the results of
directory iteration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269234 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoPreserve the FoundDecl when performing overload resolution for constructors.
Richard Smith [Wed, 11 May 2016 20:37:46 +0000 (20:37 +0000)]
Preserve the FoundDecl when performing overload resolution for constructors.
This is in preparation for C++ P0136R1, which switches the model for inheriting
constructors over from synthesizing a constructor to finding base class
constructors (via using shadow decls) when looking for derived class
constructors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269231 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[analyzer] Fix crash in ObjCGenericsChecker
Devin Coughlin [Wed, 11 May 2016 20:28:41 +0000 (20:28 +0000)]
[analyzer] Fix crash in ObjCGenericsChecker

Fix a crash in the generics checker where DynamicTypePropagation tries
to get the superclass of a root class.

This is a spot-fix for a deeper issue where the checker makes assumptions
that may not hold about subtyping between the symbolically-tracked type of
a value and the compile-time types of a cast on that value.

I've added a TODO to address the underlying issue.

rdar://problem/26086914

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269227 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[tooling] Fix missing inline keyworkd, breaking build bot.
Etienne Bergeron [Wed, 11 May 2016 20:09:17 +0000 (20:09 +0000)]
[tooling] Fix missing inline keyworkd, breaking build bot.

Summary:
The missing keyword "inline" is causing some buildbot to fail.
The symbol is not available.

see: http://lab.llvm.org:8011/builders/clang-ppc64be-linux-multistage/builds/2281/

Reviewers: rnk

Subscribers: cfe-commits, klimek

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269224 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[MSVC] Implementation of __unaligned as a proper type qualifier
Andrey Bokhanko [Wed, 11 May 2016 18:38:21 +0000 (18:38 +0000)]
[MSVC] Implementation of __unaligned as a proper type qualifier

This patch implements __unaligned (MS extension) as a proper type qualifier
(before that, it was implemented as an ignored attribute).

It also fixes PR27367 and PR27666.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269220 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRelax -Wcalling-convention-cast when casting to the default convention (cdecl)
Reid Kleckner [Wed, 11 May 2016 17:43:13 +0000 (17:43 +0000)]
Relax -Wcalling-convention-cast when casting to the default convention (cdecl)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269214 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoEmbed bitcode in object file (clang cc1 part)
Steven Wu [Wed, 11 May 2016 16:26:03 +0000 (16:26 +0000)]
Embed bitcode in object file (clang cc1 part)

Summary:
Teach clang to embed bitcode inside bitcode. When -fembed-bitcode cc1
option is used, clang will embed both the input bitcode and cc1
commandline into the bitcode in special sections before compiling to
the object file.  Using -fembed-bitcode-marker will only introduce a
marker in both sections.

Depends on D17390

Reviewers: rsmith

Subscribers: yaron.keren, vsk, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269202 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoUpdate clang support on recent Haiku
Reid Kleckner [Wed, 11 May 2016 16:19:05 +0000 (16:19 +0000)]
Update clang support on recent Haiku

[ Copied from https://llvm.org/bugs/show_bug.cgi?id=26404 ]

clang support on Haiku is lagging a bit, and missing on x86_64.

This patch updates support for x86 and add support for x86_64. It should
apply directly to trunk and it's harmless in the sense that it only
affects Haiku.

Reviewers: rnk, rsmith

Patch by Jérôme Duval

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269201 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Hexagon] Avoid spurious failures in test/Driver/hexagon-toolchain-elf.c
Krzysztof Parzyszek [Wed, 11 May 2016 16:11:22 +0000 (16:11 +0000)]
[Hexagon] Avoid spurious failures in test/Driver/hexagon-toolchain-elf.c

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269200 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[tooling] FixItHint Tooling refactoring
Etienne Bergeron [Wed, 11 May 2016 14:31:39 +0000 (14:31 +0000)]
[tooling] FixItHint Tooling refactoring

Summary:
This is the refactoring to lift some FixItHint into tooling.
used by: http://reviews.llvm.org/D19807

Reviewers: klimek, alexfh

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269188 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[clang][AVX512] completing missing set intrinsics
Michael Zuckerman [Wed, 11 May 2016 11:41:29 +0000 (11:41 +0000)]
[clang][AVX512] completing missing set intrinsics

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269172 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[clang][AVX512] completing missing intrinsics for [vpermt2d|vptestm] instruction...
Michael Zuckerman [Wed, 11 May 2016 11:21:18 +0000 (11:21 +0000)]
[clang][AVX512] completing missing intrinsics for [vpermt2d|vptestm] instruction set.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269170 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoHopefully bring llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast back to life
Sean Silva [Wed, 11 May 2016 04:04:59 +0000 (04:04 +0000)]
Hopefully bring llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast back to life

Bruno made a couple valiant attempts but the bot is still red.

This reverts r269100 (primary commit), r269108 (fix attempt), r269133
(fix attempt).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269160 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Sema] Fix value-dependent enable_if bug.
George Burgess IV [Wed, 11 May 2016 01:38:27 +0000 (01:38 +0000)]
[Sema] Fix value-dependent enable_if bug.

This patch fixes a bug where we would assume all value-dependent
enable_if conditions give successful results.

Instead, we consider value-dependent enable_if conditions to always
fail. While this isn't ideal, this is the best we can realistically do
without changing both enable_if's semantics and large parts of Sema
(specifically, all of the parts that don't expect type dependence to
come out of nowhere, and that may interact with overload resolution).

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269154 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoDisable -Wcast-calling-convention by default (follow-up to r269116)
Hans Wennborg [Wed, 11 May 2016 00:49:20 +0000 (00:49 +0000)]
Disable -Wcast-calling-convention by default (follow-up to r269116)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269148 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[VFS] One more unittest change to fix win10 buildbot
Bruno Cardoso Lopes [Tue, 10 May 2016 22:30:01 +0000 (22:30 +0000)]
[VFS] One more unittest change to fix win10 buildbot

http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/5110
Follow up from r269100.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269133 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoWildcard away paths in fixit CHECKs in my last testcase
Reid Kleckner [Tue, 10 May 2016 21:10:25 +0000 (21:10 +0000)]
Wildcard away paths in fixit CHECKs in my last testcase

Oops. :(

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269118 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd -Wcast-calling-convention to warn when casting away calling conventions
Reid Kleckner [Tue, 10 May 2016 21:00:03 +0000 (21:00 +0000)]
Add -Wcast-calling-convention to warn when casting away calling conventions

Summary:
This only warns on casts of the address of a function defined in the
current TU. In this case, the fix is likely to be local and the warning
useful.

Here are some things we could experiment with in the future:
- Fire on declarations as well as definitions
- Limit the warning to non-void function prototypes
- Limit the warning to mismatches of caller and callee cleanup CCs

This warning is currently off by default while we study its usefulness.

Reviewers: thakis, rtrieu

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269116 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoUpdate clang for LLVM API change.
Peter Collingbourne [Tue, 10 May 2016 20:23:29 +0000 (20:23 +0000)]
Update clang for LLVM API change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269111 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[VFS] Change unittest to try appeasing win10 buildbot
Bruno Cardoso Lopes [Tue, 10 May 2016 20:20:55 +0000 (20:20 +0000)]
[VFS] Change unittest to try appeasing win10 buildbot

http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/5103
Follow up from r269100.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269108 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[VFS] Reconstruct the VFS overlay tree for more accurate lookup
Bruno Cardoso Lopes [Tue, 10 May 2016 18:43:00 +0000 (18:43 +0000)]
[VFS] Reconstruct the VFS overlay tree for more accurate lookup

The way we currently build the internal VFS overlay representation leads
to inefficient path search and might yield wrong answers when asked for
recursive or regular directory iteration.

Currently, when reading an YAML file, each YAML root entry is placed
inside a new root in the filesystem overlay. In the crash reproducer, a
simple "@import Foundation" currently maps to 43 roots, and when looking
up paths, we traverse a directory tree for each of these different
roots, until we find a match (or don't). This has two consequences:

- It's slow.
- Directory iteration gives incomplete results since it only return
results within one root - since contents of the same directory can be
declared inside different roots, the result isn't accurate.

This is in part fault of the way we currently write out the YAML file
when emitting the crash reproducer - we could generate only one root and
that would make it fast and correct again. However, we should not rely
on how the client writes the YAML, but provide a good internal
representation regardless.

This patch builds a proper virtual directory tree out of the YAML
representation, allowing faster search and proper iteration. Besides the
crash reproducer, this potentially benefits other VFS clients.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269100 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[WebAssembly] Reduce strictness of static destructor test
Derek Schuff [Tue, 10 May 2016 18:35:31 +0000 (18:35 +0000)]
[WebAssembly] Reduce strictness of static destructor test

It didn't work on non-asserts builds

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269099 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoIntroduce CGCXXABI::canCallMismatchedFunctionType
Derek Schuff [Tue, 10 May 2016 17:44:55 +0000 (17:44 +0000)]
Introduce CGCXXABI::canCallMismatchedFunctionType

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269089 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agomore cleanup
Derek Schuff [Tue, 10 May 2016 17:44:52 +0000 (17:44 +0000)]
more cleanup

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269088 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoClarify condition, remove redundant check
Derek Schuff [Tue, 10 May 2016 17:44:50 +0000 (17:44 +0000)]
Clarify condition, remove redundant check

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269087 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoClean up condition, add ARM to test
Derek Schuff [Tue, 10 May 2016 17:44:48 +0000 (17:44 +0000)]
Clean up condition, add ARM to test

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269086 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoDo not register incompatible C++ destructors with __cxa_atexit
Derek Schuff [Tue, 10 May 2016 17:44:46 +0000 (17:44 +0000)]
Do not register incompatible C++ destructors with __cxa_atexit

Summary:
For a static object with a nontrivial destructor, clang generates an
initializer function (__cxx_global_var_init) which registers that
object's destructor using __cxa_atexit. However some ABIs (ARM,
WebAssembly) use destructors that return 'this' instead of having void
return (which does not match the signature of function pointers passed
to __cxa_atexit). This results in undefined behavior when the destructors are
called. All the calling conventions I know of on ARM can tolerate this,
but WebAssembly requires the signatures of indirect calls to match the
called function.

This patch disables that direct registration of destructors for ABIs
that have this-returning destructors.

Subscribers: aemerson, jfb, cfe-commits, dschuff

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269085 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoclang/test/CodeGen/avx512f-builtins.c: Fix for -Asserts.
NAKAMURA Takumi [Tue, 10 May 2016 17:16:12 +0000 (17:16 +0000)]
clang/test/CodeGen/avx512f-builtins.c: Fix for -Asserts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269079 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[CMake] Pass LLVM_LIBDIR_SUFFIX into Compiler-RT
Chris Bieneman [Tue, 10 May 2016 16:10:22 +0000 (16:10 +0000)]
[CMake] Pass LLVM_LIBDIR_SUFFIX into Compiler-RT

Not passing this causes Compiler-RT to fail to configure on multi-lib systems.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269069 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRemove unused diagnostic. NFC.
Benjamin Kramer [Tue, 10 May 2016 14:04:34 +0000 (14:04 +0000)]
Remove unused diagnostic. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269063 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Clang][AVX512] completing missing intrinsics [load/store]
Michael Zuckerman [Tue, 10 May 2016 13:13:54 +0000 (13:13 +0000)]
[Clang][AVX512] completing missing intrinsics [load/store]

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269056 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[OPENMP 4.5] Initial codegen for 'priority' clause in task-based
Alexey Bataev [Tue, 10 May 2016 12:21:02 +0000 (12:21 +0000)]
[OPENMP 4.5] Initial codegen for 'priority' clause in task-based
directives.

OpenMP 4.5 supports clause 'priority' in task-based directives. Patch
adds initial codegen support for this clause in codegen.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269050 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Clang][AVX512] completing missing intrinsics [vmin/vmax]{sd|sq|uq|ud}.
Michael Zuckerman [Tue, 10 May 2016 11:34:19 +0000 (11:34 +0000)]
[Clang][AVX512] completing missing intrinsics [vmin/vmax]{sd|sq|uq|ud}.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269042 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[OPENMP 4.0] Fixed codegen for destructors in task-based directives.
Alexey Bataev [Tue, 10 May 2016 10:36:51 +0000 (10:36 +0000)]
[OPENMP 4.0] Fixed codegen for destructors in task-based directives.

If private variables require destructors call at the deletion of the
task, additional flag in task flags must be set. Patch fixes this
problem.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269039 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Clang][AVX512] completing missing intrinsics [vextractf].
Michael Zuckerman [Tue, 10 May 2016 10:14:50 +0000 (10:14 +0000)]
[Clang][AVX512] completing missing intrinsics [vextractf].

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269037 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[OPENMP 4.5] Add codegen support in runtime for '[non]monotonic'
Alexey Bataev [Tue, 10 May 2016 09:57:36 +0000 (09:57 +0000)]
[OPENMP 4.5] Add codegen support in runtime for '[non]monotonic'
schedule modifiers.

Runtime library expects some additional data in schedule argument for
loop-based directives, that have additional schedule modifiers
'monotonic|nonmonotonic'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269035 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Clang][AVX512] completing missing intrinsics [roundscale, ceil, floor]
Michael Zuckerman [Tue, 10 May 2016 07:30:58 +0000 (07:30 +0000)]
[Clang][AVX512] completing missing intrinsics [roundscale, ceil, floor]

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269022 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Sema] Fix an overload resolution bug with enable_if.
George Burgess IV [Tue, 10 May 2016 01:59:34 +0000 (01:59 +0000)]
[Sema] Fix an overload resolution bug with enable_if.

Currently, if clang::isBetterOverloadCandidate encounters an enable_if
attribute on either candidate that it's inspecting, it will ignore all
lower priority attributes (e.g. pass_object_size). This is problematic
in cases like:

```
void foo(char *c) __attribute__((enable_if(1, "")));
void foo(char *c __attribute__((pass_object_size(0))))
    __attribute__((enable_if(1, "")));
```

...Because we would ignore the pass_object_size attribute in the second
`foo`, and consider any call to `foo` to be ambiguous.

This patch makes overload resolution consult further tiebreakers (e.g.
pass_object_size) if two candidates have equally good enable_if
attributes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269005 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[CUDA] Fix flush-denormals.cu test so that it checks what it intends to CHECK.
Justin Lebar [Tue, 10 May 2016 00:34:50 +0000 (00:34 +0000)]
[CUDA] Fix flush-denormals.cu test so that it checks what it intends to CHECK.

FileCheck does not evaluate plain CHECKs if you pass -check-prefix; you
have to ask for it explicitly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269000 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoWhen forming a fully-qualified type name, put any qualifiers outside/before the
Richard Smith [Mon, 9 May 2016 23:06:14 +0000 (23:06 +0000)]
When forming a fully-qualified type name, put any qualifiers outside/before the
nested-name-specifier. Patch by Sterling Augustine!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@268988 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[CUDA] Restrict init of local __shared__ variables to empty constructors only.
Artem Belevich [Mon, 9 May 2016 22:09:56 +0000 (22:09 +0000)]
[CUDA] Restrict init of local __shared__ variables to empty constructors only.

Allow only empty constructors for local __shared__ variables in a way
identical to restrictions imposed on dynamic initializers for global
variables on device.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@268982 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[CUDA] Only __shared__ variables can be static local on device side.
Artem Belevich [Mon, 9 May 2016 19:36:08 +0000 (19:36 +0000)]
[CUDA] Only __shared__ variables can be static local on device side.

According to CUDA programming guide (v7.5):
> E.2.9.4: Within the body of a device or global function, only
> shared variables may be declared with static storage class.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@268962 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Myriad] Use Generic_ELF::addClangTargetOptions()
Douglas Katzman [Mon, 9 May 2016 19:09:59 +0000 (19:09 +0000)]
[Myriad] Use Generic_ELF::addClangTargetOptions()

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@268956 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Power9] Enable -mcpu=pwr9 (-mcpu=power9) in the front end
Nemanja Ivanovic [Mon, 9 May 2016 18:58:02 +0000 (18:58 +0000)]
[Power9] Enable -mcpu=pwr9 (-mcpu=power9) in the front end

This patch corresponds to review:
http://reviews.llvm.org/D19684

It simply adds the handling for the option and the corresponding macros.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@268951 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[cmake] Enable zlib support for Apple stage2 builds
Vedant Kumar [Mon, 9 May 2016 18:40:09 +0000 (18:40 +0000)]
[cmake] Enable zlib support for Apple stage2 builds

This allows llvm-profdata to interact with profiles containing
compressed name data.

rdar://problem/26122944

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@268947 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[OpenMP] Parse+Sema for '#pragma omp declare target' syntax version 4.5
Dmitry Polukhin [Mon, 9 May 2016 14:59:13 +0000 (14:59 +0000)]
[OpenMP] Parse+Sema for '#pragma omp declare target' syntax version 4.5

Support OpenMP version 4.5 syntax for #pragma omp declare target.

Syntax:
  #pragma omp declare target (extended-list) new-line
or
  #pragma omp declare target clause[ [,] clause ... ] new-line

Where clause is one of the following:
  to(extended-list)
  link(list)

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@268925 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoProper detection and handling of RHEL and variants.
Rafael Espindola [Mon, 9 May 2016 13:13:50 +0000 (13:13 +0000)]
Proper detection and handling of RHEL and variants.

- Don't consider "/etc/lsb-release" to be Ubuntu only.
- Detect SL, too.
- Only add "--no-add-needed" for RHEL7 (or Fedora), not for RHEL6
  (that's what the compilers shipped with RHEL do).
- removed RHEL4 which is now four years past EOL and certainly incapable
  of building or running any recent version of llvm/clang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@268914 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRHEL: Look in more places to find g++ headers and runtime.
Rafael Espindola [Mon, 9 May 2016 13:03:10 +0000 (13:03 +0000)]
RHEL: Look in more places to find g++ headers and runtime.

Some distros with ten years of support ship an old gcc but later offer
more recent versions for installation in parallel. These versions are
typically not only needed for the compilation of llvm/clang, but also to
properly use the clang binary that comes out.

Clang already searches /usr at runtime for the most recent installation
of gcc. This patch appends paths for add-on installations of gcc in
RHEL.

Patch by Michael Lampe.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@268912 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[clang][AVX512] completing missing intrinsics [vmin/vmax].
Michael Zuckerman [Mon, 9 May 2016 12:38:49 +0000 (12:38 +0000)]
[clang][AVX512] completing missing intrinsics [vmin/vmax].

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@268910 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Clang][AVX512] completing missing intrinsics [CVT]
Michael Zuckerman [Mon, 9 May 2016 10:32:51 +0000 (10:32 +0000)]
[Clang][AVX512] completing missing intrinsics [CVT]

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@268903 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoEnable support for __float128 in Clang and enable it on pertinent platforms
Nemanja Ivanovic [Mon, 9 May 2016 08:52:33 +0000 (08:52 +0000)]
Enable support for __float128 in Clang and enable it on pertinent platforms

This patch corresponds to reviews:
http://reviews.llvm.org/D15120
http://reviews.llvm.org/D19125

It adds support for the __float128 keyword, literals and target feature to
enable it. Based on the latter of the two aforementioned reviews, this feature
is enabled on Linux on i386/X86 as well as SystemZ.
This is also the second attempt in commiting this feature. The first attempt
did not enable it on required platforms which caused failures when compiling
type_traits with -std=gnu++11.

If you see failures with compiling this header on your platform after this
commit, it is likely that your platform needs to have this feature enabled.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@268898 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix spurious warnings about unused private field
Olivier Goffart [Mon, 9 May 2016 07:09:51 +0000 (07:09 +0000)]
Fix spurious warnings about unused private field

If the address of a field is taken as a pointer to member, we should
not warn that the field is not used.

Normaly, yse of fields are done from MemberExpr, but in case of pointer to
member, it is in a DeclRefExpr

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@268895 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86] Fix up type arguments of __builtin_ia32_cvtss2sd_round_mask and __builtin_ia32_...
Craig Topper [Mon, 9 May 2016 05:34:22 +0000 (05:34 +0000)]
[X86] Fix up type arguments of __builtin_ia32_cvtss2sd_round_mask and __builtin_ia32_cvtsd2ss_round_mask to match the backend.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@268893 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoclang-format: Fix space after argument comments.
Daniel Jasper [Sun, 8 May 2016 18:14:01 +0000 (18:14 +0000)]
clang-format: Fix space after argument comments.

Before:
  f(/*a=*/a, /*b=*/ ::b);

After:
  f(/*a=*/a, /*b=*/::b);

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@268879 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoclang-format: Support enum type template arguments.
Daniel Jasper [Sun, 8 May 2016 18:12:22 +0000 (18:12 +0000)]
clang-format: Support enum type template arguments.

Before:
  template <enum E> class A { public : E *f(); };

After:
  template <enum E> class A {
  public:
    E *f();
  };

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@268878 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoTeach header search about GCC 4.9 header search paths in Gentoo, they
Chandler Carruth [Sun, 8 May 2016 07:59:56 +0000 (07:59 +0000)]
Teach header search about GCC 4.9 header search paths in Gentoo, they
now use the full GCC version in their weird suffix.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@268874 91177308-0d34-0410-b5e6-96231b3b80d8