]> granicus.if.org Git - clang/log
clang
10 years agoclang-format: Increase penalty for wrapping array subscript expressions
Daniel Jasper [Tue, 10 Jun 2014 13:27:57 +0000 (13:27 +0000)]
clang-format: Increase penalty for wrapping array subscript expressions

Before:
  aaaaaaaaaaa aaaaaaaaaaaaaaa = aaaaaaaaaaaaaaaaaaaaaaaaaa->aaaaaaaaa[0].aaaaaaa
                                    [0].aaaaaaaaaaaaaaaaaaaaaa();

After:
  aaaaaaaaaaa aaaaaaaaaaaaaaa = aaaaaaaaaaaaaaaaaaaaaaaaaa->aaaaaaaaa[0]
                                    .aaaaaaa[0]
                                    .aaaaaaaaaaaaaaaaaaaaaa();

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

10 years agoclang-format: Fix enum formatting with specific comment.
Daniel Jasper [Tue, 10 Jun 2014 10:42:26 +0000 (10:42 +0000)]
clang-format: Fix enum formatting with specific comment.

Before:
  enum Fruit {  //
    APPLE,
    PEAR };

After:
  enum Fruit {  //
    APPLE,
    PEAR
  };

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

10 years agoImprove diagnostic mapping terminology
Alp Toker [Tue, 10 Jun 2014 09:31:37 +0000 (09:31 +0000)]
Improve diagnostic mapping terminology

Diagnostic mappings are used to calculate the final severity of diagnostic
instances.

Detangle the implementation to reflect the terminology used in documentation
and bindings.

No change in functionality.

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

10 years agoDon't suppress backend diagnostics in system headers
Alp Toker [Tue, 10 Jun 2014 07:03:25 +0000 (07:03 +0000)]
Don't suppress backend diagnostics in system headers

Doing so would be inconsistent with the common fallback case where backend
diagnostics without source locations are emitted unconditionally.

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

10 years agoclang-format: Support variadic lambda captures.
Daniel Jasper [Tue, 10 Jun 2014 06:39:03 +0000 (06:39 +0000)]
clang-format: Support variadic lambda captures.

Before:
  return [ i, args... ]{};

After:
  return [i, args...] {};

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

10 years agoclang-format: Handle multiline strings inside ternary expressions.
Daniel Jasper [Tue, 10 Jun 2014 06:27:23 +0000 (06:27 +0000)]
clang-format: Handle multiline strings inside ternary expressions.

With AlwaysSplitBeforeMultilineStrings, clang-format would not find any
valid solution.

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

10 years agoShow -Wdate-time in system headers
Alp Toker [Tue, 10 Jun 2014 06:09:00 +0000 (06:09 +0000)]
Show -Wdate-time in system headers

Anyone enabling this warning would expect to hear about all occurrences
including those in system headers that can cause non-reproducible builds.

To achieve this, rework ShowInSystemHeader to remove broken unused mapping code
that didn't make sense with a simpler and correct scheme.

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

10 years agoImplement -Wdate-time preprocessor warning
Alp Toker [Tue, 10 Jun 2014 06:08:51 +0000 (06:08 +0000)]
Implement -Wdate-time preprocessor warning

This GCC warning is useful for validating reproducible builds
and might help when tracking down issues with modules too.

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

10 years agoImprove specificity in the diag-mapping2.c test
Alp Toker [Tue, 10 Jun 2014 06:08:41 +0000 (06:08 +0000)]
Improve specificity in the diag-mapping2.c test

Make sure grep catches the correct diagnostic, otherwise this test fails to
detect broken functionality.

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

10 years agoImprove checking for dynamic initializers of dllimport fields in template instantiation
Hans Wennborg [Tue, 10 Jun 2014 00:55:51 +0000 (00:55 +0000)]
Improve checking for dynamic initializers of dllimport fields in template instantiation

We would previously assert if the initializer was dependent. I also think that
checking isConstantInitializer is more correct here than checkInitIsICE.

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

10 years agoMake '-Werror=frame-larger-than=' and associated diagnostic pragmas GCC-compatible
Alp Toker [Mon, 9 Jun 2014 23:59:38 +0000 (23:59 +0000)]
Make '-Werror=frame-larger-than=' and associated diagnostic pragmas GCC-compatible

It turns out the trailing '=' really is part of the option name spelling and
treating it as such gets us compatible with GCC's -Werror= and pragmas.

(GCC doesn't appear to support any -Wno- form for this diagnostic but we do.)

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

10 years agoReduce indentation in ActOnIdExpression, NFC
Reid Kleckner [Mon, 9 Jun 2014 23:16:24 +0000 (23:16 +0000)]
Reduce indentation in ActOnIdExpression, NFC

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

10 years agoRemoving an "if (this == nullptr)" check from two print methods. The condition
Richard Trieu [Mon, 9 Jun 2014 22:53:25 +0000 (22:53 +0000)]
Removing an "if (this == nullptr)" check from two print methods.  The condition
will never be true in a well-defined context.  The checking for null pointers
has been moved into the caller logic so it does not rely on undefined behavior.

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

10 years agoObjective-C. Consider block pointer as NSObject as well as conforming to
Fariborz Jahanian [Mon, 9 Jun 2014 21:42:01 +0000 (21:42 +0000)]
Objective-C. Consider block pointer as NSObject as well as conforming to
'NSCopying' protocol when diagnosing block to ObjC pointer conversion.
// rdar://16739120

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

10 years agoDisallow multiple inclusion of clang/Config/config.h
Alp Toker [Mon, 9 Jun 2014 19:09:28 +0000 (19:09 +0000)]
Disallow multiple inclusion of clang/Config/config.h

Internal config.h headers are only meant to be included from the main file.

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

10 years agoAllow definition of dllimport static fields in partial specializations (PR19956)
Hans Wennborg [Mon, 9 Jun 2014 18:30:28 +0000 (18:30 +0000)]
Allow definition of dllimport static fields in partial specializations (PR19956)

This expands the logic from r210141 to cover partial specializations too.

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

10 years agoFix line numbers for code inlined from __nodebug__ functions.
Evgeniy Stepanov [Mon, 9 Jun 2014 09:09:19 +0000 (09:09 +0000)]
Fix line numbers for code inlined from __nodebug__ functions.

Instructions from __nodebug__ functions don't have file:line
information even when inlined into no-nodebug functions. As a result,
intrinsics (SSE and other) from <*intrin.h> clang headers _never_
have file:line information.

With this change, an instruction without !dbg metadata gets one from
the call instruction when inlined.

Fixes PR19001.

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

10 years ago[PPC64LE] Implement little-endian semantics for vec_sums
Bill Schmidt [Mon, 9 Jun 2014 03:31:47 +0000 (03:31 +0000)]
[PPC64LE] Implement little-endian semantics for vec_sums

The PowerPC vsumsws instruction, accessed via vec_sums, is defined
architecturally with a big-endian bias, in that the second input vector
and the result always reference big-endian element 3 (little-endian
element 0).  For ease of porting, the programmer wants elements 3 in
both cases.

To provide this semantics, for little endian we generate a permute for
the second input vector prior to the vsumsws instruction, and generate
a permute for the result vector following the vsumsws instruction.

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

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

10 years ago[C++11] Use 'nullptr'.
Craig Topper [Mon, 9 Jun 2014 02:04:02 +0000 (02:04 +0000)]
[C++11] Use 'nullptr'.

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

10 years agoConvert tests I recently add to use -verify instead of FileCheck.
Joey Gouly [Sun, 8 Jun 2014 21:28:54 +0000 (21:28 +0000)]
Convert tests I recently add to use -verify instead of FileCheck.

This uncovered something strange. Diagnostics for InlineAsm have source locations
that don't really map to where they are within the .c source file.

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

10 years ago[C++11] Use 'nullptr'. Unittests edition.
Craig Topper [Sun, 8 Jun 2014 08:38:12 +0000 (08:38 +0000)]
[C++11] Use 'nullptr'. Unittests edition.

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

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