Commit Graph

59711 Commits

Author SHA1 Message Date
Alexey Bataev 1185e193a4 [OPENMP 4.1] Allow to use 'uval' and 'ref' modifiers for reference types only.
Standard allows to use 'uval' and 'ref' modifiers in 'linear' clause for variables with reference types only. Added check for it and modified test.

llvm-svn: 245556
2015-08-20 12:15:57 +00:00
Alexey Bataev 182227bd5b [OPENMP 4.1] Initial support for modifiers in 'linear' clause.
OpenMP 4.1 adds 3 optional modifiers to 'linear' clause.
Format of 'linear' clause has changed to:
```
linear(linear-list[ : linear-step])
```
where linear-list is one of the following
```
list
modifier(list)
```
where modifier is one of the following:
```
 ref (C++)
 val (C/C++)
 uval (C++)
```
Patch adds parsing and sema analysis for these modifiers.

llvm-svn: 245550
2015-08-20 10:54:39 +00:00
John McCall 0d461693b6 Fix the layout of bitfields in ms_struct unions: their
alignment is ignored, and they always allocate a complete
storage unit.

Also, change the dumping of AST record layouts: use the more
readable C++-style dumping even in C, include bitfield offset
information in the dump, and don't print sizeof/alignof
information for fields of record type, since we don't do so
for bases or other kinds of field.

rdar://22275433

llvm-svn: 245514
2015-08-19 22:42:36 +00:00
Richard Smith fb5e9f5082 Add missing comment.
llvm-svn: 245509
2015-08-19 21:59:52 +00:00
Richard Trieu 1cd076eb34 Fix -Wlogical-not-parentheses to work better with C code.
Remove the assumption of a Boolean type by checking if an expression is known
to have a boolean value.  Disable warning in two other tests.

llvm-svn: 245507
2015-08-19 21:33:54 +00:00
Artem Belevich 46db9e822c [CUDA] Added stubs for __nvvm_atom_add_*_d() builtins.
They show up in CUDA headers but are not currently supported by
NVPTX back-end.

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

llvm-svn: 245502
2015-08-19 21:11:37 +00:00
Richard Smith 1d0f1996df [modules] Don't needlessly bounce through Sema when updating exception specifications.
llvm-svn: 245501
2015-08-19 21:09:32 +00:00
Richard Smith 7747ce2260 Internal-linkage variables with constant-evaluatable initializers do not need to be emitted. (Also reduces the set of variables that need to be eagerly deserialized when using PCH / modules.)
llvm-svn: 245497
2015-08-19 20:49:38 +00:00
Artem Belevich 39259ffc65 [CUDA] Add appropriate host/device attribute to builtins.
Differential Revision: http://reviews.llvm.org/D12122

llvm-svn: 245496
2015-08-19 20:48:20 +00:00
Piotr Padlewski 1d02f681a9 Generating available_externally vtables bugfix
Bugfix revealed in r245264.

http://reviews.llvm.org/D12128

llvm-svn: 245489
2015-08-19 20:09:09 +00:00
Yaron Keren 24b64a9405 Add REQUIRES: x86-registered-target to test since it's required.
llvm-svn: 245462
2015-08-19 17:18:32 +00:00
Yaron Keren 7890a01263 According to i686 ABI, long double size on x86 is 12 bytes not 16 bytes.
See
 https://gcc.gnu.org/onlinedocs/gcc-3.2/gcc/i386-and-x86-64-Options.html

llvm-svn: 245459
2015-08-19 17:02:32 +00:00
James Y Knight 5bdf7ab0cf Properly pass through the PIC mode to the integrated assembler when
doing assembly-only, and unify the Driver's PIC argument parsing.

On a few architectures, parsing of assembly files annoyingly depends
on whether PIC is enabled or not. This was handled for external 'as'
already (passing -KPIC), but was missed for calls to the standalone
internal assembler.

The integrated-as.s test needed to be modified to not expect
-fsanitize=address to be unused, as now fsanitize *IS* used for
assembly, since -fsanitize=memory can sometimes imply -fPIE, which the
assembler needs to know (gack!!).

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

llvm-svn: 245447
2015-08-19 15:12:02 +00:00
Vladimir Sukharev 457d34193e [ARM] Proper generic cpus handling
"generic" cpu was wrongly handled as exact real CPU name of ARMv8.1A architecture.

This has been fixed, now it is abstract name, suitable for any arch.

Reviewers: rengolin

Subscribers: cfe-commits

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

llvm-svn: 245445
2015-08-19 14:50:18 +00:00
Alexey Bataev c7e8435bef [OPENMP] Link libomp.lib on Windows
Adds libomp.lib for -fopenmp=libomp and libiomp5md.lib for -fopenmp=libiomp5 on Windows
Differential Revision: http://reviews.llvm.org/D11932

llvm-svn: 245414
2015-08-19 04:49:01 +00:00
Richard Smith c52efa7d40 [modules] Don't eagerly deserialize so many ImportDecls. CodeGen basically ignores ImportDecls imported from modules, so only eagerly deserialize the ones from a PCH / preamble.
llvm-svn: 245406
2015-08-19 02:30:28 +00:00
Eric Christopher 72be1c1b64 Rename getDefaultFeatures -> initDefaultFeatures and update comment
with the current behavior as the name seems to match what's going on.

llvm-svn: 245405
2015-08-19 02:24:21 +00:00
Davide Italiano 992196220a [SemaExpr] Re-enable missing assertion.
This has been disabled for a long time, but:
1) Initializers work (and apparently they're re reason why this was disabled).
2) various tests happen to hit this code path and the invariant seems to be
always verified.

Differential Revision:	http://reviews.llvm.org/D12110
Reviewed by:	rsmith

llvm-svn: 245404
2015-08-19 02:21:12 +00:00
George Burgess IV bdb5b2687a Make __builtin_object_size always answer correctly
__builtin_object_size would return incorrect answers for many uses where
type=3. This fixes the inaccuracy by making us emit 0 instead of LLVM's
objectsize intrinsic.

Additionally, there are many cases where we would emit suboptimal (but
correct) answers, such as when arrays are involved. This patch fixes
some of these cases (please see new tests in test/CodeGen/object-size.c
for specifics on which cases are improved)

Resubmit of r245323 with PR24493 fixed.
Patch mostly by Richard Smith.
Differential Revision: http://reviews.llvm.org/D12000
This fixes PR15212.

llvm-svn: 245403
2015-08-19 02:19:07 +00:00
David Blaikie 8f2a7feec8 unique_ptrify CXXBasePaths::DeclsFound & remove the then-unnecessary user-defined dtor
Maybe this and the NumDeclsFound member should just be a std::vector
instead. (it could be a std::dynarray, but that missed standardization)

llvm-svn: 245392
2015-08-18 23:56:00 +00:00
Richard Smith 401cd25b23 [modules] Tests for r245390.
llvm-svn: 245391
2015-08-18 23:42:50 +00:00
Richard Smith 386bb073d2 [modules] Fix HeaderFileInfo serialization to store all the known owning modules for a header, not just the current favourite.
llvm-svn: 245390
2015-08-18 23:42:23 +00:00
David Blaikie 7e70d6803d Devirtualize EHScopeStack::Cleanup's dtor because it's never destroyed polymorphically
llvm-svn: 245378
2015-08-18 22:40:54 +00:00
David Blaikie 50ccaa653a Fix for MSVC
llvm-svn: 245368
2015-08-18 22:10:49 +00:00
David Blaikie fb2b796ecc Wdeprecated: Support movability of EHScopeStack::Cleanup objects as they are move constructed in ConditionalCleanup::restore
llvm-svn: 245367
2015-08-18 22:09:28 +00:00
Richard Smith 080056ba5a Range-based-for-convert some loops in ASTWriter. No functionality change intended.
llvm-svn: 245361
2015-08-18 21:53:42 +00:00
Chris Bieneman 1e7ac1b99a [autoconf] Fixing reversed logic introduced r245304.
Thanks for the catch Hal!

llvm-svn: 245359
2015-08-18 21:23:44 +00:00
David Blaikie 06abbceebc Workaround -Wdeprecated on SemDiagnosticConsumer's tricksy copy ctor.
llvm-svn: 245352
2015-08-18 20:54:26 +00:00
Richard Smith 293534b1a5 Initialize the AST consumer as soon as we have both an ASTConsumer and an
ASTContext. Fixes some cases where we could previously initialize the AST
consumer more than once.

llvm-svn: 245346
2015-08-18 20:39:29 +00:00
Evgeniy Stepanov 775d905644 [sanitizer] Add -lutil to static runtime link flags.
This is needed to prevent breakage of -Wl,-as-needed link when
interceptors for functions in libutil are added. See PR15823.

llvm-svn: 245344
2015-08-18 20:36:11 +00:00
Nico Weber 19999b4816 Revert r245323, it caused PR24493.
llvm-svn: 245342
2015-08-18 20:32:55 +00:00
David Blaikie dbe1a794f1 Simplify Diagnostic's ctors a bit by using in-class initializers for its members
llvm-svn: 245339
2015-08-18 20:24:06 +00:00
Aaron Ballman 11825f2592 Add AST narrowing matchers for inline and anonymous namespaces. Since the inline keyword can also be specified on a FunctionDecl, this is a polymorphic matcher.
llvm-svn: 245337
2015-08-18 19:55:20 +00:00
Aaron Ballman 519ec4b9be Removing useless whitespace; NFC.
llvm-svn: 245332
2015-08-18 19:11:07 +00:00
George Burgess IV 232c76213d Make __builtin_object_size always answer correctly
__builtin_object_size would return incorrect answers for many uses where
type=3. This fixes the inaccuracy by making us emit 0 instead of LLVM's
objectsize intrinsic.

Additionally, there are many cases where we would emit suboptimal (but
correct) answers, such as when arrays are involved. This patch fixes
some of these cases (please see new tests in test/CodeGen/object-size.c
for specifics on which cases are improved)

Patch mostly by Richard Smith.
Differential Revision: http://reviews.llvm.org/D12000
This fixes PR15212.

llvm-svn: 245323
2015-08-18 18:18:27 +00:00
Chandler Carruth 9ae6adfa3b Update to reflect the library set in LLVM changing.
llvm-svn: 245320
2015-08-18 17:59:33 +00:00
Chris Bieneman c5635a6af7 We shouldn't need to pass -fno-strict-aliasing when building clang with clang.
Summary: The code comments in the Makefile indicate this was put in place to support issues when building clang with GCC. Today clang's strict aliasing works, so we shouldn't pass -fno-strict-aliasing when building with clang.

Reviewers: bogner, echristo

Subscribers: cfe-commits

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

llvm-svn: 245304
2015-08-18 16:15:44 +00:00
Benjamin Kramer e1c08b0bfe [TreeTransform] Simplify code. No functionality change.
llvm-svn: 245271
2015-08-18 08:10:39 +00:00
Alexey Bataev bd9fec1eaa [OPENMP 4.1] Allow variables with reference types in private clauses.
OpenMP 4.1 allows to use variables with reference types in all private clauses (private, firstprivate, lastprivate, linear etc.). Patch allows to use such variables and fixes codegen for linear variables with reference types.

llvm-svn: 245268
2015-08-18 06:47:21 +00:00
Justin Bogner 3c32c83daa Revert "Generating assumption loads of vptr after ctor call (fixed)"
Bootstrap bots were failing:

http://lab.llvm.org:8080/green/job/clang-stage2-configure-Rlto_build/6382/
http://bb.pgr.jp/builders/clang-3stage-i686-linux/builds/2969

This reverts r245264.

llvm-svn: 245267
2015-08-18 05:40:20 +00:00
Piotr Padlewski bc7497abbb Generating assumption loads of vptr after ctor call (fixed)
Generating call assume(icmp %vtable, %global_vtable) after constructor
call for devirtualization purposes.

For more info go to:
http://lists.llvm.org/pipermail/cfe-dev/2015-July/044227.html

Edit:
Fixed version because of PR24479.

http://reviews.llvm.org/D11859

llvm-svn: 245264
2015-08-18 03:52:00 +00:00
Hans Wennborg 386e442d1d Revert r245257 "Generating assumption loads of vptr after ctor call"
It caused PR24479

llvm-svn: 245260
2015-08-18 00:17:58 +00:00
Hans Wennborg 83c058925c Doxygen: add build option to use svg instead of png files for graphs
Differential Revision: http://reviews.llvm.org/D11994

llvm-svn: 245259
2015-08-17 23:38:56 +00:00
Piotr Padlewski a3f6f9477b Generating assumption loads of vptr after ctor call
Generating call assume(icmp %vtable, %global_vtable) after constructor
call for devirtualization purposes.

For more info go to:
http://lists.llvm.org/pipermail/cfe-dev/2015-July/044227.html

http://reviews.llvm.org/D11859

llvm-svn: 245257
2015-08-17 23:33:49 +00:00
Eric Christopher 15c2f936de Remove dead code, there's no need for an override that just duplicates
the default behavior.

llvm-svn: 245251
2015-08-17 22:22:28 +00:00
Richard Trieu 1bab6e5034 Make a test less brittle.
Capture line numbers in a variable for FileCheck instead of hardcoding them.

llvm-svn: 245250
2015-08-17 22:18:30 +00:00
Richard Smith 6dc8ae10aa [modules] When parsing the base specifiers of a parse-merged class, the current
context is the class itself but lookups should be performed starting with the
lookup parent of the class (class and base members don't shadow types from the
surrounding context because they have not been declared yet).

llvm-svn: 245236
2015-08-17 20:24:17 +00:00
Sean Silva 8b7c0398b6 [modules] PR20507: Avoid silent textual inclusion.
Summary:
If a module was unavailable (either a missing requirement on the module
being imported, or a missing file anywhere in the top-level module (and
not dominated by an unsatisfied `requires`)), we would silently treat
inclusions as textual. This would cause all manner of crazy and
confusing errors (and would also silently "work" sometimes, making the
problem difficult to track down).

I'm really not a fan of the `M->isAvailable(getLangOpts(), getTargetInfo(),
Requirement, MissingHeader)` function; it seems to do too many things at
once, but for now I've done things in a sort of awkward way.

The changes to test/Modules/Inputs/declare-use/module.map
were necessitated because the thing that was meant to be tested there
(introduced in r197805) was predicated on silently falling back to textual
inclusion, which we no longer do.

The changes to test/Modules/Inputs/macro-reexport/module.modulemap
are just an overlooked missing header that seems to have been missing since
this code was committed (r213922), which is now caught.

Reviewers: rsmith, benlangmuir, djasper

Subscribers: cfe-commits

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

llvm-svn: 245228
2015-08-17 16:39:30 +00:00
Alexander Kornienko 3474b55858 [clang-tidy] Make NumOccurrenceFlag for SourcePaths configurable.
Added an additional ctor that takes a NumOccurrenceFlag parameter for the
SourcePaths option. This frees applications from always having to pass at least
one source file, e.g., -list-checks.

http://reviews.llvm.org/D12069

Patch by Don Hinton!

llvm-svn: 245204
2015-08-17 10:01:42 +00:00
Richard Smith e75ee0f0c8 [modules] When explicitly building a module file, don't include timestamps in
the produced pcm file for stable file creation across distributed build
systems.

llvm-svn: 245199
2015-08-17 07:13:32 +00:00