]> granicus.if.org Git - clang/log
clang
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

11 years agoAdd support for raw_ostream on the printing methods of Diagnostics.
Samuel Benzaquen [Fri, 19 Jul 2013 20:02:35 +0000 (20:02 +0000)]
Add support for raw_ostream on the printing methods of Diagnostics.

Summary:
Add printToStream*(llvm::raw_ostream&) methods to Diagnostics, and reimplement everything based on streams instead of concatenating strings.
Also, fix some functions to start with lowercase to match the style guide.

Reviewers: klimek

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

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

11 years agoCreate calling convention AttributedType sugar nodes
Reid Kleckner [Fri, 19 Jul 2013 19:51:03 +0000 (19:51 +0000)]
Create calling convention AttributedType sugar nodes

Canonical types are unchanged.  The type printer had to be changed to
avoid printing any non-default implicit calling convention as well as
the calling convention attribute.

Reviewers: rjmccall

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

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

11 years agoFix for template substitution with packs.
Eli Friedman [Fri, 19 Jul 2013 19:40:38 +0000 (19:40 +0000)]
Fix for template substitution with packs.

When we see a pack, and replace it with a template argument which is
also a pack, we want to use the pack pattern, not the expanded pack.
The caller should take care of expanding the pack afterwards.

Fixes PR16646.

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

11 years agoUpdate users manual to indicate:
Richard Smith [Fri, 19 Jul 2013 19:06:48 +0000 (19:06 +0000)]
Update users manual to indicate:
  1) clang++ must be used when linking C++ programs using -fsanitize=undefined, and
  2) MSan can't be combined with TSan or ASan.

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

11 years ago[mips] Add support for command-line options -mno-check-zero-division and
Akira Hatanaka [Fri, 19 Jul 2013 18:58:48 +0000 (18:58 +0000)]
[mips] Add support for command-line options -mno-check-zero-division and
-mcheck-zero-division.

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

11 years ago[arcmt] After checking is successful disable auto-synthesize to avoid "@synthesize...
Argyrios Kyrtzidis [Fri, 19 Jul 2013 18:57:15 +0000 (18:57 +0000)]
[arcmt] After checking is successful disable auto-synthesize to avoid "@synthesize of 'weak' property is only
allowed in ARC" errors.

rdar://14461559

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

11 years agoReplace some existing type attribute diagnostics with a
Aaron Ballman [Fri, 19 Jul 2013 18:53:44 +0000 (18:53 +0000)]
Replace some existing type attribute diagnostics with a
single diagnostic that selects.  No functional changes intended.

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

11 years agoAdd SourceRange to PPCallbacks::Defined callback.
John Thompson [Fri, 19 Jul 2013 18:50:04 +0000 (18:50 +0000)]
Add SourceRange to PPCallbacks::Defined callback.

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

11 years agoFix source range of implicitly instantiated friend declaration.
Enea Zaffanella [Fri, 19 Jul 2013 18:02:36 +0000 (18:02 +0000)]
Fix source range of implicitly instantiated friend declaration.

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

11 years agoFix test to actually check things.
Benjamin Kramer [Fri, 19 Jul 2013 17:49:21 +0000 (17:49 +0000)]
Fix test to actually check things.

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

11 years agoFixes an ObjC migrator crash when last decl
Fariborz Jahanian [Fri, 19 Jul 2013 17:44:32 +0000 (17:44 +0000)]
Fixes an ObjC migrator crash when last decl
in file is an enum.

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

11 years agoThis patch implements __get_cpuid_max() as an inline and __cpuid() and
Roman Divacky [Fri, 19 Jul 2013 17:28:36 +0000 (17:28 +0000)]
This patch implements __get_cpuid_max() as an inline and __cpuid() and
__cpuid_count() as macros to be compatible with GCC's cpuid.h.  It also adds
bit_<foo> constants for the various feature bits as described in version 039
(May 2011) of Intel's SDM Volume 2 in the description of the CPUID
instruction.  The list of bit_<foo> constants is a bit exhaustive (GCC
doesn't do near this many).  More bits could be added from a newer version of
SDM if desired.

Patch by John Baldwin!

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

11 years ago[SystemZ] Add -march= command-line option
Richard Sandiford [Fri, 19 Jul 2013 16:51:51 +0000 (16:51 +0000)]
[SystemZ] Add -march= command-line option

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

11 years ago[SystemZ] Enable frame-pointer elimination for -O1 and above
Richard Sandiford [Fri, 19 Jul 2013 14:06:49 +0000 (14:06 +0000)]
[SystemZ] Enable frame-pointer elimination for -O1 and above

Copies the x86 behavior.

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

11 years agoRevert r186672 - turns out ASan supports Mac OS 10.6 yet.
Alexey Samsonov [Fri, 19 Jul 2013 12:53:04 +0000 (12:53 +0000)]
Revert r186672 - turns out ASan supports Mac OS 10.6 yet.

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

11 years ago[ASan] Reflect the dropped Mac OS 10.6 support in docs
Alexey Samsonov [Fri, 19 Jul 2013 12:33:30 +0000 (12:33 +0000)]
[ASan] Reflect the dropped Mac OS 10.6 support in docs

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

11 years agoAllow clang tools to display an overview when using the CommonOptionsParser.
Manuel Klimek [Fri, 19 Jul 2013 12:20:59 +0000 (12:20 +0000)]
Allow clang tools to display an overview when using the CommonOptionsParser.

Patch by Guillaume Papin.

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

11 years agoAdds overlapsWith and contains predicates on tooling::Range.
Manuel Klimek [Fri, 19 Jul 2013 12:12:36 +0000 (12:12 +0000)]
Adds overlapsWith and contains predicates on tooling::Range.

Patch by Guillaume Papin.

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

11 years agoAdds ctorInitializer and forEachConstructorInitializer matchers.
Manuel Klimek [Fri, 19 Jul 2013 11:50:54 +0000 (11:50 +0000)]
Adds ctorInitializer and forEachConstructorInitializer matchers.

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

11 years agoStmtOpenMP.h: Prune a stray \param in the comment of OMPExecutableDirective(). [...
NAKAMURA Takumi [Fri, 19 Jul 2013 10:31:05 +0000 (10:31 +0000)]
StmtOpenMP.h: Prune a stray \param in the comment of OMPExecutableDirective(). [-Wdocumentation]

-  /// \param Clauses A list of clauses.

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

11 years agoStmtOpenMP.h: Fix bogus \param(s). [-Wdocumentation]
NAKAMURA Takumi [Fri, 19 Jul 2013 10:30:58 +0000 (10:30 +0000)]
StmtOpenMP.h: Fix bogus \param(s). [-Wdocumentation]

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

11 years agoImprove clang-format vim integration.
Daniel Jasper [Fri, 19 Jul 2013 09:30:44 +0000 (09:30 +0000)]
Improve clang-format vim integration.

The previous line-by-line replacement causes vim to take a long time if
the foldmethod is set to 'syntax'. This should significantly improve
performance in that case.

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

11 years agoSimplify the CodeGenFunction::Build*Virtual*Call family of functions
Timur Iskhodzhanov [Fri, 19 Jul 2013 08:14:45 +0000 (08:14 +0000)]
Simplify the CodeGenFunction::Build*Virtual*Call family of functions

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

11 years agoRemove trailing whitespace.
Craig Topper [Fri, 19 Jul 2013 04:46:31 +0000 (04:46 +0000)]
Remove trailing whitespace.

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

11 years agoRemove unnecessary IsFirst variable from debug codde in GetDiagInfo.
Craig Topper [Fri, 19 Jul 2013 03:59:51 +0000 (03:59 +0000)]
Remove unnecessary IsFirst variable from debug codde in GetDiagInfo.

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

11 years agoOpenMP: basic support for #pragma omp parallel
Alexey Bataev [Fri, 19 Jul 2013 03:13:43 +0000 (03:13 +0000)]
OpenMP: basic support for #pragma omp parallel

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

11 years agoObjectiveC migrator: add support to migrate to
Fariborz Jahanian [Fri, 19 Jul 2013 01:05:49 +0000 (01:05 +0000)]
ObjectiveC migrator: add support to migrate to
NS_OPTIONS.

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

11 years ago[analyzer] Include analysis stack in crash traces.
Jordan Rose [Fri, 19 Jul 2013 00:59:08 +0000 (00:59 +0000)]
[analyzer] Include analysis stack in crash traces.

Sample output:

0.     Program arguments: ...
1.     <eof> parser at end of file
2.     While analyzing stack:
       #0 void inlined()
       #1 void test()
3.     crash-trace.c:6:3: Error evaluating statement

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