]> granicus.if.org Git - clang/log
clang
10 years ago[C++11] Use 'nullptr'. Tools edition.
Craig Topper [Sun, 8 Jun 2014 08:38:04 +0000 (08:38 +0000)]
[C++11] Use 'nullptr'. Tools edition.

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

10 years agoSplit out inline asm parsing into ParseStmtAsm.cpp
Alp Toker [Sun, 8 Jun 2014 05:40:04 +0000 (05:40 +0000)]
Split out inline asm parsing into ParseStmtAsm.cpp

This change isolates various llvm/MC headers from the rest of the parser and
better aligns with the existing SemaStmtAsm.cpp.

No change in functionality, code move only.

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

10 years agoDon't include llvm/MC/MCParser throughout all of Sema
Alp Toker [Sun, 8 Jun 2014 05:11:37 +0000 (05:11 +0000)]
Don't include llvm/MC/MCParser throughout all of Sema

Requires LLVM r210417.

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

10 years agoMS ABI: Simplify microsoft mangling of template instantiations
David Majnemer [Sun, 8 Jun 2014 04:51:13 +0000 (04:51 +0000)]
MS ABI: Simplify microsoft mangling of template instantiations

Use mangled template instantiation name as key for back references.
Templates have their own context for back references, so their mangling
is always the same regardless of context. This avoids mangling template
instantiations twice.

Patch by Agustín Bergé!

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

10 years agoDeclObjC: Fix comments about bad API
Alp Toker [Sat, 7 Jun 2014 23:31:01 +0000 (23:31 +0000)]
DeclObjC: Fix comments about bad API

What's going on here isn't overriding but rather the sketchy practice of member
hiding (shadowing of base members).

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

10 years agoAvoid dubious IdentifierInfo::getNameStart() uses
Alp Toker [Sat, 7 Jun 2014 23:30:53 +0000 (23:30 +0000)]
Avoid dubious IdentifierInfo::getNameStart() uses

These cases in particular were incurring an extra strlen() when we already knew
the length. They appear to be leftovers from when the interfaces worked with C
strings that have continued to compile due to the implicit StringRef ctor.

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

10 years agoStringRefize TargetInfo::getABI()
Alp Toker [Sat, 7 Jun 2014 23:30:42 +0000 (23:30 +0000)]
StringRefize TargetInfo::getABI()

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

10 years agoDriver: add -m{,no-}long-calls support
Saleem Abdulrasool [Sat, 7 Jun 2014 19:32:38 +0000 (19:32 +0000)]
Driver: add -m{,no-}long-calls support

This mirrors the GCC option for the ARM backend.  This option enables the
backend option "-enable-arm-long-calls".  The default behaviour is that this is
disabled due to the slight overhead of the generated calls.

If the target of jumps are greater than 64M range of offset-based jumps, then
the target address must be loaded into a register to make an indirect jump.  The
backend support for this has been present, but was not previously controllable
by the proper flag.

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

10 years agoUnbreak release builds.
Arnold Schwaighofer [Sat, 7 Jun 2014 02:30:08 +0000 (02:30 +0000)]
Unbreak release builds.

This test case relies on basic block labels.

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

10 years ago[PPC64LE] Implement little-endian semantics for vec_unpack[hl]
Bill Schmidt [Sat, 7 Jun 2014 02:20:52 +0000 (02:20 +0000)]
[PPC64LE] Implement little-endian semantics for vec_unpack[hl]

The PowerPC vector-unpack-high and vector-unpack-low instructions
are defined architecturally with a big-endian bias, in that the vector
element numbering is assumed to be "left to right" regardless of
whether the processor is in big-endian or little-endian mode.  This
effectively reverses the meaning of "high" and "low."  Such a
definition is unnatural for little-endian code generation.

To facilitate ease of porting, the vec_unpackh and vec_unpackl
interfaces are designed to use natural element ordering, so that
elements are numbered according to little-endian design principles
when code is generated for a little-endian target.  The desired
semantics can be achieved by using the opposite instruction for
little-endian mode.  That is, when a call to vec_unpackh appears in
the code, a vector-unpack-low is generated, and when a call to
vec_unpackl appears in the code, a vector-unpack-high is generated.

The correctness of this code is tested by the new unpack.c test
added in a previous patch, as well as the modifications to
builtins-ppc-altivec.c in the present patch.

Note that these interfaces were originally incorrectly implemented
when they take a vector pixel argument.  This patch corrects this
implementation for both big- and little-endian code generation.

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

10 years ago[PPC64LE] Update test for vec_sum2s interface
Bill Schmidt [Sat, 7 Jun 2014 01:47:42 +0000 (01:47 +0000)]
[PPC64LE] Update test for vec_sum2s interface

Commit r210384 prematurely included changes to the little-endian
implementation of the vec_sum2s interface.  This patch modifies
test/CodeGen/builtins-ppc-altivec.c to test those changes.

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

10 years agoFix crash declaring global allocation function with zero parameters. Fixes PR19968!
Nick Lewycky [Sat, 7 Jun 2014 00:43:57 +0000 (00:43 +0000)]
Fix crash declaring global allocation function with zero parameters. Fixes PR19968!

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

10 years agoFix my poor grammar from r210372
Richard Trieu [Fri, 6 Jun 2014 23:56:22 +0000 (23:56 +0000)]
Fix my poor grammar from r210372

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

10 years ago[PPC64LE] Update builtins-ppc-altivec.c for PPC64 and PPC64LE
Bill Schmidt [Fri, 6 Jun 2014 23:12:00 +0000 (23:12 +0000)]
[PPC64LE] Update builtins-ppc-altivec.c for PPC64 and PPC64LE

The Altivec builtin test case test/CodeGen/builtins-ppc-altivec.c has
always been executed only for 32-bit PowerPC.  These tests are equally
valid for 64-bit PowerPC.  This patch updates the test to be run for
three targets:  powerpc-unknown-unknown, powerpc64-unknown-unknown,
and powerpc64le-unknown-unknown.  The expected code generation changes
for some of the Altivec builtins for little endian, so this patch adds
new CHECK-LE variants to the test for the powerpc64le target.

These tests satisfy the testing requirements for some previous patches
committed over the last couple of days for lib/Headers/altivec.h:
r210279 for vec_perm, r210337 for vec_mul[eo], and r210340 for
vec_pack.

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

10 years agoDelay lookup of simple default template arguments under -fms-compatibility
Reid Kleckner [Fri, 6 Jun 2014 22:36:36 +0000 (22:36 +0000)]
Delay lookup of simple default template arguments under -fms-compatibility

MSVC delays parsing of default arguments until instantiation.  If the
default argument is never used, it is never parsed.  We don't model
this.

Instead, if lookup of a type name fails in a template argument context,
we form a DependentNameType, which will be looked up at instantiation
time.

This fixes errors about 'CControlWinTraits' in atlwin.h.

Reviewers: rsmith

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

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

10 years ago[MS-ABI] Implement dynamic_cast
Warren Hunt [Fri, 6 Jun 2014 22:12:37 +0000 (22:12 +0000)]
[MS-ABI] Implement dynamic_cast
This patch implements call lower from dynamic_cast to __RTDynamicCast
and __RTCastToVoid.  Test cases are included.  A feature of note is that
helper function getPolymorphicOffset is placed in such a way that it can
be used by EmitTypeid (to be implemented in a later patch) without being
moved.  Details are included as comments directly in the code.

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

10 years agoAdd -Wtautological-undefined-compare and -Wundefined-bool-conversion warnings
Richard Trieu [Fri, 6 Jun 2014 21:39:26 +0000 (21:39 +0000)]
Add -Wtautological-undefined-compare and -Wundefined-bool-conversion warnings
to detect underfined behavior involving pointers.

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

10 years agoFix DOS-style newlines.
Eli Bendersky [Fri, 6 Jun 2014 20:31:48 +0000 (20:31 +0000)]
Fix DOS-style newlines.

A previous patch r210330 (and possibly another) introduced DOS-style newlines
into a UNIX newline formatted file.

Patch by Mark Heffernan (http://reviews.llvm.org/D4046)

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

10 years agoMS ABI: Update the thunk linkage computation
Hans Wennborg [Fri, 6 Jun 2014 20:04:01 +0000 (20:04 +0000)]
MS ABI: Update the thunk linkage computation

As suggested by Reid:

 - class has GVA_Internal linkage -> internal
 - thunk has return adjustment -> weak_odr, to handle evil corner case [1]
 - all other normal methods -> linkonce_odr

 1. Evil corner case:

  struct Incomplete;
  struct A { int a; virtual A *bar(); };
  struct B { int b; virtual B *foo(Incomplete); };
  struct C : A, B { int c; virtual C *foo(Incomplete); };
  C c;

Here, the thunk for C::foo() will be emitted when C::foo() is defined, which
might be in a different translation unit, so it needs to be weak_odr.

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

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

10 years agotest/SemaCXX/undefined-internal.cpp: Remove target triple.
Hans Wennborg [Fri, 6 Jun 2014 17:51:25 +0000 (17:51 +0000)]
test/SemaCXX/undefined-internal.cpp: Remove target triple.

This test seems to run fine in both MS and Itanium C++ ABI mode these days.

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

10 years agoDefer codegen of inline method definitions to the end of current top level declaration
Hans Wennborg [Fri, 6 Jun 2014 17:36:17 +0000 (17:36 +0000)]
Defer codegen of inline method definitions to the end of current top level declaration

We would previously fail to emit a definition of bar() for the following code:

  struct __declspec(dllexport) S {
    void foo() {
      t->bar();
    }
    struct T {
      void bar() {}
    };
    T *t;
  };

Note that foo() is an exported method, but bar() is not. However, foo() refers
to bar() so we need to emit its definition. We would previously fail to
realise that bar() is used.

By deferring the method definitions until the end of the top level declaration,
we can simply call EmitTopLevelDecl on them and rely on the usual mechanisms
to decide whether the method should be emitted or not.

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

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

10 years agoRetain an expression pack expansion when the parameter pack expansion code asks
Richard Smith [Fri, 6 Jun 2014 17:33:35 +0000 (17:33 +0000)]
Retain an expression pack expansion when the parameter pack expansion code asks
us to.

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

10 years agoPR14841: If partial substitution of explicitly-specified template arguments
Richard Smith [Fri, 6 Jun 2014 16:00:50 +0000 (16:00 +0000)]
PR14841: If partial substitution of explicitly-specified template arguments
results in a template having too many arguments, but all the trailing arguments
are packs, that's OK if we have a partial pack substitution: the trailing pack
expansions may end up empty.

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

10 years ago[PPC64LE] Implement little-endian semantics for vec_pack family
Bill Schmidt [Fri, 6 Jun 2014 15:10:47 +0000 (15:10 +0000)]
[PPC64LE] Implement little-endian semantics for vec_pack family

The PowerPC vector-pack instructions are defined architecturally with
a big-endian bias, in that the vector element numbering is assumed to
be "left to right" regardless of whether the processor is in
big-endian or little-endian mode.  This definition is unnatural for
little-endian code generation.

To facilitate ease of porting, the vec_pack and related interfaces are
designed to use natural element ordering, so that elements are
numbered according to little-endian design principles when code is
generated for a little-endian target.  The vec_pack calls are
implemented as calls to vec_perm, specifying selection of the
odd-numbered vector elements.  For little endian, this means the
odd-numbered elements counting from the right end of the register.
Since the underlying instructions count from the left end, we must
instead select the even-numbered vector elements for little endian to
achieve the desired semantics.

The correctness of this code is tested by the new pack.c test added in
a previous patch.  I plan to later make the existing ppc32 Altivec
compile-time tests work for ppc64 and ppc64le as well.

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

10 years agoFix RecursiveASTVisitor to visit types in ObjCPropertyDecl
Alp Toker [Fri, 6 Jun 2014 15:05:09 +0000 (15:05 +0000)]
Fix RecursiveASTVisitor to visit types in ObjCPropertyDecl

Patch by Mathieu Baudet!

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

10 years agoReplacing r210333 with an improved solution; we should never reach this code with...
Aaron Ballman [Fri, 6 Jun 2014 15:01:47 +0000 (15:01 +0000)]
Replacing r210333 with an improved solution; we should never reach this code with any other loop hint options.

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

10 years ago[PPC64LE] Implement little-endian semantics for vec_mul[eo]
Bill Schmidt [Fri, 6 Jun 2014 14:45:06 +0000 (14:45 +0000)]
[PPC64LE] Implement little-endian semantics for vec_mul[eo]

The PowerPC vector-multiply-even and vector-multiply-odd instructions
are defined architecturally with a big-endian bias, in that the vector
element numbering is assumed to be "left to right" regardless of
whether the processor is in big-endian or little-endian mode.  This
definition is unnatural for little-endian code generation.

To facilitate ease of porting, the vec_mule and vec_mulo interfacs are
designed to use natural element ordering, so that elements are
numbered according to little-endian design principles when code is
generated for a little-endian target.  The desired semantics can be
achieved by using the opposite instruction for little-endian mode.
That is, when a call to vec_mule appears in the code, a
vector-multiply-odd is generated, and when a call to vec_mulo appears
in the code, a vector-multiply-even is generated.

The correctness of this code is tested by the new mult-even-odd.c test
added in a previous patch.  I plan to later make the existing ppc32
Altivec compile-time tests work for ppc64 and ppc64le as well.

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

10 years agoclang-format: Fix incorrect indentation.
Daniel Jasper [Fri, 6 Jun 2014 13:49:04 +0000 (13:49 +0000)]
clang-format: Fix incorrect indentation.

Before (JavaScript example, but can extend to other languages):
  return {
    a: 'E',
    b: function() {
      return function() {
      f();  // This is wrong.
      };
    }
  };

After:
  return {
    a: 'E',
    b: function() {
      return function() {
        f();  // This is better.
      };
    }
  };

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

10 years agoQuieting a false-positive which was causing the sanitizer bots to go red.
Aaron Ballman [Fri, 6 Jun 2014 13:39:32 +0000 (13:39 +0000)]
Quieting a false-positive which was causing the sanitizer bots to go red.

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

10 years agoAdding a new #pragma for the vectorize and interleave optimization hints.
Aaron Ballman [Fri, 6 Jun 2014 12:40:24 +0000 (12:40 +0000)]
Adding a new #pragma for the vectorize and interleave optimization hints.

Patch thanks to Tyler Nowicki!

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

10 years agoFix typos
Alp Toker [Fri, 6 Jun 2014 12:02:07 +0000 (12:02 +0000)]
Fix typos

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

10 years agoDon't generate assembly in backend diagnostic tests
Alp Toker [Fri, 6 Jun 2014 11:20:58 +0000 (11:20 +0000)]
Don't generate assembly in backend diagnostic tests

A leftover -S was generating unwanted output in the source tree overriding
-only flags that normally disable output.

This reverts commit r210323 and implements the proper fix.

Reported by Timur Iskhodzhanov!

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

10 years agoFix C++ style // comments in a couple of C files
Timur Iskhodzhanov [Fri, 6 Jun 2014 11:04:46 +0000 (11:04 +0000)]
Fix C++ style // comments in a couple of C files

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

10 years agoRemove an unused variable
Timur Iskhodzhanov [Fri, 6 Jun 2014 11:02:48 +0000 (11:02 +0000)]
Remove an unused variable

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

10 years agoAdd -o /dev/null to one of the tests as it fails when run from a read-only checkout
Timur Iskhodzhanov [Fri, 6 Jun 2014 10:58:21 +0000 (10:58 +0000)]
Add -o /dev/null to one of the tests as it fails when run from a read-only checkout

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

10 years agoRevert "Revert "Devise a package-private means to determine the LLVM version string""
Alp Toker [Fri, 6 Jun 2014 10:36:22 +0000 (10:36 +0000)]
Revert "Revert "Devise a package-private means to determine the LLVM version string""

We probably just need to touch LLVM's configure this time to work around the
totally inadequate Makefile build server integration.

This reverts commit r210314.

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

10 years agoRevert "Devise a package-private means to determine the LLVM version string"
Alp Toker [Fri, 6 Jun 2014 07:26:57 +0000 (07:26 +0000)]
Revert "Devise a package-private means to determine the LLVM version string"

This didn't work out on the build servers. Investigating

This reverts commit r210313.

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

10 years agoDevise a package-private means to determine the LLVM version string
Alp Toker [Fri, 6 Jun 2014 06:58:25 +0000 (06:58 +0000)]
Devise a package-private means to determine the LLVM version string

This will unbreak clang vendor builds as a follow-up to r210238, now that we
can't poke into LLVM's private config.h (nor should the string be exposed by
llvm-config.h).

This hopefully removes for good the last include of LLVM's config.h.

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

10 years agoAlways check for libxml2 in CMake
Alp Toker [Fri, 6 Jun 2014 05:01:47 +0000 (05:01 +0000)]
Always check for libxml2 in CMake

This is clang's business and LLVM will soon be updated not to perform the check
for us.

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

10 years agoAdd first set of tests for FriendDecl source range and location.
Nikola Smiljanic [Fri, 6 Jun 2014 04:40:35 +0000 (04:40 +0000)]
Add first set of tests for FriendDecl source range and location.

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

10 years agoRnamed Class to TestClass
Alexey Bataev [Fri, 6 Jun 2014 03:41:14 +0000 (03:41 +0000)]
Rnamed Class to TestClass

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

10 years agoPR11306 - Variadic template fix-it suggestion. Recover from misplaced or redundant...
Nikola Smiljanic [Fri, 6 Jun 2014 02:58:59 +0000 (02:58 +0000)]
PR11306 - Variadic template fix-it suggestion. Recover from misplaced or redundant ellipsis in parameter pack.

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

10 years agoUpdate for llvm api change.
Rafael Espindola [Fri, 6 Jun 2014 01:20:47 +0000 (01:20 +0000)]
Update for llvm api change.

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

10 years agoPR19936: Fix a really dumb bug where we would profile dependent operator* expressions...
Richard Smith [Thu, 5 Jun 2014 22:43:40 +0000 (22:43 +0000)]
PR19936: Fix a really dumb bug where we would profile dependent operator* expressions incorrectly.

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

10 years agoRemove old proposal notices
Alp Toker [Thu, 5 Jun 2014 22:11:20 +0000 (22:11 +0000)]
Remove old proposal notices

Let's just go ahead and assume the answer was 'I do'

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

10 years agoProvide fallback locations for backend remarks
Alp Toker [Thu, 5 Jun 2014 22:11:12 +0000 (22:11 +0000)]
Provide fallback locations for backend remarks

Instead of disembodied diagnostics when debug info is disabled it's now
possible to identify the associated function's location in order to provide
some amount of of context.

We use the definition's body right brace location to differentiate the fallback
from diagnostics that genuinely relate to the function declaration itself (a
convention also used by gcc).

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

10 years agoImplement -Wframe-larger-than backend diagnostic
Alp Toker [Thu, 5 Jun 2014 22:10:59 +0000 (22:10 +0000)]
Implement -Wframe-larger-than backend diagnostic

Add driver and frontend support for the GCC -Wframe-larger-than=bytes warning.
This is the first GCC-compatible backend diagnostic built around LLVM's
reporting feature.

This commit adds infrastructure to perform reverse lookup from mangled names
emitted after LLVM IR generation. We use that to resolve precise locations and
originating AST functions, lambdas or block declarations to produce seamless
codegen-guided diagnostics.

An associated change, StringMap now maintains unique mangled name strings
instead of allocating copies. This is a net memory saving in C++ and a small
hit for C where we no longer reuse IdentifierInfo storage, pending further
optimisation.

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

10 years agoWhen an inline-asm diagnostic is reported by the backend, report it with the
Joey Gouly [Thu, 5 Jun 2014 21:23:42 +0000 (21:23 +0000)]
When an inline-asm diagnostic is reported by the backend, report it with the
correct severity.

Previously all inline-asm diagnostics were reported as errors.

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

10 years agoMangle predefined string constants names to merge them at link-time
Alexey Samsonov [Thu, 5 Jun 2014 20:53:34 +0000 (20:53 +0000)]
Mangle predefined string constants names to merge them at link-time

Summary:
This change generalizes the code used to create global LLVM
variables referencing predefined strings (e.g. __FUNCTION__): now it
just calls GetAddrOfConstantStringFromLiteral method. As a result,
global variables for these predefined strings may get mangled names
and linkonce_odr linkage. Fix the test accordingly.

Test Plan: clang regression tests

Reviewers: majnemer

Reviewed By: majnemer

Subscribers: cfe-commits

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

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

10 years agoCleanup, and always create a DecltypeType for a decltype expression, rather
Richard Smith [Thu, 5 Jun 2014 20:13:13 +0000 (20:13 +0000)]
Cleanup, and always create a DecltypeType for a decltype expression, rather
than omitting it the first time we see a decltype type with a particular
expression.

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

10 years ago[PPC64LE] Implement little-endian semantics for vec_perm
Bill Schmidt [Thu, 5 Jun 2014 19:07:40 +0000 (19:07 +0000)]
[PPC64LE] Implement little-endian semantics for vec_perm

The PowerPC vperm (vector permute) instruction is defined
architecturally with a big-endian bias, in that the two input vectors
are assumed to be concatenated "left to right" and the elements of the
combined input vector are assumed to be numbered from "left to right"
(i.e., with element 0 referencing the high-order element).  This
definition is unnatural for little-endian code generation.

To facilitate ease of porting, the vec_perm interface is designed to
use natural element ordering, so that elements are numbered according
to little-endian design principles when code is generated for a
little-endian target.  The desired semantics can be achieved with the
vperm instruction provided that the two input vector registers are
reversed, and the permute control vector is complemented.  The
complementing is performed using an xor with a vector containing all
one bits.

Only the rightmost 5 bits of each element of the permute control
vector are relevant, so it would be possible to complement the vector
with respect to a <16xi8> vector containing all 31s.  However, when
the permute control vector is not a constant, using 255 instead has
the advantage that the vec_xor can be recognized during code
generation as a vnor instruction.  (Power8 introduces a vnand
instruction which could alternatively be generated.)

The correctness of this code is tested by the new perm.c test added in
a previous patch.  I plan to later make the existing ppc32 Altivec
compile-time tests work for ppc64 and ppc64le as well.

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

10 years agoAdd hasLocalStorage/hasGlobalStorage matchers.
Samuel Benzaquen [Thu, 5 Jun 2014 18:22:14 +0000 (18:22 +0000)]
Add hasLocalStorage/hasGlobalStorage matchers.

Summary:
Add hasLocalStorage/hasGlobalStorage matchers for VarDecl nodes.
Update the doc. Also add them to the dynamic registry.

Reviewers: klimek

Subscribers: klimek, cfe-commits

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

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

10 years agoFix bot for named register test
Renato Golin [Thu, 5 Jun 2014 16:52:20 +0000 (16:52 +0000)]
Fix bot for named register test

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

10 years agoAdd pointer types to global named register
Renato Golin [Thu, 5 Jun 2014 16:45:22 +0000 (16:45 +0000)]
Add pointer types to global named register

This patch adds support for pointer types in global named registers variables.
It'll be lowered as a pair of read/write_register and inttoptr/ptrtoint calls.
Also adds some early checks on types on SemaDecl to avoid the assert.

Tests changed accordingly. (PR19837)

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

10 years ago[mips] Add macros _MIPS_ISA and __mips_isa_rev (same expansion as defined by GCC).
Matheus Almeida [Thu, 5 Jun 2014 14:59:18 +0000 (14:59 +0000)]
[mips] Add macros _MIPS_ISA and __mips_isa_rev (same expansion as defined by GCC).

Summary: The Linux Kernel is one example of a piece of software that relies on them.

Reviewers: atanasyan

Reviewed By: atanasyan

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

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

10 years agoFix equalsNode() to accept pointers to derived types.
Samuel Benzaquen [Thu, 5 Jun 2014 14:47:08 +0000 (14:47 +0000)]
Fix equalsNode() to accept pointers to derived types.

Summary:
Move the 'const' in the AST_*MATCHER_P* macros to the right of ParamType to
avoiad applying the constness on the wrong level when ParamType is a pointer.
Change equalsNode() to explicitly accept 'const Decl*' or 'const Stmt*'.

Reviewers: klimek

Subscribers: klimek, cfe-commits

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

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

10 years agoFix driver warning about -pthread on Android.
Evgeniy Stepanov [Thu, 5 Jun 2014 11:41:39 +0000 (11:41 +0000)]
Fix driver warning about -pthread on Android.

-pthread is no-op on Android. Suppress the unused argument warning.

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

10 years agoFix driver warning about -shared-libasan on Android.
Evgeniy Stepanov [Thu, 5 Jun 2014 11:14:00 +0000 (11:14 +0000)]
Fix driver warning about -shared-libasan on Android.

Asan runtime library is always shared on Android, and -shared-libasan is no-op.
Suppress the unused argument warning.

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

10 years agoXCore target: Fix 'typestring' binding qualifier to the array and not the type
Robert Lytton [Thu, 5 Jun 2014 09:06:21 +0000 (09:06 +0000)]
XCore target: Fix 'typestring' binding qualifier to the array and not the type

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

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

10 years agoChanging this line of code back to the way it was before Alp's config.h clean up...
Puyan Lotfi [Thu, 5 Jun 2014 04:29:21 +0000 (04:29 +0000)]
Changing this line of code back to the way it was before Alp's config.h clean up changes.
I've already spoken to Alp and he signed off on making this one change, so that our buildbots
go green in the short term.

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

10 years agoBugfix: don't assert if someone manages to declare an operator new/delete template...
Richard Smith [Thu, 5 Jun 2014 00:43:02 +0000 (00:43 +0000)]
Bugfix: don't assert if someone manages to declare an operator new/delete template before the builtin operator new/delete.

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

10 years agoFlush C stdio streams upon process termination
Reid Kleckner [Thu, 5 Jun 2014 00:13:43 +0000 (00:13 +0000)]
Flush C stdio streams upon process termination

Due to what can only be described as a CRT bug, stdout and amazingly
even stderr are not always flushed upon process termination, especially
when the system is under high threading pressure.  I have found two
repros for this:

1) In lib\Support\Threading.cpp, change sys::Mutex to an
std::recursive_mutex and run check-clang.  Usually between 30 and 40
tests will fail.

2) Add OutputDebugStrings in code that runs during static initialization
and static shutdown.  This will sometimes generate similar failures.

After a substantial amount of troubleshooting and debugging, I found
that I could reproduce this from the command line without running
check-clang.  Simply make the mutex change described in #1, then
manually run the following command many times by running it once, then
pressing Up -> Enter very quickly:

D:\src\llvm\build\vs2013\Debug\bin\c-index-test.EXE -cursor-at=D:\src\llvm\tools\clang\test\Index\targeted-preamble.h:2:15 D:\src\llvm\tools\clang\test\Index\targeted-cursor.c -include D:\src\llvm\build\vs2013\tools\clang\test\Index\Output\targeted-cursor.c.tmp.h -Xclang -error-on-deserialized-decl=NestedVar1      -Xclang -error-on-deserialized-decl=TopVar    | D:\src\llvm\build\vs2013\Debug\bin\FileCheck.EXE D:\src\llvm\tools\clang\test\Index\targeted-cursor.c -check-prefix=PREAMBLE-CURSOR1

Sporadically they will fail, and attaching a debugger to a failed
instance indicates that stdin of FileCheck.exe is empty.

Note that due to the repro in #2, we can rule out a bug in the STL's
mutex implementation, and instead conclude that this is a real flake in
the windows test harness.

Test Plan:
Without patch: Ran check-clang 10 times and saw over 30 Unexpected failures on every run.
With patch: Ran check-clang 10 times and saw 0 unexpected failures across all runs.

Reviewers: rnk

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

Patch by Zachary Turner!

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

10 years ago[ubsan] Don't add a --dynamic-list for ubsan symbols when building a shared
Richard Smith [Wed, 4 Jun 2014 23:28:46 +0000 (23:28 +0000)]
[ubsan] Don't add a --dynamic-list for ubsan symbols when building a shared
library. That results in the linker resolving all references to weak symbols in
the DSO to the definition from within that DSO. Ironically, this rarely causes
observable problems, except that it causes ubsan's own dynamic type check to
spuriously fail (because we fail to properly merge type_info object names).

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

10 years agoFormatting cleanup.
Richard Smith [Wed, 4 Jun 2014 23:26:06 +0000 (23:26 +0000)]
Formatting cleanup.

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

10 years agoDon't dynamically initialize dllimport vars (PR19933)
Hans Wennborg [Wed, 4 Jun 2014 21:09:46 +0000 (21:09 +0000)]
Don't dynamically initialize dllimport vars (PR19933)

They should be initialized when they're exported.

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

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

10 years agoRemove the overload of GetAddrOfConstantString method
Alexey Samsonov [Wed, 4 Jun 2014 20:25:57 +0000 (20:25 +0000)]
Remove the overload of GetAddrOfConstantString method

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

10 years agoRefactor and generalize GetAddrOfConstantString and GetAddrOfConstantStringFromLiteral.
Alexey Samsonov [Wed, 4 Jun 2014 19:56:57 +0000 (19:56 +0000)]
Refactor and generalize GetAddrOfConstantString and GetAddrOfConstantStringFromLiteral.

Share mode code between these functions and re-structure them in a way
which shows how similar they actually are. The latter function works well
with literals of multi-byte chars and does a GlobalVariable name mangling
(if global strings are non-writable).

No functionality change.

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

10 years agoThis cast is not necessary any more (llvm api change).
Rafael Espindola [Wed, 4 Jun 2014 19:03:20 +0000 (19:03 +0000)]
This cast is not necessary any more (llvm api change).

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

10 years agoUpdate for llvm api change.
Rafael Espindola [Wed, 4 Jun 2014 18:51:46 +0000 (18:51 +0000)]
Update for llvm api change.

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

10 years agoMS-ABI: Mangle empty template parameter packs correctly
David Majnemer [Wed, 4 Jun 2014 16:46:32 +0000 (16:46 +0000)]
MS-ABI: Mangle empty template parameter packs correctly

Tested for compatibility with VS2013.

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

10 years agoMS-ABI: Implement user defined literals
David Majnemer [Wed, 4 Jun 2014 16:46:26 +0000 (16:46 +0000)]
MS-ABI: Implement user defined literals

Straightforward implementation of UDLs, it's compatible with VS "14".

This nearly completes our implementation of C++ name mangling for the
MS-ABI.

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

10 years ago[OPENMP] Parsing/Sema for OMPLasprivateClause.
Alexander Musman [Wed, 4 Jun 2014 13:06:39 +0000 (13:06 +0000)]
[OPENMP] Parsing/Sema for OMPLasprivateClause.
Parsing this clause, allowing it on directive ‘omp simd’ and semantic checks.

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

10 years agoclang-format: Leave empty lines within UnwrappedLines.
Daniel Jasper [Wed, 4 Jun 2014 12:40:57 +0000 (12:40 +0000)]
clang-format: Leave empty lines within UnwrappedLines.

These are commonly used to structure things like enums or long braced
lists. There doesn't seem to be a good reason to have the behavior in
such structures be different from the behavior between statements.

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

10 years ago[OPENMP] Small comment and reformatting fixes.
Alexander Musman [Wed, 4 Jun 2014 07:53:32 +0000 (07:53 +0000)]
[OPENMP] Small comment and reformatting fixes.

Fix post-commit review comments by Carlo Bertolli
for commit r209660 - OMP collapse clause.

Re-formatted TransformOMP* functions in TreeTransform.h with clang-format.

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

10 years agoRemove the last remaining llvm/Config/config.h includes
Alp Toker [Wed, 4 Jun 2014 03:28:55 +0000 (03:28 +0000)]
Remove the last remaining llvm/Config/config.h includes

This corrects long-standing misuses of LLVM's internal config.h.

In most cases the public llvm-config.h header was intended and we can now
remove the old hacks thanks to LLVM r210144.

The config.h header is private, won't be installed and should no longer be
included by clang or other modules.

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

10 years agoDowngrade "definition of dllimport static field" error to warning for class templates...
Hans Wennborg [Wed, 4 Jun 2014 00:18:41 +0000 (00:18 +0000)]
Downgrade "definition of dllimport static field" error to warning for class templates (PR19902)

This allows us to compile the following kind of code, which occurs in MSVC
headers:

  template <typename> struct S {
    __declspec(dllimport) static int x;
  };
  template <typename T> int S<T>::x;

The definition works similarly to a dllimport inline function definition and
gets available_externally linkage.

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

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

10 years agoAdd __builtin_operator_new and __builtin_operator_delete, which act like calls
Richard Smith [Tue, 3 Jun 2014 23:27:44 +0000 (23:27 +0000)]
Add __builtin_operator_new and __builtin_operator_delete, which act like calls
to the normal non-placement ::operator new and ::operator delete, but allow
optimizations like new-expressions and delete-expressions do.

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

10 years agoUpdate DR page for latest revision of CWG issues list.
Richard Smith [Tue, 3 Jun 2014 21:58:55 +0000 (21:58 +0000)]
Update DR page for latest revision of CWG issues list.

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

10 years agoFix leak from r210059
Alp Toker [Tue, 3 Jun 2014 17:23:34 +0000 (17:23 +0000)]
Fix leak from r210059

Also revert r210096 which temporarily disabled the test while this was being
investigated.

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

10 years agoUse IntrusiveRefCntPtr's == and != nullptr operators.
Rafael Espindola [Tue, 3 Jun 2014 13:27:48 +0000 (13:27 +0000)]
Use IntrusiveRefCntPtr's == and != nullptr operators.

This is a partial revert of r210075.

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

10 years agoclang-format: Refactor indentation behavior for multiple nested blocks.
Daniel Jasper [Tue, 3 Jun 2014 12:02:45 +0000 (12:02 +0000)]
clang-format: Refactor indentation behavior for multiple nested blocks.

This fixes a few oddities when formatting multiple nested JavaScript
blocks, e.g.:

Before:
  promise.then(
      function success() {
        doFoo();
        doBar();
      },
      [], function error() {
        doFoo();
        doBaz();
      });
  promise.then([],
               function success() {
                 doFoo();
                 doBar();
               },
               function error() {
    doFoo();
    doBaz();
  });

After:
  promise.then(
      function success() {
        doFoo();
        doBar();
      },
      [],
      function error() {
        doFoo();
        doBaz();
      });
  promise.then([],
               function success() {
                 doFoo();
                 doBar();
               },
               function error() {
                 doFoo();
                 doBaz();
               });

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

10 years agotemporary disable part of a test because it causes clang to leak memory (want to...
Kostya Serebryany [Tue, 3 Jun 2014 11:45:37 +0000 (11:45 +0000)]
temporary disable part of a test because it causes clang to leak memory (want to have the sanitizer bot green)

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

10 years ago[OPENMP] Loop canonical form analysis (Sema)
Alexander Musman [Tue, 3 Jun 2014 10:16:47 +0000 (10:16 +0000)]
[OPENMP] Loop canonical form analysis (Sema)

This patch implements semantic analysis to make sure that the loop is in OpenMP canonical form.
This is the form required for 'omp simd', 'omp for' and other loop pragmas.

Differential revision: http://reviews.llvm.org/D3778

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

10 years agoRemove incorrect assertion.
Richard Smith [Tue, 3 Jun 2014 08:40:27 +0000 (08:40 +0000)]
Remove incorrect assertion.

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

10 years agoImplement DR990 and DR1070. Aggregate initialization initializes uninitialized
Richard Smith [Tue, 3 Jun 2014 08:26:00 +0000 (08:26 +0000)]
Implement DR990 and DR1070. Aggregate initialization initializes uninitialized
elements from {}, rather than value-initializing them. This permits calling an
initializer-list constructor or constructing a std::initializer_list object.
(It would also permit initializing a const reference or rvalue reference if
that weren't explicitly prohibited by other rules.)

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

10 years agoTeach AST dumper to dump the array filler in an initializer list.
Richard Smith [Tue, 3 Jun 2014 08:24:28 +0000 (08:24 +0000)]
Teach AST dumper to dump the array filler in an initializer list.

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

10 years agoPR11410: Extend diagnostic to cover all cases of aggregate initialization, not
Richard Smith [Tue, 3 Jun 2014 07:28:54 +0000 (07:28 +0000)]
PR11410: Extend diagnostic to cover all cases of aggregate initialization, not
just the extremely specific case of a trailing array element that couldn't be
initialized because the default constructor for the element type is deleted.

Also reword the diagnostic to better match our other context diagnostics and to
prepare for the implementation of core issue 1070.

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

10 years agoList DR532 as implemented on the defect report status page by renaming the namespace.
Nikola Smiljanic [Tue, 3 Jun 2014 07:06:20 +0000 (07:06 +0000)]
List DR532 as implemented on the defect report status page by renaming the namespace.

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

10 years agoWhen emitting a multidimensional array new, emit the initializers for the
Richard Smith [Tue, 3 Jun 2014 06:58:52 +0000 (06:58 +0000)]
When emitting a multidimensional array new, emit the initializers for the
trailing elements as a single loop, rather than sometimes emitting a nest of
several loops. This fixes a bug where CodeGen would sometimes try to emit an
expression with the wrong type for the element being initialized. Plus various
other minor cleanups to the IR produced for array new initialization.

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

10 years agoDon't assume an implicit IntrusiveRefCntPtr -> bool operator.
Rafael Espindola [Tue, 3 Jun 2014 05:04:52 +0000 (05:04 +0000)]
Don't assume an implicit IntrusiveRefCntPtr -> bool operator.

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

10 years agoMove DR532 test where it belongs.
Nikola Smiljanic [Tue, 3 Jun 2014 02:56:59 +0000 (02:56 +0000)]
Move DR532 test where it belongs.

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

10 years agoUpdate for llvm API change.
Rafael Espindola [Tue, 3 Jun 2014 02:42:01 +0000 (02:42 +0000)]
Update for llvm API change.

Aliases in llvm now hold an arbitrary expression.

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

10 years agoFix -emit-codegen-only to not generate binaries
Alp Toker [Tue, 3 Jun 2014 02:14:20 +0000 (02:14 +0000)]
Fix -emit-codegen-only to not generate binaries

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

10 years agoEliminate redundant MangleBuffer class
Alp Toker [Tue, 3 Jun 2014 02:13:57 +0000 (02:13 +0000)]
Eliminate redundant MangleBuffer class

The only remaining user didn't actually use the non-dynamic storage facility
this class provides.

The std::string is transitional and likely to be StringRefized shortly.

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

10 years agoItanium ABI: Update getAddrOfVTable to set the DLL storage class for vtables
Hans Wennborg [Mon, 2 Jun 2014 23:13:03 +0000 (23:13 +0000)]
Itanium ABI: Update getAddrOfVTable to set the DLL storage class for vtables

This corresponds to the same change for the MS ABI in r209908.

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

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

10 years agoallow optional signext attribute
Will Schmidt [Mon, 2 Jun 2014 21:47:14 +0000 (21:47 +0000)]
allow optional signext attribute

Allow the tests to succeed with tne signext (or other) attribute is present.  The attributes
show up for Power, but not for x86*, so need to be appropriately wildcarded.

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

10 years agoDelete apparently unused method
Alexey Samsonov [Mon, 2 Jun 2014 21:05:54 +0000 (21:05 +0000)]
Delete apparently unused method

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

10 years ago[CodeGen] Don't use SizeTy for EmitNeonSplat.
Michael J. Spencer [Mon, 2 Jun 2014 19:48:59 +0000 (19:48 +0000)]
[CodeGen] Don't use SizeTy for EmitNeonSplat.

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

10 years agoRemove unused variable
Alexey Samsonov [Mon, 2 Jun 2014 19:45:14 +0000 (19:45 +0000)]
Remove unused variable

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

10 years agoFix comment vs function name mismatch
Hans Wennborg [Mon, 2 Jun 2014 18:50:54 +0000 (18:50 +0000)]
Fix comment vs function name mismatch

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