]> granicus.if.org Git - clang/log
clang
12 years agoobjective-c parsing. Don't crash when selector name
Fariborz Jahanian [Thu, 26 Jul 2012 17:32:28 +0000 (17:32 +0000)]
objective-c parsing. Don't crash when selector name
is missing in method prototype. // rdar://11939584

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

12 years agoPut back dump() without a default argument, "because debuggers don't usually respect...
Alexander Kornienko [Thu, 26 Jul 2012 17:11:45 +0000 (17:11 +0000)]
Put back dump() without a default argument, "because debuggers don't usually respect default arguments".

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

12 years agoAdded -ast-dump-filter option to clang -cc1.
Alexander Kornienko [Thu, 26 Jul 2012 16:01:23 +0000 (16:01 +0000)]
Added -ast-dump-filter option to clang -cc1.

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

12 years agoRemove an outdated comment; add one test to compare function pointer and block mangling
Timur Iskhodzhanov [Thu, 26 Jul 2012 13:41:30 +0000 (13:41 +0000)]
Remove an outdated comment; add one test to compare function pointer and block mangling

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

12 years agoAdd more tests for PR13207 (Mangling of template back references with -cxx-abi micros...
Timur Iskhodzhanov [Thu, 26 Jul 2012 11:01:05 +0000 (11:01 +0000)]
Add more tests for PR13207 (Mangling of template back references with -cxx-abi microsoft) now that PR13389 is fixed (mangling of return types)

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

12 years agoFix PR13389 (Wrong mangling of return type qualifiers with -cxx-abi microsoft)
Timur Iskhodzhanov [Thu, 26 Jul 2012 10:41:15 +0000 (10:41 +0000)]
Fix PR13389 (Wrong mangling of return type qualifiers with -cxx-abi microsoft)

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

12 years agoRemoved standalone clang-ast-dump tool.
Alexander Kornienko [Thu, 26 Jul 2012 01:44:18 +0000 (01:44 +0000)]
Removed standalone clang-ast-dump  tool.

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

12 years ago[analyzer] Inline ObjC class methods.
Anna Zaks [Thu, 26 Jul 2012 00:27:51 +0000 (00:27 +0000)]
[analyzer] Inline ObjC class methods.

- Some cleanup(the TODOs) will be done after ObjC method inlining is
complete.
- Simplified CallEvent::getDefinition not to require ISDynamicDispatch
parameter.
- Also addressed Jordan's comments from r160530.

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

12 years agoAdd static analyzer check for calling a C++ instance method with a null/uninitialized...
Ted Kremenek [Thu, 26 Jul 2012 00:22:32 +0000 (00:22 +0000)]
Add static analyzer check for calling a C++ instance method with a null/uninitialized pointer.

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

12 years agoDisable the warning for missing prototypes for OpenCL kernels. Includes testcase.
Tanya Lattner [Thu, 26 Jul 2012 00:08:28 +0000 (00:08 +0000)]
Disable the warning for missing prototypes for OpenCL kernels. Includes testcase.

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

12 years agoRemove the ability to stash arbitrary pointers into UndefinedVal (no longer needed).
Ted Kremenek [Wed, 25 Jul 2012 22:09:19 +0000 (22:09 +0000)]
Remove the ability to stash arbitrary pointers into UndefinedVal (no longer needed).

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

12 years agoFix two typos in the doc
Sylvestre Ledru [Wed, 25 Jul 2012 22:02:37 +0000 (22:02 +0000)]
Fix two typos in the doc

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

12 years agoRemove ExprEngine::MarkBranch(), as it is no longer needed.
Ted Kremenek [Wed, 25 Jul 2012 21:58:29 +0000 (21:58 +0000)]
Remove ExprEngine::MarkBranch(), as it is no longer needed.

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

12 years agoUpdate ExprEngine's handling of ternary operators to find the ternary expression
Ted Kremenek [Wed, 25 Jul 2012 21:58:25 +0000 (21:58 +0000)]
Update ExprEngine's handling of ternary operators to find the ternary expression
value by scanning the path, rather than assuming we have visited the '?:' operator
as a terminator (which sets a value indicating which expression to grab the
final ternary expression value from).

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

12 years agoobjective-c modern translator. Provide declaration of
Fariborz Jahanian [Wed, 25 Jul 2012 21:48:36 +0000 (21:48 +0000)]
objective-c modern translator. Provide declaration of
"memset' lazily when is needed in translation of
struct-valued methods which require checkinf of nil receivers
outside their bodies. // rdar://11847319

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

12 years agoRemove experimental invalid iterators checker from the codebase until we have the...
Ted Kremenek [Wed, 25 Jul 2012 20:02:05 +0000 (20:02 +0000)]
Remove experimental invalid iterators checker from the codebase until we have the time
to fix all the issues.  Currently the code is essentially unmaintained and buggy, and
needs major revision (with coupled enhancements to the analyzer core).

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

12 years ago[driver crash diagnostics] Strip -internal-isystem and -internal-externc-isystem.
Chad Rosier [Wed, 25 Jul 2012 18:55:43 +0000 (18:55 +0000)]
[driver crash diagnostics] Strip -internal-isystem and -internal-externc-isystem.
rdar://11949066

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

12 years ago[driver crash diagnostics] Strip -idirafter, -iprefix, -iwithprefix,
Chad Rosier [Wed, 25 Jul 2012 18:38:57 +0000 (18:38 +0000)]
[driver crash diagnostics] Strip -idirafter, -iprefix, -iwithprefix,
-iwithprefixbefore, and -isystem options, per Matt's suggestion.
rdar://11949066

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

12 years ago[driver crash diagnostics] A few enhancements:
Chad Rosier [Wed, 25 Jul 2012 17:52:16 +0000 (17:52 +0000)]
[driver crash diagnostics] A few enhancements:
 -Strip -iquote and -M options.
 -Quote -D options to avoid problems with command line macros that include
  parens.
rdar://11949066

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

12 years agolibclang comment to HTML rendering: \result is the same as \returns
Dmitri Gribenko [Wed, 25 Jul 2012 17:14:58 +0000 (17:14 +0000)]
libclang comment to HTML rendering: \result is the same as \returns

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

12 years agotest/PCH/objc_stmts.m: Suppress stderr to be fed to FileCheck.
NAKAMURA Takumi [Wed, 25 Jul 2012 11:14:11 +0000 (11:14 +0000)]
test/PCH/objc_stmts.m: Suppress stderr to be fed to FileCheck.

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

12 years agoIntroduces the 'decl' matcher which was missing for a while
Manuel Klimek [Wed, 25 Jul 2012 10:02:02 +0000 (10:02 +0000)]
Introduces the 'decl' matcher which was missing for a while
and became necessary with the change to require BindableMatchers
for binding.

Also fixes PR 13445: "hasSourceExpression only works for implicit casts".

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

12 years agotest/Analysis/iterators.cpp: Mark as REQUIRES:asserts. It crashes due to assertion...
NAKAMURA Takumi [Wed, 25 Jul 2012 09:47:24 +0000 (09:47 +0000)]
test/Analysis/iterators.cpp: Mark as REQUIRES:asserts. It crashes due to assertion failure.

I saw the case it XPASSes.

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

12 years agoAdd a FIXME to revisit the performance of BackRefMap later
Timur Iskhodzhanov [Wed, 25 Jul 2012 08:16:41 +0000 (08:16 +0000)]
Add a FIXME to revisit the performance of BackRefMap later

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

12 years agoAdds a introductionary document to the Clang AST.
Manuel Klimek [Wed, 25 Jul 2012 07:28:11 +0000 (07:28 +0000)]
Adds a introductionary document to the Clang AST.

Next steps are adding information about types & source location handling.

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

12 years agoTurn -Wobjc-root-class on by default. <rdar://problem/11203649>.
Ted Kremenek [Wed, 25 Jul 2012 07:26:32 +0000 (07:26 +0000)]
Turn -Wobjc-root-class on by default.  <rdar://problem/11203649>.

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

12 years agoPromote warn_unknown_analyzer_checker to an error. Addresses <rdar://problem/10987863>.
Ted Kremenek [Wed, 25 Jul 2012 07:12:13 +0000 (07:12 +0000)]
Promote warn_unknown_analyzer_checker to an error.  Addresses <rdar://problem/10987863>.

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

12 years agoPR12057: Allow variadic template pack expansions to cross lambda boundaries.
Richard Smith [Wed, 25 Jul 2012 03:56:55 +0000 (03:56 +0000)]
PR12057: Allow variadic template pack expansions to cross lambda boundaries.
Rather than adding a ContainsUnexpandedParameterPack bit to essentially every
AST node, we tunnel the bit directly up to the surrounding lambda expression
when we reach a context where an unexpanded pack can not normally appear.
Thus any statement or declaration within a lambda can now potentially contain
an unexpanded parameter pack.

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

12 years agoMake comments::Parser and comments::Sema noncopyable.
Dmitri Gribenko [Wed, 25 Jul 2012 00:02:45 +0000 (00:02 +0000)]
Make comments::Parser and comments::Sema noncopyable.

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

12 years agoComment parsing tests: fix test
Dmitri Gribenko [Tue, 24 Jul 2012 21:56:59 +0000 (21:56 +0000)]
Comment parsing tests: fix test

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

12 years agoAdd __has_feature(attribute_availability_with_message).
Jordan Rose [Tue, 24 Jul 2012 21:55:34 +0000 (21:55 +0000)]
Add __has_feature(attribute_availability_with_message).

This tests for the ability to include a "message" field in availability
attributes, like so:

  extern void ATSFontGetName(const char *oName)
    __attribute__((availability(macosx,introduced=8.0,deprecated=9.0,
                                message="use CTFontCopyFullName")));

This was actually supported in Clang 3.1, but we got a request for a
__has_feature so that header files can use this more safely. It's
unfortunate that the 3.1 release doesn't include this, however.

<rdar://problem/11886458>

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

12 years agoComment diagnostics tests: add a function with zero arguments, for completeness.
Dmitri Gribenko [Tue, 24 Jul 2012 21:46:24 +0000 (21:46 +0000)]
Comment diagnostics tests: add a function with zero arguments, for completeness.

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

12 years agoComment diagnostics: add warning for multiple \param commands with duplicate
Dmitri Gribenko [Tue, 24 Jul 2012 21:44:16 +0000 (21:44 +0000)]
Comment diagnostics: add warning for multiple \param commands with duplicate
parameter names.

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

12 years agoWhen a && or || appears as the condition of a ?:, perform appropriate
Richard Smith [Tue, 24 Jul 2012 21:02:14 +0000 (21:02 +0000)]
When a && or || appears as the condition of a ?:, perform appropriate
short-circuiting when building the CFG. Also be sure to skip parens before
checking for the && / || special cases. Finally, fix some crashes in CFG
printing in the presence of calls to destructors for array of array of class
type.

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

12 years agoCommentSema: simplify functions, per Jordan's comment.
Dmitri Gribenko [Tue, 24 Jul 2012 20:58:46 +0000 (20:58 +0000)]
CommentSema: simplify functions, per Jordan's comment.

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

12 years agoPedantic -pedantic correction. Duplicate cv-qualifiers are permitted in C++11
Richard Smith [Tue, 24 Jul 2012 20:24:58 +0000 (20:24 +0000)]
Pedantic -pedantic correction. Duplicate cv-qualifiers are permitted in C++11
unless they appear in a decl-specifier-seq.

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

12 years agoDon't use a temporary file.
Rafael Espindola [Tue, 24 Jul 2012 20:00:35 +0000 (20:00 +0000)]
Don't use a temporary file.

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

12 years agoABIArgInfo's constructor is private and only used by the static get* methods.
Rafael Espindola [Tue, 24 Jul 2012 19:30:23 +0000 (19:30 +0000)]
ABIArgInfo's constructor is private and only used by the static get* methods.
No need to abuse default arguments.

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

12 years agoComment parsing: allow newlines between \param, direction specification (e.g.,
Dmitri Gribenko [Tue, 24 Jul 2012 18:23:31 +0000 (18:23 +0000)]
Comment parsing: allow newlines between \param, direction specification (e.g.,
[in]), parameter name and description paragraph.

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

12 years agoTweak warning text for returning incomplete type from extern "C" functions.
Hans Wennborg [Tue, 24 Jul 2012 17:59:41 +0000 (17:59 +0000)]
Tweak warning text for returning incomplete type from extern "C" functions.

A warning was added in r150128 for returning non-C compatible
user-defined types from functions with C linkage.

This makes the text more clear for the case when the type isn't
decidedly non-C compatible, but incomplete.

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

12 years agoComment parsing: couple TextTokenRetokenizer and comment parser together to
Dmitri Gribenko [Tue, 24 Jul 2012 17:52:18 +0000 (17:52 +0000)]
Comment parsing: couple TextTokenRetokenizer and comment parser together to
remove one of the two variable-length lookahead buffers.  Now retokenizer will
ask for more tokens when it needs them.

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

12 years agoMove TextTokenRetokenizer from CommentLexer.h to CommentParser.cpp since it is
Dmitri Gribenko [Tue, 24 Jul 2012 17:43:18 +0000 (17:43 +0000)]
Move TextTokenRetokenizer from CommentLexer.h to CommentParser.cpp since it is
an implementation detail of the parser.

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

12 years agoComment parsing: retokenized text tokens are now pushed back in correct (not
Dmitri Gribenko [Tue, 24 Jul 2012 16:10:47 +0000 (16:10 +0000)]
Comment parsing: retokenized text tokens are now pushed back in correct (not
reverse) order

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

12 years agoIntroduces a new concept for binding results to matchers
Manuel Klimek [Tue, 24 Jul 2012 13:37:29 +0000 (13:37 +0000)]
Introduces a new concept for binding results to matchers
as per Chandler's request:
- introduces a new matcher base type BindableMatcher that
  provides the bind() call
- makes all dynamic-cast matcher creation functions return
  BindableMatchers; the special case about dynamic-cast
  matchers is that the node they match on and the node
  their child matchers match on are the same node, just
  casted to a different type; thus, there is no ambiguity
  on what bind() matches on; additionally, those are the
  matchers that we name with nouns in the matcher language,
  so it's easy for users to intuitively know which matchers
  are bindable

To make this change possible, we got rid of a non-orthogonal
implementation of thisPointerType, which had an implicit
dynamic-cast matcher from CallExpr to CXXMemberCallExpr; as
alternative, we now provide a memberCall dynamic-cast matcher
and thisPointerType is a predicate on CXXMemberCallExpr.

Last, the ArgumentAdaptingMatcher is actually not required
for the implementation of makeDynCastAllOfComposite - this
simplification makes it more obvious where the bind() call
can be used based on the matcher creation function types.

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

12 years agoFix PR13207 (Mangling of templates with back references when using -cxx-abi microsoft)
Timur Iskhodzhanov [Tue, 24 Jul 2012 09:37:54 +0000 (09:37 +0000)]
Fix PR13207 (Mangling of templates with back references when using -cxx-abi microsoft)

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

12 years agoChange the way KEYNOMS is defined to be more comprehensible.
Francois Pichet [Tue, 24 Jul 2012 06:17:24 +0000 (06:17 +0000)]
Change the way KEYNOMS is defined to be more comprehensible.

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

12 years agoclang/test/CodeGenCXX/debug-info-globalinit.cpp: Fix for -Asserts.
NAKAMURA Takumi [Tue, 24 Jul 2012 02:03:39 +0000 (02:03 +0000)]
clang/test/CodeGenCXX/debug-info-globalinit.cpp: Fix for -Asserts.

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

12 years agoEmit debug info for dynamic initializers. Permit __attribute__((nodebug)) on
Nick Lewycky [Tue, 24 Jul 2012 01:40:49 +0000 (01:40 +0000)]
Emit debug info for dynamic initializers. Permit __attribute__((nodebug)) on
variables that have static storage duration, it removes debug info on the
emitted initializer function but not all debug info about this variable.

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

12 years agoFix whitespace, whoops missed a spot!
Nick Lewycky [Tue, 24 Jul 2012 01:37:23 +0000 (01:37 +0000)]
Fix whitespace, whoops missed a spot!

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

12 years agoFix whitespace, tabs to spaces. No functionality change.
Nick Lewycky [Tue, 24 Jul 2012 01:31:55 +0000 (01:31 +0000)]
Fix whitespace, tabs to spaces. No functionality change.

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

12 years agomove X86_32ABIInfo::computeInfo out of line.
Rafael Espindola [Tue, 24 Jul 2012 00:01:07 +0000 (00:01 +0000)]
move X86_32ABIInfo::computeInfo out of line.

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

12 years agoComment parser unit tests: split a huge test case
Dmitri Gribenko [Mon, 23 Jul 2012 23:37:11 +0000 (23:37 +0000)]
Comment parser unit tests: split a huge test case

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

12 years agoMake classifyReturnType and classifyArgumentType private.
Rafael Espindola [Mon, 23 Jul 2012 23:30:29 +0000 (23:30 +0000)]
Make classifyReturnType and classifyArgumentType private.

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

12 years agoComment parser unit tests: reduce code duplication
Dmitri Gribenko [Mon, 23 Jul 2012 23:09:32 +0000 (23:09 +0000)]
Comment parser unit tests: reduce code duplication

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

12 years agoDo not warn about a function decl / direct init ambiguity if the function has a trail...
Richard Smith [Mon, 23 Jul 2012 21:41:30 +0000 (21:41 +0000)]
Do not warn about a function decl / direct init ambiguity if the function has a trailing return type.

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

12 years agoChange APInt to APSInt in one instance. Also change a call to operator==() to
Richard Trieu [Mon, 23 Jul 2012 20:21:35 +0000 (20:21 +0000)]
Change APInt to APSInt in one instance.  Also change a call to operator==() to
APSInt::isSameValue() when comparing different sized APSInt's.

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

12 years agoadd AST unittests to CMake build system
Dmitri Gribenko [Mon, 23 Jul 2012 20:11:34 +0000 (20:11 +0000)]
add AST unittests to CMake build system

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

12 years agolibclang comments AST: clang_ParamCommandComment_getParamName: don't assert
Dmitri Gribenko [Mon, 23 Jul 2012 19:41:49 +0000 (19:41 +0000)]
libclang comments AST: clang_ParamCommandComment_getParamName: don't assert
when a \param command does not have a parameter name, just return an empty
string instead.

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

12 years agoRefactor handler functions for thread safety attributes.
Michael Han [Mon, 23 Jul 2012 18:48:41 +0000 (18:48 +0000)]
Refactor handler functions for thread safety attributes.

Make handler functions for thread safety attributes consistent with other attributes handler functions
by removing the bool parameter from some of the thread safety attributes handler functions and extracting
common checks out of different handler functions.

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

12 years agoComment Sema: refactor handling of 'ParmVarDecl's and save them in Sema members.
Dmitri Gribenko [Mon, 23 Jul 2012 17:40:30 +0000 (17:40 +0000)]
Comment Sema: refactor handling of 'ParmVarDecl's and save them in Sema members.

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

12 years agoComment AST: add InlineContentComment::RenderKind to specify a default
Dmitri Gribenko [Mon, 23 Jul 2012 16:43:01 +0000 (16:43 +0000)]
Comment AST: add InlineContentComment::RenderKind to specify a default
rendering mode for clients that don't want to interpret Doxygen commands.

Also add a libclang API to query this information.

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

12 years agoFollow-up: fix the quotes
Timur Iskhodzhanov [Mon, 23 Jul 2012 09:43:03 +0000 (09:43 +0000)]
Follow-up: fix the quotes

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

12 years agoReplace wrong CHECK array mangling expectations with correct CHECK-NOT+FIXME (PR13182)
Timur Iskhodzhanov [Mon, 23 Jul 2012 09:32:54 +0000 (09:32 +0000)]
Replace wrong CHECK array mangling expectations with correct CHECK-NOT+FIXME (PR13182)

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

12 years agoFix a typo (the the => the)
Sylvestre Ledru [Mon, 23 Jul 2012 08:59:39 +0000 (08:59 +0000)]
Fix a typo (the the => the)

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

12 years agoAdd diagnostics for comma at end of enum and for extra semicolon at namespace
Richard Smith [Mon, 23 Jul 2012 05:45:25 +0000 (05:45 +0000)]
Add diagnostics for comma at end of enum and for extra semicolon at namespace
scope to -Wc++11-extensions. Move extra semicolon after member function
definition diagnostic out of -pedantic, since C++ allows a single semicolon
there. Keep it in -Wextra-semi, though, since it's still questionable.

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

12 years agoWhen we have an Objective-C object with non-trivial lifetime in a
Douglas Gregor [Mon, 23 Jul 2012 04:23:39 +0000 (04:23 +0000)]
When we have an Objective-C object with non-trivial lifetime in a
structor class under ARC, that struct/class does not have a trivial
move constructor or move assignment operator. Fixes the rest of
<rdar://problem/11738725>.

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

12 years agoPR12917: Remove incorrect assumption that lambda mangling information cannot
Richard Smith [Sun, 22 Jul 2012 23:45:10 +0000 (23:45 +0000)]
PR12917: Remove incorrect assumption that lambda mangling information cannot
change once it's been assigned. It can change in two ways:
 1) In a template instantiation, the context declaration should be the
    instantiated declaration, not the declaration in the template.
 2) If a lambda appears in the pattern of a variadic pack expansion, the
    mangling number will depend on the pack length.

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

12 years agoAllow the parser to recover gracefully if a typename is used to introduce a decltype...
Francois Pichet [Sun, 22 Jul 2012 15:10:57 +0000 (15:10 +0000)]
Allow the parser to recover gracefully if a typename is used to introduce a decltype type.
In Microsoft mode, we emit a warning instead of an error.

This fixes a couple of errors when parsing the MSVC 11 RC headers with clang.

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

12 years agochar16_t and char32_t are defined via typedef in MSVC 11 RC. So introduce a way to...
Francois Pichet [Sun, 22 Jul 2012 11:32:41 +0000 (11:32 +0000)]
char16_t and char32_t are defined via typedef in MSVC 11 RC. So introduce a way to disable keywords under Microsoft mode.

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

12 years agoComment AST nodes: add NumHTMLStartTagCommentBits member.
Dmitri Gribenko [Sat, 21 Jul 2012 03:10:43 +0000 (03:10 +0000)]
Comment AST nodes: add NumHTMLStartTagCommentBits member.

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

12 years agoComment to HTML conversion: add more CSS classes to identify function arguments
Dmitri Gribenko [Sat, 21 Jul 2012 01:47:43 +0000 (01:47 +0000)]
Comment to HTML conversion: add more CSS classes to identify function arguments
by index.  This is useful if the user does not document all arguments, and we
can't find a particular argument by index via :nth-of-type() CSS selector.

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

12 years agoRename -fms-inline-asm to -fenable-experimental-ms-inline-asm.
Chad Rosier [Fri, 20 Jul 2012 23:12:26 +0000 (23:12 +0000)]
Rename -fms-inline-asm to -fenable-experimental-ms-inline-asm.

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

12 years agoAdd "long double" to permitted list of ARM complex homogeneous aggregates.
Tim Northover [Fri, 20 Jul 2012 22:29:29 +0000 (22:29 +0000)]
Add "long double" to permitted list of ARM complex homogeneous aggregates.

Under AAPCS, long double is the same as double, which means it should be
allowed as part of a homogeneous aggregate.

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

12 years agoRemove unused private member variable uncovered by the recent changes to clang's...
Benjamin Kramer [Fri, 20 Jul 2012 22:06:30 +0000 (22:06 +0000)]
Remove unused private member variable uncovered by the recent changes to clang's -Wunused-private-field.

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

12 years agoFix c-index-test to compile as C89.
Dmitri Gribenko [Fri, 20 Jul 2012 22:00:35 +0000 (22:00 +0000)]
Fix c-index-test to compile as C89.

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

12 years agoTidy up.
Chad Rosier [Fri, 20 Jul 2012 21:49:05 +0000 (21:49 +0000)]
Tidy up.

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

12 years agoAdd the mechanics for -fms-inline-asm. No easy way to test at this time.
Chad Rosier [Fri, 20 Jul 2012 21:44:43 +0000 (21:44 +0000)]
Add the mechanics for -fms-inline-asm.  No easy way to test at this time.

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

12 years agoAdd libclang APIs to walk comments ASTs and an API to convert a comment to an
Dmitri Gribenko [Fri, 20 Jul 2012 21:34:34 +0000 (21:34 +0000)]
Add libclang APIs to walk comments ASTs and an API to convert a comment to an
HTML fragment.

For testing, c-index-test now has even more output:
* HTML rendering of a comment
* comment AST tree dump in S-expressions like Comment::dump(), but implemented
* with libclang APIs.

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

12 years agoRevert accidental commit.
Chad Rosier [Fri, 20 Jul 2012 21:22:24 +0000 (21:22 +0000)]
Revert accidental commit.

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

12 years agoAdd a new flag, -fms-inline-asm, that enables the output of MS-style inline
Chad Rosier [Fri, 20 Jul 2012 21:20:33 +0000 (21:20 +0000)]
Add a new flag, -fms-inline-asm, that enables the output of MS-style inline
assembly.

By default, we don't emit IR for MS-style inline assembly (see r158833 as to
why).  This is strictly for testing purposes and should not be enabled with the
expectation that things will work.  This is a temporary flag and will be removed
once MS-style inline assembly is fully supported.

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

12 years agoNo longer assuming the number of prototype arguments is always less than the number...
Aaron Ballman [Fri, 20 Jul 2012 20:40:35 +0000 (20:40 +0000)]
No longer assuming the number of prototype arguments is always less than the number of formal parameters for a variadic function call.

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

12 years agoFix PR13411: Comment parsing: failed assertion on unterminated verbatim block.
Dmitri Gribenko [Fri, 20 Jul 2012 20:18:53 +0000 (20:18 +0000)]
Fix PR13411: Comment parsing: failed assertion on unterminated verbatim block.

The assertion was wrong in case we have a verbatim block without a closing
command.

Also add tests for closing command name in a verbatim block, since now it can
be empty in such cases.

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

12 years agoRe-apply r160319 "Don't crash when emitting fixits following Unicode chars"
Jordan Rose [Fri, 20 Jul 2012 18:50:51 +0000 (18:50 +0000)]
Re-apply r160319 "Don't crash when emitting fixits following Unicode chars"

This time, make sure we don't try to print fixits with newline characters,
since they don't have a valid column width, and they don't look good anyway.

PR13417 (and originally <rdar://problem/11877454>)

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

12 years agoAdd a reverse iterator to DeclStmt, and use it when building a CFG.
Jordan Rose [Fri, 20 Jul 2012 18:50:48 +0000 (18:50 +0000)]
Add a reverse iterator to DeclStmt, and use it when building a CFG.

The CFG creates dummy DeclStmts with one Decl per statement, and it has
to do so from last to first in order to build the graph correctly.

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

12 years agoDon't need to specify the abi as it's the default.
Eric Christopher [Fri, 20 Jul 2012 17:42:31 +0000 (17:42 +0000)]
Don't need to specify the abi as it's the default.

rdar://11842763

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

12 years agoFixes an ObjC++ parse crash caused by delayed parsing
Fariborz Jahanian [Fri, 20 Jul 2012 17:19:54 +0000 (17:19 +0000)]
Fixes an ObjC++ parse crash caused by delayed parsing
of c-functions nested in namespace in method implementations
by turning off its delayed parsing until a proper solution is
figured out. pr13418

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

12 years agoCommentBriefParser: coding style fix
Dmitri Gribenko [Fri, 20 Jul 2012 17:02:25 +0000 (17:02 +0000)]
CommentBriefParser: coding style fix

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

12 years agoCommentBriefParser: use \returns if we can't find the \brief or just a plain
Dmitri Gribenko [Fri, 20 Jul 2012 17:01:34 +0000 (17:01 +0000)]
CommentBriefParser: use \returns if we can't find the \brief or just a plain
paragraph.

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

12 years agoCMake: clang should depend on clang-headers, or bin/clang would not work better.
NAKAMURA Takumi [Fri, 20 Jul 2012 16:40:09 +0000 (16:40 +0000)]
CMake: clang should depend on clang-headers, or bin/clang would not work better.

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

12 years agoRevert r160319, it caused PR13417. Add a test for PR13417.
Nico Weber [Fri, 20 Jul 2012 06:44:52 +0000 (06:44 +0000)]
Revert r160319, it caused PR13417. Add a test for PR13417.

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

12 years agoLet Expr::HasSideEffects() return false for NULL, bool literals, this, and nullptr.
Nico Weber [Fri, 20 Jul 2012 03:39:05 +0000 (03:39 +0000)]
Let Expr::HasSideEffects() return false for NULL, bool literals, this, and nullptr.

Fixes PR13413, -Wunused-private-field now warns on unused fields initialized to NULL.

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

12 years agoRename warn-unused-member.cpp to warn-unused-private-field.cpp to
Nico Weber [Fri, 20 Jul 2012 01:42:44 +0000 (01:42 +0000)]
Rename warn-unused-member.cpp to warn-unused-private-field.cpp to
make it match the flag it tests.

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

12 years agoSwitch to the canonical pipe-based testing of clang output using
Chandler Carruth [Fri, 20 Jul 2012 00:49:53 +0000 (00:49 +0000)]
Switch to the canonical pipe-based testing of clang output using
FileCheck.

This avoids copying files around needlessly during test runs.

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

12 years agoRemove dos line endings. Please remember to configure your windows SVN
Chandler Carruth [Fri, 20 Jul 2012 00:49:51 +0000 (00:49 +0000)]
Remove dos line endings. Please remember to configure your windows SVN
clients to default text files to 'eol-native'.

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

12 years ago[analyzer] Refactor VisitObjCMessage and VisitCallExpr to rely on the
Anna Zaks [Thu, 19 Jul 2012 23:38:13 +0000 (23:38 +0000)]
[analyzer] Refactor VisitObjCMessage and VisitCallExpr to rely on the
same implementation for call evaluation.

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

12 years agoFileCheck-ize.
Eric Christopher [Thu, 19 Jul 2012 22:22:58 +0000 (22:22 +0000)]
FileCheck-ize.

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

12 years agoRemove HasSynthBitfield and all callers/writers/etc. Also remove
Eric Christopher [Thu, 19 Jul 2012 22:22:55 +0000 (22:22 +0000)]
Remove HasSynthBitfield and all callers/writers/etc. Also remove
previous ResetObjCLayout calls since this is now handled in Sema.

Part of rdar://11842763

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

12 years agoReset the layout of an ObjC class if we see an ivar in a category
Eric Christopher [Thu, 19 Jul 2012 22:22:51 +0000 (22:22 +0000)]
Reset the layout of an ObjC class if we see an ivar in a category
or implementation since we've now got a different layout.

Fixes rdar://11842763

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

12 years agoRemoving a spurious comment, no functionality changes.
Aaron Ballman [Thu, 19 Jul 2012 21:00:48 +0000 (21:00 +0000)]
Removing a spurious comment, no functionality changes.

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

12 years agoCommentDumper: print word-like arguments for block commands.
Dmitri Gribenko [Thu, 19 Jul 2012 18:43:24 +0000 (18:43 +0000)]
CommentDumper: print word-like arguments for block commands.

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