Commit Graph

59665 Commits

Author SHA1 Message Date
Aaron Ballman ed455d4062 Add an AST matcher to match member intializers of a CXXCtorInitializer.
llvm-svn: 244662
2015-08-11 20:42:00 +00:00
Daniel Jasper a804d1ec80 clang-format: Make SpaceBeforeParens work with overloaded operators.
Patch by Jon Chesterfield, thank you!

llvm-svn: 244660
2015-08-11 20:32:24 +00:00
David Majnemer f6ae8ae025 [MSVC Compatibility] Classify ext_ms_cast_fn_obj as DefaultError
This non-conforming extension was introduced to make it possible for us
to correctly compile <atomic> in VS 2013 and 2015.  Let's limit its
impact to system headers to encourage portable code.

llvm-svn: 244650
2015-08-11 19:25:13 +00:00
Daniel Jasper 3b0f87d289 Revert "[CUDA] Add implicit __attribute__((used)) to all __global__ functions."
This is breaking internal test. I'll provide a reproduction.

llvm-svn: 244583
2015-08-11 11:02:09 +00:00
Michael Wong b5c1698994 This patch fixes the assert in emitting captured code in the target data construct.
This is on behalf of Kelvin Li.
http://reviews.llvm.org/D11475

llvm-svn: 244569
2015-08-11 04:52:01 +00:00
Filipe Cabecinhas 7af183d841 Propagate SourceLocations through to get a Loc on float_cast_overflow
Summary:
float_cast_overflow is the only UBSan check without a source location attached.
This patch propagates SourceLocations where necessary to get them to the
EmitCheck() call.

Reviewers: rsmith, ABataev, rjmccall

Subscribers: cfe-commits

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

llvm-svn: 244568
2015-08-11 04:19:28 +00:00
David Majnemer ac73de9502 [MSVC Compat] Implement __is_destructible, __is_nothrow_destructible
Our implementations of these type trait intrinsics simply mapped them to
__has_trivial_destructor.  Instead, flesh these intrinsics out with a
full implementation which matches the standard's description.

llvm-svn: 244564
2015-08-11 03:03:28 +00:00
Tyler Nowicki 26cee3d929 Make the analysis reporting test with x86 to fix the hexagon build.
llvm-svn: 244561
2015-08-11 01:54:48 +00:00
Tyler Nowicki 65061a293b Print vectorization analysis when loop hint is specified.
This patche and a related llvm patch solve the problem of having to explicitly enable analysis when specifying a loop hint pragma to get the diagnostics. Passing AlwasyPrint as the pass name (see below) causes the front-end to print the diagnostic if the user has specified '-Rpass-analysis' without an '=<target-pass>’. Users of loop hints can pass that compiler option without having to specify the pass and they will get diagnostics for only those loops with loop hints.

llvm-svn: 244556
2015-08-11 01:10:08 +00:00
Richard Smith d61c1f8280 [modules] Don't suggest deleting the module cache on an error if there is no module cache for this build.
llvm-svn: 244547
2015-08-11 00:32:42 +00:00
Derek Schuff 33d60bfc0d add comment
llvm-svn: 244542
2015-08-11 00:19:54 +00:00
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
Douglas Katzman 96ad05ec5e Range-forify a loop, delete trailing whitespace. NFC
llvm-svn: 244290
2015-08-06 22:36:24 +00:00
Richard Smith ca3156ac77 [modules] Remove unused ModuleManager::visitDepthFirst function.
llvm-svn: 244289
2015-08-06 22:14:35 +00:00
Richard Smith 9ccdd93cec [modules] Fix use-after-iterator-invalidation bug.
llvm-svn: 244288
2015-08-06 22:14:12 +00:00
Eric Christopher b6dfd9490b Continue the work from r243908 by adding a Features field to Builtin::Info
so that we can populate it on a per-target basis with required features.

Future commits will start using this information for warnings.

llvm-svn: 244286
2015-08-06 22:11:54 +00:00
Richard Smith 82f8fcda9f [modules] Stop walking all modules when looking for lexical decls for a
DeclContext. These only ever come from the owning module file for the Decl.

llvm-svn: 244285
2015-08-06 22:07:25 +00:00
James Y Knight 6a84cefd03 Fix alignment of TemplateArgumentList.
llvm-svn: 244280
2015-08-06 21:22:02 +00:00
Richard Smith 73a7d7d4b8 [modules] Remove now-unused MergedLookups map.
llvm-svn: 244277
2015-08-06 21:09:44 +00:00
Richard Smith f13c68d4b1 [modules] Remove redundant lookups into non-primary DeclContexts. These were made unnecessary by r244192.
llvm-svn: 244271
2015-08-06 21:05:21 +00:00
David Majnemer be9022c502 [ItaniumCXXABI] Don't import RTTI data for classes with key functions
MinGW has some pretty strange behvaior around RTTI and
dllimport/dllexport:
- RTTI data is never imported
- RTTI data is only exported if the class has no key function.

llvm-svn: 244266
2015-08-06 20:56:55 +00:00
James Y Knight 7a22b24961 Convert a few classes over to use the new TrailingObjects helper.
This initial commit serves as an example -- the remainder of the
classes using pointer arithmetic for trailing objects will be
converted in subsequent changes.

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

llvm-svn: 244262
2015-08-06 20:26:32 +00:00
James Y Knight 7d708db0cb Remove unused 'Owned' flag from TemplateArgumentList.
llvm-svn: 244261
2015-08-06 20:26:18 +00:00
Argyrios Kyrtzidis e26aea5b29 [Frontend] Fix crash when serializing diagnostics with really long text.
rdar://21896690

llvm-svn: 244245
2015-08-06 18:46:36 +00:00
David Blaikie 4c96a5ef1c Fix memory ownership in the NeonEmitter by using values instead of pointers (smart or otherwise)
Improvement to the memory leak fix in 244196.

Address validity is required for the Intrinsic objects, but since the
collections only ever grow (no elements are removed), deque provides
sufficient guarantees (that the objects will never be reallocated/moved
around) for this use case.

llvm-svn: 244241
2015-08-06 18:29:32 +00:00
Alexey Bataev a889917493 [OPENMP 4.1] Allow references in init expression for loop-based constructs.
OpenMP 4.1 allows to use variables with reference types in private clauses and, therefore, in init expressions of the cannonical loop forms.

llvm-svn: 244209
2015-08-06 12:30:57 +00:00
Michael Kuperstein 819ad33f63 Mark calls in thunk functions as tail-call optimization candidates
When a thunk is generated with a call to the original adjusted function, 
the thunk appears in the debugger call stack. We want the backend to perform
tail-call optimization on the call, to make it invisible to the debugger.

This fixes PR24235

Patch by: amjad.aboud@intel.com
Differential Revision: http://reviews.llvm.org/D11476

llvm-svn: 244207
2015-08-06 11:57:15 +00:00
Michael Kuperstein d7b9392f59 [X86] Add support for _MM_ALIGN16
Differential Revision: http://reviews.llvm.org/D11753

llvm-svn: 244201
2015-08-06 08:24:38 +00:00
Yaron Keren 9f168530a2 Plug a memory leak in NeonEmitter: Intrinsics allocated were never released.
llvm-svn: 244196
2015-08-06 07:28:36 +00:00
Alex Denisov 5dfac81c60 [ObjC] Circular containers: add support of subclasses
llvm-svn: 244193
2015-08-06 04:51:14 +00:00
Richard Smith 0f4e2c4d0f [modules] Defer setting up the lookup table for a DeclContext until we can
determine the primary context, rather than sometimes registering the lookup
table on the wrong context.

This exposed a couple of bugs:
 * the odr violation check didn't deal properly with mergeable declarations
   if the declaration retained by name lookup wasn't in the canonical
   definition of the class
 * the (broken) RewriteDecl mechanism would emit two name lookup tables for
   the same DeclContext into the same module file (one as part of the
   rewritten declaration and one as a visible update for the old declaration)
These are both fixed too.

llvm-svn: 244192
2015-08-06 04:23:48 +00:00
Argyrios Kyrtzidis 3f84b7353b [test] Another attempt to fix the test.
llvm-svn: 244187
2015-08-06 01:06:55 +00:00
Eric Christopher 02d5d86b4e Rename the non-coding style conformant functions in namespace Builtins
to match the rest of their brethren and reformat the bits that need it.

llvm-svn: 244186
2015-08-06 01:01:12 +00:00
Justin Bogner e03437c756 Driver: Strip -header-include-file and -diagnostic-log-file from crash repro scripts
These two arguments tend to refer to a local path that won't exist
when we try to reproduce a bug. Strip them.

llvm-svn: 244179
2015-08-05 23:49:44 +00:00
Eric Christopher 964a5f3b5c Rename DescriptionString -> DataLayoutString as it matches the actual
use of the string.

llvm-svn: 244178
2015-08-05 23:48:05 +00:00
Argyrios Kyrtzidis 5365532b99 [test] Fix tests in non-darwin bots.
llvm-svn: 244176
2015-08-05 23:44:06 +00:00
Diego Novillo c4b94da00e Add -fno-coverage-mapping flag.
This new flag allows the user to disable a previous instance of
-fcoverage-mapping, if needed.

llvm-svn: 244170
2015-08-05 23:27:40 +00:00
Richard Smith 3cb15729af function_ref-ize ExternalASTSource::FindExternalLexicalDecl and remove its
useless return value. Switch to using it directly when completing the
redeclaration chain for an anonymous declaration, and reduce the set of
declarations that we load in the process to just those of the right kind.

llvm-svn: 244161
2015-08-05 22:41:45 +00:00
Diego Novillo 758f3f542a Add flags to disable profile generation.
This patch adds flags -fno-profile-instr-generate and
-fno-profile-instr-use, and the GCC aliases -fno-profile-generate and
-fno-profile-use.

These flags are used in situations where users need to disable profile
generation or use for specific files in a build, without affecting other
files.

llvm-svn: 244153
2015-08-05 21:49:51 +00:00
Douglas Katzman 44f5d18587 Reword a comment about IncludeDirGroup. NFC
Referring to the groups by mixing the enumerated name
with the command-line flag was not as clear as could be.

llvm-svn: 244150
2015-08-05 21:31:54 +00:00
Eric Christopher 53645350e2 Remove unused header includes.
llvm-svn: 244131
2015-08-05 21:11:56 +00:00
Eric Christopher 35869a26cd Rename builtin_lang -> Langs to match the rest of the code a bit better.
llvm-svn: 244126
2015-08-05 21:04:28 +00:00
Eric Christopher b20d7700cc Remove unused function GetBuiltinNames.
llvm-svn: 244125
2015-08-05 21:04:24 +00:00
James Dennett 7ab178a29a Documentation: fix another typo, "arrays types" -> "array types".
Thanks to Kim Gräsman <kim.grasman@gmail.com> for pointing this out.

llvm-svn: 244124
2015-08-05 20:58:23 +00:00
Chris Bieneman 936ff96fae [CMake] Add USES_TERMINAL 1 to ExternalProject_Add_Step calls on 3.3.20150708 and later.
llvm-svn: 244119
2015-08-05 20:46:39 +00:00
Eric Christopher 27fbefde07 Remove unused comparison operators from the Builtin Info struct.
llvm-svn: 244111
2015-08-05 20:11:04 +00:00
Yaron Keren a910741cea Remove unnecessary ClangLibdirSuffix variable.
Twine + const char * is supported.

llvm-svn: 244110
2015-08-05 20:06:56 +00:00
James Dennett 2a02557b4e Documentation: fix a typo, "This flag is determines" -> "This flag determines".
No functional change.

llvm-svn: 244104
2015-08-05 19:44:47 +00:00
Reid Kleckner 124955aade Add -gcodeview and -gdwarf to control which type Clang emits
Summary:
By default, 'clang' emits dwarf and 'clang-cl' emits codeview.  You can
force emission of one or both by passing -gcodeview and -gdwarf to
either driver.

Reviewers: dblaikie, hans

Subscribers: cfe-commits

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

llvm-svn: 244097
2015-08-05 18:51:13 +00:00
Renato Golin d45c2df4ab [AArch64] Enable thread sanitizer on clang
With this option, clang can use -fsanitize=thread on AArch64.

Patch by Adhemerval Zanella.

llvm-svn: 244091
2015-08-05 18:42:41 +00:00
Douglas Katzman 8b50e0175f Claim arguments that belong to 'clang_ignored_gcc_optimization_f_Group'
This seems preferable to printing two warnings per unsupported option-
one warning about not supporting it, and one about not using it.
It also makes the '-Wno-' option do what you mean.

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

llvm-svn: 244079
2015-08-05 18:03:47 +00:00
Argyrios Kyrtzidis 09b9f0eb07 [test] Attempt a change to see if it fixes the test for the windows bot.
llvm-svn: 244076
2015-08-05 17:52:57 +00:00
Chris Bieneman f2a00e9d2a [CMake] First pass at adding support for clang bootstrap builds to CMake
Summary:
This patch adds a new CLANG_ENABLE_BOOTSTRAP option to CMake which adds targets for building a stage2 bootstrap compiler. The targets are:

bootstrap-configure
bootstrap-build
bootstrap (same as bootstrap-configure and bootstrap-build)
bootstrap-install
bootstrap-check-llvm
bootstrap-check-clang
bootstrap-check-all

If you are using 3.3.20150708 or greater it utilizes the ninja USES_TERMINAL_* settings on the external project so that the output is properly buffered.

Reviewers: bogner, chandlerc

Subscribers: filcab, cfe-commits

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

llvm-svn: 244070
2015-08-05 17:38:12 +00:00
Argyrios Kyrtzidis 819f9ffe85 [test/Index] Update libclang tests to use libclang for creating PCH files.
This is consistent and tests the primary configuration we want to test, libclang
creating and consuming PCH files.

llvm-svn: 244066
2015-08-05 17:23:59 +00:00
Chandler Carruth 9ade6a9a74 Fix a tiny bug in -no-canonical-prefixes that somehow we have never
noticed until now.

The code for setting up the driver's InstalledDir didn't respect
-no-canonical-prefixes. Because of this, there are a few places in the
driver where we would unexpectedly form absolute paths, notably when
searching for and finding GCC installations to use, etc. The fix is
straightforward, and I've added this path to '-v' both so we can test it
sanely and so that it will be substantially more obvious the next time
someone has to debug something here.

Note that there is another bug that we don't actually *canonicalize* the
installed directory! I don't really want to fix that because I don't
have a realistic way to test the usage of this mode. I suspect that
folks using the shared module cache would care about getting this right
though, and so they might want to address it. I've left the appropriate
FIXMEs so that it is clear what to change, and I've updated the test
code to make it clear what is happening here.

llvm-svn: 244065
2015-08-05 17:07:33 +00:00
James Y Knight 81167fb799 Add missing atomic libcall support.
Support for emitting libcalls for __atomic_fetch_nand and
__atomic_{add,sub,and,or,xor,nand}_fetch was missing; add it, and some
test cases.

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

llvm-svn: 244063
2015-08-05 16:57:36 +00:00
Douglas Katzman fc29f69d74 [SHAVE] uppercase the CHECK prefixes in 'lit' tests. NFC
llvm-svn: 244052
2015-08-05 15:08:54 +00:00
Douglas Katzman 31fdbfe5c8 Delete trailing whitespace
llvm-svn: 244051
2015-08-05 15:08:53 +00:00
Chad Rosier ea43d95329 Officially end my reign as owner of the driver.
llvm-svn: 244049
2015-08-05 14:52:01 +00:00
Aaron Ballman 1ca258e6a8 Add AST matchers for narrowing constructors that are default, copy, or move constructors, as well as functionality to determine whether a ctor initializer is a base initializer.
llvm-svn: 244036
2015-08-05 12:11:30 +00:00
Benjamin Kramer 9cc21065b4 [AST] ArrayRefize template param list info setters. No functionality change intended.
llvm-svn: 244028
2015-08-05 09:40:49 +00:00
Benjamin Kramer b40e4af845 [AST] ArrayRefize BlockDecl::setCaptures. No functionality change intended.
llvm-svn: 244027
2015-08-05 09:40:35 +00:00
Benjamin Kramer cce6347be5 [AST] ArrayRefize template argument packs. No functionality change intended.
llvm-svn: 244026
2015-08-05 09:40:22 +00:00
Benjamin Kramer 1f11d45a3f [Comments] Replace custom ArrayRef copying with ArrayRef::copy. NFC.
llvm-svn: 244025
2015-08-05 09:40:04 +00:00
Benjamin Kramer fa7f85523f [Parse] ArrayRefize PragmaLoopHintInfo. No functionality change.
llvm-svn: 244024
2015-08-05 09:39:57 +00:00
Filipe Cabecinhas 650d7f7dd5 Don't repeat function names in comments. NFC.
llvm-svn: 244018
2015-08-05 06:19:26 +00:00
Tanya Lattner 4a08e931b6 Update mailing list references to lists.llvm.org
llvm-svn: 244000
2015-08-05 03:55:23 +00:00
Benjamin Kramer da32cf82ba [CodeGen] Fold memcpy into SmallVector initializer. No functionality change.
llvm-svn: 243992
2015-08-04 15:38:49 +00:00
Benjamin Kramer a00e997b4f [Sema] Add a crazy test case for r243987
It's not valid code (maybe it can be made valid, but I'm not sure how).
To trigger the crash fixed in r243987 requires a friend function with
more than four template parameter lists. With this test we have at least
some coverage.

llvm-svn: 243989
2015-08-04 15:18:16 +00:00
Benjamin Kramer 9dc549b1dd [Sema] Allocate SmallVector to the right size.
SmallVector::set_size does not reallocate the vector. Sadly I have no
idea how to test this. The vector never has more than one member in all
of the regression tests.

Found by inspection.

llvm-svn: 243987
2015-08-04 14:46:06 +00:00
Benjamin Kramer c9ba1bd20a [AST] Really allocate a SmallVector to the right size.
set_size only resets the end pointer and asserts if it is used to grow
the buffer. This would crash when mangling a float with more than 80 bits,
add a test with a ppc double double (128 bits).

Found by inspection.

llvm-svn: 243979
2015-08-04 13:34:50 +00:00
Benjamin Kramer 29111d5493 [AST] Simplify code by letting ArrayRef do the copying.
No functionality change intended.

llvm-svn: 243974
2015-08-04 12:59:41 +00:00
Benjamin Kramer 6c3e4ec449 [CodeGen] Don't write into a SmallVector's uninitialized memory.
That's just ugly and not needed in this case. No functionality change.

llvm-svn: 243973
2015-08-04 12:34:30 +00:00
Benjamin Kramer 2ab0d88b91 [ASTContext] Add a templated convenience wrapper for Allocate.
This brings ASTContext closer to LLVM's Allocator concept. Ideally we
would just derive ASTContext from llvm::AllocatorBase, but that does
not work because ASTContext's allocator is mutable and we allocate using
const ASTContext& everywhere.

llvm-svn: 243972
2015-08-04 12:34:23 +00:00
Benjamin Kramer da4690ae12 [FileManager] Use StringRef::copy to store canonical paths.
No functional change intended.

llvm-svn: 243970
2015-08-04 11:27:08 +00:00
Alexey Bataev 54acd40591 [OPENMP 4.1] Support for 'linear' clause in loop directives.
OpenMP 4.1 allows 'linear' clause in loop directives. Patch adds support for it.

llvm-svn: 243969
2015-08-04 11:18:19 +00:00
Benjamin Kramer 323dc2d064 [Edit] Use StringRef's copy method. No functional change intended.
llvm-svn: 243968
2015-08-04 11:18:09 +00:00
Benjamin Kramer 8d3bfd0fa1 [AST] Use StringRef's convenient copy method. No functionality change.
llvm-svn: 243966
2015-08-04 10:22:38 +00:00
Alexey Bataev 48977c3364 [OPENMP] Fix compiler crash during data-sharing attributes analysis.
If a global variable is marked as private in OpenMP construct and then is used in of the private clauses of the same construct, it might cause compiler crash because of incorrect capturing.

llvm-svn: 243964
2015-08-04 08:10:48 +00:00
Chandler Carruth 6ac555fb71 [UB] Avoid a really broken call to realloc that would later result in
a bad call to memcpy.

When we only have a buffer from one of the two reparse calls, we can
just return that buffer rather than going through the realloc/memcpy
dance.

Found with UBsan.

llvm-svn: 243950
2015-08-04 03:53:04 +00:00
Chandler Carruth 38a45cc686 [UB] Guard two calls to memcpy in generated attribute code to handle
null StringRef objects as inputs.

Found by UBSan.

llvm-svn: 243949
2015-08-04 03:53:01 +00:00
Chandler Carruth a91ba1260a [UB] Another place where we were trying to put string data into
a BumpPtrAllocator. This at least now handles the case where there is no
concatentation without calling memcpy on a null pointer. It might be
interesting to handle the case where everything is empty without
round-tripping through the allocator, but it wasn't clear to me if the
pointer returned is significant in any way, so I've left it in
a conservatively more-correct state.

Again, found with UBSan.

llvm-svn: 243948
2015-08-04 03:53:00 +00:00
Chandler Carruth f0c627d5f8 [UB] When attaching empty strings to the AST, use an empty StringRef
rather than forcing the bump pointer allocator to produce a viable
pointer. This also fixes UB when we would try to memcpy from the null
incoming StringRef.

llvm-svn: 243947
2015-08-04 03:52:58 +00:00
Chandler Carruth b6708d8ebf [UB] Fix the two ways that we would try to memcpy from a null buffer in
the nested name specifier code.

First, skip the entire thing when the input is empty.

Next, handle the case where we started off with a null buffer and a zero
capacity to skip copying and freeing.

This was found with UBSan.

llvm-svn: 243946
2015-08-04 03:52:56 +00:00
Chandler Carruth d96e877788 [UB] Fix two cases of UB in copy/pasted code from SmallVector.
We should really stop copying and pasting code around. =/

Found by UBSan.

llvm-svn: 243945
2015-08-04 03:52:52 +00:00
Richard Smith 8cbd895947 [modules] Make IndirectFieldDecl mergeable to avoid lookup ambiguity when the same anonymous union is defined across multiple modules.
llvm-svn: 243940
2015-08-04 02:05:09 +00:00
Argyrios Kyrtzidis 0ce08b890e Remove unused header include.
llvm-svn: 243938
2015-08-04 01:44:13 +00:00
Naomi Musgrave bb4df94faa Dtor callback emitted when msan attribute not repressed for this function.
Summary: In addition to checking compiler flags, the front-end also examines the attributes of the destructor definition to ensure that the SanitizeMemory attribute is attached.

Reviewers: eugenis, kcc

Subscribers: cfe-commits

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

refactored test into new file, revised how function attribute examined

modified test to examine default dtor with and without attribute

removed attribute check

llvm-svn: 243912
2015-08-03 22:53:11 +00:00
Justin Bogner 5ff020a6b6 X86: Teach X86 builtins which target features they require
This adds the required target feature names to x86 builtins that need
particular features. Most have exactly one ("avx", "aes", etc), but some
of the avx512 features have multiple requirements, eg "avx512vl,avx512bw".

llvm-svn: 243908
2015-08-03 22:26:06 +00:00
Douglas Katzman 1e7bf36f45 Grammar: Don't imply that a program wouldn't want a person as its output.
(Because, hey, who wouldn't?)

llvm-svn: 243901
2015-08-03 20:41:31 +00:00
Douglas Katzman f607111d95 [SHAVE] Pass all -f, -g, -O, -W options through directly to moviCompile.
Differential Revision: http://reviews.llvm.org/D11581

llvm-svn: 243878
2015-08-03 14:34:22 +00:00
Nathan Wilson 8567a000b9 [CONCEPTS] Add concept to VarDecl and diagnostic for uninitialized variable concept
Summary: Add IsConcept bit to VarDecl::NonParmVarDeclBitfields and associated isConcept/setConcept member functions. Set IsConcept to true when 'concept' specifier is in variable declaration. Create diagnostic when variable concept is not initialized.

Reviewers: fraggamuffin, hubert.reinterpretcast, faisalv, aaron.ballman, rsmith

Subscribers: aemerson, cfe-commits

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

llvm-svn: 243876
2015-08-03 14:25:45 +00:00
Andrey Bokhanko d9eab9cc13 Additional fix for PR14269: Crash on vector elements / global register vars in inline assembler.
Compiler crashed when vector elements / global register vars were used in inline assembler with "m" restriction. This patch fixes this.

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

llvm-svn: 243870
2015-08-03 10:38:10 +00:00
Asaf Badouh c68e347c25 [X86][AVX512VLBW] add pack, cvt, mulhi and madd intrinsics
Differential Revision: http://reviews.llvm.org/D11642

llvm-svn: 243867
2015-08-03 07:51:00 +00:00
Simon Pilgrim 4034b9f0b9 Fix invalid shufflevector operands
This patch fixes bug 23800 ( https://llvm.org/bugs/show_bug.cgi?id=23800#c2 ). There existed a case where the index operand from extractelement was directly used to create a shufflevector mask. Since the index can be of any integral type but the mask must only contain 32 bit integers a 64 bit index operand led to an assertion error later on.

Committed on behalf of mpflanzer (Moritz Pflanzer)

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

llvm-svn: 243851
2015-08-02 15:28:10 +00:00
Asaf Badouh 73b639f650 [X86][AVX512VLDQ] add reduce/range/cvt intrinsics
add 128 & 256 width intrinsic versions of reduce/range and cvt i64 to FP and vice versa

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

llvm-svn: 243848
2015-08-02 12:43:08 +00:00
Yaron Keren ede603057e Rangify for loops, NFC.
llvm-svn: 243841
2015-08-01 19:11:36 +00:00
Davide Italiano 9e1006d785 Revert r243827.
Until I figure out what's the right way of updating this file.

llvm-svn: 243840
2015-08-01 18:25:03 +00:00
Davide Italiano f76da1dac9 [SemaExpr] Factor out common diagnostic code for remainder/division.
llvm-svn: 243832
2015-08-01 10:13:39 +00:00
David Majnemer e5c8787521 [MS ABI] Create a mangling for extended vector types
Extended vector types are mangled just like normal vector types.

llvm-svn: 243828
2015-08-01 05:51:55 +00:00
Davide Italiano 2dd004487d Convertibility of nullptr_t to bool is available in clang. Note it.
llvm-svn: 243827
2015-08-01 05:48:03 +00:00