Leave constructor initializer lists on one line in styles with no column limit.
Summary:
Allow tryFitMultipleLinesInOne join unwrapped lines when
ContinuationIndenter::mustBreak doesn't agree. But don't merge any lines, that
are separate in the input.
[SystemZ] Fix handling of pass-by-pointer arguments
I'd misunderstood getIndirect() to mean that the argument should be passed
as a pointer at the ABI level, with the ByVal argument choosing caller-copy
semantics over no-caller-copy (callee-copy-on-write) semantics. But
getIndirect(x) actually means that x is passed by pointer at the IR
level but (at least on all other targets I looked at) directly at the
ABI level. getIndirect(x, false) selects a pointer to a caller-made
copy, which is what SystemZ was aiming for.
This fixes a miscompilation of c-index-test. Structure arguments were being
passed by pointer, but no copy was being made, so a write in the callee
stomped over a caller's local variable.
David Majnemer [Wed, 4 Dec 2013 09:01:55 +0000 (09:01 +0000)]
Sema: Propagate the mangling number into instantiations
We would lose track of the mangling number assigned to the original
declaration which would cause us to create manglings that didn't match
the Itanium C++ specification.
e.g. Two static fields with the same name inside of a function template
would receive the same mangling with LLVM fixing up the second field so
they wouldn't collide. This would create an incompatibility with other
compilers following the Itanium ABI.
I've confirmed that the new mangling is identical to the ones generated
by icc and gcc.
N.B. This was uncovered while working on Microsoft mangler.
Faisal Vali [Wed, 4 Dec 2013 03:51:14 +0000 (03:51 +0000)]
Fix PR17637: incorrect calculation of template parameter depth
In delayed template parsing mode, adjust the template depth counter for each template parameter list associated with an out of line member template specialization.
[objc] Emit warning when the implementation of a secondary initializer calls on
super another initializer and when the implementation does not delegate to
another initializer via a call on 'self'.
A secondary initializer is an initializer method not marked as a designated
initializer within a class that has at least one initializer marked as a
designated initializer.
[objc] Emit warnings when the implementation of a designated initializer calls on
super an initializer that is not a designated one or any initializer on self.
[objc] Emit a warning when the implementation of a designated initializer does not chain to
an init method that is a designated initializer for the superclass.
[objc] Introduce ObjCInterfaceDecl::getDesignatedInitializers() to get the
designated initializers of an interface.
If the interface declaration does not have methods marked as designated
initializers then the interface inherits the designated initializers of
its super class.
Daniel Jasper [Tue, 3 Dec 2013 20:30:36 +0000 (20:30 +0000)]
Fix corner case in module-based layering warning.
Before, there SourceManager would not return a FileEntry for a
SourceLocation of a macro expansion (if the header name itself is
defined in a macro). We'd then fallback to assume that the module
currently being built is the including module. However, in this case we
are actually interested in the spelling location of the filename loc in
order to derive the including module.
Hans Wennborg [Tue, 3 Dec 2013 18:02:51 +0000 (18:02 +0000)]
CMake: enable building the clang-format vs plugin
This makes it possible to build the clang-format vs plugin from the cmake build.
It is a hack, as it shells out to "devenv" to actually build it, but it's hidden
away in a corner behind a flag, and it provides a convenient way of building the
plug-in from the command-line together with the rest of clang.
Alp Toker [Tue, 3 Dec 2013 06:13:01 +0000 (06:13 +0000)]
Emit an extension warning when changing system header tokens
clang converts keywords to identifiers for compatibility with various system
headers such as GNU libc.
Implement a -Wkeyword-compat extension warning to diagnose those cases. The
warning is on by default but will generally be ignored in system headers. It
can however be enabled globally to aid standards conformance testing.
This also changes the __uptr keyword avoidance from r195710 to no longer
special-case system headers, bringing it in line with other similar workarounds
in clang.
Implementation returns bool for symmetry with token annotation functions.
Some examples:
warning: keyword '__is_pod' will be treated as an identifier for the remainder of the translation unit [-Wkeyword-compat]
struct __is_pod
warning: keyword '__uptr' will be treated as an identifier here [-Wkeyword-compat]
union w *__uptr;
Hao Liu [Tue, 3 Dec 2013 05:58:49 +0000 (05:58 +0000)]
AArch64: add missing ACLE intrinsics mapping to general arithmetic operation from VFP instructions.
E.g. float64x1_t vadd_f64(float64x1_t a, float64x1_t b) -> FADD Dd, Dn, Dm.
Hao Liu [Tue, 3 Dec 2013 05:35:17 +0000 (05:35 +0000)]
revert r196152.
This is a duplicate implementation.
E.g. this patch defines:
float64_t vabd_f64(float64_t a, float64_t b)
But there is already a similar intrinsic "vabdd_f64" with the same types.
Also, this intrinsic will be conflicted to the vector type intrinsic as following(Which is implemented by me and will be committed to trunk):
float64x1_t vabd_f64(float64x1_t a, float64x1_t b).
Two functions shouldn't have a same name in arm_neon.h.
According to ARM ACLE document, such vabd_f64 with float64_t is not existing.
So I revert this commit.
Dmitri Gribenko [Tue, 3 Dec 2013 00:48:09 +0000 (00:48 +0000)]
MS inline asm: When LLVM called back to Clang to parse a name and do name
lookup, if parsing failed, we did not restore the lexer state properly, and
eventually crashed. This change ensures that we always consume all the tokens
from the new token stream we started to parse the name from inline asm.
Aaron Ballman [Mon, 2 Dec 2013 22:38:33 +0000 (22:38 +0000)]
Refactored the work group-related attributes to use a template, which reduces the amount of duplicate code in the handler. No functional change intended.
Aaron Ballman [Mon, 2 Dec 2013 21:09:08 +0000 (21:09 +0000)]
The CUDA device attribute doesn't need custom logic to check the number of attribute arguments (the common attribute handler already does this). Switching to use the simple attribute handler. No functional change intended.
Aaron Ballman [Mon, 2 Dec 2013 18:05:46 +0000 (18:05 +0000)]
Factored attribute mutual exclusion code into a helper function; split the cf_audited_transfer and cf_unknown_transfer attributes into separate helper methods for simplicity. No functional changes intended.
Hans Wennborg [Mon, 2 Dec 2013 17:31:52 +0000 (17:31 +0000)]
clang-format vs plugin: bake clang-format.exe into the vsix
This makes the clang-format plugin self-contained. Instead of
requiring clang-format.exe to be available on the PATH, this
includes it in the plugin's installer (.vsix file) and runs it
from the install directory.
Aaron Ballman [Mon, 2 Dec 2013 17:07:07 +0000 (17:07 +0000)]
Re-enabled support for the Subjects for the weak attribute. This changes the diagnostic involved to be more accurate -- for C++ code, it will now report that weak applies to variables, functions or classes. Added additional test case for this.
Aaron Ballman [Mon, 2 Dec 2013 16:17:55 +0000 (16:17 +0000)]
The __w64 attribute handler was more generically named, but only applied to __w64 specifically. Renamed and removed some unused code. No functional change intended.
add an additional test case for generic attributes
gcc treats [[gnu:const]], [[gnu::__const]], and [[gnu:__const__]] as all being
equivalent. Add an additional test case to ensure that we do not miss the last
case.