]> granicus.if.org Git - clang/log
clang
11 years agoSema: Minor const fixups and control flow tidying.
Benjamin Kramer [Wed, 24 Jul 2013 15:28:33 +0000 (15:28 +0000)]
Sema: Minor const fixups and control flow tidying.

No functionality change.

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

11 years agoAdd support for Adaptative matchers on the dynamic registry.
Samuel Benzaquen [Wed, 24 Jul 2013 14:48:01 +0000 (14:48 +0000)]
Add support for Adaptative matchers on the dynamic registry.

Summary:
Add support for Adaptative matchers on the dynamic registry.
Each adaptative matcher is created with a function template. We instantiate the function N times, one for each possible From type and apply the techniques used on argument overloaded and polymorphic matchers to add them to the registry.

Reviewers: klimek

CC: cfe-commits, revane
Differential Revision: http://llvm-reviews.chandlerc.com/D1201

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

11 years agoclang-format: Initial (incomplete) support for the WebKit coding style.
Daniel Jasper [Wed, 24 Jul 2013 13:10:59 +0000 (13:10 +0000)]
clang-format: Initial (incomplete) support for the WebKit coding style.

This is far from implementing all the rules given by
http://www.webkit.org/coding/coding-style.html

The important new feature is the support for styles that don't have a
column limit. For such styles, clang-format will (at the moment) simply
respect the input's formatting decisions within statements.

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

11 years agoC++1y: track object lifetime during constexpr evaluation, and don't allow
Richard Smith [Wed, 24 Jul 2013 07:11:57 +0000 (07:11 +0000)]
C++1y: track object lifetime during constexpr evaluation, and don't allow
objects to be used once their lifetimes end. This completes the C++1y
constexpr extensions.

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

11 years agoUpdate docs.
Manuel Klimek [Wed, 24 Jul 2013 05:46:07 +0000 (05:46 +0000)]
Update docs.

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

11 years agoObjectiveC migration: more migration to
Fariborz Jahanian [Tue, 23 Jul 2013 23:55:55 +0000 (23:55 +0000)]
ObjectiveC migration: more migration to
instancetype of NSDictionary methods.

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

11 years agoObjectiveC migrator: start migrating to
Fariborz Jahanian [Tue, 23 Jul 2013 23:34:42 +0000 (23:34 +0000)]
ObjectiveC migrator: start migrating to
instancetype methods.

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

11 years agoObjC migrator: more knobs toward doing
Fariborz Jahanian [Tue, 23 Jul 2013 22:42:28 +0000 (22:42 +0000)]
ObjC migrator: more knobs toward doing
instancetype migration.

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

11 years ago[PowerPC64] Fix passing of single-vector-member structs to match ABI.
Bill Schmidt [Tue, 23 Jul 2013 22:15:57 +0000 (22:15 +0000)]
[PowerPC64] Fix passing of single-vector-member structs to match ABI.

The 64-bit PowerPC ELF ABI requires a struct that contains a single
vector member to be passed in a vector register as though the wrapping
struct were not present.  Instead we were passing this as a byval
struct.

The same logic was already present for floating-point arguments, so
this patch just extends the logic to handle vector types.  The new
test case verifies that clang coerces the parameter and annotates it
as inreg.

Thanks,
Bill

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

11 years agoRemove HelpText for -fno-diagnostics-show-note-include-stack
Hans Wennborg [Tue, 23 Jul 2013 21:17:14 +0000 (21:17 +0000)]
Remove HelpText for -fno-diagnostics-show-note-include-stack

The help text was wrong, and we already provide help text on the
option that actually changes anything, i.e. -fdiagnostics-show-note-include-stack.

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

11 years agoChanged "an macro" to "a macro" in diagnostic note.
Richard Trieu [Tue, 23 Jul 2013 21:06:45 +0000 (21:06 +0000)]
Changed "an macro" to "a macro" in diagnostic note.

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

11 years agoRemove support for CCC_ADD_ARGS. QA_OVERRIDE_GCC3_OPTIONS supersedes it.
Rafael Espindola [Tue, 23 Jul 2013 19:55:06 +0000 (19:55 +0000)]
Remove support for CCC_ADD_ARGS. QA_OVERRIDE_GCC3_OPTIONS supersedes it.

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

11 years agoRemoving a number of individual run lines and replacing them with single line test...
Aaron Ballman [Tue, 23 Jul 2013 19:37:19 +0000 (19:37 +0000)]
Removing a number of individual run lines and replacing them with single line test cases.  This reduces the number of test runs, provides the same coverage, and allows us to test that the attribute names are included in the diagnostic.

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

11 years agoObjC migrator: Define family of methods
Fariborz Jahanian [Tue, 23 Jul 2013 19:31:17 +0000 (19:31 +0000)]
ObjC migrator: Define family of methods
which are candidate for migrating to
'instancetype'. wip.

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

11 years agoAdded the attribute name to the err_attribute_wrong_number_arguments diagnostic for...
Aaron Ballman [Tue, 23 Jul 2013 19:30:11 +0000 (19:30 +0000)]
Added the attribute name to the err_attribute_wrong_number_arguments diagnostic for clarity; updated almost all of the affected test cases.

Thanks to Fariborz Jahanian for the suggestion!

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

11 years agoRemoved useless source loc field in UnresolvedUsingTypenameDecl node.
Enea Zaffanella [Tue, 23 Jul 2013 18:25:15 +0000 (18:25 +0000)]
Removed useless source loc field in UnresolvedUsingTypenameDecl node.

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

11 years agoAdd new diagnostic messages when too many arguments are presented to a
Richard Trieu [Tue, 23 Jul 2013 18:01:49 +0000 (18:01 +0000)]
Add new diagnostic messages when too many arguments are presented to a
function-like macro.  Clang will attempt to correct the arguments by detecting
braced initializer lists:

1) If possible, suggest parentheses around arguments
containing braced lists which will give the proper number of arguments.
2) If a braced list is detected at the start of a macro argument, it cannot be
corrected by parentheses.  Instead, just point out the location of these
braced lists.

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

11 years agoRemove the -ccc-echo option that is now unused.
Rafael Espindola [Tue, 23 Jul 2013 17:58:53 +0000 (17:58 +0000)]
Remove the -ccc-echo option that is now unused.

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

11 years ago[libclang] Expose the rest of the array types.
Argyrios Kyrtzidis [Tue, 23 Jul 2013 17:36:21 +0000 (17:36 +0000)]
[libclang] Expose the rest of the array types.

Patch by Che-Liang Chiou!

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

11 years agoGoing back to using getName for consistency.
Aaron Ballman [Tue, 23 Jul 2013 17:35:26 +0000 (17:35 +0000)]
Going back to using getName for consistency.

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

11 years agoExpand test/Driver/at_file.c test to check that PR16209 is fixed.
Hans Wennborg [Tue, 23 Jul 2013 17:26:56 +0000 (17:26 +0000)]
Expand test/Driver/at_file.c test to check that PR16209 is fixed.

It was fixed by r186603.

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

11 years agoRemove unused diagnostics.
Benjamin Kramer [Tue, 23 Jul 2013 16:18:53 +0000 (16:18 +0000)]
Remove unused diagnostics.

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

11 years agoRemove line number from test/Analysis/crash-trace.c.
Jordan Rose [Tue, 23 Jul 2013 16:12:18 +0000 (16:12 +0000)]
Remove line number from test/Analysis/crash-trace.c.

...and hopefully, finally, unbreak buildbots.

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

11 years agoMark test/Analysis/crash-trace.c as requiring crash recovery.
Jordan Rose [Tue, 23 Jul 2013 16:02:54 +0000 (16:02 +0000)]
Mark test/Analysis/crash-trace.c as requiring crash recovery.

This plus Rafael's fix at r186943 should keep all the buildbots happy.

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

11 years agoConvert another test to -###.
Rafael Espindola [Tue, 23 Jul 2013 15:57:21 +0000 (15:57 +0000)]
Convert another test to -###.

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

11 years agoFixing the build bots from the previous commit.
Aaron Ballman [Tue, 23 Jul 2013 15:21:34 +0000 (15:21 +0000)]
Fixing the build bots from the previous commit.

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

11 years agoAdd missing quotes for -###.
Rafael Espindola [Tue, 23 Jul 2013 15:20:22 +0000 (15:20 +0000)]
Add missing quotes for -###.

Sorry about forgetting to include this in the previous patch.

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

11 years agoUse -### instead of -ccc-echo.
Rafael Espindola [Tue, 23 Jul 2013 15:17:51 +0000 (15:17 +0000)]
Use -### instead of -ccc-echo.

This is still a fairly odd test. Clang wants to run gcc for assembling. At
least with -### it only prints that instead of actually trying to run it with
-ccc-echo.

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

11 years agoReplacing some manual diagnostic checks with an existing helper method. Adding missi...
Aaron Ballman [Tue, 23 Jul 2013 15:16:00 +0000 (15:16 +0000)]
Replacing some manual diagnostic checks with an existing helper method.  Adding missing test cases for the diagnostics.

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

11 years agoRun %clang_cc1, it is the one that actually crashes.
Rafael Espindola [Tue, 23 Jul 2013 15:02:28 +0000 (15:02 +0000)]
Run %clang_cc1, it is the one that actually crashes.

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

11 years agoRemoved a redundant diagnostic and replaced it with a more standard one. Added a...
Aaron Ballman [Tue, 23 Jul 2013 14:54:24 +0000 (14:54 +0000)]
Removed a redundant diagnostic and replaced it with a more standard one.  Added a test case for the diagnostic.

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

11 years agoConsolidate several attribute argument diagnostics into a single, selectable diagnost...
Aaron Ballman [Tue, 23 Jul 2013 14:03:57 +0000 (14:03 +0000)]
Consolidate several attribute argument diagnostics into a single, selectable diagnostic.  This makes the diagnostic more consistent.

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

11 years agoCorrecting the NSObject and Overloadable attribute diagnostics so that the count...
Aaron Ballman [Tue, 23 Jul 2013 12:13:14 +0000 (12:13 +0000)]
Correcting the NSObject and Overloadable attribute diagnostics so that the count reported matches reality.

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

11 years agoC++1y literal suffix support:
Richard Smith [Tue, 23 Jul 2013 08:14:48 +0000 (08:14 +0000)]
C++1y literal suffix support:
 * Allow ns, us, ms, s, min, h as numeric ud-suffixes
 * Allow s as string ud-suffix

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

11 years ago[analyzer] Enable pseudo-destructor expressions.
Jordan Rose [Tue, 23 Jul 2013 02:15:20 +0000 (02:15 +0000)]
[analyzer] Enable pseudo-destructor expressions.

These are cases where a scalar type is "destructed", usually due to
template instantiation (e.g. "obj.~T()", where 'T' is 'int'). This has
no actual effect and the analyzer should just skip over it.

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

11 years ago[analyzer] Add test for crash tracing (r186639)
Jordan Rose [Tue, 23 Jul 2013 02:15:16 +0000 (02:15 +0000)]
[analyzer] Add test for crash tracing (r186639)

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

11 years agoRevert "[analyzer] Add very limited support for temporary destructors"
Jordan Rose [Tue, 23 Jul 2013 02:15:11 +0000 (02:15 +0000)]
Revert "[analyzer] Add very limited support for temporary destructors"

The analyzer doesn't currently expect CFG blocks with terminators to be
empty, but this can happen when generating conditional destructors for
a complex logical expression, such as (a && (b || Temp{})). Moreover,
the branch conditions for these expressions are not persisted in the
state. Even for handling noreturn destructors this needs more work.

This reverts r186498.

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

11 years agoError on more illegal kernel argument types for OpenCL
Matt Arsenault [Tue, 23 Jul 2013 01:23:36 +0000 (01:23 +0000)]
Error on more illegal kernel argument types for OpenCL

bool, half, pointers and structs / unions containing any
of these are not allowed. Does not yet reject size_t and
related integer types that are also disallowed.

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

11 years agoMake the nomathbuiltin.c test less demanding.
Eli Bendersky [Tue, 23 Jul 2013 01:09:17 +0000 (01:09 +0000)]
Make the nomathbuiltin.c test less demanding.

This should hopefully unbreak the Windows bots at http://bb.pgr.jp

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

11 years agoFurther simplify test case from r186894
David Blaikie [Tue, 23 Jul 2013 01:01:17 +0000 (01:01 +0000)]
Further simplify test case from r186894

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

11 years agoIntegers which are too large should be an error.
Eli Friedman [Tue, 23 Jul 2013 00:25:18 +0000 (00:25 +0000)]
Integers which are too large should be an error.

Switch some warnings over to errors which should never have been warnings
in the first place.  (Also, a minor fix to the preprocessor rules for
integer literals while I'm here.)

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

11 years agoSimplify testcase.
Adrian Prantl [Tue, 23 Jul 2013 00:21:48 +0000 (00:21 +0000)]
Simplify testcase.
rdar://problem/14386148

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

11 years agoAdd a -fno-math-builtin option to the Clang -cc1
Eli Bendersky [Tue, 23 Jul 2013 00:13:01 +0000 (00:13 +0000)]
Add a -fno-math-builtin option to the Clang -cc1

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

11 years agoImplement a better fix for r186894 by setting the appropriate type for __byref_variab...
Adrian Prantl [Tue, 23 Jul 2013 00:12:14 +0000 (00:12 +0000)]
Implement a better fix for r186894 by setting the appropriate type for __byref_variable_layout.

rdar://problem/14386148

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

11 years agoObjectiveC migration. Better handle migration to conforming
Fariborz Jahanian [Mon, 22 Jul 2013 23:50:04 +0000 (23:50 +0000)]
ObjectiveC migration. Better handle migration to conforming
protocols by ignoring cases where all protocol properties
and methods are optional.

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

11 years agoDebug Info: Acknowledge the alignment when locating byref block variables.
Adrian Prantl [Mon, 22 Jul 2013 23:44:26 +0000 (23:44 +0000)]
Debug Info: Acknowledge the alignment when locating byref block variables.
Fixes rdar://problem/14386148

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

11 years agoTestcase for PR16673.
Eli Friedman [Mon, 22 Jul 2013 23:30:13 +0000 (23:30 +0000)]
Testcase for PR16673.

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

11 years agoDon't emit open-paren fixit without close-paren.
Eli Friedman [Mon, 22 Jul 2013 23:09:39 +0000 (23:09 +0000)]
Don't emit open-paren fixit without close-paren.

getLocForEndOfToken() isn't guaranteed to succeed; if it doesn't, make sure
we do something sane.

Fixes PR16673.  I'm not sure how to write a testcase for this short of grepping
through the diagnostic output.

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

11 years agoRevert commit 186833 (no longer needed after the fix in 186859).
Enea Zaffanella [Mon, 22 Jul 2013 20:58:30 +0000 (20:58 +0000)]
Revert commit 186833 (no longer needed after the fix in 186859).

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

11 years agoMake modules depend on the compiler's own module.map, as a proxy for the compiler...
Douglas Gregor [Mon, 22 Jul 2013 20:48:33 +0000 (20:48 +0000)]
Make modules depend on the compiler's own module.map, as a proxy for the compiler itself.

The headers in the compiler's own resource include directory are
system headers, which means we don't stat() them eagerly when loading
a module. Use module.map as a proxy for these headers and the compiler
itself. Fixes <rdar://problem/13856838>.

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

11 years agoUse the updated name for the attribute.
Bill Wendling [Mon, 22 Jul 2013 20:15:41 +0000 (20:15 +0000)]
Use the updated name for the attribute.

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

11 years agoFixed implementation of C89 6.5.7 p3.
Enea Zaffanella [Mon, 22 Jul 2013 19:10:20 +0000 (19:10 +0000)]
Fixed implementation of C89 6.5.7 p3.
Warning should be emitted only for InitListExpr nodes.

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

11 years agoObjective-C migration: Use NS_OPTIONS when enumerators
Fariborz Jahanian [Mon, 22 Jul 2013 18:53:45 +0000 (18:53 +0000)]
Objective-C migration: Use NS_OPTIONS when enumerators
have shift/bitwise operators or are power of 2.

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

11 years ago[arcmt] Only disable ARC in the second compilation if there were actually ARC errors...
Argyrios Kyrtzidis [Mon, 22 Jul 2013 18:13:54 +0000 (18:13 +0000)]
[arcmt] Only disable ARC in the second compilation if there were actually ARC errors in the checking phase.

rdar://14490204

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

11 years agoAdd testcase for PR16134, which no longer crashes with ToT.
Richard Smith [Mon, 22 Jul 2013 18:09:32 +0000 (18:09 +0000)]
Add testcase for PR16134, which no longer crashes with ToT.

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

11 years agoUpdate comment to refer to core issue number.
Richard Smith [Mon, 22 Jul 2013 18:06:23 +0000 (18:06 +0000)]
Update comment to refer to core issue number.

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

11 years agoThis test was missing its -verify argument.
Aaron Ballman [Mon, 22 Jul 2013 17:55:04 +0000 (17:55 +0000)]
This test was missing its -verify argument.

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

11 years agoFix bug in clang-format's vim integration cause by r186789.
Daniel Jasper [Mon, 22 Jul 2013 16:22:13 +0000 (16:22 +0000)]
Fix bug in clang-format's vim integration cause by r186789.

After the first operation, the buffer contents has changed and thus all
other operations would be invalid. Executing the operations in reversed
order should fix this.

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

11 years agoAdd support for overloaded matchers. ie different matcher function signatures with...
Samuel Benzaquen [Mon, 22 Jul 2013 16:13:57 +0000 (16:13 +0000)]
Add support for overloaded matchers. ie different matcher function signatures with the same name.

Summary:
Add support for overloaded matchers.
This composes with other features, like supporting polymorphic matchers.

Reviewers: klimek

CC: cfe-commits, revane
Differential Revision: http://llvm-reviews.chandlerc.com/D1188

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

11 years agoc-index-test.c: Let this C89-compliant since r186817.
NAKAMURA Takumi [Mon, 22 Jul 2013 15:59:52 +0000 (15:59 +0000)]
c-index-test.c: Let this C89-compliant since r186817.

  warning: initializer for aggregate is not a compile-time constant [-Wc99-extensions]

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

11 years ago[ms-cxxabi] Emit linkonce complete dtors in TUs that need them
Reid Kleckner [Mon, 22 Jul 2013 13:51:44 +0000 (13:51 +0000)]
[ms-cxxabi] Emit linkonce complete dtors in TUs that need them

Based on Peter Collingbourne's destructor patches.

Prior to this change, clang was considering ?1 to be the complete
destructor and the base destructor, which was wrong.  This lead to
crashes when clang tried to emit two LLVM functions with the same name.

In this ABI, TUs with non-inline dtors might not emit a complete
destructor.  They are emitted as inline thunks in TUs that need them,
and they always delegate to the base dtors of the complete class and its
virtual bases.  This change uses the DeferredDecls machinery to emit
complete dtors as needed.

Currently in clang try body destructors can catch exceptions thrown by
virtual base destructors.  In the Microsoft C++ ABI, clang may not have
the destructor definition, in which case clang won't wrap the virtual
virtual base destructor calls in a try-catch.  Diagnosing this in user
code is TODO.

Finally, for classes that don't use virtual inheritance, MSVC always
calls the base destructor (?1) directly.  This is a useful code size
optimization that avoids emitting lots of extra thunks or aliases.
Implementing it also means our existing tests continue to pass, and is
consistent with MSVC's output.

We can do the same for Itanium by tweaking GetAddrOfCXXDestructor, but
it will require further testing.

Reviewers: rjmccall

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1066

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

11 years agoRename D to GD to match the type, which is GlobalDecl
Reid Kleckner [Mon, 22 Jul 2013 13:07:10 +0000 (13:07 +0000)]
Rename D to GD to match the type, which is GlobalDecl

Now we can save GD.getDecl() in D and shorten some casts.

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

11 years agoInstall git-clang-format along with clang-format by default.
Daniel Jasper [Mon, 22 Jul 2013 12:51:47 +0000 (12:51 +0000)]
Install git-clang-format along with clang-format by default.

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

11 years agoForward declare OMPClause in Sema.h to avoid an include
Reid Kleckner [Mon, 22 Jul 2013 12:47:44 +0000 (12:47 +0000)]
Forward declare OMPClause in Sema.h to avoid an include

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

11 years agoImplement the part of C89 6.5.7 p3 requiring a constant initializer list
Enea Zaffanella [Mon, 22 Jul 2013 10:58:26 +0000 (10:58 +0000)]
Implement the part of C89 6.5.7 p3 requiring a constant initializer list
when initializing aggregate/union types, no matter if static or not.

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

11 years agoImprove clarity/consistency of a few UsingDecl methods and related helpers.
Enea Zaffanella [Mon, 22 Jul 2013 10:54:09 +0000 (10:54 +0000)]
Improve clarity/consistency of a few UsingDecl methods and related helpers.
No functionality change.

In Sema helper functions:
 * renamed isTypeName as HasTypenameKeyword
In UsingDecl:
 * renamed get/setUsingLocation to get/setUsingLoc
 * renamed is/setTypeName as has/setTypename

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

11 years agoRemove superfluous cast.
Robert Wilhelm [Mon, 22 Jul 2013 05:04:01 +0000 (05:04 +0000)]
Remove superfluous cast.

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

11 years agoPR16288: A template is only missing a default template argument if it provides
Richard Smith [Mon, 22 Jul 2013 03:31:14 +0000 (03:31 +0000)]
PR16288: A template is only missing a default template argument if it provides
any default template arguments, not if it inherits some.

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

11 years agoImplement DR257 / fix PR16659:
Richard Smith [Mon, 22 Jul 2013 02:56:56 +0000 (02:56 +0000)]
Implement DR257 / fix PR16659:
  A constructor for an abstract class does not call constructors for virtual
  base classes, so it is not an error if no initializer is present for the
  virtual base and the virtual base cannot be default initialized.

Also provide a (disabled by default, for now) warning for the case where a
virtual base class's initializer is ignored in an abstract class's constructor,
and address a defect in DR257 where it was not carried through to C++11's rules
for implicit deletion of special member functions.

Based on a patch by Maurice Bos.

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

11 years agoSemaTemplate.cpp: Prune a stray "\param NumParamLists" in comment. [-Wdocumentation]
NAKAMURA Takumi [Mon, 22 Jul 2013 01:27:42 +0000 (01:27 +0000)]
SemaTemplate.cpp: Prune a stray "\param NumParamLists" in comment. [-Wdocumentation]

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

11 years agoTest updates missed from r186799.
Richard Smith [Sun, 21 Jul 2013 23:13:17 +0000 (23:13 +0000)]
Test updates missed from r186799.

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

11 years agoTighten up the set of operator new/operator delete calls we're permitted to
Richard Smith [Sun, 21 Jul 2013 23:12:18 +0000 (23:12 +0000)]
Tighten up the set of operator new/operator delete calls we're permitted to
optimize, to follow the permissions granted in N3664. Under those rules, only
calls generated by new-expressions and delete-expressions are permitted to be
optimized, and direct calls to ::operator new and ::operator delete must be
treated as normal calls.

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

11 years agoConst-correct some iterators. No functional change.
Craig Topper [Sun, 21 Jul 2013 22:20:10 +0000 (22:20 +0000)]
Const-correct some iterators. No functional change.

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

11 years agoReplace 'unsigned short' with 'uint16_t' in a packed data structure for consistency...
Craig Topper [Sun, 21 Jul 2013 21:56:18 +0000 (21:56 +0000)]
Replace 'unsigned short' with 'uint16_t' in a packed data structure for consistency with other fields and to be explicit about bit count.

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

11 years agoRevert r186649 because it wasn't unnecessary and add a comment.
Craig Topper [Sun, 21 Jul 2013 18:58:40 +0000 (18:58 +0000)]
Revert r186649 because it wasn't unnecessary and add a comment.

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

11 years agoConvert Sema::MatchTemplateParametersToScopeSpecifier to ArrayRef.
Robert Wilhelm [Sun, 21 Jul 2013 15:20:44 +0000 (15:20 +0000)]
Convert  Sema::MatchTemplateParametersToScopeSpecifier to ArrayRef.

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

11 years agoreport unused-value warning also for warn_unused types
Lubos Lunak [Sun, 21 Jul 2013 13:15:58 +0000 (13:15 +0000)]
report unused-value warning also for warn_unused types

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

11 years agoclang-format: Smarter replacement in the vim integration.
Daniel Jasper [Sun, 21 Jul 2013 10:45:33 +0000 (10:45 +0000)]
clang-format: Smarter replacement in the vim integration.

With this fix, only changed regions will be replaced in vim's buffer.
Thereby, marks should mostly be left intact. Furthermore, this is a
better fix for the performance problem in conjunction with
'foldmethod=syntax' (see r186660).

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

11 years agoAdded preproc callback for pragma directives.
Enea Zaffanella [Sat, 20 Jul 2013 20:09:11 +0000 (20:09 +0000)]
Added preproc callback for pragma directives.

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

11 years agoAdd missing check for creating an instance of an abstract class through an
Richard Smith [Sat, 20 Jul 2013 19:41:36 +0000 (19:41 +0000)]
Add missing check for creating an instance of an abstract class through an
implicit conversion sequence.

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

11 years agoUndisable a test for a c++98-compat warning for inheriting constructors now that...
Richard Smith [Sat, 20 Jul 2013 19:22:08 +0000 (19:22 +0000)]
Undisable a test for a c++98-compat warning for inheriting constructors now that we implement them.

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

11 years agoadd type attribute warn_unused, for -Wunused-variable warnings (pr#14253)
Lubos Lunak [Sat, 20 Jul 2013 15:05:36 +0000 (15:05 +0000)]
add type attribute warn_unused, for -Wunused-variable warnings (pr#14253)

The functionality is equivalent to the GCC attribute. Variables of tagged
types will be warned about as unused if they are not used in any way
except for possible (even non-trivial) ctors/dtors called. Useful for tagging
classes like std::string (which is not part of this commit).

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

11 years agoavoid bogus warnings about "unknown" pragmas with -frewrite-includes (pr#14831)
Lubos Lunak [Sat, 20 Jul 2013 14:30:01 +0000 (14:30 +0000)]
avoid bogus warnings about "unknown" pragmas with -frewrite-includes (pr#14831)

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

11 years agofix sometimes incorrect line numbers in -frewrite-includes mode (pr#14795)
Lubos Lunak [Sat, 20 Jul 2013 14:23:27 +0000 (14:23 +0000)]
fix sometimes incorrect line numbers in -frewrite-includes mode (pr#14795)

Every #include is surrounded by #if 0 in order to comment it out, which adds
lines. That is fixed up right after, but that all can be inside #if part
that is not processed, so fix up also after every end of a conditional part.

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

11 years agoSilence GCC warning for using both enum and unsigned in a ternary expr.
Benjamin Kramer [Sat, 20 Jul 2013 12:06:17 +0000 (12:06 +0000)]
Silence GCC warning for using both enum and unsigned in a ternary expr.

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

11 years agoDiagnosticIDs: Forbid Diag ID from being valid
David Majnemer [Sat, 20 Jul 2013 07:15:15 +0000 (07:15 +0000)]
DiagnosticIDs: Forbid Diag ID from being valid

Diag ID is used throughout clang as a sentinel id meaning "this is an
invalid diagnostic id."  Confusingly, Diag ID maps to a valid, usable,
diagnostic id.  Instead, start diagnostic ids at ID one.

Incidently, remove an unused element from StaticDiagInfo.

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

11 years agoIf a default argument is a dependent type, get the real type from the desugared
Richard Trieu [Sat, 20 Jul 2013 03:49:02 +0000 (03:49 +0000)]
If a default argument is a dependent type, get the real type from the desugared
template.  Passing around dependent types can lead to integral arguments that
cannot be evaluated.

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

11 years agoFix bug in computing POD-for-layout.
Eli Friedman [Sat, 20 Jul 2013 01:06:31 +0000 (01:06 +0000)]
Fix bug in computing POD-for-layout.

A class with a field of non-POD-for-layout type is not POD-for-layout.
This computation should not depend on whether the field is of POD type
in the language sense.

Fixes PR16537.

Patch by Josh Magee.

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

11 years agoUse -lines option instead of -offset/-length. This fixes problems with files using...
Alexander Kornienko [Sat, 20 Jul 2013 01:01:25 +0000 (01:01 +0000)]
Use -lines option instead of -offset/-length. This fixes problems with files using dos newlines (<CR><LF>).

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

11 years agoMake IgnoreParens() look through ChooseExprs.
Eli Friedman [Sat, 20 Jul 2013 00:40:58 +0000 (00:40 +0000)]
Make IgnoreParens() look through ChooseExprs.

This is the same way GenericSelectionExpr works, and it's generally a
more consistent approach.

A large part of this patch is devoted to caching the value of the condition
of a ChooseExpr; it's needed to avoid threading an ASTContext into
IgnoreParens().

Fixes <rdar://problem/14438917>.

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

11 years agoFIXME fix: improving diagnostics for template arguments deduction of class templates...
Larisse Voufo [Fri, 19 Jul 2013 23:00:19 +0000 (23:00 +0000)]
FIXME fix: improving diagnostics for template arguments deduction of class templates and explicit specializations
    This patch essentially removes all the FIXMEs following calls to DeduceTemplateArguments() that want to keep track of deduction failure info.

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

11 years agoRevert "Use function overloading instead of template specialization for diagnosis...
Larisse Voufo [Fri, 19 Jul 2013 22:53:23 +0000 (22:53 +0000)]
Revert "Use function overloading instead of template specialization for diagnosis of bad template argument deductions."

This reverts commit a730f548325756d050d4caaa28fcbffdae8dfe95.

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

11 years agoFix pack instantiation with function types.
Eli Friedman [Fri, 19 Jul 2013 22:50:29 +0000 (22:50 +0000)]
Fix pack instantiation with function types.

Make sure we correctly expand packs which expand to another
pack in a function type.

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

11 years agoUse function overloading instead of template specialization for diagnosis of bad...
Larisse Voufo [Fri, 19 Jul 2013 22:34:32 +0000 (22:34 +0000)]
Use function overloading instead of template specialization for diagnosis of bad template argument deductions.

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

11 years agoCorrectly handle packs for variadic type traits.
Eli Friedman [Fri, 19 Jul 2013 21:49:32 +0000 (21:49 +0000)]
Correctly handle packs for variadic type traits.

I'm not sure how to write a test for this; the following shows the
difference in -ast-dump:

template <int x> struct A {};
template <class T> struct B { };
template <class ...Args> using C = A<(__is_trivially_constructible(Args...))>;
template <class ...Args> using D = C<B<Args>...>;

However, I can't seem to write a test that triggers a visible difference
in behavior.

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

11 years agoRemove trailing whitespace
Craig Topper [Fri, 19 Jul 2013 21:43:59 +0000 (21:43 +0000)]
Remove trailing whitespace

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

11 years agoAdd a cl.exe compatible driver mode
Hans Wennborg [Fri, 19 Jul 2013 20:33:20 +0000 (20:33 +0000)]
Add a cl.exe compatible driver mode

The mode doesn't actually do anything yet, but this provides a
way to get into it.

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

11 years agoUse an i686 triple for this test now that it uses stdcall
Reid Kleckner [Fri, 19 Jul 2013 20:32:18 +0000 (20:32 +0000)]
Use an i686 triple for this test now that it uses stdcall

There seems to be a crash here if we have a calling convention attribute
that gets ignored and then we instantiate templates.

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

11 years agoFix another place where clang check objc selector name instead of checking the select...
Jean-Daniel Dupas [Fri, 19 Jul 2013 20:25:56 +0000 (20:25 +0000)]
Fix another place where clang check objc selector name instead of checking the selector family

Summary: In ARC mode, clang emits a warning if the result of an 'init' method is unused but miss cases where the method does not follows the Cocoa naming convention but is properly declared as an init family method.

CC: cfe-commits, eli.friedman
Differential Revision: http://llvm-reviews.chandlerc.com/D1163

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

11 years agoObjectiveC migrator: Another use case of enum
Fariborz Jahanian [Fri, 19 Jul 2013 20:18:36 +0000 (20:18 +0000)]
ObjectiveC migrator: Another use case of enum
declaration which can be migrated to NS_ENUM.

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