Commit Graph

50445 Commits

Author SHA1 Message Date
Daniel Jasper 0c214fa2e3 clang-format: Don't indent relative to unary operators.
It seems like most people see unary operators more like part of the
subsequent identifier and find relative indentation odd.

Before:
  aaaaaaaaaa(!aaaaaaaaaa( // break
                  aaaaa));
After:
  aaaaaaaaaa(!aaaaaaaaaa( // break
                 aaaaa));

llvm-svn: 200840
2014-02-05 13:43:04 +00:00
Alexander Kornienko 3bb8fbfa3e Make the OptionCategory variable static.
llvm-svn: 200839
2014-02-05 13:42:43 +00:00
Jordan Rose 749b581272 Fix typo in CastExpr::getCastKindName.
Patch by Mathieu Baudet!

llvm-svn: 200817
2014-02-05 03:49:45 +00:00
Hans Wennborg 39a509aa70 Don't mark decls with mismatching exception specs invalid in MS mode (PR18683)
We accept these with a warning in MS mode, but we would previously mark them
invalid, causing us not to emit code for them.

Differential Revision: http://llvm-reviews.chandlerc.com/D2681

llvm-svn: 200815
2014-02-05 02:37:58 +00:00
John McCall 9b595db16d Tighten lax vector-conversion rules and enforce them consistently.
When a lax conversion featured a vector and a non-vector, we were
only requiring the non-vector to be a scalar type, but really it
needs to be a real type (i.e. integral or real floating); it is
not reasonable to allow a pointer, member pointer, or complex
type here.

r198474 required lax conversions to match in "data size", i.e.
element size * element count, forbidding matches that happen
only because a vector is rounded up to the nearest power of two
in size.  Unfortunately, the erroneous logic was repeated in
several different places; unify them to use the new condition,
so that it triggers for arbitrary conversions and not just
those performed as part of binary operator checking.

rdar://15931426

llvm-svn: 200810
2014-02-04 23:58:19 +00:00
David Blaikie 535083efc9 Further simplify r200797 and add an explanatory comment.
llvm-svn: 200805
2014-02-04 23:46:16 +00:00
Adrian Prantl ade48ed6a0 Simplify testcase from r200797 some more.
llvm-svn: 200798
2014-02-04 21:50:56 +00:00
Adrian Prantl 381e75589d Debug info: fix a crasher when when emitting debug info for
not-yet-completed templated types. getTypeSize() needs a complete type.

rdar://problem/15931354

llvm-svn: 200797
2014-02-04 21:29:50 +00:00
Justin Bogner d554a8eb91 Clean up whitespace checks
In TokenLexer::ExpandFunctionArguments(), CurTok.hasLeadingSpace() is
checked in multiple locations, each time subtly differently. Checking it
early, when the token is seen, and using NextTokGetsSpace exclusively
after that makes the code simpler.

No change in behaviour is intended.

Patch by Harald van Dijk!

llvm-svn: 200788
2014-02-04 19:18:37 +00:00
Justin Bogner 79c93845f6 Fix whitespace handling in empty macro expansions
When a macro expansion does not result in any tokens, and the macro name
is preceded by whitespace, the whitespace should be passed to the first
token that follows the macro expansion. Similarly when a macro expansion
ends with a placemarker token, and that placemarker token is preceded by
whitespace. This worked already for top-level macro expansions, but is
now extended to also work for nested macro expansions.

Patch by Harald van Dijk!

llvm-svn: 200787
2014-02-04 19:18:35 +00:00
Justin Bogner eacd96d972 Fix whitespace handling in empty macro arguments
When a function-like macro definition ends with one of the macro's
parameters, and the argument is empty, any whitespace before the
parameter name in the macro definition needs to be preserved. Promoting
the existing NextTokGetsSpace to a preserved bit-field and checking it
at the end of the macro expansion allows it to be moved to the first
token following the macro expansion result.

Patch by Harald van Dijk!

llvm-svn: 200786
2014-02-04 19:18:32 +00:00
Justin Bogner 502155aff9 Fix whitespace handling in ## operator
In x ## y, where x and y are regular tokens, whitespace between x and ##
is ignored, and whitespace between ## and y is also ignored. When either
x or y is a function argument, whitespace was preserved, but it should
not be. This patch removes the checks for whitespace before ## and
before y, and in the special case where x is an empty macro argument and
y is a regular token, actively removes whitespace before y.

One existing test is affected by that change, but as clang's output now
matches the standard's requirements and that of GCC, I've tweaked the
testcase.

Patch by Harald van Dijk!

llvm-svn: 200785
2014-02-04 19:18:28 +00:00
Tim Northover 7ffb2c5523 ARM & AArch64: combine implementation of vcaXYZ intrinsics
Now that the back-end intrinsics are more regular, there's no need for the
special handling these got in the front-end, so they can be moved to
EmitCommonNeonBuiltinExpr.

llvm-svn: 200769
2014-02-04 14:55:52 +00:00
NAKAMURA Takumi da94d8a72e [CMake] add_clang_library(): Fix LLVM_PLUGIN_EXT in MODULE. It was broken since my r199902.
llvm-svn: 200760
2014-02-04 12:26:48 +00:00
NAKAMURA Takumi 75ab7f9b88 [CMake] add_clang_library(): Honor STATIC.
llvm-svn: 200759
2014-02-04 12:26:40 +00:00
Richard Smith bdd146435f Add implicit declarations of allocation functions when looking them up for
redeclaration, not just when looking them up for a use -- we need the implicit
declaration to appropriately check various properties of them (notably, whether
they're deleted).

llvm-svn: 200729
2014-02-04 01:14:30 +00:00
Richard Smith 5ef98f7288 Tidy up and reduce some comment redundancy.
llvm-svn: 200723
2014-02-03 23:22:05 +00:00
David Blaikie 9d3640836d DebugInfo: Fix for an improvement to DIBuilder to not emit {i32 0} for zero-length arrays.
llvm-svn: 200722
2014-02-03 23:08:59 +00:00
Reid Kleckner 0133e780a4 Fix a -Wmicrosoft warning about an unrepresentable enum value
In MSVC, enums are always signed unless you explicitly specify the type.

llvm-svn: 200719
2014-02-03 22:20:34 +00:00
Reid Kleckner c50b4bfc1c Fix a -Wformat warning in ASTUnit.cpp
llvm::sys::cas_flag is 'long' instead of 'uint32_t' on win32, because
that's what InterlockedIncrement is defined to accept.

I still don't know if we should be calling fprintf from ASTUnit.cpp
behind a getenv check.

llvm-svn: 200718
2014-02-03 22:20:24 +00:00
Richard Smith d7d11ef5c1 PR17846, PR17848: don't build a VarTemplateSpecializationDecl for a use of a
variable template until we know what the template arguments actually are.

llvm-svn: 200714
2014-02-03 20:09:56 +00:00
Reid Kleckner b78257d0c1 [ms-cxxabi] Fix cast when structor replacement is an alias
llvm-svn: 200711
2014-02-03 18:54:51 +00:00
Alexander Kornienko 7a712cea71 Allow specifying a custom PathDiagnosticConsumer for use with the static analyzer.
Summary:
Make objects returned by CreateAnalysisConsumer expose an interface,
that allows providing a custom PathDiagnosticConsumer, so that users can have
raw data in a form easily usable from the code (unlike plist/HTML in a file).

Reviewers: jordan_rose, krememek

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D2556

llvm-svn: 200710
2014-02-03 18:37:50 +00:00
Joerg Sonnenberger d5e2f094d4 Test cases for NetBSD/eARM
llvm-svn: 200709
2014-02-03 17:46:52 +00:00
Tim Northover 02e38609e7 ARM: implement support for crypto intrinsics in arm_neon.h
llvm-svn: 200708
2014-02-03 17:28:04 +00:00
Tim Northover 51ab388266 AArch64: use new non-polymorphic crypto intrinsics
The LLVM backend now has invariant types on the various crypto-intrinsics,
because in all cases there's only really one interpretation.

llvm-svn: 200707
2014-02-03 17:28:00 +00:00
Evgeniy Stepanov 9e7cb33b17 Fix handling of -fno-function-sections, -fno-data-sections in clang driver.
llvm-svn: 200685
2014-02-03 11:11:37 +00:00
Richard Smith 2eaf206455 Fix typo 'uusal'.
llvm-svn: 200681
2014-02-03 07:04:10 +00:00
Richard Smith 5e34db94bb Fix typo in CSS class name.
llvm-svn: 200680
2014-02-03 07:02:19 +00:00
Richard Smith 7fe896251d Clang 3.4 was released, make the boxes green.
llvm-svn: 200679
2014-02-03 06:58:08 +00:00
Richard Smith c94410bc8d Tests for DR331-350.
llvm-svn: 200678
2014-02-03 06:34:23 +00:00
Richard Smith 209bbb7774 Update C++ DR page now 3.4 has been released.
llvm-svn: 200674
2014-02-03 02:40:25 +00:00
Richard Smith 91dfaacd38 Implement DR329. We already did the right thing here in C++98 mode, but r104014
(which implemented the DR) was disabled in C++11.

llvm-svn: 200673
2014-02-03 02:37:59 +00:00
Richard Smith 9f38709193 Tests for DR321-330.
llvm-svn: 200672
2014-02-03 02:13:49 +00:00
Richard Smith 6938adbd16 Tests for DR301-320.
llvm-svn: 200671
2014-02-03 01:23:27 +00:00
David Majnemer 04606bda08 MS ABI: Fix some layout tests
Some lines intended to be used for testing x86_64 ABI compatibility were
not firing because lines were annotated with the wrong FileCheck prefix:
X64 vs x64

N.B. Changes beyond just changing x64 to X64 were made, presumably
because other parts of the layout engine have changed.  I've verified
the changes to make sure that MSVC creates a compatible layout.

llvm-svn: 200670
2014-02-03 00:29:57 +00:00
Joerg Sonnenberger e7f9759fd9 Handle O32/N64 ABIs for NetBSD/MIPS64. From Matt Thomas.
llvm-svn: 200668
2014-02-02 22:59:16 +00:00
Joerg Sonnenberger d68c650489 Replace hasMipsN32ABIArg with hasMipsABIArg in preparation of o32/n64
support.

llvm-svn: 200667
2014-02-02 22:54:18 +00:00
Joerg Sonnenberger 6cd7deb9fe Use a switch for the emulation handling.
llvm-svn: 200666
2014-02-02 22:50:34 +00:00
Joerg Sonnenberger 25de31d472 Handle compat support for EABI/old APCS compatibility on NetBSD/ARM.
llvm-svn: 200665
2014-02-02 22:47:37 +00:00
Joerg Sonnenberger d11c478ac3 Replace hasMipsN32ABIArg by hasMipsABIArg to make it easier to add
support for o32 and n64.

llvm-svn: 200662
2014-02-02 22:40:33 +00:00
Joerg Sonnenberger dc7a23c660 Pass down -mcpu for external assembler in thumb mode, too. From Matt Thomas.
llvm-svn: 200661
2014-02-02 22:37:14 +00:00
Joerg Sonnenberger 1e205ef7cf Minor formatting improvement.
llvm-svn: 200659
2014-02-02 22:36:13 +00:00
Joerg Sonnenberger ec39cc6165 Test pre-defined macros of aarch64-netbsd.
llvm-svn: 200656
2014-02-02 21:55:32 +00:00
Joerg Sonnenberger 9864bd5858 NetBSD uses signed wchar_t on AArch64. It also wants __LITTLE_ENDIAN__ /
__BIG_ENDIAN__ as on other architectures.

llvm-svn: 200655
2014-02-02 21:55:10 +00:00
Nico Weber 514ecc8ce8 clang-format: Let chromium style inherit google style's javascript tweaks.
llvm-svn: 200652
2014-02-02 20:50:45 +00:00
NAKAMURA Takumi 85d65ff49b [CMake] Move cmake_minimum_required(2.8.8) at the top.
Suggested by Stephen Kelly.

llvm-svn: 200645
2014-02-02 16:59:36 +00:00
NAKAMURA Takumi 6b13975d40 clang/CMakeLists.txt: Untabify.
llvm-svn: 200643
2014-02-02 16:46:07 +00:00
NAKAMURA Takumi 549d510c0b clang/lib/ASTMatchers/Dynamic/CMakeLists.txt: redundant
llvm-svn: 200642
2014-02-02 16:46:03 +00:00
Benjamin Kramer 35e6fee3e9 Sema: Reject templates in all extern "C" contexts.
Otherwise we'd accept them if the LinkageDecl was not the direct
parent DeclContext. PR17968.

llvm-svn: 200641
2014-02-02 16:35:43 +00:00