Commit Graph

57443 Commits

Author SHA1 Message Date
Chandler Carruth 580dd296fa [Modules] Stop creating timestamps for the modules cache and trying to
prune it when we have disabled implicit module generation and thus are
not using any cached modules.

Also update a test of explicitly generated modules to pass this CC1 flag
correctly.

This fixes an issue where Clang was dropping files into the source tree
while running its tests.

llvm-svn: 233117
2015-03-24 21:44:25 +00:00
Chandler Carruth 885e78cb22 [Modules] Start making explicit modules produce deterministic output.
There are two aspects of non-determinism fixed here, which was the
minimum required to cause at least an empty module to be deterministic.

First, the random number signature is only inserted into the module when
we are building modules implicitly. The use case for these random
signatures is to work around the very fact that modules are not
deterministic in their output when working with the implicitly built and
populated module cache. Eventually this should go away entirely when
we're confident that Clang is producing deterministic output.

Second, the on-disk hash table is populated based on the order of
iteration over a DenseMap. Instead, use a MapVector so that we can walk
it in insertion order.

I've added a test that an empty module, when built twice, produces the
same binary PCM file.

llvm-svn: 233115
2015-03-24 21:18:10 +00:00
Sanjay Patel 7a9f5d380b Adding back a CHECK that works with r233110
llvm-svn: 233111
2015-03-24 20:42:20 +00:00
Sanjay Patel 1a94ccbec8 Removing a CHECK that is about to go wrong.
I'm about to commit a patch for:
http://reviews.llvm.org/D8567

That patch will break this one existing test case in Clang.
I'm not sure if this file is intending to create a Clang
dependency on the LLVM IR optimizer, but that's the
consequence of specifying -O3 on this test file.

My hope is to avoid buildbot rage by removing this check,
committing the LLVM patch, and then fixing this check.
I don't know how to make a simultaneous commit to Clang
and LLVM.

I will commit the correct CHECK line fix for this test 
shortly.

llvm-svn: 233109
2015-03-24 20:35:24 +00:00
Fariborz Jahanian a9dccd41e9 [Objective-C diagnostic PATCH] Accept and ignore -Wreceiver-is-weak
warning until Xcode removes the warning setting.
rdar://20262140

llvm-svn: 233093
2015-03-24 17:14:20 +00:00
Aaron Ballman f4cb2be05a Track the source location of the dot or arrow operator in a MemberExpr.
Patch by Joe Ranieri!

llvm-svn: 233085
2015-03-24 15:07:53 +00:00
Aaron Ballman 368701a0c8 Reverting r233023 -- it caused test failures on Windows with MSVC x86.
http://bb.pgr.jp/builders/ninja-clang-i686-msc18-R/builds/572

llvm-svn: 233082
2015-03-24 13:51:13 +00:00
Ehsan Akhgari 841cfe1c69 Revert "Diagnose declspecs occuring after virt-specifier-seq and generate fixit hints"
This reverts commit 2131e63e2fdff7c831ab3bfe31facf2e3ebab03d.

llvm-svn: 233074
2015-03-24 13:25:26 +00:00
Ehsan Akhgari 378444331b Revert "Diagnose ref-qualifiers occuring after virt-specifier-seq and generate fixit hints"
This reverts commit 49079d45966a3f57cd82edb35bde2e8e88fccf40.

llvm-svn: 233073
2015-03-24 13:25:23 +00:00
Ehsan Akhgari 86638e59bf Diagnose ref-qualifiers occuring after virt-specifier-seq and generate fixit hints
Summary: Follow-up to the fix of PR22075.

Reviewers: rsmith

Subscribers: cfe-commits

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

llvm-svn: 233070
2015-03-24 13:02:50 +00:00
Ehsan Akhgari 9a7adfcf3a Diagnose declspecs occuring after virt-specifier-seq and generate fixit hints
Summary: This fixes PR22075.

Reviewers: rsmith

Subscribers: cfe-commits

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

llvm-svn: 233069
2015-03-24 13:02:47 +00:00
Benjamin Kramer 2a403d1c01 [analyzer] Remove unused function. No functional change intended.
llvm-svn: 233060
2015-03-24 11:11:11 +00:00
Benjamin Kramer e80728cfa2 Make header standalone, it uses memset and memcmp.
NFC.

llvm-svn: 233059
2015-03-24 11:11:05 +00:00
Daniel Jasper c77b0a1b60 Silence unused warning in non-assert builds.
llvm-svn: 233053
2015-03-24 08:06:38 +00:00
Richard Smith c2bb81860b [modules] Deserialize CXXCtorInitializer list for a constructor lazily.
Previously we'd deserialize the list of mem-initializers for a constructor when
we deserialized the declaration of the constructor. That could trigger a
significant amount of unnecessary work (pulling in all base classes
recursively, for a start) and was causing problems for the modules buildbot due
to cyclic deserializations. We now deserialize these on demand.

This creates a certain amount of duplication with the handling of
CXXBaseSpecifiers; I'll look into reducing that next.

llvm-svn: 233052
2015-03-24 06:36:48 +00:00
Ben Langmuir 70a1b816cc A couple of readASTFileSignature improvements (NFC)
* Strength reduce a std::function to a function pointer,
* Factor out checking the AST file magic number,
* Add a brief doc comment to readAStFileSignature

Thanks to Chandler for spotting these oddities.

llvm-svn: 233050
2015-03-24 04:43:52 +00:00
Richard Smith d2f887dd02 [modules] More removal of unnecessary deserialization of lexical decls.
Even if we have no external visible declarations, we may still have external
lexical decls that lookup() would import to fill its lookup table. It's simpler
and faster to always take the no-deserialization path through noload_lookup.

llvm-svn: 233046
2015-03-24 02:49:55 +00:00
Richard Smith 18b380b1e5 When looking for lexical decls from an external source, check all contexts
rather than just the primary context. This is technically correct but results
in no functionality change (in Clang nor LLDB) because all users of this
functionality only use it on single-context DCs.

llvm-svn: 233045
2015-03-24 02:44:20 +00:00
Eli Bendersky 4184222e82 Cleanup: no need to pass DefinitionKind into ParseCXXInlineMethodDef
All ParseCXXInlineMethodDef does with it is assign it on the ParsingDeclarator.
Since that is passed in as well, the (single) caller may as well set the
DefinitionKind, thus simplifying the code.

No change in functionality.

llvm-svn: 233043
2015-03-23 23:49:41 +00:00
Alexey Samsonov 498f3c3416 [UBSan] Use shared library for UBSan on OS X (Clang part).
Summary:
UBSan is now used in the same way as ASan, and is supported on
OSX and on iOS simulator. At the moment ASan and UBSan can't be used
together due to PR21112, but I hope to resolve it soon by
embedding UBSan into ASan.

Test Plan: regression test suite.

Reviewers: zaks.anna, kubabrecka

Subscribers: cfe-commits

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

llvm-svn: 233035
2015-03-23 23:14:05 +00:00
Eli Bendersky 5f4d76efd3 Record correct source range for defaulted/deleted members.
Fixes https://llvm.org/bugs/show_bug.cgi?id=20744

struct A {

A() = default;
};

Previously the source range of the declaration of A ended at the ')'. It should
include the '= default' part as well. The same for '= delete'.

Note: this will break one of the clang-tidy fixers, which is going to be
addessed in a follow-up patch.

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

llvm-svn: 233028
2015-03-23 21:43:28 +00:00
Reid Kleckner a7b275d3b2 MS ABI: lambda call operators are instance methods and should use thiscall
Fixes an issue reported by Daniel Berenyi on cfe-dev.

llvm-svn: 233023
2015-03-23 21:16:49 +00:00
Fariborz Jahanian 98253306f3 [SDK modernizer PATCH]. Fixes a bug whereby a call to super
was not converted to property-dot syntax by removing an unused
code. rdar://19140267

llvm-svn: 233019
2015-03-23 20:52:26 +00:00
Chris Bieneman c3e44c2284 [cmake] Clang's install should install clang/Config/config.h
llvm-svn: 233016
2015-03-23 20:43:21 +00:00
Yunzhong Gao 99efc0361b Adds a warning for unrecognized argument to #pragma comment() on PS4.
PS4 target recognizes the #pragma comment() syntax as in -fms-extensions, but
only handles the case of #pragma comment(lib). This patch adds a warning if any
other arguments are encountered.

This patch also refactors the code in ParsePragma.cpp a little bit to make it
more obvious that some codes are being shared between -fms-extensions and PS4.

llvm-svn: 233015
2015-03-23 20:41:42 +00:00
Alexey Samsonov 3ae177cdb3 [UBSan] Introduce "ubsan_standalone" library (Clang part).
Get rid of "libclang_rt.san" library that used to contain
sanitizer_common pieces required by UBSan if it's used in a standalone
mode. Instead, build two variants of UBSan runtime: "ubsan" and
"ubsan_standalone" (same for "ubsan_cxx" and "ubsan_standalone_cxx").

Later "ubsan" and "ubsan_cxx" libraries will go away, as they will
embedded it into corresponding ASan runtimes.

llvm-svn: 233010
2015-03-23 20:05:42 +00:00
Richard Smith 7226f2a497 [modules] Fix an iterator invalidation bug found by the modules selfhost bot.
llvm-svn: 233007
2015-03-23 19:54:56 +00:00
David Blaikie 96cedb52b3 Make Oveflow tracking more legible (CR feedback from Richard Smith on r232999)
llvm-svn: 233006
2015-03-23 19:54:44 +00:00
David Blaikie 252f743858 Refactor: Simplify boolean expresssions in lib/Lex
Simplify boolean expressions using `true` and `false` with `clang-tidy`

Patch by Richard Thomson.

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

llvm-svn: 232999
2015-03-23 19:39:19 +00:00
Eric Christopher c54920a123 Fix and update comments and a small reformatting.
llvm-svn: 232997
2015-03-23 19:26:05 +00:00
Dmitri Gribenko e5423a766b Refactor: Simplify boolean expressions in libclang
Simplify boolean expresions using true and false with clang-tidy.

Patch by Richard.

llvm-svn: 232996
2015-03-23 19:23:50 +00:00
Benjamin Kramer 53f5e893c2 Explicitly include raw_ostream.h instead of relying on transitive inclusion.
NFC.

llvm-svn: 232975
2015-03-23 18:05:43 +00:00
Ahmed Bougacha d1801afeac [CodeGen] Properly support the half FP type with non-native operations.
On AArch64, the -fallow-half-args-and-returns option is the default.
With it, the half type is considered legal (rather than the i16 used
normally for __fp16), but no operation is, except conversions and
load/stores and such.

The previous behavior was tantamount to saying LangOpts.NativeHalfType
was implied by LangOpts.HalfArgsAndReturns, which isn't true.
Instead, teach the various parts of CodeGen that already know about
half (using the intrinsics or not) about this weird in-between case,
where the "half" type is legal, but operations on it aren't.

This is a smaller intermediate step to the end-goal of removing the
intrinsic, always using "half", and letting the backend legalize.

Builds on r232968.
rdar://20045970, rdar://17468714
Differential Revision: http://reviews.llvm.org/D8367

llvm-svn: 232971
2015-03-23 17:54:16 +00:00
Ahmed Bougacha 47ec2c7479 [CodeGen] Convert double -> __fp16 in one step.
Fix the CodeGen so that for types bigger than float, instead of
converting to fp16 via the sequence "InTy -> float -> fp16", we
perform conversions in just one step.  This avoids the double
rounding which potentially changes results from a natural
IEEE-754 operation.

rdar://17594379, rdar://17468714
Differential Revision: http://reviews.llvm.org/D4602
Part of: http://reviews.llvm.org/D8367

llvm-svn: 232968
2015-03-23 17:48:07 +00:00
NAKAMURA Takumi 544d2bdb5c OpenMPClause.h: Fix typo in \param. [-Wdocumentation]
llvm-svn: 232956
2015-03-23 16:05:50 +00:00
Benjamin Kramer 9e925c1d66 [tooling] Move ArgumentsAdjustingCompilations into an anonymous namespace.
NFC.

llvm-svn: 232947
2015-03-23 12:47:15 +00:00
Benjamin Kramer d5748c7b9d Move private classes into anonymous namespaces
Also merge anonymous namespaces in Targets.cpp a bit. NFC.

llvm-svn: 232945
2015-03-23 12:31:05 +00:00
Scott Douglass 3205f52198 handle armeb/thumb/thumbeb consistently in gnutools::Assemble::ConstructJob
Differential Revision: http://reviews.llvm.org/D8196

llvm-svn: 232940
2015-03-23 10:54:24 +00:00
Scott Douglass d4cfffccc7 Convert cascading if-else-if to switch. NFC
Differential Revision: http://reviews.llvm.org/D8485

llvm-svn: 232939
2015-03-23 10:46:28 +00:00
Alexey Bataev 1b752aab3f [OPENMP] Fixed test for 'single' directive codegen.
llvm-svn: 232933
2015-03-23 06:40:37 +00:00
Alexey Bataev a63048e4fd [OPENMP] Codegen for 'copyprivate' clause ('single' directive).
If there is at least one 'copyprivate' clause is associated with the single directive, the following code is generated:

```
i32 did_it = 0;                                  \\ for 'copyprivate' clause
if(__kmpc_single(ident_t *, gtid)) {
  SingleOpGen();
  __kmpc_end_single(ident_t *, gtid);
  did_it = 1;                                    \\ for 'copyprivate' clause
}
<copyprivate_list>[0] = &var0;
...
<copyprivate_list>[n] = &varn;
call __kmpc_copyprivate(ident_t *, gtid, <copyprivate_list_size>,
                        <copyprivate_list>, <copy_func>, did_it);

...

void<copy_func>(void *LHSArg, void *RHSArg) {
  Dst = (void * [n])(LHSArg);
  Src = (void * [n])(RHSArg);
  Dst[0] = Src[0];
  ... Dst[n] = Src[n];
}
```
All list items from all 'copyprivate' clauses are gathered into single <copyprivate list> (<copyprivate_list_size> is a size in bytes of this list) and <copy_func> is used to propagate values of private or threadprivate variables from the 'single' region to other implicit threads from outer 'parallel' region.
Differential Revision: http://reviews.llvm.org/D8410

llvm-svn: 232932
2015-03-23 06:18:07 +00:00
Daniel Jasper 17ae9f0206 Revert "Add CodeGen support for adding cpu attributes on functions based on"
This breaks CodeGen for an internal target. I'll get repro instructions
to you.

llvm-svn: 232930
2015-03-23 05:52:28 +00:00
Richard Smith 9e2341d093 [modules] Remove redundant import of lexical decls when building a lookup table
for a DeclContext, and fix propagation of exception specifications along
redeclaration chains.

This reverts r232905, r232907, and r232907, which reverted r232793, r232853,
and r232853.

One additional change is present here to resolve issues with LLDB: distinguish
between whether lexical decls missing from the lookup table are local or are
provided by the external AST source, and still look in the external source if
that's where they came from.

llvm-svn: 232928
2015-03-23 03:25:59 +00:00
Benjamin Kramer 70f19df90d [ASTMatchers] Factor wrapping matcher classes into a common base class.
The deduplication here is negligible, but it allows the compiler to
skip emission of many templated base class destructors. Shrinks
clang-query by 53k. No functionality change intended.

llvm-svn: 232924
2015-03-22 21:57:53 +00:00
Benjamin Kramer b474c04f49 [Analyzer] Don't inherit from FoldingSet.
That's not really necessary here. NFCI.

llvm-svn: 232921
2015-03-22 18:16:22 +00:00
Benjamin Kramer 15a6194b5d Update unit test for r232916.
llvm-svn: 232918
2015-03-22 16:05:46 +00:00
Benjamin Kramer ac75baaad8 [multilib] Turn virtual functor into functin_ref
And update code to use lambdas where possible, plus random cleanup. NFCI.

llvm-svn: 232916
2015-03-22 15:56:12 +00:00
Faisal Vali 2da8ed9241 Add a dump function to Stmt that takes only an output stream. No functionality change.
This allows dumping to any given output stream but without requiring a SourceManager, similar to the interface provided by Decl.

It's useful when writing certain generic debug functions, external to the clang code base (for e.g.).

llvm-svn: 232912
2015-03-22 13:35:56 +00:00
Benjamin Kramer b7e4a1a0b6 Remove empty files left behind by r232907.
llvm-svn: 232909
2015-03-22 10:08:31 +00:00
Vince Harron 08dcf60295 Reverting 232853 and 232870 because they depend on 232793,
which was reverted because it was causing LLDB test failures

llvm-svn: 232907
2015-03-22 08:47:07 +00:00