Commit Graph

59554 Commits

Author SHA1 Message Date
Derek Schuff 9cfd488443 Add NaCl to long double/fp128 mangling test
Summary:
NaCl is a platform where long double is the same as double.
Its mangling is spelled with "long double" but its ABI lowering is the same
as double.

Reviewers: rnk, chh

Subscribers: jfb, cfe-commits, dschuff

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

llvm-svn: 244541
2015-08-11 00:19:53 +00:00
Richard Smith a24ff5545b [modules] Properly diagnose errors in module files for which we have no
corresponding include location (those specified on the command line).

llvm-svn: 244538
2015-08-11 00:05:21 +00:00
Richard Smith 629d8e6f18 Fix some tabs.
llvm-svn: 244537
2015-08-11 00:03:28 +00:00
Richard Smith 6d47d16ed6 Remove some dead code.
llvm-svn: 244530
2015-08-10 23:26:54 +00:00
Tyler Nowicki 034baf6154 Append options for vectorization when pointer checking threshold is exceeded.
Following one of the appended options will allow the loop to be vectorized. We do not include a command line option for modifying the pointer checking threshold because there is no clang-level interface for this currently.

llvm-svn: 244526
2015-08-10 23:05:16 +00:00
Derek Schuff 4044f6197a Add NaCl (a target where long double = double) to long double ABI test
A test was recently (r244468) added to cover long double calling convention
codegen, distinguishing between Android and GNU conventions (where long doubles
are fp128 and x86_fp80, respectively). Native Client is a target where long
doubles are the same as doubles. This change augments the test to cover
that case.

Also rename the test to test/codeGen/X86_64-longdouble.c

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

llvm-svn: 244524
2015-08-10 23:02:37 +00:00
Tyler Nowicki 020dd79fb7 Make frontend floating-point commutivity test X86 specific to avoid cost-model related problems on arm-thumb and hexagon.
llvm-svn: 244517
2015-08-10 22:17:40 +00:00
Nick Lewycky 6ca07ca618 If a variable template is inside a context with template arguments that is being instantiated, and that instantiation fails, fail our instantiation instead of crashing. Errors have already been emitted.
llvm-svn: 244515
2015-08-10 21:54:08 +00:00
Tyler Nowicki 40e5d08a74 Remove non-ascii characters.
llvm-svn: 244506
2015-08-10 21:18:01 +00:00
Chih-Hung Hsieh 00b6f74935 Fix test case to work with -Asserts builds.
When clang is built with -DLLVM_ENABLE_ASSERTIONS=Off,
it does not create names for IR values.

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

llvm-svn: 244502
2015-08-10 20:58:54 +00:00
Artem Belevich b7e4aab40c [CUDA] Add implicit __attribute__((used)) to all __global__ functions.
This allows emitting kernels that were instantiated from the host code
and which would never be explicitly referenced otherwise.

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

llvm-svn: 244501
2015-08-10 20:57:02 +00:00
Artem Belevich 194ba60fe2 [CUDA] Added stubs for new attributes used by CUDA headers.
The main purpose is to avoid errors and warnings while parsing CUDA
header files. The attributes are currently unused otherwise.

Differential version: http://reviews.llvm.org/D11690

llvm-svn: 244497
2015-08-10 20:33:56 +00:00
Tyler Nowicki 8a0925cb62 Append options for floating-point commutivity when related diagnostics are produced.
With this patch clang appends the command line options that would allow vectorization when floating-point commutativity is required. Specifically those are enabling fast-math or specifying a loop hint. 

llvm-svn: 244492
2015-08-10 19:56:40 +00:00
Nick Lewycky 00a5d21803 Fix typo.
llvm-svn: 244490
2015-08-10 19:54:11 +00:00
Reid Kleckner c2e3ba48e3 [dllimport] A non-imported class with an imported key can't have a key
Summary:
The vtable takes its DLL storage class from the class, not the key
function. When they disagree, the vtable won't be exported by the DLL
that defines the key function. The easiest way to ensure that importers
of the class emit their own vtable is to say that the class has no key
function.

Reviewers: hans, majnemer

Subscribers: cfe-commits

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

llvm-svn: 244488
2015-08-10 19:39:01 +00:00
David Majnemer 3a4f95867f [clang-cl] Add support for CL and _CL_ environment variables
cl uses 'CL' and '_CL_' to prepend and append command line options to
the given argument vector.  There is an additional quirk whereby '#' is
transformed into '='.

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

llvm-svn: 244473
2015-08-10 18:16:32 +00:00
Chih-Hung Hsieh 241a890bd7 Correct x86_64 fp128 calling convention
These changes are for Android x86_64 targets to be compatible
with current Android g++ and conform to AMD64 ABI.

https://llvm.org/bugs/show_bug.cgi?id=23897
  * Return type of long double (fp128) should be fp128, not x86_fp80.
  * Vararg of long double (fp128) could be in register and overflowed to memory.

https://llvm.org/bugs/show_bug.cgi?id=24111
  * Return value of long double (fp128) _Complex should be in memory like a structure of {fp128,fp128}.

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

llvm-svn: 244468
2015-08-10 17:33:31 +00:00
Mark Heffernan 397a98d86d Add new llvm.loop.unroll.enable metadata for use with "#pragma unroll".
This change adds the new unroll metadata "llvm.loop.unroll.enable" which directs
the optimizer to unroll a loop fully if the trip count is known at compile time, and
unroll partially if the trip count is not known at compile time. This differs from
"llvm.loop.unroll.full" which explicitly does not unroll a loop if the trip count is not
known at compile time

With this change "#pragma unroll" generates "llvm.loop.unroll.enable" rather than
"llvm.loop.unroll.full" metadata. This changes the semantics of "#pragma unroll" slightly
to mean "unroll aggressively (fully or partially)" rather than "unroll fully or not at all".

The motivating example for this change was some internal code with a loop marked
with "#pragma unroll" which only sometimes had a compile-time trip count depending
on template magic. When the trip count was a compile-time constant, everything works
as expected and the loop is fully unrolled. However, when the trip count was not a
compile-time constant the "#pragma unroll" explicitly disabled unrolling of the loop(!).
Removing "#pragma unroll" caused the loop to be unrolled partially which was desirable
from a performance perspective.

llvm-svn: 244467
2015-08-10 17:29:39 +00:00
Roman Kashitsyn 291f64fd03 Add WebKit brace style configuration option.
Summary:
Add brace style `BS_WebKit` as described on https://www.webkit.org/coding/coding-style.html:

* Function definitions: place each brace on its own line.
* Other braces: place the open brace on the line preceding the code block; place the close brace on its own line.

Set brace style used in `getWebKitStyle()` to the newly added `BS_WebKit`.

Reviewers: djasper, klimek

Subscribers: klimek, cfe-commits

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

llvm-svn: 244446
2015-08-10 13:43:19 +00:00
John Brawn a7b4ec0a9c [Driver] Fix handling of -fbuiltin/-fcommon when combined with -mkernel
-mkernel enables -fno-builtin and -fno-common by default, but allows -fbuiltin
and -fcommon to override that. However "-fbuiltin -fno-builtin" is treated the
same as "-fbuiltin" which is wrong, so fix that. Also fixes similar behaviour
when -fno-common is default.

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

llvm-svn: 244437
2015-08-10 11:11:28 +00:00
Daniel Marjamaki 30e2a44a06 [Static Analyzer] Warn when inner and outer conditions are identical. The inner condition is always true.
Reviewed in http://reviews.llvm.org/D10892.

llvm-svn: 244435
2015-08-10 07:18:29 +00:00
Filipe Cabecinhas 011e388d3c [tests] Remove calls to grep
llvm-svn: 244433
2015-08-10 07:01:11 +00:00
Alexey Bataev a93fb5b048 [MSVC] Crash fix: assigning of overloaded member function pointer caused assertion
Original class was not marked with inheritance attribute and it causes a crash on codegen.
Differential Revision: http://reviews.llvm.org/D11828

llvm-svn: 244428
2015-08-10 04:07:49 +00:00
NAKAMURA Takumi 4b81164810 clang/test/Modules: Satisfy win32 hosts due to dospath issue.
llvm-svn: 244427
2015-08-09 22:55:50 +00:00
Richard Smith 86cc82906f [modules] Remove now-dead code for lazy loading of files specified by -fmodule-file=.
llvm-svn: 244417
2015-08-09 08:58:36 +00:00
Richard Smith 0f99d6a441 [modules] PR22534: Load files specified by -fmodule-file= eagerly. In particular, this avoids the need to re-parse module map files when using such a module.
llvm-svn: 244416
2015-08-09 08:48:41 +00:00
Richard Smith 38c1e6d355 Unrevert r244412 (reverted in r244414), and delete the bogus line left behind
in the unit test that was checking a file the test no longer creates.

llvm-svn: 244415
2015-08-09 06:03:55 +00:00
Justin Bogner b102d1a432 Revert "[modules] Don't leak -M flags for dependency file generation into the module"
This was failing tests on a bunch of bots:

http://lab.llvm.org:8011/builders/clang-hexagon-elf/builds/29919/steps/check-all
http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/29627/steps/check-all
http://lab.llvm.org:8080/green/job/clang-stage1-configure-RA_check/9959/
http://lab.llvm.org:8080/green/job/clang-stage2-configure-Rlto_check/5591/

This reverts r244412

llvm-svn: 244414
2015-08-09 05:40:38 +00:00
Richard Smith 2a6edb30d9 [modules] When building a dependency file, include module maps parsed in the
current compilation, not just those from imported modules.

llvm-svn: 244413
2015-08-09 04:46:57 +00:00
Richard Smith 2d7fbbc7be [modules] Don't leak -M flags for dependency file generation into the module
build process when we implicitly build a module. Previously, we'd create the
specified .d file once for each implicitly-built module and then finally
overwrite it with the correct contents after the requested build completes.
(This fails if you use stdout as a dependency file, which is what the provided
testcase does, and is how I discovered this brokenness.)

llvm-svn: 244412
2015-08-09 02:44:20 +00:00
Richard Smith 03f7e611c6 [modules] Attach dependency listeners to the module manager once when it's
created, rather than creating and attaching a new listener each time we load a
module file (yes, the old ones were kept around too!). No functionality change
intended, but a bit more sanity.

llvm-svn: 244411
2015-08-09 02:28:42 +00:00
Richard Smith d9a0e64f66 Add file missed from r244409.
llvm-svn: 244410
2015-08-09 01:50:14 +00:00
Richard Smith 2bb3c34ed4 [modules] When loading a template specialization, re-canonicalize its template
arguments because the reloaded form might have become non-canonical across the
serialization/deserialization step (this particularly happens when the
canonical form of the type involves an expression).

llvm-svn: 244409
2015-08-09 01:05:31 +00:00
Yaron Keren aa2813325f Teach mingw toolchain driver to properly emit static or dynamic linking of ligcc.
Implemented in MinGW::Linker::AddLibGCC since AddLibgcc is a logic puzzle even
before adding one more boolean. A first step towards simplification of AddLibgcc
would be to factor out the Android AddLibgcc code into its own routine.

llvm-svn: 244407
2015-08-09 00:24:07 +00:00
Ted Kremenek 0270a08ebf [Static Analyzer] Add --analyzer-target option to scan-build.
When interposing on a compiler doing cross-compilation, scan-build
does not infer the target triple needed to pass to clang for
doing static analysis.  The --analyzer-target option allows one
to manually specify the target triple used during static analysis
(and only static analysis) for such cases.

Patch by Honggyu Kim!

Reviewed in http://reviews.llvm.org/D10356.

llvm-svn: 244400
2015-08-08 17:58:47 +00:00
Anna Zaks 9592df7901 Revert "[analyzer] Add checkers for OS X / iOS localizability issues"
This reverts commit fc885033a30b6e30ccf82398ae7c30e646727b10.

Revert all localization checker commits until the proper fix is implemented.

llvm-svn: 244394
2015-08-08 04:53:04 +00:00
Anna Zaks 08f3c1e12a Revert "[analyzer] Fixup to r244389 to make this build on windows."
This reverts commit 57a46a75b408245cf4154a838fe13ad702065745.

Revert all localization checker commits until the proper fix is implemented.

llvm-svn: 244393
2015-08-08 04:52:59 +00:00
Anna Zaks 67c4df8313 [analyzer] Fixup to r244389 to make this build on windows.
llvm-svn: 244390
2015-08-08 02:26:07 +00:00
Anna Zaks 38b496a05d [analyzer] Add checkers for OS X / iOS localizability issues
Add checkers that detect code-level localizability issues for OS X / iOS:
 - A path sensitive checker that warns about uses of non-localized
 NSStrings passed to UI methods expecting localized strings.
 - A syntax checker that warns against not including a comment in
 NSLocalizedString macros.

A patch by Kulpreet Chilana!

llvm-svn: 244389
2015-08-08 01:49:26 +00:00
Devin Coughlin de2cc01cd4 [analyzer] Don't issue alarm in ObjCSuperCallChecker for the super class itself.
The ObjCSuperCallChecker issues alarms for various Objective-C APIs that require
a subclass to call to its superclass's version of a method when overriding it.
So, for example, it raises an alarm when the -viewDidLoad method in a subclass
of UIViewController does not call [super viewDidLoad].

This patch fixes a false alarm where the analyzer erroneously required the
implementation of the superclass itself (e.g., UIViewController) to call
super.

rdar://problem/18416944

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

llvm-svn: 244386
2015-08-08 01:31:51 +00:00
Peter Collingbourne eeebc41b58 AST: Implement mangling support for function types without a prototype.
Function types without prototypes can arise when mangling a function type
within an overloadable function in C. We mangle these as the absence of
any parameter types (not even an empty parameter list).

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

llvm-svn: 244374
2015-08-07 23:25:47 +00:00
James Y Knight 57fc89f029 [Sparc] XFAIL CodeGen/atomic_ops test.
llvm-svn: 244370
2015-08-07 22:52:34 +00:00
Eric Christopher e4f73b3f3b Update a comment to be more descriptive.
llvm-svn: 244346
2015-08-07 19:07:08 +00:00
Eric Christopher e173314d39 Move the cpu validating virtual method down to the feature routines
where it belongs.

llvm-svn: 244342
2015-08-07 18:31:25 +00:00
Nico Weber 6362745a76 Restore PrettyStackTrace state on crash.
Last part of PR11974.

llvm-svn: 244339
2015-08-07 17:48:57 +00:00
Yaron Keren b7e8c7c7c6 Use LLVM_ATTRIBUTE_UNUSED to hide gcc 5.1 unused variable warning.
Suggestion by David Blaikie!

llvm-svn: 244326
2015-08-07 16:21:23 +00:00
Michael Wong e710d5459e This patch commits OpenMP 4 target device clauses
This is committed on behalf of Kelvin Li
http://reviews.llvm.org/D11469?id=31227

llvm-svn: 244325
2015-08-07 16:16:36 +00:00
Yaron Keren ae55b483d4 Silence tools/clang/lib/Tooling/CompilationDatabase.cpp:328:12: warning:
‘clang::tooling::JSONAnchorDest’ defined but not used [-Wunused-variable]
from gcc 5.1.

llvm-svn: 244312
2015-08-07 10:15:15 +00:00
Craig Topper 07d3b62548 Make sure the Features field of the Builtin Info struct is always initialized. Silences -Wmissing-field-initializers.
While there convert 0 in the BUILTIN macros to nullptr.

llvm-svn: 244307
2015-08-07 05:14:44 +00:00
Ben Langmuir 587aeafe2c Make 'arm' cover both 32 and 64 bit architecutres
... and add aarch32 to specifically refer to the 32-bit ones.

Previously, 'arm' meant only 32-bit architectures and there was no way
for a module to build with both 32 and 64 bit ARM architectures.

Now a module that is intended to work on both architectures can specify
    requires arm
whereas a module only for 32-bit platforms can say
    requires aarch32
and just like before, 64-bit only can say
    requires aarch64

llvm-svn: 244306
2015-08-07 01:59:56 +00:00