]> granicus.if.org Git - clang/log
clang
9 years agoFix interaction of max_align_t and modules.
Richard Smith [Fri, 3 Oct 2014 00:31:35 +0000 (00:31 +0000)]
Fix interaction of max_align_t and modules.

When building with modules enabled, we were defining max_align_t as a typedef
for a different anonymous struct type each time it was included, resulting in
an error if <stddef.h> is not covered by a module map and is included more than
once in the same modules-enabled compilation of C11 or C++11 code.

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

9 years agoPatch to warn if 'override' is missing
Fariborz Jahanian [Thu, 2 Oct 2014 23:13:51 +0000 (23:13 +0000)]
Patch to warn if 'override' is missing
for an overriding method if class has at least one
'override' specified on one of its methods.
Reviewed by Doug Gregor. rdar://18295240
(I have already checked in all llvm files with missing 'override'
 methods and Bob Wilson has fixed a TableGen of FastISel so
 no warnings are expected from build of llvm after this patch.
 I have already verified this).

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

9 years agoRevert "DI: LLVM schema change: fold constants into string"
Duncan P. N. Exon Smith [Thu, 2 Oct 2014 22:15:09 +0000 (22:15 +0000)]
Revert "DI: LLVM schema change: fold constants into string"

This reverts commit r218913 while I investigate some bots.

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

9 years agoDI: LLVM schema change: fold constants into string
Duncan P. N. Exon Smith [Thu, 2 Oct 2014 21:56:07 +0000 (21:56 +0000)]
DI: LLVM schema change: fold constants into string

Update debug info testcases for an LLVM metadata schema change to fold
metadata constant operands into a single `MDString`.

Part of PR17891.

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

9 years agoReflowing some comments, NFC.
Aaron Ballman [Thu, 2 Oct 2014 21:41:27 +0000 (21:41 +0000)]
Reflowing some comments, NFC.

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

9 years agoInitial support for the align_value attribute
Hal Finkel [Thu, 2 Oct 2014 21:21:25 +0000 (21:21 +0000)]
Initial support for the align_value attribute

This adds support for the align_value attribute. This attribute is supported by
Intel's compiler (versions 14.0+), and several of my HPC users have requested
support in Clang. It specifies an alignment assumption on the values to which a
pointer points, and is used by numerical libraries to encourage efficient
generation of vector code.

Of course, we already have an aligned attribute that can specify enhanced
alignment for a type, so why is this additional attribute important? The
problem is that if you want to specify that an input array of T is, say,
64-byte aligned, you could try this:

  typedef double aligned_double attribute((aligned(64)));
  void foo(aligned_double *P) {
    double x = P[0]; // This is fine.
    double y = P[1]; // What alignment did those doubles have again?
  }

the access here to P[1] causes problems. P was specified as a pointer to type
aligned_double, and any object of type aligned_double must be 64-byte aligned.
But if P[0] is 64-byte aligned, then P[1] cannot be, and this access causes
undefined behavior. Getting round this problem requires a lot of awkward
casting and hand-unrolling of loops, all of which is bad.

With the align_value attribute, we can accomplish what we'd like in a well
defined way:

  typedef double *aligned_double_ptr attribute((align_value(64)));
  void foo(aligned_double_ptr P) {
    double x = P[0]; // This is fine.
    double y = P[1]; // This is fine too.
  }

This attribute does not create a new type (and so it not part of the type
system), and so will only "propagate" through templates, auto, etc. by
optimizer deduction after inlining. This seems consistent with Intel's
implementation (thanks to Alexey for confirming the various Intel-compiler
behaviors).

As a final note, I would have chosen to call this aligned_value, not
align_value, for better naming consistency with the aligned attribute, but I
think it would be more useful to users to adopt Intel's name.

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

9 years agoAdd __sync_fetch_and_nand (again)
Hal Finkel [Thu, 2 Oct 2014 20:53:50 +0000 (20:53 +0000)]
Add __sync_fetch_and_nand (again)

Prior to GCC 4.4, __sync_fetch_and_nand was implemented as:

  { tmp = *ptr; *ptr = ~tmp & value; return tmp; }

but this was changed in GCC 4.4 to be:

  { tmp = *ptr; *ptr = ~(tmp & value); return tmp; }

in response to this change, support for sync_fetch_and_nand (and
sync_nand_and_fetch) was removed in r99522 in order to avoid miscompiling code
depending on the old semantics. However, at this point:

  1. Many years have passed, and the amount of code relying on the old
     semantics is likely smaller.

  2. Through the work of many contributors, all LLVM backends have been updated
     such that "atomicrmw nand" provides the newer GCC 4.4+ semantics (this process
     was complete July of 2014 (added to the release notes in r212635).

  3. The lack of this intrinsic is now a needless impediment to porting codes
     from GCC to Clang (I've now seen several examples of this).

It is true, however, that we still set GNUC_MINOR to 2 (corresponding to GCC
4.2). To compensate for this, and to address the original concern regarding
code relying on the old semantics, I've added a warning that specifically
details the fact that the semantics have changed and that we provide the newer
semantics.

Fixes PR8842.

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

9 years agoDiagnose mixed use of '_' and '.' as version
Fariborz Jahanian [Thu, 2 Oct 2014 17:57:26 +0000 (17:57 +0000)]
Diagnose mixed use of '_' and '.' as version
separators in my previous patch.

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

9 years ago[x32/NaCl] Check if method pointers straddle an eightbyte to classify Hi
Jan Wen Voung [Thu, 2 Oct 2014 16:56:57 +0000 (16:56 +0000)]
[x32/NaCl] Check if method pointers straddle an eightbyte to classify Hi

Summary:
Currently, with struct my_struct { int x; method_ptr y; };
a call to foo(my_struct s) may end up dropping the last 4 bytes
of the method pointer for x86_64 NaCl and x32.

When checking Has64BitPointers, also check if the method pointer
straddles an eightbyte boundary and classify Hi as well as Lo if needed.

Test Plan: test/CodeGenCXX/x86_64-arguments-nacl-x32.cpp

Reviewers: dschuff, pavel.v.chupin

Subscribers: jfb

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

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

9 years agoReapply "InstrProf: Update for the LLVM API change in r218879"
Justin Bogner [Thu, 2 Oct 2014 16:44:01 +0000 (16:44 +0000)]
Reapply "InstrProf: Update for the LLVM API change in r218879"

Reapplying now that r218887 is in.

This reverts commit r218882, reapplying r218880.

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

9 years agoPatch to accept '_' in addition to '.' as version
Fariborz Jahanian [Thu, 2 Oct 2014 16:39:45 +0000 (16:39 +0000)]
Patch to accept '_' in addition to '.' as version
number separator in "availability" attribute.
rdar://18490958

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

9 years agoRevert "InstrProf: Update for the LLVM API change in r218879"
Justin Bogner [Thu, 2 Oct 2014 16:15:37 +0000 (16:15 +0000)]
Revert "InstrProf: Update for the LLVM API change in r218879"

r218879 has been reverted for now, this needs to go to match.

This reverts commit r218880.

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

9 years agoInstrProf: Update for the LLVM API change in r218879
Justin Bogner [Thu, 2 Oct 2014 16:04:18 +0000 (16:04 +0000)]
InstrProf: Update for the LLVM API change in r218879

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

9 years agoEmit lifetime.start / lifetime.end markers for unnamed temporary objects.
Arnaud A. de Grandmaison [Thu, 2 Oct 2014 12:19:51 +0000 (12:19 +0000)]
Emit lifetime.start / lifetime.end markers for unnamed temporary objects.

This will give more information to the optimizers so that they can reuse stack slots
and reduce stack usage.

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

9 years agoFix a broken test case.
Asiri Rathnayake [Thu, 2 Oct 2014 10:45:58 +0000 (10:45 +0000)]
Fix a broken test case.

Summary: Commit r218863 broke this test case. This patch fixes it
by updating the expected output line. Should've been updated with
the original patch but for some reason it didn't fail during my
local make check.

Change-Id: I89ed28b37f67c34d1a5d28a3e47ae33d9a82a98f

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

9 years ago[ARM] Handle conflicts between -mfpu and -mfloat-abi options.
Asiri Rathnayake [Thu, 2 Oct 2014 09:56:07 +0000 (09:56 +0000)]
[ARM] Handle conflicts between -mfpu and -mfloat-abi options.

Summary: This patch implements warnings/downgradable errors for
invalid -mfpu, -mfloat-abi option combinations (e.g. -mfpu=none
-mfloat-abi=hard).

Change-Id: I94fa664e1bc0b5855ad835abd7a50a3e0395632d

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

9 years agoReduce the PR20399 test case.
David Blaikie [Wed, 1 Oct 2014 23:16:30 +0000 (23:16 +0000)]
Reduce the PR20399 test case.

I couldn't get something /really/ obvious, and I imagine Richard Smith
might be able to provide some text explaining the sequence of steps
that's demonstrated by these files - but at least it's a bit simpler
now.

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

9 years agoTest case for my r218780 patch.
Fariborz Jahanian [Wed, 1 Oct 2014 21:33:22 +0000 (21:33 +0000)]
Test case for my r218780 patch.
Suggested by Richard Smith.
rdar://18508589.

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

9 years agoFix trailing commas in AMD define.
Joerg Sonnenberger [Wed, 1 Oct 2014 21:22:17 +0000 (21:22 +0000)]
Fix trailing commas in AMD define.

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

9 years agoAdd the various signature macros.
Joerg Sonnenberger [Wed, 1 Oct 2014 21:21:42 +0000 (21:21 +0000)]
Add the various signature macros.

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

9 years agoRename bit_RDRAND to bit_RDRND to match GCC's version of this header.
Joerg Sonnenberger [Wed, 1 Oct 2014 21:21:16 +0000 (21:21 +0000)]
Rename bit_RDRAND to bit_RDRND to match GCC's version of this header.

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

9 years agoObjective-C Modernizer. Patch to remove dangling space
Fariborz Jahanian [Wed, 1 Oct 2014 20:46:32 +0000 (20:46 +0000)]
Objective-C Modernizer. Patch to remove dangling space
before the semicolon wahen modernizing to use
NS_ENUM/NS_OPTIONS macros. rdar://18498539

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

9 years agoDIBuilder: Encapsulate DIExpression's element type
Duncan P. N. Exon Smith [Wed, 1 Oct 2014 20:26:18 +0000 (20:26 +0000)]
DIBuilder: Encapsulate DIExpression's element type

Update for corresponding LLVM API change for
`DIBuilder::createExpression()`.

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

9 years agoUpdate CGDebugInfo to the updated API in LLVM.
Adrian Prantl [Wed, 1 Oct 2014 18:55:34 +0000 (18:55 +0000)]
Update CGDebugInfo to the updated API in LLVM.
Complex address expressions are no longer part of DIVariable, but
rather an extra argument to the debug intrinsics.

http://reviews.llvm.org/D4919
rdar://problem/17994491

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

9 years agoReverting r218777 while investigating buildbot breakage.
Adrian Prantl [Wed, 1 Oct 2014 18:10:14 +0000 (18:10 +0000)]
Reverting r218777 while investigating buildbot breakage.
"Update CGDebugInfo to the updated API in LLVM."

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

9 years agoc++ error recovery. Build a valid AST when trying
Fariborz Jahanian [Wed, 1 Oct 2014 18:03:51 +0000 (18:03 +0000)]
c++ error recovery. Build a valid AST when trying
to recover from parse error parsing the default
argument. Patch prevents crash after spewing 100s
of errors caused by someone who forgot to compile in c++11
mode. So no test. rdar://18508589

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

9 years agoDo not use delegated constructors.
Samuel Benzaquen [Wed, 1 Oct 2014 17:58:42 +0000 (17:58 +0000)]
Do not use delegated constructors.

Do not use delegated constructors.
It is not supported on all platforms yet.
Fixes build broken by r218769.

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

9 years agoUpdate CGDebugInfo to the updated API in LLVM.
Adrian Prantl [Wed, 1 Oct 2014 17:55:09 +0000 (17:55 +0000)]
Update CGDebugInfo to the updated API in LLVM.
Complex address expressions are no longer part of DIVariable, but
rather an extra argument to the debug intrinsics.

http://reviews.llvm.org/D4919
rdar://problem/17994491

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

9 years agoAdds 'override' to overriding methods. NFC.
Fariborz Jahanian [Wed, 1 Oct 2014 16:56:40 +0000 (16:56 +0000)]
Adds 'override' to overriding methods. NFC.
These were uncoveredby my yet undelivered patch.

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

9 years agoRefactor Matcher<T> and DynTypedMatcher to reduce overhead of casts.
Samuel Benzaquen [Wed, 1 Oct 2014 15:08:07 +0000 (15:08 +0000)]
Refactor Matcher<T> and DynTypedMatcher to reduce overhead of casts.

Summary:
This change introduces DynMatcherInterface and changes the internal
representation of DynTypedMatcher and Matcher<T> to use a generic
interface instead.
It removes unnecessary indirections and virtual function calls when
converting matchers by implicit and dynamic casts.
DynTypedMatcher now remembers the stricter type in the chain of casts
and checks it before calling into DynMatcherInterface.
This change improves our clang-tidy related benchmark by ~14%.
Also, it opens the door for more optimizations of this kind that are
coming in future changes.

As a side effect of removing these template instantiations, it also
speeds up compilation of Dynamic/Registry.cpp by ~17% and reduces the
number of
symbols generated by ~30%.

Reviewers: klimek

Subscribers: klimek, cfe-commits

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

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

9 years ago[ARM] Add support for Cortex-M7, FPv5-SP and FPv5-DP
Oliver Stannard [Wed, 1 Oct 2014 09:03:02 +0000 (09:03 +0000)]
[ARM] Add support for Cortex-M7, FPv5-SP and FPv5-DP

The Cortex-M7 has 3 options for its FPU: none, FPv5-SP-D16 and
FPv5-DP-D16. FPv5 has the same instructions as FP-ARMv8, so it can be
modeled using the same target feature, and all double-precision
operations are already disabled by the fp-only-sp target features.

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

9 years ago[OPENMP] Loop collapsing and codegen for 'omp simd' directive.
Alexander Musman [Wed, 1 Oct 2014 06:03:56 +0000 (06:03 +0000)]
[OPENMP] Loop collapsing and codegen for 'omp simd' directive.

This patch implements collapsing of the loops (in particular, in
presense of clause 'collapse'). It calculates number of iterations N
and expressions nesessary to calculate the nested loops counters
values based on new iteration variable (that goes from 0 to N-1)
in Sema. It also adds Codegen for 'omp simd', which uses
(and tests) this feature.

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

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

9 years agoImprove -Wuninitialized warnings for fields that are record types.
Richard Trieu [Wed, 1 Oct 2014 03:44:58 +0000 (03:44 +0000)]
Improve -Wuninitialized warnings for fields that are record types.

Get the record handling code from SelfReferenceChecker into
UninitializedFieldVisitor as well as copying the testcases.

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

9 years agoInstrProf: Avoid repeated linear searches in a hot path
Justin Bogner [Wed, 1 Oct 2014 03:33:52 +0000 (03:33 +0000)]
InstrProf: Avoid repeated linear searches in a hot path

When generating coverage regions, we were doing a linear search
through the existing regions in order to try to merge related ones.
Most of the time this would find what it was looking for in a small
number of steps and it wasn't a big deal, but in cases with many
regions and few mergeable ones this leads to an absurd compile time
regression.

This changes the coverage mapping logic to do a single sort and then
merge as we go, which is a bit simpler and about 100 times faster.
I've also added FIXMEs on a couple of behaviours that seem a little
suspect, while keeping them behaving as they were - I'll look into
these soon.

The test changes here are mostly tedious reorganization, because the
ordering of regions we output has become slightly (but not completely)
more consistent from the almost completely arbitrary ordering we got
before.

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

9 years agoInstrProf: Hide SourceMappingRegion's internals (NFC)
Justin Bogner [Wed, 1 Oct 2014 03:33:49 +0000 (03:33 +0000)]
InstrProf: Hide SourceMappingRegion's internals (NFC)

This struct has some members that are accessed directly and others
that need accessors, but it's all just public. This is confusing, so
I've changed it to a class and made more members private.

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

9 years agoUpdate uninitialized tests to ensure that field initialization has the
Richard Trieu [Tue, 30 Sep 2014 23:46:05 +0000 (23:46 +0000)]
Update uninitialized tests to ensure that field initialization has the
same coverage as the global checker.

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

9 years agoEnable both C and C++ modules with -fmodules, by switching -fcxx-modules to
Richard Smith [Tue, 30 Sep 2014 23:10:19 +0000 (23:10 +0000)]
Enable both C and C++ modules with -fmodules, by switching -fcxx-modules to
being on by default. -fno-cxx-modules can still be used to enable C modules but
not C++ modules, but C++ modules is not significantly less stable than C
modules any more.

Also remove some of the scare words from the modules documentation. We're
certainly not going to remove modules support (though we might change the
interface), and it works well enough to bootstrap and build lots of
non-trivial code.

Note that this does not represent a commitment to the current interface nor
implementation, and we still intend to follow whatever direction the C and C++
committees take regarding modules support.

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

9 years agoUpdate -Wuninitialized to be stricter on CK_NoOp casts.
Richard Trieu [Tue, 30 Sep 2014 23:04:37 +0000 (23:04 +0000)]
Update -Wuninitialized to be stricter on CK_NoOp casts.

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

9 years agoInstrProf: Remove an unused member (NFC)
Justin Bogner [Tue, 30 Sep 2014 20:21:50 +0000 (20:21 +0000)]
InstrProf: Remove an unused member (NFC)

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

9 years agoAvoid a crash after loading an #undef'd macro in code completion
Ben Langmuir [Tue, 30 Sep 2014 20:00:18 +0000 (20:00 +0000)]
Avoid a crash after loading an #undef'd macro in code completion

In code-completion, don't assume there is a MacroInfo for everything,
since we aren't serializing the def corresponding to a later #undef in
the same module.  Also setup the HadMacro bit correctly for undefs to
avoid an assertion failure.

rdar://18416901

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

9 years agoclang-format: [JS] Support AllowShortFunctionsOnASingleLine.
Daniel Jasper [Tue, 30 Sep 2014 17:57:06 +0000 (17:57 +0000)]
clang-format: [JS] Support AllowShortFunctionsOnASingleLine.

Specifically, this also counts for stuff like (with style "inline"):
  var x = function() {
    return 1;
  };

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

9 years agoCUDA: mark the target of implicit intrinsics properly
Eli Bendersky [Tue, 30 Sep 2014 17:38:34 +0000 (17:38 +0000)]
CUDA: mark the target of implicit intrinsics properly

r218624 implemented target inference for implicit special members. However,
other entities can be implicit - for example intrinsics. These can not have
inference running on them, so they should be marked host device as before. This
is the safest and most flexible setting, since by construction these functions
don't invoke anything, and we'd like them to be invokable from both host and
device code. LLVM's intrinsics definitions (where these intrinsics come from in
the case of CUDA/NVPTX) have no notion of target, so both host and device
intrinsics can be supported this way.

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

9 years agoMake sure aggregates are properly alligned on MSP430.
Job Noorman [Tue, 30 Sep 2014 11:19:13 +0000 (11:19 +0000)]
Make sure aggregates are properly alligned on MSP430.

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

9 years agoMS ABI: Correct layout for empty records
David Majnemer [Tue, 30 Sep 2014 06:45:43 +0000 (06:45 +0000)]
MS ABI: Correct layout for empty records

Empty records do not always have size equivalent to their alignment.
They only do so when their alignment is at least as large as the minimum
empty struct size: 1 byte in C++ and 4 bytes in C.

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

9 years ago[OPENMP] Codegen of the ‘aligned’ clause for the ‘omp simd’ directive.
Alexander Musman [Tue, 30 Sep 2014 05:29:28 +0000 (05:29 +0000)]
[OPENMP] Codegen of the ‘aligned’ clause for the ‘omp simd’ directive.
Differential Revision: http://reviews.llvm.org/D5499

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

9 years agoPR20399: Do not assert when adding an implicit member coming from a module at
Richard Smith [Tue, 30 Sep 2014 00:45:29 +0000 (00:45 +0000)]
PR20399: Do not assert when adding an implicit member coming from a module at
writing time.

Patch by Vassil Vassilev!

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

9 years agoRevert r218616, "Refactor Matcher<T> and DynTypedMatcher to reduce overhead of casts."
NAKAMURA Takumi [Mon, 29 Sep 2014 23:56:21 +0000 (23:56 +0000)]
Revert r218616, "Refactor Matcher<T> and DynTypedMatcher to reduce overhead of casts."

MSC17, aka VS2012, cannot compile it.

  clang/include/clang/ASTMatchers/ASTMatchersInternal.h(387) : error C4519: default template arguments are only allowed on a class template

  clang/include/clang/ASTMatchers/ASTMatchersInternal.h(443) : see reference to class template instantiation 'clang::ast_matchers::internal::Matcher<T>' being compiled

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

9 years agoclang/test/CodeGenCXX/vararg-non-pod-ms-compat.cpp: Appease -Asserts to skip 1st...
NAKAMURA Takumi [Mon, 29 Sep 2014 23:55:58 +0000 (23:55 +0000)]
clang/test/CodeGenCXX/vararg-non-pod-ms-compat.cpp: Appease -Asserts to skip 1st alloca.

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

9 years agoTry to fix non-asserts CodeGenCXX/vararg-non-pod-ms-compat.cpp
Hans Wennborg [Mon, 29 Sep 2014 23:45:00 +0000 (23:45 +0000)]
Try to fix non-asserts CodeGenCXX/vararg-non-pod-ms-compat.cpp

There are two GEP's in the function, and it seems the X64 CHECK
was matching the wrong one.

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

9 years agoDon't trap when passing non-POD arguments to variadic functions in MS-compatibility...
Hans Wennborg [Mon, 29 Sep 2014 23:06:57 +0000 (23:06 +0000)]
Don't trap when passing non-POD arguments to variadic functions in MS-compatibility mode

Clang warns (treated as error by default, but still ignored in system headers)
when passing non-POD arguments to variadic functions, and generates a trap
instruction to crash the program if that code is ever run.

Unfortunately, MSVC happily generates code for such calls without a warning,
and there is code in system headers that use it.

This makes Clang not insert the trap instruction when in -fms-compatibility
mode, while still generating the warning/error message.

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

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

9 years agoUse ClangToLLVMArgsMapping in CodeGenTypes::GetFunctionType(). NFC.
Alexey Samsonov [Mon, 29 Sep 2014 22:08:00 +0000 (22:08 +0000)]
Use ClangToLLVMArgsMapping in CodeGenTypes::GetFunctionType(). NFC.

This is the last piece of CGCall code that had implicit assumptions about
the order in which Clang arguments are translated to LLVM ones (positions
of inalloca argument, sret, this, padding arguments etc.) Now all of
this data is encapsulated in ClangToLLVMArgsMapping. If this information
would be required somewhere else, this class can be moved to a separate
header or pulled into CGFunctionInfo.

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

9 years agoTest commit. Fix a whitespace in ToolChains.cpp.
Rafael Auler [Mon, 29 Sep 2014 21:50:34 +0000 (21:50 +0000)]
Test commit. Fix a whitespace in ToolChains.cpp.

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

9 years agoAST: Fix a typo in RecordLayoutBuilder
David Majnemer [Mon, 29 Sep 2014 21:38:08 +0000 (21:38 +0000)]
AST: Fix a typo in RecordLayoutBuilder

No functional change intended.

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

9 years agoIntroduce CGFunctionInfo::getNumRequiredArgs(). NFC.
Alexey Samsonov [Mon, 29 Sep 2014 21:21:48 +0000 (21:21 +0000)]
Introduce CGFunctionInfo::getNumRequiredArgs(). NFC.

Save the callers from necessity to special-case on variadic functions.

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

9 years agoCUDA: Fix incorrect target inference for implicit members.
Eli Bendersky [Mon, 29 Sep 2014 20:38:29 +0000 (20:38 +0000)]
CUDA: Fix incorrect target inference for implicit members.

As PR20495 demonstrates, Clang currenlty infers the CUDA target (host/device,
etc) for implicit members (constructors, etc.) incorrectly. This causes errors
and even assertions in Clang when compiling code (assertions in C++11 mode where
implicit move constructors are added into the mix).

Fix the problem by inferring the target from the methods the implicit member
should call (depending on its base classes and fields).

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

9 years agoSpeedup ClangToLLVMArgMapping construction. NFC.
Alexey Samsonov [Mon, 29 Sep 2014 20:30:22 +0000 (20:30 +0000)]
Speedup ClangToLLVMArgMapping construction. NFC.

Add a method to calculate the number of arguments given QualType
expnads to. Use this method in ClangToLLVMArgMapping calculation.
This number may be cached in CodeGenTypes for efficiency, if needed.

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

9 years agoObjective-C [qoi] - provide group name for
Fariborz Jahanian [Mon, 29 Sep 2014 20:17:04 +0000 (20:17 +0000)]
Objective-C [qoi] - provide group name for
warn_property_types_are_incompatible. rdar://18487506

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

9 years agoRefactor Matcher<T> and DynTypedMatcher to reduce overhead of casts.
Samuel Benzaquen [Mon, 29 Sep 2014 18:43:20 +0000 (18:43 +0000)]
Refactor Matcher<T> and DynTypedMatcher to reduce overhead of casts.

Summary:
This change introduces DynMatcherInterface and changes the internal
representation of DynTypedMatcher and Matcher<T> to use a generic
interface instead.
It removes unnecessary indirections and virtual function calls when
converting matchers by implicit and dynamic casts.
DynTypedMatcher now remembers the stricter type in the chain of casts
and checks it before calling into DynMatcherInterface.
This change improves our clang-tidy related benchmark by ~14%.
Also, it opens the door for more optimizations of this kind that are
coming in future changes.

As a side effect of removing these template instantiations, it also
speeds up compilation of Dynamic/Registry.cpp by ~17% and reduces the number of
symbols generated by ~30%.

Reviewers: klimek

Subscribers: klimek, cfe-commits

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

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

9 years agoRefactor ABIArgInfo::Expand implementation (NFC).
Alexey Samsonov [Mon, 29 Sep 2014 18:41:28 +0000 (18:41 +0000)]
Refactor ABIArgInfo::Expand implementation (NFC).

Hoist the logic which determines the way QualType is expanded
into a separate method. Remove a bunch of copy-paste and simplify
getTypesFromArgs() / ExpandTypeFromArgs() / ExpandTypeToArgs() methods.

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

9 years agoUpdate modules documentation now that C++ support is working pretty well.
Richard Smith [Mon, 29 Sep 2014 17:46:41 +0000 (17:46 +0000)]
Update modules documentation now that C++ support is working pretty well.

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

9 years agoFix bug 20116 - http://llvm.org/bugs/show_bug.cgi?id=20116
Alexey Bataev [Mon, 29 Sep 2014 10:32:21 +0000 (10:32 +0000)]
Fix bug 20116 - http://llvm.org/bugs/show_bug.cgi?id=20116

Fixes incorrect codegen when devirtualization is aborted due to covariant return types.

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

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

9 years agoclang-format: Fix GCC warning about implicit bool pointer conversion.
Daniel Jasper [Mon, 29 Sep 2014 08:07:46 +0000 (08:07 +0000)]
clang-format: Fix GCC warning about implicit bool pointer conversion.

Introduced in r217880.

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

9 years agoclang-format: [JS] Improve formatting of function literals in chains
Daniel Jasper [Mon, 29 Sep 2014 07:54:54 +0000 (07:54 +0000)]
clang-format: [JS] Improve formatting of function literals in chains

Before:
  getSomeLongPromise(.....)
      .then(
           function(value) {
             body();
             body();
           })
      .thenCatch(function(error) {
    body();
    body();
  });

After:
  getSomeLongPromise(.....)
      .then(function(value) {
        body();
        body();
      })
      .thenCatch(function(error) {
        body();
        body();
      });

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

9 years agoRemove dead code from DIBuilder
Jyoti Allur [Mon, 29 Sep 2014 06:32:54 +0000 (06:32 +0000)]
Remove dead code from DIBuilder

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

9 years agotesting commit access to clang repo
Jyoti Allur [Mon, 29 Sep 2014 06:23:54 +0000 (06:23 +0000)]
testing commit access to clang repo

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

9 years agoTests for DR600-640.
Richard Smith [Mon, 29 Sep 2014 06:03:56 +0000 (06:03 +0000)]
Tests for DR600-640.

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

9 years agoFix "unsupported friend" diagnostic to also appear for friend functions with dependen...
Richard Smith [Mon, 29 Sep 2014 05:57:29 +0000 (05:57 +0000)]
Fix "unsupported friend" diagnostic to also appear for friend functions with dependent scopes.

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

9 years agoAdd the tests for __super that I forgot to commit in as part of r218484.
Nikola Smiljanic [Mon, 29 Sep 2014 01:11:55 +0000 (01:11 +0000)]
Add the tests for __super that I forgot to commit in as part of r218484.

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

9 years agoRun DR tests in C++17 mode too.
Richard Smith [Sun, 28 Sep 2014 21:56:04 +0000 (21:56 +0000)]
Run DR tests in C++17 mode too.

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

9 years agoCodeGen: Don't crash when initializing pointer-to-member fields in bases
David Majnemer [Sun, 28 Sep 2014 06:39:30 +0000 (06:39 +0000)]
CodeGen: Don't crash when initializing pointer-to-member fields in bases

Clang uses two types to talk about a C++ class, the
NonVirtualBaseLLVMType and the LLVMType.  Previously, we would allow one
of these to be packed and the other not.

This is problematic.  If both don't agree on a common subset of fields,
then routines like getLLVMFieldNo will point to the wrong field.  Solve
this by copying the 'packed'-ness of the complete type to the
non-virtual subobject.  For this to work, we need to take into account
the non-virtual subobject's size and alignment when we are computing the
layout of the complete object.

This fixes PR21089.

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

9 years agoAdd back checking for condition of conditional operator for -Wuninitialized
Richard Trieu [Fri, 26 Sep 2014 23:48:30 +0000 (23:48 +0000)]
Add back checking for condition of conditional operator for -Wuninitialized

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

9 years agoEnsure that all module build failures get diagnosed
Ben Langmuir [Fri, 26 Sep 2014 22:42:23 +0000 (22:42 +0000)]
Ensure that all module build failures get diagnosed

Otherwise we can end up silently skipping an import.  If we happen to be
building another module at the time, we may build a mysteriously broken
module and not know why it seems to be missing symbols.

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

9 years agoDon't link in sanitizer runtimes if -nostdlib/-nodefaultlibs is provided.
Alexey Samsonov [Fri, 26 Sep 2014 21:22:08 +0000 (21:22 +0000)]
Don't link in sanitizer runtimes if -nostdlib/-nodefaultlibs is provided.

It makes no sense to link in sanitizer runtimes in this case: the user
probably doesn't want to see any system/toolchain libs in his link if he
provides these flags, and the link will most likely fail anyway - as sanitizer
runtimes depend on libpthread, libdl, libc etc.

Also, see discussion in https://code.google.com/p/address-sanitizer/issues/detail?id=344

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

9 years agoFix an assertion failure trying to emit a trivial destructor in ObjC++
Ben Langmuir [Fri, 26 Sep 2014 15:27:29 +0000 (15:27 +0000)]
Fix an assertion failure trying to emit a trivial destructor in ObjC++

If a base class declares a destructor, we will add the implicit
destructor for the subclass in
ActOnFields -> AddImplicitlyDeclaredMembersToClass

But in Objective C++, we did not compute whether we have a trivial
destructor until after that in
CXXRecordDecl::completeDefinition()

This was leading to a mismatch between the class, which thought it had
no trivial destructor, and the CXXDestructorDecl, which considered
itself trivial. It turns out the reason we delayed setting this until
completeDefinition() was for a warning that has since been removed as
part of -Warc-abi, so we just do it eagerly now.

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

9 years agoclang/test/CodeGen/builtin-assume-aligned.c: Fix for -Asserts.
NAKAMURA Takumi [Fri, 26 Sep 2014 09:37:15 +0000 (09:37 +0000)]
clang/test/CodeGen/builtin-assume-aligned.c: Fix for -Asserts.

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

9 years agoMS ABI: Assert that vftables should have a non-RTTI entry
David Majnemer [Fri, 26 Sep 2014 08:07:55 +0000 (08:07 +0000)]
MS ABI: Assert that vftables should have a non-RTTI entry

No functional change intended.

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

9 years agoSmall fix for bug 18635.
Alexander Musman [Fri, 26 Sep 2014 06:28:25 +0000 (06:28 +0000)]
Small fix for bug 18635.
(clang crashed in CodeGen in llvm::Module::getNamedValue on
 thread_local std::unique_ptr<int>).
Differential Revision: http://reviews.llvm.org/D5353

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

9 years agoSupport the assume_aligned function attribute
Hal Finkel [Fri, 26 Sep 2014 05:04:30 +0000 (05:04 +0000)]
Support the assume_aligned function attribute

In addition to __builtin_assume_aligned, GCC also supports an assume_aligned
attribute which specifies the alignment (and optional offset) of a function's
return value. Here we implement support for the assume_aligned attribute by making
use of the @llvm.assume intrinsic.

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

9 years agoCGBuiltin: Use frem instruction rather than libcall to implement fmod
Jan Vesely [Fri, 26 Sep 2014 01:19:41 +0000 (01:19 +0000)]
CGBuiltin: Use frem instruction rather than libcall to implement fmod

AFAICT the semantics of frem match libm's fmod.

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Tom Stellard <tom@stellard.net>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@218488 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago-ms-extensions: Implement __super scope specifier (PR13236).
Nikola Smiljanic [Fri, 26 Sep 2014 00:28:20 +0000 (00:28 +0000)]
-ms-extensions: Implement __super scope specifier (PR13236).

We build a NestedNameSpecifier that records the CXXRecordDecl in which
__super appeared. Name lookup is performed in all base classes of the
recorded CXXRecordDecl. Use of __super is allowed only inside class and
member function scope.

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

9 years agoFix PR20886 - enforce CUDA target match in method calls
Eli Bendersky [Thu, 25 Sep 2014 23:59:08 +0000 (23:59 +0000)]
Fix PR20886 - enforce CUDA target match in method calls

http://reviews.llvm.org/D5298

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

9 years agoSuggest fix-it for missing '{' after base-clause
Ismail Pazarbasi [Thu, 25 Sep 2014 21:13:02 +0000 (21:13 +0000)]
Suggest fix-it for missing '{' after base-clause

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

9 years agoMove calls to ResolveExceptionSpec out of SetDeclDefaulted and into DefineImplicit*
Ben Langmuir [Thu, 25 Sep 2014 20:55:00 +0000 (20:55 +0000)]
Move calls to ResolveExceptionSpec out of SetDeclDefaulted and into DefineImplicit*

This fixes an assertion failure in CodeGen where we were not resolving
an exception specification.

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

9 years agoMS ABI: Avoid hashing back reference keys in mangler
David Majnemer [Thu, 25 Sep 2014 19:43:56 +0000 (19:43 +0000)]
MS ABI: Avoid hashing back reference keys in mangler

This patch replaces the back reference StringMap from the MS mangler
with a SmallVector of strings. My previous patches reduced the number of
hashes involved in back reference lookups, this one removes them
completely. The back reference map contains at most 10 entries, which
are likely to be of varying sizes and different initial subsequences,
and which can easily became huge (due to templates and namespaces).

The solution presented is the simplest possible one. Nevertheless, it's
enough to reduce compilation times for a particular test case from 11.1s
to 9s, versus 8.58s for the Itanium ABI. Possible further improvements
include using a sorted vector (carefully to not introduce an extra
comparison), storing the string contents in a common arena, and/or keep
the string storage in the context for reuse.

Patch by Agustín Bergé.

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

9 years agoAdd increment/decrement operators and compound assignment operators to the
Richard Trieu [Thu, 25 Sep 2014 01:15:40 +0000 (01:15 +0000)]
Add increment/decrement operators and compound assignment operators to the
uninitialized checkers that did not have them before.

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

9 years agoFix handling of preincrement on bit-fields. This gives a bit-field in C++, but
Richard Smith [Wed, 24 Sep 2014 23:55:00 +0000 (23:55 +0000)]
Fix handling of preincrement on bit-fields. This gives a bit-field in C++, but
we were failing to find that bit-field when performing integer promotions. This
brings us closer to following the standard, and closer to GCC.

In C, this change is technically a regression: we get bit-field promotions
completely wrong in C, promoting cases that are categorically not bit-field
designators. This change makes us do so slightly more consistently, though.

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

9 years agoThread Safety Analysis: Update to documentation.
DeLesley Hutchins [Wed, 24 Sep 2014 22:13:34 +0000 (22:13 +0000)]
Thread Safety Analysis:  Update to documentation.

The attribute documentation now conforms to Aaron Ballman's renaming of the
thread safety attributes, as well as the new paper that is due to be published
in the conference on Source Code Analysis and Manipulation (SCAM 2014) later
this week.  In addition, recent changes to the analysis, such as checking
of references and negative capabilities, are now documented.

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

9 years agopass environment when invoking llvm-config and clang from lit.cfg
Scott Douglass [Wed, 24 Sep 2014 18:37:52 +0000 (18:37 +0000)]
pass environment when invoking llvm-config and clang from lit.cfg

Use the same environment when invoking llvm-config from lit.cfg as
will be used when running tests, so that ASAN_OPTIONS, INCLUDE, etc.
are present.

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

9 years agoSimplify tests.
Nico Weber [Wed, 24 Sep 2014 18:25:54 +0000 (18:25 +0000)]
Simplify tests.

This reverts bits of r218166 that are no longer necessary now that r218394 made
-Wmissing-prototype-for-cc a regular warning.

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

9 years agoDowngrade error about stdcall decls with no prototype to a warning
Reid Kleckner [Wed, 24 Sep 2014 17:49:24 +0000 (17:49 +0000)]
Downgrade error about stdcall decls with no prototype to a warning

Fixes PR21027.  The MIDL compiler produces code that does this.

If we wanted to improve the warning, I think we could do this:
  void __stdcall f(); // Don't warn without -Wstrict-prototypes.
  void g() {
    f(); // Might warn, the user probably meant for f to take no args.
    f(1, 2, 3); // Warn, we have no idea what args f takes.
    f(1); // Error, this is insane, one of these calls is broken.
  }

Reviewers: thakis

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

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

9 years agoclang-format: Don't let -style=Chromium imply c++03 template formatting.
Nico Weber [Wed, 24 Sep 2014 17:17:32 +0000 (17:17 +0000)]
clang-format: Don't let -style=Chromium imply c++03 template formatting.

Chromium's now using some c++11 language features, so it's now fine that
clang-format produces vector<vector<int>>.

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

9 years agoInclude debug info for types referenced only via explicit cast expressions.
David Blaikie [Wed, 24 Sep 2014 17:01:27 +0000 (17:01 +0000)]
Include debug info for types referenced only via explicit cast expressions.

Most of the debug info emission is powered essentially from function
definitions - if we emit the definition of a function, we emit the types
of its parameters, the members of those types, and so on and so forth.

For types that aren't referenced even indirectly due to this - because
they only appear in temporary expressions, not in any named variable, we
need to explicitly emit/add them as is done here. This is not the only
case of such code, and we might want to consider handling "void
func(void*); ... func(new T());" (currently debug info for T is not
emitted) at some point, though GCC doesn't. There's a much broader
solution to these issues, but it's a lot of work for possibly marginal
gain (but might help us improve the default -fno-standalone-debug
behavior to be even more aggressive in some places). See the original
review thread for more details.

Patch by jyoti allur (jyoti.yalamanchili@gmail.com)!

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

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

9 years agoConstify a functor's function call operator because it can/should be.
David Blaikie [Wed, 24 Sep 2014 16:35:29 +0000 (16:35 +0000)]
Constify a functor's function call operator because it can/should be.

Patch by Graham Lee (graham@iamleeg.com)!

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

9 years agoPatch to allow mangling of microsoft’s __uuidof expression for the Itanium ABI
Fariborz Jahanian [Wed, 24 Sep 2014 16:28:40 +0000 (16:28 +0000)]
Patch to allow mangling of microsoft’s __uuidof expression for the Itanium ABI
when under -fms-extensions. Reviewed by John McCall.
//rdar://17784718

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

9 years agoClean up ClangTool's argument adjuster handling a bit with unique_ptr.
Benjamin Kramer [Wed, 24 Sep 2014 11:47:42 +0000 (11:47 +0000)]
Clean up ClangTool's argument adjuster handling a bit with unique_ptr.

Make the dtor non-virtual while there. No functionality change.

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

9 years agoSema: Inherit the flexible array property from struct fields
David Majnemer [Wed, 24 Sep 2014 11:04:09 +0000 (11:04 +0000)]
Sema: Inherit the flexible array property from struct fields

A record which contains a flexible array member is itself a flexible
array member.  A struct which contains such a record should also
consider itself to be a flexible array member.

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

9 years ago[x86] Fixed argument types in intrinsics:
Robert Khasanov [Wed, 24 Sep 2014 06:45:23 +0000 (06:45 +0000)]
[x86] Fixed argument types in intrinsics:
_addcarryx_u64
_addcarry_u64
_subborrow_u64

Thanks Pasi Parviainen for notice.

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

9 years agoFix the argument index error of __builtin___memccpy_chk
Steven Wu [Wed, 24 Sep 2014 04:37:33 +0000 (04:37 +0000)]
Fix the argument index error of __builtin___memccpy_chk

memccpy_check should have source and dest size at arg 3 and 4
rdar://18431336

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

9 years agoFix an edge case with BinaryOperator's in -Wuninitialized. Add testcases for
Richard Trieu [Wed, 24 Sep 2014 03:53:56 +0000 (03:53 +0000)]
Fix an edge case with BinaryOperator's in -Wuninitialized.  Add testcases for
the other visitors as well.

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

9 years agoFollow-up to r218292: Add more REVERTIBLE_TYPE_TRAITs.
Nico Weber [Wed, 24 Sep 2014 03:28:54 +0000 (03:28 +0000)]
Follow-up to r218292: Add more REVERTIBLE_TYPE_TRAITs.

r218292 reverted r197496 because it broke things. In addition to breaking
things, r197496 also made all traits starting with __is_ revertible.
Reinstantiate that part of r197496 because code out there (e.g. libc++) depends
on this behavior. Fixes PR21045.

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