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

12 years agoFor varargs, diagnose passing ObjC objects by value like other non-POD types.
Jordan Rose [Thu, 19 Jul 2012 18:10:23 +0000 (18:10 +0000)]
For varargs, diagnose passing ObjC objects by value like other non-POD types.

While we still want to consider this a hard error (non-POD variadic args are
normally a DefaultError warning), delaying the diagnostic allows us to give
better error messages, which also match the usual non-POD errors more closely.

In addition, this change improves the diagnostic messages for format string
argument type mismatches by passing down the type of the callee, so we can
say "variadic method" or "variadic function" appropriately.

<rdar://problem/11825593>

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

12 years agoCapitalize "Objective-C" and "C++" in user-facing contexts.
Jordan Rose [Thu, 19 Jul 2012 18:10:18 +0000 (18:10 +0000)]
Capitalize "Objective-C" and "C++" in user-facing contexts.

No functionality change.

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

12 years agoDon't crash checking a format string if one of the arguments is invalid.
Jordan Rose [Thu, 19 Jul 2012 18:10:08 +0000 (18:10 +0000)]
Don't crash checking a format string if one of the arguments is invalid.

Previously, we would ask for the SourceLocation of an argument even if
it were NULL (i.e. if Sema resulted in an ExprError trying to build it).

<rdar://problem/11890818>

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

12 years agoAdd a test case for rdar://11806334.
Argyrios Kyrtzidis [Thu, 19 Jul 2012 16:08:28 +0000 (16:08 +0000)]
Add a test case for rdar://11806334.

Makes sure we don't overflow the stack.

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

12 years agoSimplify UninitializedValues.cpp by removing logic to handle the previous (imprecise...
Ted Kremenek [Thu, 19 Jul 2012 04:59:05 +0000 (04:59 +0000)]
Simplify UninitializedValues.cpp by removing logic to handle the previous (imprecise) representation
of '&&' and '||' in the CFG.  This is no longer needed, and greatly simplifies the code.

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

12 years agoRemove an unused header
Michael Han [Thu, 19 Jul 2012 04:10:19 +0000 (04:10 +0000)]
Remove an unused header

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

12 years agoDefine __FINITE_MATH_ONLY__ based on -ffast-math and -ffinite-math-only.
Bob Wilson [Thu, 19 Jul 2012 03:52:53 +0000 (03:52 +0000)]
Define __FINITE_MATH_ONLY__ based on -ffast-math and -ffinite-math-only.

This macro was being unconditionally set to zero, preceded by a FIXME comment.
This fixes <rdar://problem/11845441>.  Patch by Michael Gottesman!

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

12 years agoRelaxed enumeration constant naming rules for scoped enumerators so they no longer...
Aaron Ballman [Thu, 19 Jul 2012 03:12:23 +0000 (03:12 +0000)]
Relaxed enumeration constant naming rules for scoped enumerators so they no longer emit a diagnostic when the enumeration's name matches that of the class.  Fixes PR13128.

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

12 years agoSilence another GCC warning.
Richard Smith [Thu, 19 Jul 2012 03:08:07 +0000 (03:08 +0000)]
Silence another GCC warning.

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

12 years agoRevert r160404, "Eliminating the GCC_CAST hack, take two.", for now.
NAKAMURA Takumi [Thu, 19 Jul 2012 02:27:55 +0000 (02:27 +0000)]
Revert r160404, "Eliminating the GCC_CAST hack, take two.", for now.

It crashes mingw32-gcc-4.4.

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

12 years agoSilence GCC warnings.
Richard Smith [Thu, 19 Jul 2012 01:53:26 +0000 (01:53 +0000)]
Silence GCC warnings.

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

12 years agoForce the OS X version to 10.6 for old-style simulator builds.
Bob Wilson [Thu, 19 Jul 2012 01:35:55 +0000 (01:35 +0000)]
Force the OS X version to 10.6 for old-style simulator builds.

The hack of recognizing a -D__IPHONE_OS_VERSION_MIN_REQUIRED option
in place of -mios-simulator-version-min leaves the Darwin version
unspecified.  It can be set separately with -mmacosx-version-min (which
makes no sense) or inferred to match the host version (which is unpredictable
and usually wrong).  This really needs to get cleaned up, but in the
meantime, force the OS X version to 10.6 so that the behavior is sane for
the iOS simulator.  Thanks for Argyrios for the patch.
<rdar://problem/11858187>

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

12 years agoCommentSema: add more inline commands to tables
Dmitri Gribenko [Thu, 19 Jul 2012 00:21:03 +0000 (00:21 +0000)]
CommentSema: add more inline commands to tables

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

12 years agoFix ParagraphComment::isWhitespace(): a paragraph without a non-whitespace
Dmitri Gribenko [Thu, 19 Jul 2012 00:01:56 +0000 (00:01 +0000)]
Fix ParagraphComment::isWhitespace(): a paragraph without a non-whitespace
TextComment node was considered whitespace even if it contained other child
nodes.

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

12 years agoFix OverloadCandidateSet::clear to not leak PartialDiagnostics, found by Samuel
Richard Smith [Wed, 18 Jul 2012 23:52:59 +0000 (23:52 +0000)]
Fix OverloadCandidateSet::clear to not leak PartialDiagnostics, found by Samuel
Panzer. I've not been able to trigger a failure caused by this, so no test yet.
Also included is a small change from Paul Robinson to only consider the
FailureKind if the overload candidate did actually fail.

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

12 years agoComment::dump(): show name of inline command
Dmitri Gribenko [Wed, 18 Jul 2012 23:20:23 +0000 (23:20 +0000)]
Comment::dump(): show name of inline command

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

12 years agoComment parsing: don't parse whitespace before \endverbatim as a separate line of...
Dmitri Gribenko [Wed, 18 Jul 2012 23:01:58 +0000 (23:01 +0000)]
Comment parsing: don't parse whitespace before \endverbatim as a separate line of whitespace.

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

12 years agoRolling this change back because the fix doesn't fit the symptoms (even if it solves...
Aaron Ballman [Wed, 18 Jul 2012 22:38:11 +0000 (22:38 +0000)]
Rolling this change back because the fix doesn't fit the symptoms (even if it solves them).

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

12 years ago[analyzer] Combine all ObjC message CallEvents into ObjCMethodCall.
Jordan Rose [Wed, 18 Jul 2012 21:59:51 +0000 (21:59 +0000)]
[analyzer] Combine all ObjC message CallEvents into ObjCMethodCall.

As pointed out by Anna, we only differentiate between explicit message sends

This also adds support for ObjCSubscriptExprs, which are basically the same
as properties in many ways. We were already checking these, but not emitting
nice messages for them.

This depends on the llvm::PointerIntPair change in r160456.

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

12 years ago[analyzer] Rename addExtraInvalidatedRegions to get...Regions
Jordan Rose [Wed, 18 Jul 2012 21:59:46 +0000 (21:59 +0000)]
[analyzer] Rename addExtraInvalidatedRegions to get...Regions

Per Anna's comment that "add..." sounds like a method that modifies
the receiver, rather than its argument.

No functionality change.

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

12 years ago[analyzer] Make CallEvent a value object.
Jordan Rose [Wed, 18 Jul 2012 21:59:41 +0000 (21:59 +0000)]
[analyzer] Make CallEvent a value object.

We will need to be able to easily reconstruct a CallEvent from an ExplodedNode
for diagnostic purposes, and that's exactly what factory functions are for.
CallEvent objects are small enough (four pointers and a SourceLocation) that
returning them through the stack is fairly cheap. Clients who just need to use
existing CallEvents can continue to do so using const references.

This uses the same sort of "kind-field-dispatch" as SVal, though most of the
nastiness is contained in the DISPATCH and DISPATCH_ARG macros at the end of
the file. (We can't use a template for this because member-pointers to base
class methods don't call derived-class methods even when casting to the
derived class. We can't use variadic macros because they're a C99 feature.)

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

12 years ago[analyzer] Remove obsolete ObjCPropRef SVal kind.
Jordan Rose [Wed, 18 Jul 2012 21:59:37 +0000 (21:59 +0000)]
[analyzer] Remove obsolete ObjCPropRef SVal kind.

ObjC properties are handled through their semantic form of ObjCMessageExprs
and their wrapper PseudoObjectExprs, and have been for quite a while. The
syntactic ObjCPropertyRefExprs do not appear in the CFG and are not visited
by ExprEngine.

No functionality change.

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

12 years ago[analyzer] Remove unused ExprEngine::VisitCXXTemporaryObjectExpr.
Jordan Rose [Wed, 18 Jul 2012 21:59:23 +0000 (21:59 +0000)]
[analyzer] Remove unused ExprEngine::VisitCXXTemporaryObjectExpr.

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

12 years agoFixing up a test case that was failing due to the lack of -std=c++11
Aaron Ballman [Wed, 18 Jul 2012 21:56:43 +0000 (21:56 +0000)]
Fixing up a test case that was failing due to the lack of -std=c++11

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

12 years agoThis fits into 80 columns without wrapping.
Dmitri Gribenko [Wed, 18 Jul 2012 21:27:38 +0000 (21:27 +0000)]
This fits into 80 columns without wrapping.

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

12 years agoAdd caching for TextComment::isWhitespace(), ParagraphComment::isWhitespace().
Dmitri Gribenko [Wed, 18 Jul 2012 20:54:32 +0000 (20:54 +0000)]
Add caching for TextComment::isWhitespace(), ParagraphComment::isWhitespace().

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

12 years agoRemove trivial destructor from SVal.
Benjamin Kramer [Wed, 18 Jul 2012 19:08:44 +0000 (19:08 +0000)]
Remove trivial destructor from SVal.

This enables the faster SmallVector in clang and also allows clang's unused
variable warnings to be more effective. Fix the two instances that popped up.

The RetainCountChecker change actually changes functionality, it would be nice
if someone from the StaticAnalyzer folks could look at it.

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

12 years agoOn Darwin, the linker removes functions in CommentDumper.o (Comment::dump())
Dmitri Gribenko [Wed, 18 Jul 2012 16:30:42 +0000 (16:30 +0000)]
On Darwin, the linker removes functions in CommentDumper.o (Comment::dump())
despite __attribute__(__used__).  As explained by Argyrios,
> .a archive files do some stripping of their own and they remove .o files that
> contain functions that are not referenced by any other .o file.

The fix is to use these functions from another .o file.

Thanks, Argyrios!

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

12 years agoReverted custom init hook from r160369.
Alexander Kornienko [Wed, 18 Jul 2012 12:24:51 +0000 (12:24 +0000)]
Reverted custom init hook from r160369.

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

12 years agoFix crash in RegionStoreManager::evalDerivedToBase() due to not handling references
Ted Kremenek [Wed, 18 Jul 2012 05:57:33 +0000 (05:57 +0000)]
Fix crash in RegionStoreManager::evalDerivedToBase() due to not handling references
(in uses of dynamic_cast<>).

Fixes <rdar://problem/11817693>.

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

12 years agoTeach CFG construction about destructors resulting from references to array types...
Ted Kremenek [Wed, 18 Jul 2012 04:57:57 +0000 (04:57 +0000)]
Teach CFG construction about destructors resulting from references to array types.  Fixes crash in <rdar://problem/11671507>.

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

12 years agoPR13381, part 2: when determining if a defaulted special member function should
Richard Smith [Wed, 18 Jul 2012 03:51:16 +0000 (03:51 +0000)]
PR13381, part 2: when determining if a defaulted special member function should
be defined as deleted, take cv-qualifiers on class members into account when
looking up the copy or move constructor or assignment operator which will be
used for them.

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

12 years agoPR13381: consider cv-qualifiers on a class member's type when determining which
Richard Smith [Wed, 18 Jul 2012 03:36:00 +0000 (03:36 +0000)]
PR13381: consider cv-qualifiers on a class member's type when determining which
constructor will be used for moving that object, in the computation of its
exception specification.

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

12 years agoPR13386: When matching up parameters between a function template declaration
Richard Smith [Wed, 18 Jul 2012 01:29:05 +0000 (01:29 +0000)]
PR13386: When matching up parameters between a function template declaration
and a function template instantiation, if there's a parameter pack in the
declaration and one at the same place in the instantiation, don't assume that
the pack wasn't expanded -- it may have expanded to nothing. Instead, go ahead
and check whether the parameter pack was expandable. We can do this as a
side-effect of the work we'd need to do anyway, to find how many parameters
were produced.

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

12 years agoFix test so it works the same way on 32-bit and 64-bit.
Eli Friedman [Wed, 18 Jul 2012 01:03:11 +0000 (01:03 +0000)]
Fix test so it works the same way on 32-bit and 64-bit.

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

12 years agoCommentSema: \short is the same as \brief.
Dmitri Gribenko [Wed, 18 Jul 2012 00:44:55 +0000 (00:44 +0000)]
CommentSema: \short is the same as \brief.

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

12 years agoWhen performing the deduced/actual argument type check for C++
Douglas Gregor [Wed, 18 Jul 2012 00:14:59 +0000 (00:14 +0000)]
When performing the deduced/actual argument type check for C++
[temp.deduct.call]p4 under Objective-C++ ARC, make sure to adjust the
qualifiers to introduce the implicit strong lifetime when
needed. Fixes <rdar://problem/11825671>.

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

12 years agoMore replacing of target-dependent intrinsics with target-indepdent
Joel Jones [Wed, 18 Jul 2012 00:01:03 +0000 (00:01 +0000)]
More replacing of  target-dependent intrinsics with target-indepdent
intrinsics.  The second instruction(s) to be handled are the vector versions
of count set bits (ctpop).

The changes here are to clang so that it generates a target independent
vector ctpop when it sees an ARM dependent vector bits set count.  The changes
in llvm are to match the target independent vector ctpop and in
VMCore/AutoUpgrade.cpp to update any existing bc files containing ARM
dependent vector pop counts with target-independent ctpops.  There are also
changes to an existing test case in llvm for ARM vector count instructions and
to a test for the bitcode upgrade.

<rdar://problem/11892519>

There is deliberately no test for the change to clang, as so far as I know, no
consensus has been reached regarding how to test neon instructions in clang;
q.v. <rdar://problem/8762292>

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

12 years agoRemove unnecessary spacing around Objective-C object literal code
Douglas Gregor [Tue, 17 Jul 2012 23:24:47 +0000 (23:24 +0000)]
Remove unnecessary spacing around Objective-C object literal code
completions. Fixes <rdar://problem/11889572>.

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

12 years agoAdding a fixit for includes that cannot be found with angle brackets, but can be...
Aaron Ballman [Tue, 17 Jul 2012 23:19:16 +0000 (23:19 +0000)]
Adding a fixit for includes that cannot be found with angle brackets, but can be found with quoted strings instead.  Implements PR13201.

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

12 years agoImprove comment for TypeDecl::getTypeForDecl(), from Sean Silva!
Douglas Gregor [Tue, 17 Jul 2012 23:09:36 +0000 (23:09 +0000)]
Improve comment for TypeDecl::getTypeForDecl(), from Sean Silva!

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

12 years agoEliminating the GCC_CAST hack, take two.
Douglas Gregor [Tue, 17 Jul 2012 23:07:44 +0000 (23:07 +0000)]
Eliminating the GCC_CAST hack, take two.

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

12 years agoComment AST nodes: rename Num*Bitfields to Num*Bits to be consistent with Stmt AST...
Dmitri Gribenko [Tue, 17 Jul 2012 22:43:26 +0000 (22:43 +0000)]
Comment AST nodes: rename Num*Bitfields to Num*Bits to be consistent with Stmt AST nodes.

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

12 years agoReinstate the GCC_CAST hack; I apparently did not appease GCC with r160397.
Douglas Gregor [Tue, 17 Jul 2012 22:32:15 +0000 (22:32 +0000)]
Reinstate the GCC_CAST hack; I apparently did not appease GCC with r160397.

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

12 years agoImplement an optimization for finding the comment that occurs just after a
Dmitri Gribenko [Tue, 17 Jul 2012 22:01:09 +0000 (22:01 +0000)]
Implement an optimization for finding the comment that occurs just after a
given declaration.

It is based on the observation that during parsing the comment that should be
attached to the decl is usually among the last two documentation comments
parsed.

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

12 years agoRobustify test in the face of no assertions.
Eric Christopher [Tue, 17 Jul 2012 21:52:07 +0000 (21:52 +0000)]
Robustify test in the face of no assertions.

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

12 years agoTry to eliminate GCC_CAST hack in a manner that should work for both
Douglas Gregor [Tue, 17 Jul 2012 21:27:49 +0000 (21:27 +0000)]
Try to eliminate GCC_CAST hack in a manner that should work for both
GCC and MSVC.

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

12 years agoCommentBriefParser: use StringSwitch::Cases to group synonyms. Thanks Jordan!
Dmitri Gribenko [Tue, 17 Jul 2012 21:21:55 +0000 (21:21 +0000)]
CommentBriefParser: use StringSwitch::Cases to group synonyms.  Thanks Jordan!

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

12 years agoTeach the ASTImporter how to handle anonymous structs/unions
Douglas Gregor [Tue, 17 Jul 2012 21:16:27 +0000 (21:16 +0000)]
Teach the ASTImporter how to handle anonymous structs/unions
better. Fixes <rdar://problem/11466212>; the test (and back-ported
version of this code) were committed to LLDB in r160186.

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

12 years agoDon't treat overflow in floating-point conversions as a hard error in constant evalua...
Eli Friedman [Tue, 17 Jul 2012 21:03:05 +0000 (21:03 +0000)]
Don't treat overflow in floating-point conversions as a hard error in constant evaluation. <rdar://problem/11874571>.

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

12 years agoHandle the case where the base type is not dependent, but the derived one is.
Rafael Espindola [Tue, 17 Jul 2012 20:24:05 +0000 (20:24 +0000)]
Handle the case where the base type is not dependent, but the derived one is.
Fixes pr13353.cpp.

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

12 years agoFixed whitespace issue introduced in r160373.
Joao Matos [Tue, 17 Jul 2012 19:17:58 +0000 (19:17 +0000)]
Fixed whitespace issue introduced in r160373.

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

12 years agoMinor cleanups and additions to the users manual. UsersManual.html now validates...
Dmitri Gribenko [Tue, 17 Jul 2012 18:51:47 +0000 (18:51 +0000)]
Minor cleanups and additions to the users manual.  UsersManual.html now validates as HTML 4.01 Strict.

Patch by Jonathan Sauer!  (With minor edits from me.)

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

12 years agoFix regexp for this test to properly check.
Eric Christopher [Tue, 17 Jul 2012 18:40:46 +0000 (18:40 +0000)]
Fix regexp for this test to properly check.

Patch by Eli Bendersky.

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

12 years agoCommentBriefParser: make \short should equivalent to \brief, per Doxygen manual.
Dmitri Gribenko [Tue, 17 Jul 2012 18:35:14 +0000 (18:35 +0000)]
CommentBriefParser: make \short should equivalent to \brief, per Doxygen manual.

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

12 years agoIssue warning when assigning out-of-range integer values to enums.
Fariborz Jahanian [Tue, 17 Jul 2012 18:00:08 +0000 (18:00 +0000)]
Issue warning when assigning out-of-range integer values to enums.
Due to performance cost, this is an opt-in option placed
under -Wassign-enum. // rdar://11824807

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

12 years ago-Wobjc-literal-compare: don't warn when comparing against nil.
Jordan Rose [Tue, 17 Jul 2012 17:46:48 +0000 (17:46 +0000)]
-Wobjc-literal-compare: don't warn when comparing against nil.

Checks against nil often appear as guards in macros, and comparing
Objective-C literals to nil has well-defined behavior (if tautological).

On OS X, 'nil' has not been typed as 'id' since 10.6 (possibly earlier),
so the warning was already not firing, but other runtimes continue to use
((id)0) or some variant. This change accepts comparisons to any null pointer;
to keep it simple, it looks through all casts (not just casts to 'id').

PR13276

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

12 years agoAdd -Wobjc-string-compare under -Wobjc-literal-compare.
Jordan Rose [Tue, 17 Jul 2012 17:46:44 +0000 (17:46 +0000)]
Add -Wobjc-string-compare under -Wobjc-literal-compare.

Suggested by Ted, since string literal comparison is at least slightly more
sensible than comparison of runtime literals. (Ambiguous language on
developer.apple.com implies that strings are guaranteed to be uniqued within
a translation unit and possibly across a linked binary.)

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

12 years agoNow that -Wobjc-literal-compare is a warning, put the fixit on a note.
Jordan Rose [Tue, 17 Jul 2012 17:46:40 +0000 (17:46 +0000)]
Now that -Wobjc-literal-compare is a warning, put the fixit on a note.

Recovering as if the user had actually called -isEqual: is a bit too far from
the semantics of the program as written, /even though/ it's probably what they
intended.

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

12 years ago[analyzer] Remove stale result type lvalue code.
Jordan Rose [Tue, 17 Jul 2012 17:27:10 +0000 (17:27 +0000)]
[analyzer] Remove stale result type lvalue code.

This code has been moved around multiple times, but seems to have been
obsolete ever since we started handled references like pointers.

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

12 years ago[Windows] Abstract pure virtual method calls in the ABI. Fix the Windows ABI to forwa...
Joao Matos [Tue, 17 Jul 2012 17:10:11 +0000 (17:10 +0000)]
[Windows] Abstract pure virtual method calls in the ABI. Fix the Windows ABI to forward to the correct function.

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