]> granicus.if.org Git - clang/log
clang
10 years agoObjectiveC driver. reinstate -fno-objc-legacy-dispatch behavior
Fariborz Jahanian [Mon, 20 Jan 2014 19:32:33 +0000 (19:32 +0000)]
ObjectiveC driver. reinstate -fno-objc-legacy-dispatch behavior
when the deployment target is 10.5. // rdar://15852259

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

10 years agoAdding a bit of documentation that was missed with r198883 (when ParseArgumentsAsUnev...
Aaron Ballman [Mon, 20 Jan 2014 18:42:10 +0000 (18:42 +0000)]
Adding a bit of documentation that was missed with r198883 (when ParseArgumentsAsUnevaluated was added).

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

10 years agoExposed a declarative way to specify that an attribute can be duplicated when merging...
Aaron Ballman [Mon, 20 Jan 2014 18:07:09 +0000 (18:07 +0000)]
Exposed a declarative way to specify that an attribute can be duplicated when merging attributes on a declaration. This replaces some hard-coded functionality from Sema.

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

10 years agoRemove some hard-coded specialness for thread-safety attributes from the parser,...
Aaron Ballman [Mon, 20 Jan 2014 17:18:35 +0000 (17:18 +0000)]
Remove some hard-coded specialness for thread-safety attributes from the parser, and made it more declarative. If an attribute is allowed to appear on a function definition when late parsed, it can now use the FunctionDefinition attribute subject. It's treated as a FunctionDecl for most purposes, except it also gets exposed on the AttributeList so that it can be used while parsing.

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

10 years agoclang-format: Properly format custom options in protocol buffer definitions.
Daniel Jasper [Mon, 20 Jan 2014 16:47:22 +0000 (16:47 +0000)]
clang-format: Properly format custom options in protocol buffer definitions.

Before:
  option(my_option) = "abc";

After:
  option (my_option) = "abc";

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

10 years agoFormatting cleanups; no functional changes.
Aaron Ballman [Mon, 20 Jan 2014 16:15:55 +0000 (16:15 +0000)]
Formatting cleanups; no functional changes.

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

10 years agoAdd a triple. Should fix the 64 bit bots.
Rafael Espindola [Mon, 20 Jan 2014 16:15:48 +0000 (16:15 +0000)]
Add a triple. Should fix the 64 bit bots.

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

10 years agoMake the test more strict.
Rafael Espindola [Mon, 20 Jan 2014 15:58:59 +0000 (15:58 +0000)]
Make the test more strict.

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

10 years agoFixing a typo (turned out to be harmless since the default priority values are the...
Aaron Ballman [Mon, 20 Jan 2014 15:22:57 +0000 (15:22 +0000)]
Fixing a typo (turned out to be harmless since the default priority values are the same between the two attributes).

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

10 years agoRemove virtual methods that were added in 2009 and still had 1 implementation.
Rafael Espindola [Mon, 20 Jan 2014 15:19:43 +0000 (15:19 +0000)]
Remove virtual methods that were added in 2009 and still had 1 implementation.

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

10 years agoSince the diagnostics engine understands Attr objects, this code is no longer require...
Aaron Ballman [Mon, 20 Jan 2014 15:06:09 +0000 (15:06 +0000)]
Since the diagnostics engine understands Attr objects, this code is no longer required -- we can just pass in the attribute directly.

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

10 years agoMaking some minor improvements to r199626.
Aaron Ballman [Mon, 20 Jan 2014 14:19:44 +0000 (14:19 +0000)]
Making some minor improvements to r199626.

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

10 years agoHasFunctionProto is a more strict version of FunctionLike. Since attribute subjects...
Aaron Ballman [Mon, 20 Jan 2014 14:18:40 +0000 (14:18 +0000)]
HasFunctionProto is a more strict version of FunctionLike. Since attribute subjects are inclusive (passing a single subject test means no subject-related diagnostic will fire), these two subjects should not be combined.

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

10 years agoclang-format: Leave 2 empty lines in Google's JavaScript style.
Daniel Jasper [Mon, 20 Jan 2014 14:10:30 +0000 (14:10 +0000)]
clang-format: Leave 2 empty lines in Google's JavaScript style.

As per the style guide, two lines are required between top-level
elements.

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

10 years ago[ARM] Add ACLE enum/wchar size predefines
Bradley Smith [Mon, 20 Jan 2014 10:52:00 +0000 (10:52 +0000)]
[ARM] Add ACLE enum/wchar size predefines

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

10 years ago[CMake] Apply ADDITIONAL_HEADERS introduced in r199639.
NAKAMURA Takumi [Mon, 20 Jan 2014 10:24:05 +0000 (10:24 +0000)]
[CMake] Apply ADDITIONAL_HEADERS introduced in r199639.

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

10 years agoAdd the test trees that were supposed to be part of r199632.
Chandler Carruth [Mon, 20 Jan 2014 09:47:21 +0000 (09:47 +0000)]
Add the test trees that were supposed to be part of r199632.

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

10 years agoMake the Linux support for finding libc++ somewhat less braindead.
Chandler Carruth [Mon, 20 Jan 2014 09:42:24 +0000 (09:42 +0000)]
Make the Linux support for finding libc++ somewhat less braindead.

Now instead of just looking in the system root for it, we also look
relative to the clang binary's directory. This should "just work" in
almost all cases. I've added test cases accordingly.

This is probably *very* worthwhile to backport to the 3.4 branch so that
folks can check it out, build it, and use that as their host compiler
going forward.

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

10 years agoPR18551: accepts invalid strong enum to bool when operator! is used
Alp Toker [Mon, 20 Jan 2014 07:20:22 +0000 (07:20 +0000)]
PR18551: accepts invalid strong enum to bool when operator! is used

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

10 years agoWire up basic parser/sema support for attribute 'returns_nonnull'.
Ted Kremenek [Mon, 20 Jan 2014 05:50:47 +0000 (05:50 +0000)]
Wire up basic parser/sema support for attribute 'returns_nonnull'.

This attribute is supported by GCC.  More generally it should
probably be a type attribute, but this behavior matches 'nonnull'.

This patch does not include warning logic for checking if a null
value is returned from a function annotated with this attribute.
That will come in subsequent patches.

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

10 years agoThese attributes are no longer "checker-specific."
Ted Kremenek [Mon, 20 Jan 2014 05:50:41 +0000 (05:50 +0000)]
These attributes are no longer "checker-specific."

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

10 years agoMSVC 2013 type trait support
Alp Toker [Mon, 20 Jan 2014 00:24:09 +0000 (00:24 +0000)]
MSVC 2013 type trait support

Implement type trait primitives used in the latest edition of the Microsoft
standard C++ library type_traits header.

With this change we can parse much of the Visual Studio 2013 standard headers,
particularly anything that includes <type_traits>.

Fully implemented, available in all language modes:

 * __is_constructible()
 * __is_nothrow_constructible()
 * __is_nothrow_assignable()

Partially implemented, semantic analysis WIP, available as MS extensions:

 * __is_destructible()
 * __is_nothrow_destructible()

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

10 years agoFix nothrow trait with multiple default constructors
Alp Toker [Mon, 20 Jan 2014 00:23:47 +0000 (00:23 +0000)]
Fix nothrow trait with multiple default constructors

Check all default ctors, not just the first one we see. This brings
__has_nothrow_constructor() in line with the other unary type traits.

A C++ class can have multiple default constructors but clang was only checking
the first one written, presumably due to ambiguity in the GNU specification.

MSVC has the same bug, while g++ has the correct implementation which we now
match.

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

10 years agoPR18544: don't assert that 'operator new' is not declared inside a namespace;
Richard Smith [Sun, 19 Jan 2014 23:25:37 +0000 (23:25 +0000)]
PR18544: don't assert that 'operator new' is not declared inside a namespace;
such an assert will fail in invalid code that does so!

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

10 years ago[CMake] Deprecate CLANG_RUNTIME_OUTPUT_INTDIR and CLANG_LIBRARY_OUTPUT_INTDIR.
NAKAMURA Takumi [Sun, 19 Jan 2014 13:00:01 +0000 (13:00 +0000)]
[CMake] Deprecate CLANG_RUNTIME_OUTPUT_INTDIR and CLANG_LIBRARY_OUTPUT_INTDIR.

LLVM_*_OUTPUT_INTDIR should be available everywhere. It was my mistake when I introduced INTDIR stuff.

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

10 years ago[CMake][Standalone] Redefine LLVM_RUNTIME_OUTPUT_INTDIR and LLVM_LIBRARY_OUTPUT_INTDI...
NAKAMURA Takumi [Sun, 19 Jan 2014 12:55:14 +0000 (12:55 +0000)]
[CMake][Standalone] Redefine LLVM_RUNTIME_OUTPUT_INTDIR and LLVM_LIBRARY_OUTPUT_INTDIR to point appropriate target directories.

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

10 years ago[CMake] Prune LLVM_TOOLS_DIR and LLVM_LIBS_DIR in clang/test/CMakeLists.txt. They...
NAKAMURA Takumi [Sun, 19 Jan 2014 12:45:35 +0000 (12:45 +0000)]
[CMake] Prune LLVM_TOOLS_DIR and LLVM_LIBS_DIR in clang/test/CMakeLists.txt. They are overridden in configure_lit_site_cfg().

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

10 years agoclang-format: Better support and testing for protocol buffers.
Daniel Jasper [Sun, 19 Jan 2014 09:04:08 +0000 (09:04 +0000)]
clang-format: Better support and testing for protocol buffers.

With this patch, there is dedicated testing for protocol buffers
(https://developers.google.com/protocol-buffers/).

Also some minor tweaks formatting tweaks.

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

10 years ago[CMake] check-clang requires clang-tblgen. It is not required by anyone when external...
NAKAMURA Takumi [Sun, 19 Jan 2014 08:54:48 +0000 (08:54 +0000)]
[CMake] check-clang requires clang-tblgen. It is not required by anyone when external CLANG_TABLEGEN is specified.

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

10 years agoclang-format: Fix ObjC block as first call parameter formatting.
Daniel Jasper [Sun, 19 Jan 2014 07:46:32 +0000 (07:46 +0000)]
clang-format: Fix ObjC block as first call parameter formatting.

Before:
  foo (^{ bar(); });
After:
  foo(^{ bar(); });

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

10 years agoHarden InitListExpr::isStringLiteralInit() against getInit() returning null.
Ted Kremenek [Sun, 19 Jan 2014 06:31:34 +0000 (06:31 +0000)]
Harden InitListExpr::isStringLiteralInit() against getInit() returning null.

This led to a crash on invalid code (sorry, no good test case).

Fixes <rdar://problem/15831804>.

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

10 years agoFix comment typos
Alp Toker [Sat, 18 Jan 2014 21:49:37 +0000 (21:49 +0000)]
Fix comment typos

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

10 years agodocs: clarify the role of compiler-builtin type trait primitives
Alp Toker [Sat, 18 Jan 2014 21:49:02 +0000 (21:49 +0000)]
docs: clarify the role of compiler-builtin type trait primitives

Update the documentation to clarify the intent of clang's built-in type trait
facilities, their relation to user-facing C++ type traits and means to check
for availability.

Also explain that __has_feature() is not currently up to date and should not
generally be used in user code (there's a proposal to provide more consistent
checks via __has_builtin(), see cfe-dev).

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

10 years agoMake unreferenced f-group options anonymous
Alp Toker [Sat, 18 Jan 2014 20:45:14 +0000 (20:45 +0000)]
Make unreferenced f-group options anonymous

These were showing up with find-unused-options.sh

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

10 years agoTry to fix this link.
Nick Lewycky [Sat, 18 Jan 2014 02:29:10 +0000 (02:29 +0000)]
Try to fix this link.

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

10 years agoDriver support for -fdebug-types-sections
David Blaikie [Sat, 18 Jan 2014 02:02:06 +0000 (02:02 +0000)]
Driver support for -fdebug-types-sections

Using backend-option like a few other debug codegen flags. I believe
Eric Christopher's working at porting those over to something nicer
such as an API level CodeGenOptions or the like, so this can be
improved along with that work.

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

10 years agoRefactor ABI argument lowering a little
Reid Kleckner [Sat, 18 Jan 2014 01:12:41 +0000 (01:12 +0000)]
Refactor ABI argument lowering a little

Currently it tracks the number of free registers, but soon it will track
stack offsets for inalloca lowering.

No functional change.

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

10 years agoRestrict redeclaration of tags introduced by using decls to MSVCCompat
Alp Toker [Sat, 18 Jan 2014 00:59:32 +0000 (00:59 +0000)]
Restrict redeclaration of tags introduced by using decls to MSVCCompat

This limits the facility added in r199490 while we seek clarification on the
standard.

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

10 years agoUse switch statements in preparation for adding more architectures.
Joerg Sonnenberger [Sat, 18 Jan 2014 00:50:49 +0000 (00:50 +0000)]
Use switch statements in preparation for adding more architectures.

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

10 years agoPR12788: Remove unnecessary and incorrect special case for indirect fields.
Richard Smith [Fri, 17 Jan 2014 22:29:43 +0000 (22:29 +0000)]
PR12788: Remove unnecessary and incorrect special case for indirect fields.
This caused us to skip a step that was essential for correct access control.

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

10 years agoFix string-literal to char* conversion in overload resolution for C++11
Ismail Pazarbasi [Fri, 17 Jan 2014 21:08:52 +0000 (21:08 +0000)]
Fix string-literal to char* conversion in overload resolution for C++11

String literal to char* conversion is deprecated in C++03, and is removed in
C++11. We still accept this conversion in C++11 mode as an extension, if we find
it in the best viable function.

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

10 years agoDon't allow 'this' within typedefs within classes that otherwise look like they
Richard Smith [Fri, 17 Jan 2014 21:01:18 +0000 (21:01 +0000)]
Don't allow 'this' within typedefs within classes that otherwise look like they
might be member function declarations. Patch by Harald van Dijk!

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

10 years agoclang-format: Don't break lines starting with "import <string-literal>"
Daniel Jasper [Fri, 17 Jan 2014 16:21:39 +0000 (16:21 +0000)]
clang-format: Don't break lines starting with "import <string-literal>"

The author might be missing the "#" or these might be protocol buffer
definitions. Either way, we should not break the line or the string.

There don't seem to be other valid use cases.

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

10 years ago[analyzer] Fix incorrect spelling of 'pthread_rwlock_trywrlock'. Patch by Jean Bapti...
Ted Kremenek [Fri, 17 Jan 2014 16:06:43 +0000 (16:06 +0000)]
[analyzer] Fix incorrect spelling of 'pthread_rwlock_trywrlock'.  Patch by Jean Baptiste Noblot.

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

10 years agoAdding a test case for nonnull being attached to something other than a function...
Aaron Ballman [Fri, 17 Jan 2014 14:38:58 +0000 (14:38 +0000)]
Adding a test case for nonnull being attached to something other than a function, Objective-C method, or parameter.

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

10 years agoPermit redeclaration of tags introduced by using decls
Alp Toker [Fri, 17 Jan 2014 12:57:21 +0000 (12:57 +0000)]
Permit redeclaration of tags introduced by using decls

This valid construct appears in MSVC headers where it's used to provide a
definition for the '::type_info' compiler builtin type.

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

10 years agoFix a build-bot breakage for clang-modernize when run with the MSVC ABI
David Majnemer [Fri, 17 Jan 2014 10:54:42 +0000 (10:54 +0000)]
Fix a build-bot breakage for clang-modernize when run with the MSVC ABI

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

10 years agoRevert "Revert r199416, "MS ABI: Improve selection of an inheritance model""
David Majnemer [Fri, 17 Jan 2014 09:01:00 +0000 (09:01 +0000)]
Revert "Revert r199416, "MS ABI: Improve selection of an inheritance model""

This reverts commit r199475 (which reverted r199416) with fixes for the
breakages.

We wouldn't lock an inheritance model if we saw a pointer-to-member
formed as a result of the address-of operator.

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

10 years agoAdd more test cases for attribute 'objc_protocol_requires_explicit_implementation'.
Ted Kremenek [Fri, 17 Jan 2014 08:34:19 +0000 (08:34 +0000)]
Add more test cases for attribute 'objc_protocol_requires_explicit_implementation'.

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

10 years agoRevert r199416, "MS ABI: Improve selection of an inheritance model"
NAKAMURA Takumi [Fri, 17 Jan 2014 07:33:47 +0000 (07:33 +0000)]
Revert r199416, "MS ABI: Improve selection of an inheritance model"

It broke tests for targeting x86_64-pc-win32:

    Clang Tools :: clang-modernize/LoopConvert/array.cpp
    Clang :: CodeGenCXX/2010-05-10-Var-DbgInfo.cpp
    Clang :: CodeGenCXX/member-call-parens.cpp
    Clang :: CodeGenCXX/ptr-to-datamember.cpp
    Clang :: SemaTemplate/instantiate-function-1.cpp

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

10 years ago[analyzer] Teach NonNullParamChecker about 'nonnull' attributes on parameters.
Ted Kremenek [Fri, 17 Jan 2014 07:15:35 +0000 (07:15 +0000)]
[analyzer] Teach NonNullParamChecker about 'nonnull' attributes on parameters.

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

10 years agoChange CallEvent to use ArrayRef<> interface to get formal parameters of callee.
Ted Kremenek [Fri, 17 Jan 2014 07:15:31 +0000 (07:15 +0000)]
Change CallEvent to use ArrayRef<> interface to get formal parameters of callee.

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

10 years agoAdd ArrayRef<> interface to get the formal parameters of a BlockDecl.
Ted Kremenek [Fri, 17 Jan 2014 07:15:26 +0000 (07:15 +0000)]
Add ArrayRef<> interface to get the formal parameters of a BlockDecl.

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

10 years agoTweak clang/test/PCH/modified-module-dependency.m for win32 hosts.
NAKAMURA Takumi [Fri, 17 Jan 2014 07:04:17 +0000 (07:04 +0000)]
Tweak clang/test/PCH/modified-module-dependency.m for win32 hosts.

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

10 years agoEnhance attribute 'nonnull' to be applicable to parameters directly (infix).
Ted Kremenek [Fri, 17 Jan 2014 06:24:56 +0000 (06:24 +0000)]
Enhance attribute 'nonnull' to be applicable to parameters directly (infix).

This allows the following syntax:

  void baz(__attribute__((nonnull)) const char *str);

instead of:

  void baz(const char *str) __attribute__((nonnull(1)));

This also extends to Objective-C methods.

The checking logic in Sema is not as clean as I would like.  Effectively
now we need to check both the FunctionDecl/ObjCMethodDecl and the parameters,
so the point of truth is spread in two places, but the logic isn't that
cumbersome.

Implements <rdar://problem/14691443>.

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

10 years agoAdd ArrayRef<> interface to get the parameters of a FunctionDecl/ObjCMethodDecl.
Ted Kremenek [Fri, 17 Jan 2014 06:24:50 +0000 (06:24 +0000)]
Add ArrayRef<> interface to get the parameters of a FunctionDecl/ObjCMethodDecl.

This is an alternate interface to the separate iterator interfaces
provided by FunctionDecl and ObjCMethodDecl, which precede ArrayRef.

Providing this new interface is more convenient for some uses, and
likely the old interfaces should be removed.  I have not undertaken
that effort in this change because this API introduction may
solicit commentary and that was a larger change than I wanted
to introduce all at once to serve a direct purpose.

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

10 years agoPush NonNullAttr inspection loop into CheckNonNullArguments.
Ted Kremenek [Fri, 17 Jan 2014 06:24:47 +0000 (06:24 +0000)]
Push NonNullAttr inspection loop into CheckNonNullArguments.

No functionality change.

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

10 years agoMake 'CheckNonNullArguments' a static function. No functionality change.
Ted Kremenek [Fri, 17 Jan 2014 06:24:43 +0000 (06:24 +0000)]
Make 'CheckNonNullArguments' a static function.  No functionality change.

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

10 years agoRefine diagnostic: attribute 'nonnull' applies to both functions and methods.
Ted Kremenek [Fri, 17 Jan 2014 04:58:29 +0000 (04:58 +0000)]
Refine diagnostic: attribute 'nonnull' applies to both functions and methods.

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

10 years agoKill off obsolete err_target_unknown_cxxabi diag
Alp Toker [Fri, 17 Jan 2014 04:23:58 +0000 (04:23 +0000)]
Kill off obsolete err_target_unknown_cxxabi diag

Unused since r199250.

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

10 years agoMake -cl-kernel-arg-info a cc1-only option like the others
Alp Toker [Fri, 17 Jan 2014 04:19:59 +0000 (04:19 +0000)]
Make -cl-kernel-arg-info a cc1-only option like the others

The driver wasn't doing anything with it. Also rephrase the help text.

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

10 years agoUpdating the minimum version information for Visual Studio.
Aaron Ballman [Fri, 17 Jan 2014 03:38:49 +0000 (03:38 +0000)]
Updating the minimum version information for Visual Studio.

Patch thanks to Nikola Smiljanic!

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

10 years agoTweak test run line for readability
Alp Toker [Fri, 17 Jan 2014 03:35:04 +0000 (03:35 +0000)]
Tweak test run line for readability

Matching up the argument order in r199455's two RUN lines better demonstrates
what's going on.

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

10 years agoMake -verify a -cc1 NoDriverOption
Alp Toker [Fri, 17 Jan 2014 03:21:54 +0000 (03:21 +0000)]
Make -verify a -cc1 NoDriverOption

'%clang -verify' will now issue an error instead of succeeding without
verification. This should catch flawed tests like r199347.

Followup to r199451.

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

10 years agoDriver: Stub -Wa,-compress-debug-sections support for integrated-as with a suppressab...
David Blaikie [Fri, 17 Jan 2014 03:17:40 +0000 (03:17 +0000)]
Driver: Stub -Wa,-compress-debug-sections support for integrated-as with a suppressable warning

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

10 years agoPR18477: Create a function scope representing the constructor call when
Richard Smith [Fri, 17 Jan 2014 03:11:34 +0000 (03:11 +0000)]
PR18477: Create a function scope representing the constructor call when
handling C++11 default initializers. Without this, other parts of Sema (such as
lambda capture) would think the default initializer is part of the surrounding
function scope.

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

10 years agoIssue a warning if a throwing operator new or operator new[] returns a null
Richard Smith [Fri, 17 Jan 2014 02:09:33 +0000 (02:09 +0000)]
Issue a warning if a throwing operator new or operator new[] returns a null
pointer, since this invokes undefined behavior. Based on a patch by Artyom
Skrobov! Handling of dependent exception specifications and some additional
testcases by me.

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

10 years agoSplit out -verify into two distinct option flags
Alp Toker [Fri, 17 Jan 2014 02:06:23 +0000 (02:06 +0000)]
Split out -verify into two distinct option flags

Instead of dual-purposing a single flag, rename the driver option to
--verify-debug-info.

The frontend -verify option that enables diagnostic verification remains
unchanged except that it's now a pure CC1Option.

Both have been given proper help text.

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

10 years agoms-intrin.cpp: add -Werror to the test
Hans Wennborg [Fri, 17 Jan 2014 01:41:07 +0000 (01:41 +0000)]
ms-intrin.cpp: add -Werror to the test

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

10 years agoImprove the error message when a PCH dependency is modified
Ben Langmuir [Fri, 17 Jan 2014 00:19:09 +0000 (00:19 +0000)]
Improve the error message when a PCH dependency is modified

Show the top-level pch file as the culprit, rather than the immediate
dependency when a pch file imports a pcm from a module. To clarify the
relationship, the pch import stack is printed as notes. The old behaviour was
misleading when a pch imported a pcm (from a module), since removing the pcm
would not fix the problem, whereas rebuilding the pch would.

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

10 years agoDebug info: Refactor NoLocation and ArtificialLocation to use a common base
Adrian Prantl [Fri, 17 Jan 2014 00:15:10 +0000 (00:15 +0000)]
Debug info: Refactor NoLocation and ArtificialLocation to use a common base
class and use it pervasively to restore debug locations.
Fixes an interaction between cleanup and EH that caused the location
to not be restored properly after emitting a landing pad.
rdar://problem/15208190

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

10 years agoMove away from 'general' / 'generalized' as a way of identifying C++11
Richard Smith [Fri, 17 Jan 2014 00:11:48 +0000 (00:11 +0000)]
Move away from 'general' / 'generalized' as a way of identifying C++11
attribute syntax. There's nothing generalized about this; it's one of
several first-class attribute syntaxes we support, all of which are
more-or-less equally general.

As discussed on cfe-commits, we may want to revisit this if we start allowing
this syntax as an extension in C (or if C adopts the syntax), but hopefully
this diagnostic wording will be crystal clear to everyone in the mean time.

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

10 years agoms-intrin.cpp: no need for -verify anymore
Hans Wennborg [Fri, 17 Jan 2014 00:04:43 +0000 (00:04 +0000)]
ms-intrin.cpp: no need for -verify anymore

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

10 years agoRelax the ms-intrin.cpp test
Hans Wennborg [Thu, 16 Jan 2014 23:59:08 +0000 (23:59 +0000)]
Relax the ms-intrin.cpp test

The part that checks that certain functions are marked deprecated doesn't
seem that useful, and it has the bad effect that the test hard-coded the
locations of the notes from that test.

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

10 years agoAdd implementations of _cpuid and _xgetbv to Intrin.h
Hans Wennborg [Thu, 16 Jan 2014 23:39:35 +0000 (23:39 +0000)]
Add implementations of _cpuid and _xgetbv to Intrin.h

The _cpuid() implementation is the same as in lib/Headers/cpuid.h
with the parameter names adjusted to match the interface.

_xgetbv just does what the Intel manual says.

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

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

10 years agoClean up variable template handling a bit, and correct the behavior of name
Richard Smith [Thu, 16 Jan 2014 23:39:20 +0000 (23:39 +0000)]
Clean up variable template handling a bit, and correct the behavior of name
lookup when declaring a variable template specialization.

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

10 years agoConsumed analysis: bugfix for operator calls. Also fixes some formatting
DeLesley Hutchins [Thu, 16 Jan 2014 23:07:16 +0000 (23:07 +0000)]
Consumed analysis: bugfix for operator calls.  Also fixes some formatting
issues, a few testcases, and kills fish.

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

10 years agoRemove an unnecessary special case to check for a few Darwin-specific options.
Bob Wilson [Thu, 16 Jan 2014 21:50:37 +0000 (21:50 +0000)]
Remove an unnecessary special case to check for a few Darwin-specific options.

Using -mmacosx-version-min (etc.) on non-Darwin platforms should be a warning,
not a hard error. There is no reason to add a special check for these options
in the default toolchain. This just removes the special check and then we get
the usual -Wunused-command-line-argument warning if someone tries to use one
of these options for a target where they are not supported.
<rdar://problem/15569346>

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

10 years agoMS ABI: Improve selection of an inheritance model
David Majnemer [Thu, 16 Jan 2014 20:05:57 +0000 (20:05 +0000)]
MS ABI: Improve selection of an inheritance model

The MSVC ABI is rather finicky about the exact representation of it's
pointer-to-member representation.  The exact position of when and where
it will go with one representation versus another appears to be when it
desires the pointer-to-member to be complete.

To properly implement this in clang, do several things:
- Give up on tracking the polymorphic nature of the class.  It isn't
  useful to Sema and is only pertinent when choosing CodeGen-time
  details like whether the field-offset can be 0 instead of -1.
- Insist on locking-in the inheritance model when we ask our
  pointer-to-member type to be complete.  From there, grab the
  underlying CXXRecordDecl and try to make *that* complete.  Once we've
  done this, we can calculate it's inheritance model and apply it using
  an attribute.

N.B. My first bullet point is a lie.  We will eventually care about the
specifics of whether or not a CXXRecordDecl is or is not polymorphic
because MSVC compatible mangling of such things depends on it.  However,
I believe we will handle this in a rather different way.

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

10 years agoWhen generating Spelling enumeration values, do not generate identifiers in the reser...
Aaron Ballman [Thu, 16 Jan 2014 19:44:01 +0000 (19:44 +0000)]
When generating Spelling enumeration values, do not generate identifiers in the reserved namespace. Strip underscores as appropriate, taking care to not create duplicate identifiers.

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

10 years agoclang-format: Improve formatting of ObjC Blocks with return type.
Daniel Jasper [Thu, 16 Jan 2014 19:14:34 +0000 (19:14 +0000)]
clang-format: Improve formatting of ObjC Blocks with return type.

Before:
  int a = [operation block:^int(int * i) { return 1; }];

After:
  int a = [operation block:^int(int *i) { return 1; }];

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

10 years agoGiving a spelling to the Override attribute, and commenting on the absence of a spell...
Aaron Ballman [Thu, 16 Jan 2014 19:00:04 +0000 (19:00 +0000)]
Giving a spelling to the Override attribute, and commenting on the absence of a spelling for a few implicitly-only attributes. No functional change intended.

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

10 years ago[analyzer] Shitfing a constant value by its bit width is undefined.
Jordan Rose [Thu, 16 Jan 2014 18:02:23 +0000 (18:02 +0000)]
[analyzer] Shitfing a constant value by its bit width is undefined.

Citation: C++11 [expr.shift]p1 (and the equivalent text in C11).

This fixes PR18073, but the right thing to do (as noted in the FIXME) is to
have a real checker for too-large shifts.

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

10 years agowww: update the "Follow what's going on" section too
Alp Toker [Thu, 16 Jan 2014 17:04:52 +0000 (17:04 +0000)]
www: update the "Follow what's going on" section too

Includes some style tweaks and removes the tautological observation that "Clang
is still under heavy development" -- it hopefully always will be.

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

10 years agoSPARCv9 implements long double as an IEEE quad.
Jakob Stoklund Olesen [Thu, 16 Jan 2014 16:43:19 +0000 (16:43 +0000)]
SPARCv9 implements long double as an IEEE quad.

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

10 years agowww: link to the planet clang newsfeed
Alp Toker [Thu, 16 Jan 2014 16:29:02 +0000 (16:29 +0000)]
www: link to the planet clang newsfeed

Also shuffle the Communication section so the bug tracker comes first.

(The sidebar isn't scrollable at the moment so this gives a better chance of
the bug tracker being seen. The links further down are basically invisible --
we should look into that.)

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

10 years agoFixing a warning that causes the sanitizer build disliked about mixing && and ||...
Aaron Ballman [Thu, 16 Jan 2014 14:32:03 +0000 (14:32 +0000)]
Fixing a warning that causes the sanitizer build disliked about mixing && and ||. Since this is generated code, the && has been removed from the expression entirely.

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

10 years ago[ASan] Enough to have llvm-symbolizer in $PATH.
Alexander Potapenko [Thu, 16 Jan 2014 14:01:39 +0000 (14:01 +0000)]
[ASan] Enough to have llvm-symbolizer in $PATH.

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

10 years agoFactored some function-like type reasoning out of SemaDeclAttr and onto Decl itself...
Aaron Ballman [Thu, 16 Jan 2014 13:55:42 +0000 (13:55 +0000)]
Factored some function-like type reasoning out of SemaDeclAttr and onto Decl itself. This allows for more declarative subjects in attribute tablegen where the attribute appertains to something function-like, but not strictly a FunctionDecl.

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

10 years ago[ASan] Typo fix (symbolize=0 disables online symbolization)
Alexander Potapenko [Thu, 16 Jan 2014 13:48:16 +0000 (13:48 +0000)]
[ASan] Typo fix (symbolize=0 disables online symbolization)

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

10 years ago[ASan] Describe online/offline symbolization of reports, mention dsymutil.
Alexander Potapenko [Thu, 16 Jan 2014 13:46:29 +0000 (13:46 +0000)]
[ASan] Describe online/offline symbolization of reports, mention dsymutil.

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

10 years agoGiving the asm attribute some keyword spellings based off of GCC's documentation...
Aaron Ballman [Thu, 16 Jan 2014 13:45:57 +0000 (13:45 +0000)]
Giving the asm attribute some keyword spellings based off of GCC's documentation. No functional changes.

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

10 years agoDistinguish between attributes explicitly written at the request of the user, and...
Aaron Ballman [Thu, 16 Jan 2014 13:03:14 +0000 (13:03 +0000)]
Distinguish between attributes explicitly written at the request of the user, and attributes implicitly generated to assist in bookkeeping by the compiler. This is done so by table generating a CreateImplicit method for each attribute.

Additionally, remove the optional nature of the spelling list index when creating attributes. This is supported by table generating a Spelling enumeration when the spellings for an attribute are distinct enough to warrant it.

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

10 years agoSema: Fix crash during member pointer conversion involving incomplete classes
David Majnemer [Thu, 16 Jan 2014 12:02:55 +0000 (12:02 +0000)]
Sema: Fix crash during member pointer conversion involving incomplete classes

We would attempt to determine the inheritance relationship between
classes 'A' and 'B' during static_cast if we tried to convert from 'int
A::*' to 'int B::*'.  However, the question "does A derive from B" is
not meaningful when 'A' isn't defined.

Handle this case by requiring that 'A' be defined.

This fixes PR18506.

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

10 years ago[asan] Remove -fsanitize-address-zero-base-shadow command line
Evgeniy Stepanov [Thu, 16 Jan 2014 10:19:31 +0000 (10:19 +0000)]
[asan] Remove -fsanitize-address-zero-base-shadow command line
flag from clang, and disable zero-base shadow support on all platforms
where it is not the default behavior.

- It is completely unused, as far as we know.
- It is ABI-incompatible with non-zero-base shadow, which means all
objects in a process must be built with the same setting. Failing to
do so results in a segmentation fault at runtime.
- It introduces a backward dependency of compiler-rt on user code,
which is uncommon and complicates testing.

This is the Clang part of a larger change.

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

10 years agoclang-format: Enable formatting of lambdas with explicit return type.
Daniel Jasper [Thu, 16 Jan 2014 09:11:55 +0000 (09:11 +0000)]
clang-format: Enable formatting of lambdas with explicit return type.

So clang-format can now format:

  int c = []()->int { return 2; }();
  int c = []()->vector<int> { return { 2 }; }();

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

10 years agoMachO: use *-*-*-macho for MachO embedded targets.
Tim Northover [Thu, 16 Jan 2014 08:48:16 +0000 (08:48 +0000)]
MachO: use *-*-*-macho for MachO embedded targets.

Previously we had bodged together some hacks mapping MachO embedded
targets (i.e. mainly ARM v6M and v7M) to the "*-*-darwin-eabi" triple.
This is incorrect in both details (they don't run Darwin and they're
not EABI in any real sense).

This commit appropriates the existing "MachO" environment for the
purpose instead.

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

10 years agoForbid driver use in Sema tests
Alp Toker [Thu, 16 Jan 2014 02:37:08 +0000 (02:37 +0000)]
Forbid driver use in Sema tests

This ports the last Sema tests over to use the frontend directly, and adds a
local lit substitution to disable inappropriate %clang usage under this
directory.

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

10 years agoDisable and XFAIL a test that never worked
Alp Toker [Thu, 16 Jan 2014 02:36:24 +0000 (02:36 +0000)]
Disable and XFAIL a test that never worked

-verify was simply ignored by the driver.

This commit fixes the RUN line and XFAILs the test, unblocking changes to ban
use of the driver in Sema tests and avoid problems like this.

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

10 years agoRemove support for armv7f slice. <rdar://problem/12478440>
Bob Wilson [Wed, 15 Jan 2014 21:43:40 +0000 (21:43 +0000)]
Remove support for armv7f slice. <rdar://problem/12478440>

This was never used for anything so we should just get rid of it.

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