]> granicus.if.org Git - clang/log
clang
10 years agoChanged OptionCategory variables to be static.
Alexander Kornienko [Wed, 5 Feb 2014 21:28:03 +0000 (21:28 +0000)]
Changed OptionCategory variables to be static.

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

10 years agoPGO: instrumentation based profiling sets function attributes.
Manman Ren [Wed, 5 Feb 2014 20:40:15 +0000 (20:40 +0000)]
PGO: instrumentation based profiling sets function attributes.

We collect a maximal function count among all functions in the pgo data file.
For functions that are hot, we set its InlineHint attribute. For functions that
are cold, we set its Cold attribute.

We currently treat functions with >= 30% of the maximal function count as hot
and functions with <= 1% of the maximal function count are treated as cold.
These two numbers are from preliminary tuning on SPEC.

This commit should not affect non-PGO builds and should boost performance on
instrumentation based PGO.

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

10 years agoMS ABI: Fix mangling of static methods and function references
Reid Kleckner [Wed, 5 Feb 2014 18:59:38 +0000 (18:59 +0000)]
MS ABI: Fix mangling of static methods and function references

Function references always use $1? like function pointers and never $E?
like var decl references.  Static methods are mangled like function
pointers.

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

10 years agoDon't consider records with a NULL identifier as a name for typo correction.
Kaelyn Uhrain [Wed, 5 Feb 2014 18:57:51 +0000 (18:57 +0000)]
Don't consider records with a NULL identifier as a name for typo correction.

Because in C++, "anonymous" doesn't mean "nameless" for records. In
other words, RecordDecl::isAnonymousStructOrUnion only returns true if
the record lacks a name *and* is not used as the type in an object's
declaration.

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

10 years agoUpdate for llvm api change.
Rafael Espindola [Wed, 5 Feb 2014 18:00:26 +0000 (18:00 +0000)]
Update for llvm api change.

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

10 years agoRemove unused variable to fix -Werror build
Reid Kleckner [Wed, 5 Feb 2014 18:00:01 +0000 (18:00 +0000)]
Remove unused variable to fix -Werror build

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

10 years agoMS ABI: Mangle member pointer template arguments
Reid Kleckner [Wed, 5 Feb 2014 17:27:08 +0000 (17:27 +0000)]
MS ABI: Mangle member pointer template arguments

Member pointers are mangled as they would be represented at runtime.
They can be a single integer literal, single decl, or a tuple with some
more numbers tossed in.  With Clang today, most of those numbers will be
zero because we reject pointers to members of virtual bases.

This change required moving VTableContextBase ownership from
CodeGenVTables to ASTContext, because mangling now depends on vtable
layout.

I also hoisted the inheritance model helpers up to be inline static
methods of MSInheritanceAttr.  This makes the AST code that deals with
member pointers much more readable.

MSVC doesn't appear to have stable manglings of null member pointers:
- Null data memptrs in function templates have a mangling collision with
  the first field of a non-polymorphic single inheritance class.
- The mangling of null data memptrs changes if you add casts.
- Large null function memptrs in class templates crash MSVC.

Clang uses the class template mangling for null data memptrs and the
function template mangling for null function memptrs to deal with this.

Reviewers: majnemer

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

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

10 years agoObjective-C driver. Do not use legacy dispatch for
Fariborz Jahanian [Wed, 5 Feb 2014 17:13:42 +0000 (17:13 +0000)]
Objective-C driver. Do not use legacy dispatch for
10.5 or less for x86_64 arch. // rdar://15852259

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

10 years agoAdded the hasLoopVariable sub-matcher for forRangeStmt.
Alexander Kornienko [Wed, 5 Feb 2014 16:35:08 +0000 (16:35 +0000)]
Added the hasLoopVariable sub-matcher for forRangeStmt.

Summary:
This sub-matcher makes it possible to access directly the range-based for
loop variable: forRangeStmt(hasLoopVariable(anything()).bind(...)).
I've tried to re-generate the docs, but the diffs seem to include much more than
this change could cause, so I'd better leave docs update to someone who knows
the intended changes in the contents better.

Reviewers: klimek

Reviewed By: klimek

CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D2702

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

10 years agoFix the range for Malayam UCNs in C99.
Joey Gouly [Wed, 5 Feb 2014 15:32:23 +0000 (15:32 +0000)]
Fix the range for Malayam UCNs in C99.

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

10 years agoclang-format: Don't indent relative to unary operators.
Daniel Jasper [Wed, 5 Feb 2014 13:43:04 +0000 (13:43 +0000)]
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));

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

10 years agoMake the OptionCategory variable static.
Alexander Kornienko [Wed, 5 Feb 2014 13:42:43 +0000 (13:42 +0000)]
Make the OptionCategory variable static.

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

10 years agoFix typo in CastExpr::getCastKindName.
Jordan Rose [Wed, 5 Feb 2014 03:49:45 +0000 (03:49 +0000)]
Fix typo in CastExpr::getCastKindName.

Patch by Mathieu Baudet!

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

10 years agoDon't mark decls with mismatching exception specs invalid in MS mode (PR18683)
Hans Wennborg [Wed, 5 Feb 2014 02:37:58 +0000 (02:37 +0000)]
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

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

10 years agoTighten lax vector-conversion rules and enforce them consistently.
John McCall [Tue, 4 Feb 2014 23:58:19 +0000 (23:58 +0000)]
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

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

10 years agoFurther simplify r200797 and add an explanatory comment.
David Blaikie [Tue, 4 Feb 2014 23:46:16 +0000 (23:46 +0000)]
Further simplify r200797 and add an explanatory comment.

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

10 years agoSimplify testcase from r200797 some more.
Adrian Prantl [Tue, 4 Feb 2014 21:50:56 +0000 (21:50 +0000)]
Simplify testcase from r200797 some more.

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

10 years agoDebug info: fix a crasher when when emitting debug info for
Adrian Prantl [Tue, 4 Feb 2014 21:29:50 +0000 (21:29 +0000)]
Debug info: fix a crasher when when emitting debug info for
not-yet-completed templated types. getTypeSize() needs a complete type.

rdar://problem/15931354

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

10 years agoClean up whitespace checks
Justin Bogner [Tue, 4 Feb 2014 19:18:37 +0000 (19:18 +0000)]
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!

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

10 years agoFix whitespace handling in empty macro expansions
Justin Bogner [Tue, 4 Feb 2014 19:18:35 +0000 (19:18 +0000)]
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!

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

10 years agoFix whitespace handling in empty macro arguments
Justin Bogner [Tue, 4 Feb 2014 19:18:32 +0000 (19:18 +0000)]
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!

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

10 years agoFix whitespace handling in ## operator
Justin Bogner [Tue, 4 Feb 2014 19:18:28 +0000 (19:18 +0000)]
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!

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

10 years agoARM & AArch64: combine implementation of vcaXYZ intrinsics
Tim Northover [Tue, 4 Feb 2014 14:55:52 +0000 (14:55 +0000)]
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.

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

10 years ago[CMake] add_clang_library(): Fix LLVM_PLUGIN_EXT in MODULE. It was broken since my...
NAKAMURA Takumi [Tue, 4 Feb 2014 12:26:48 +0000 (12:26 +0000)]
[CMake] add_clang_library(): Fix LLVM_PLUGIN_EXT in MODULE. It was broken since my r199902.

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

10 years ago[CMake] add_clang_library(): Honor STATIC.
NAKAMURA Takumi [Tue, 4 Feb 2014 12:26:40 +0000 (12:26 +0000)]
[CMake] add_clang_library(): Honor STATIC.

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

10 years agoAdd implicit declarations of allocation functions when looking them up for
Richard Smith [Tue, 4 Feb 2014 01:14:30 +0000 (01:14 +0000)]
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).

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

10 years agoTidy up and reduce some comment redundancy.
Richard Smith [Mon, 3 Feb 2014 23:22:05 +0000 (23:22 +0000)]
Tidy up and reduce some comment redundancy.

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

10 years agoDebugInfo: Fix for an improvement to DIBuilder to not emit {i32 0} for zero-length...
David Blaikie [Mon, 3 Feb 2014 23:08:59 +0000 (23:08 +0000)]
DebugInfo: Fix for an improvement to DIBuilder to not emit {i32 0} for zero-length arrays.

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

10 years agoFix a -Wmicrosoft warning about an unrepresentable enum value
Reid Kleckner [Mon, 3 Feb 2014 22:20:34 +0000 (22:20 +0000)]
Fix a -Wmicrosoft warning about an unrepresentable enum value

In MSVC, enums are always signed unless you explicitly specify the type.

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

10 years agoFix a -Wformat warning in ASTUnit.cpp
Reid Kleckner [Mon, 3 Feb 2014 22:20:24 +0000 (22:20 +0000)]
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.

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

10 years agoPR17846, PR17848: don't build a VarTemplateSpecializationDecl for a use of a
Richard Smith [Mon, 3 Feb 2014 20:09:56 +0000 (20:09 +0000)]
PR17846, PR17848: don't build a VarTemplateSpecializationDecl for a use of a
variable template until we know what the template arguments actually are.

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

10 years ago[ms-cxxabi] Fix cast when structor replacement is an alias
Reid Kleckner [Mon, 3 Feb 2014 18:54:51 +0000 (18:54 +0000)]
[ms-cxxabi] Fix cast when structor replacement is an alias

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

10 years agoAllow specifying a custom PathDiagnosticConsumer for use with the static analyzer.
Alexander Kornienko [Mon, 3 Feb 2014 18:37:50 +0000 (18:37 +0000)]
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

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

10 years agoTest cases for NetBSD/eARM
Joerg Sonnenberger [Mon, 3 Feb 2014 17:46:52 +0000 (17:46 +0000)]
Test cases for NetBSD/eARM

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

10 years agoARM: implement support for crypto intrinsics in arm_neon.h
Tim Northover [Mon, 3 Feb 2014 17:28:04 +0000 (17:28 +0000)]
ARM: implement support for crypto intrinsics in arm_neon.h

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

10 years agoAArch64: use new non-polymorphic crypto intrinsics
Tim Northover [Mon, 3 Feb 2014 17:28:00 +0000 (17:28 +0000)]
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.

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

10 years agoFix handling of -fno-function-sections, -fno-data-sections in clang driver.
Evgeniy Stepanov [Mon, 3 Feb 2014 11:11:37 +0000 (11:11 +0000)]
Fix handling of -fno-function-sections, -fno-data-sections in clang driver.

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

10 years agoFix typo 'uusal'.
Richard Smith [Mon, 3 Feb 2014 07:04:10 +0000 (07:04 +0000)]
Fix typo 'uusal'.

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

10 years agoFix typo in CSS class name.
Richard Smith [Mon, 3 Feb 2014 07:02:19 +0000 (07:02 +0000)]
Fix typo in CSS class name.

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

10 years agoClang 3.4 was released, make the boxes green.
Richard Smith [Mon, 3 Feb 2014 06:58:08 +0000 (06:58 +0000)]
Clang 3.4 was released, make the boxes green.

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

10 years agoTests for DR331-350.
Richard Smith [Mon, 3 Feb 2014 06:34:23 +0000 (06:34 +0000)]
Tests for DR331-350.

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

10 years agoUpdate C++ DR page now 3.4 has been released.
Richard Smith [Mon, 3 Feb 2014 02:40:25 +0000 (02:40 +0000)]
Update C++ DR page now 3.4 has been released.

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

10 years agoImplement DR329. We already did the right thing here in C++98 mode, but r104014
Richard Smith [Mon, 3 Feb 2014 02:37:59 +0000 (02:37 +0000)]
Implement DR329. We already did the right thing here in C++98 mode, but r104014
(which implemented the DR) was disabled in C++11.

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

10 years agoTests for DR321-330.
Richard Smith [Mon, 3 Feb 2014 02:13:49 +0000 (02:13 +0000)]
Tests for DR321-330.

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

10 years agoTests for DR301-320.
Richard Smith [Mon, 3 Feb 2014 01:23:27 +0000 (01:23 +0000)]
Tests for DR301-320.

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

10 years agoMS ABI: Fix some layout tests
David Majnemer [Mon, 3 Feb 2014 00:29:57 +0000 (00:29 +0000)]
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.

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

10 years agoHandle O32/N64 ABIs for NetBSD/MIPS64. From Matt Thomas.
Joerg Sonnenberger [Sun, 2 Feb 2014 22:59:16 +0000 (22:59 +0000)]
Handle O32/N64 ABIs for NetBSD/MIPS64. From Matt Thomas.

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

10 years agoReplace hasMipsN32ABIArg with hasMipsABIArg in preparation of o32/n64
Joerg Sonnenberger [Sun, 2 Feb 2014 22:54:18 +0000 (22:54 +0000)]
Replace hasMipsN32ABIArg with hasMipsABIArg in preparation of o32/n64
support.

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

10 years agoUse a switch for the emulation handling.
Joerg Sonnenberger [Sun, 2 Feb 2014 22:50:34 +0000 (22:50 +0000)]
Use a switch for the emulation handling.

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

10 years agoHandle compat support for EABI/old APCS compatibility on NetBSD/ARM.
Joerg Sonnenberger [Sun, 2 Feb 2014 22:47:37 +0000 (22:47 +0000)]
Handle compat support for EABI/old APCS compatibility on NetBSD/ARM.

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

10 years agoReplace hasMipsN32ABIArg by hasMipsABIArg to make it easier to add
Joerg Sonnenberger [Sun, 2 Feb 2014 22:40:33 +0000 (22:40 +0000)]
Replace hasMipsN32ABIArg by hasMipsABIArg to make it easier to add
support for o32 and n64.

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

10 years agoPass down -mcpu for external assembler in thumb mode, too. From Matt Thomas.
Joerg Sonnenberger [Sun, 2 Feb 2014 22:37:14 +0000 (22:37 +0000)]
Pass down -mcpu for external assembler in thumb mode, too. From Matt Thomas.

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

10 years agoMinor formatting improvement.
Joerg Sonnenberger [Sun, 2 Feb 2014 22:36:13 +0000 (22:36 +0000)]
Minor formatting improvement.

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

10 years agoTest pre-defined macros of aarch64-netbsd.
Joerg Sonnenberger [Sun, 2 Feb 2014 21:55:32 +0000 (21:55 +0000)]
Test pre-defined macros of aarch64-netbsd.

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

10 years agoNetBSD uses signed wchar_t on AArch64. It also wants __LITTLE_ENDIAN__ /
Joerg Sonnenberger [Sun, 2 Feb 2014 21:55:10 +0000 (21:55 +0000)]
NetBSD uses signed wchar_t on AArch64. It also wants __LITTLE_ENDIAN__ /
__BIG_ENDIAN__ as on other architectures.

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

10 years agoclang-format: Let chromium style inherit google style's javascript tweaks.
Nico Weber [Sun, 2 Feb 2014 20:50:45 +0000 (20:50 +0000)]
clang-format: Let chromium style inherit google style's javascript tweaks.

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

10 years ago[CMake] Move cmake_minimum_required(2.8.8) at the top.
NAKAMURA Takumi [Sun, 2 Feb 2014 16:59:36 +0000 (16:59 +0000)]
[CMake] Move cmake_minimum_required(2.8.8) at the top.

Suggested by Stephen Kelly.

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

10 years agoclang/CMakeLists.txt: Untabify.
NAKAMURA Takumi [Sun, 2 Feb 2014 16:46:07 +0000 (16:46 +0000)]
clang/CMakeLists.txt: Untabify.

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

10 years agoclang/lib/ASTMatchers/Dynamic/CMakeLists.txt: redundant
NAKAMURA Takumi [Sun, 2 Feb 2014 16:46:03 +0000 (16:46 +0000)]
clang/lib/ASTMatchers/Dynamic/CMakeLists.txt: redundant

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

10 years agoSema: Reject templates in all extern "C" contexts.
Benjamin Kramer [Sun, 2 Feb 2014 16:35:43 +0000 (16:35 +0000)]
Sema: Reject templates in all extern "C" contexts.

Otherwise we'd accept them if the LinkageDecl was not the direct
parent DeclContext. PR17968.

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

10 years agoReport a correct end location for nameless parameters.
Benjamin Kramer [Sun, 2 Feb 2014 15:28:46 +0000 (15:28 +0000)]
Report a correct end location for nameless parameters.

Ranges before:
void test(void (*)(int), int, float);
          ~~~~~~~~~~~~~  ~~~~ ~~~~~~

Ranges after:
void test(void (*)(int), int, float);
          ~~~~~~~~~~~~~  ~~~  ~~~~~

This does not change the actual location of the ParmVarDecl, it still
points to the location where the name would be. PR17970.

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

10 years agoRevert r200555, r200545.
Evgeniy Stepanov [Sun, 2 Feb 2014 10:39:45 +0000 (10:39 +0000)]
Revert r200555, r200545.

These changes make it impossible to use ARM EHABI for stack unwinding without
enabling exceptions and break AddressSanitizer on ARM.

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

10 years ago[Sema] Follow-up on r200521 for the -Wnon-literal-null-conversion warning and revert...
Argyrios Kyrtzidis [Sun, 2 Feb 2014 05:26:43 +0000 (05:26 +0000)]
[Sema] Follow-up on r200521 for the -Wnon-literal-null-conversion warning and revert its behavior for C++.

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

10 years agoFix an assertion failure when building for the iOS simulator. rdar://15959009
Bob Wilson [Sat, 1 Feb 2014 21:06:21 +0000 (21:06 +0000)]
Fix an assertion failure when building for the iOS simulator. rdar://15959009

When building for i386 or x86_64 with IPHONEOS_DEPLOYMENT_TARGET set in the
environment, the toolchain correctly recognizes that the target platform is
the iOS simulator. The code in Darwin::addMinVersionArgs was not updated for
svn 197148, where isTargetIPhoneOS() was widely replaced by isTargetIOSBased().
This is kind of a strange case, though, because we probably ought to be
passing -ios_simulator_version_min to the linker, but according to the FIXME
in the code, we intentionally avoid that unless the -mios-simulator-version-min
option was used. I don't know whether it is safe to change that yet, so
for now, I am just fixing the assertion failure.

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

10 years agoRemove local type use in template.
Reid Kleckner [Sat, 1 Feb 2014 00:23:22 +0000 (00:23 +0000)]
Remove local type use in template.

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

10 years ago[ms-cxxabi] Use inalloca on win32 when passing non-trivial C++ objects
Reid Kleckner [Sat, 1 Feb 2014 00:04:45 +0000 (00:04 +0000)]
[ms-cxxabi] Use inalloca on win32 when passing non-trivial C++ objects

When a non-trivial parameter is present, clang now gathers up all the
parameters that lack inreg and puts them into a packed struct.  MSVC
always aligns each parameter to 4 bytes and no more, so this is a pretty
simple struct to lay out.

On win64, non-trivial records are passed indirectly.  Prior to this
change, clang was incorrectly using byval on win64.

I'm able to self-host a working clang with this change and additional
LLVM patches.

Reviewers: rsmith

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

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

10 years ago[ms-cxxabi] Use x86_cdeclmethodcc for __cdecl methods on win32
Reid Kleckner [Fri, 31 Jan 2014 22:54:50 +0000 (22:54 +0000)]
[ms-cxxabi] Use x86_cdeclmethodcc for __cdecl methods on win32

This fixes PR15768, where the sret parameter and the 'this' parameter
are in the wrong order.

Instance methods compiled by MSVC never return records in registers,
they always return indirectly through an sret pointer.  That sret
pointer always comes after the 'this' parameter, for both __cdecl and
__thiscall methods.

Unfortunately, the same is true for other calling conventions, so we'll
have to change the overall approach here relatively soon.

Reviewers: rsmith

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

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

10 years ago[ms-cxxabi] Raise aggregate memptr alignment to 8 for x86_32
Reid Kleckner [Fri, 31 Jan 2014 22:28:50 +0000 (22:28 +0000)]
[ms-cxxabi] Raise aggregate memptr alignment to 8 for x86_32

With this change, we give different results for __alignof than MSVC, but
our record layout is compatible.

Some data member pointers also now have a size that is not a multiple of
their alignment.

Fixes PR18618.

Reviewers: majnemer

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

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

10 years agoFix comment typo in test.
Richard Smith [Fri, 31 Jan 2014 22:28:08 +0000 (22:28 +0000)]
Fix comment typo in test.

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

10 years agoTrack the currently-being-built submodule inside the preprocessor (rather than
Richard Smith [Fri, 31 Jan 2014 20:47:44 +0000 (20:47 +0000)]
Track the currently-being-built submodule inside the preprocessor (rather than
just storing a flag indicating if there was one), and include it in the 'end of
module' annotation. No functionality change.

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

10 years agoMS Intrin.h: implement __cpuidex and simplify __cpuid
Hans Wennborg [Fri, 31 Jan 2014 19:44:55 +0000 (19:44 +0000)]
MS Intrin.h: implement __cpuidex and simplify __cpuid

The two identical implementations of __cpuid for X86 / X86_64 were
leftovers from my first iteration on the patch that implemented it.

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

10 years ago[CMake] arcmt-test: Reorganize link libraries with *actually referenced* libs from...
NAKAMURA Takumi [Fri, 31 Jan 2014 18:09:49 +0000 (18:09 +0000)]
[CMake] arcmt-test: Reorganize link libraries with *actually referenced* libs from arcmt-test.cpp.

arcmt-test doesn't depend on llvm codegen.

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

10 years agoLast option on -fexception for arm-disable-ehabi
Renato Golin [Fri, 31 Jan 2014 16:19:26 +0000 (16:19 +0000)]
Last option on -fexception for arm-disable-ehabi

Previous commit would have a following flag overriding the behaviour
and not taken care of.

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

10 years agoConnect -fno-exceptions to -arm-disable-ehabi
Renato Golin [Fri, 31 Jan 2014 14:13:20 +0000 (14:13 +0000)]
Connect -fno-exceptions to -arm-disable-ehabi

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

10 years agoclang-format: (JavaScript) Don't crash on empty string literals.
Daniel Jasper [Fri, 31 Jan 2014 12:49:42 +0000 (12:49 +0000)]
clang-format: (JavaScript) Don't crash on empty string literals.

Before, this would lead to a crash:
  f('', true);

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

10 years agoAdd tests for ARM RT library name
Renato Golin [Fri, 31 Jan 2014 12:21:55 +0000 (12:21 +0000)]
Add tests for ARM RT library name

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

10 years agoARM RT libs with generic name
Renato Golin [Fri, 31 Jan 2014 11:47:28 +0000 (11:47 +0000)]
ARM RT libs with generic name

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

10 years ago[CMake] clang doesn't care whether CLANG_ENABLE_*(s) were set or not.
NAKAMURA Takumi [Fri, 31 Jan 2014 11:19:15 +0000 (11:19 +0000)]
[CMake] clang doesn't care whether CLANG_ENABLE_*(s) were set or not.

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

10 years ago[CMake] Suppress SampleAnalyzerPlugin w/o ENABLE_STATIC_ANALYZER.
NAKAMURA Takumi [Fri, 31 Jan 2014 11:19:09 +0000 (11:19 +0000)]
[CMake] Suppress SampleAnalyzerPlugin w/o ENABLE_STATIC_ANALYZER.

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

10 years ago[CMake] Prune stray entries in add_dependencies(). target_link_libraries() implies it.
NAKAMURA Takumi [Fri, 31 Jan 2014 11:19:04 +0000 (11:19 +0000)]
[CMake] Prune stray entries in add_dependencies(). target_link_libraries() implies it.

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

10 years ago[sanitizer] update the list of supported platforms in the docs
Kostya Serebryany [Fri, 31 Jan 2014 10:49:34 +0000 (10:49 +0000)]
[sanitizer] update the list of supported platforms in the docs

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

10 years agoARM & AArch64: unify the rest of the completely shared NEON implementations
Tim Northover [Fri, 31 Jan 2014 10:46:52 +0000 (10:46 +0000)]
ARM & AArch64: unify the rest of the completely shared NEON implementations

This should be the last routine patch: AArch64 does still delegate to
EmitARMBuiltinExpr, but the remaining instances have complications of
one sort or another so some more cunning thought will be needed.

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

10 years agoARM & AArch64: another block of miscellaneous NEON sharing.
Tim Northover [Fri, 31 Jan 2014 10:46:49 +0000 (10:46 +0000)]
ARM & AArch64: another block of miscellaneous NEON sharing.

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

10 years agoARM & AArch64: move shared vld/vst intrinsics to common implementation.
Tim Northover [Fri, 31 Jan 2014 10:46:45 +0000 (10:46 +0000)]
ARM & AArch64: move shared vld/vst intrinsics to common implementation.

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

10 years agoARM & AArch64: more instructions into common block
Tim Northover [Fri, 31 Jan 2014 10:46:41 +0000 (10:46 +0000)]
ARM & AArch64: more instructions into common block

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

10 years agoARM & AArch64: merge another NEON block completely.
Tim Northover [Fri, 31 Jan 2014 10:46:36 +0000 (10:46 +0000)]
ARM & AArch64: merge another NEON block completely.

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

10 years ago[Sema] For -Wnon-literal-null-conversion warning, look through integer casts, which...
Argyrios Kyrtzidis [Fri, 31 Jan 2014 07:51:32 +0000 (07:51 +0000)]
[Sema] For -Wnon-literal-null-conversion warning, look through integer casts, which are used
by some projects in their null macro.

rdar://15925483

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

10 years ago[OPENMP] Bug fixes in threadprivate declaration and data sharing attributes processin...
Alexey Bataev [Fri, 31 Jan 2014 05:15:34 +0000 (05:15 +0000)]
[OPENMP] Bug fixes in threadprivate declaration and data sharing attributes processing. (http://llvm-reviews.chandlerc.com/D2451)

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

10 years agoMake x86 Android default target CPUs compatible with GCC (http://llvm-reviews.chandle...
Alexey Bataev [Fri, 31 Jan 2014 04:07:13 +0000 (04:07 +0000)]
Make x86 Android default target CPUs compatible with GCC (http://llvm-reviews.chandlerc.com/D2655)

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

10 years agolibclang/Makefile: Reorder libraries.
NAKAMURA Takumi [Fri, 31 Jan 2014 01:39:31 +0000 (01:39 +0000)]
libclang/Makefile: Reorder libraries.

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

10 years agoDriver: Don't use DOS style paths on UNIX
David Majnemer [Fri, 31 Jan 2014 01:35:55 +0000 (01:35 +0000)]
Driver: Don't use DOS style paths on UNIX

We'd add, as a fallback, DOS style paths when using the driver using a
win32 triple.  On a UNIX-like platform, this isn't particularly helpful.

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

10 years agoFix autolinking when modules are imported in pch files
Ben Langmuir [Fri, 31 Jan 2014 01:06:56 +0000 (01:06 +0000)]
Fix autolinking when modules are imported in pch files

Add the ImportDecl to the set of interesting delcarations that are
deserialized eagerly when an AST file is loaded (rather than lazily like
most decls). This is required to get auto linking to work when there is
no explicit import in the main file. Also resolve a FIXME to rename
'ExternalDefinitions', since that is only one of the things that need eager
deserialization. The new name is 'EagerlyDeserializedDecls'. The corresponding
AST bitcode is also renamed.

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

10 years agoIntroduce Parser::completeExpression.
Peter Collingbourne [Thu, 30 Jan 2014 22:38:41 +0000 (22:38 +0000)]
Introduce Parser::completeExpression.

This function returns a list of completions for a given expression and
completion position.

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

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

10 years agoPR14995: Allow a dependent type as the second parameter of operator++ and
Richard Smith [Thu, 30 Jan 2014 22:24:05 +0000 (22:24 +0000)]
PR14995: Allow a dependent type as the second parameter of operator++ and
operator--, since it might instantiate as 'int' (or, if it's a pack, it
might instantiate as an empty pack).

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

10 years agoDon't produce a 'returning reference to local' warning if a lambda returns a
Richard Smith [Thu, 30 Jan 2014 22:05:38 +0000 (22:05 +0000)]
Don't produce a 'returning reference to local' warning if a lambda returns a
reference (or pointer) to a variable from the closure object or from the
surrounding function scope.

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

10 years agoRevert "Fix assertion failures on annot_* tokens in clang -E"
Ben Langmuir [Thu, 30 Jan 2014 21:50:18 +0000 (21:50 +0000)]
Revert "Fix assertion failures on annot_* tokens in clang -E"

This is causing a failure in the msan buildbot that I am having trouble
reproducing.  Reverting until I can figure out what went wrong.

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

10 years agoFix assertion failures on annot_* tokens in clang -E
Ben Langmuir [Thu, 30 Jan 2014 18:09:55 +0000 (18:09 +0000)]
Fix assertion failures on annot_* tokens in clang -E

In particular, #pragma clang __debug, and #include implicitly changed
into @import were causing assertion failures.

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

10 years agoARM & AArch64: extend shared NEON implementation to first block.
Tim Northover [Thu, 30 Jan 2014 14:48:01 +0000 (14:48 +0000)]
ARM & AArch64: extend shared NEON implementation to first block.

This extends the refactoring to the whole of the first block of
trivial correspondences (as a fairly arbitrary boundary).

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

10 years agoARM & AArch64: fully share NEON implementation of permutation intrinsics
Tim Northover [Thu, 30 Jan 2014 14:47:57 +0000 (14:47 +0000)]
ARM & AArch64: fully share NEON implementation of permutation intrinsics

As a starting point, this moves the CodeGen for NEON permutation
instructions (vtrn, vzip, vuzp) into a new shared function.

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

10 years agoARM & AArch64: share the BI__builtin_neon enum defs.
Tim Northover [Thu, 30 Jan 2014 14:47:51 +0000 (14:47 +0000)]
ARM & AArch64: share the BI__builtin_neon enum defs.

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