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

12 years agoAdd a custom initialize hook for clang tools + minor fixes in CustomCompilationDatabase.h
Alexander Kornienko [Tue, 17 Jul 2012 16:11:17 +0000 (16:11 +0000)]
Add a custom initialize hook for clang tools + minor fixes in CustomCompilationDatabase.h

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

12 years agoMerge visibility from previous decls before looking at visibility pragma. This
Rafael Espindola [Tue, 17 Jul 2012 15:14:47 +0000 (15:14 +0000)]
Merge visibility from previous decls before looking at visibility pragma. This
is a bit fuzzy, but matches gcc behavior and existing code bases seem to
depend on it.

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

12 years agotest/Driver/crash-report.c: Remove "REQUIRES: shell". env(1) can be used also with...
NAKAMURA Takumi [Tue, 17 Jul 2012 12:00:24 +0000 (12:00 +0000)]
test/Driver/crash-report.c: Remove "REQUIRES: shell". env(1) can be used also with gnuwin32.

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

12 years agoFix unit test dependency in Makefile and remove unneccessary dependency
Daniel Jasper [Tue, 17 Jul 2012 09:12:33 +0000 (09:12 +0000)]
Fix unit test dependency in Makefile and remove unneccessary dependency
again.

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

12 years agoAdd missing dependency for unit test.
Daniel Jasper [Tue, 17 Jul 2012 08:49:28 +0000 (08:49 +0000)]
Add missing dependency for unit test.

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

12 years agoFinishing the move of RefactoringCallbacks and fixing the corresponding
Daniel Jasper [Tue, 17 Jul 2012 08:37:03 +0000 (08:37 +0000)]
Finishing the move of RefactoringCallbacks and fixing the corresponding
buildbot failures.

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

12 years agoRevert commit r160308. We decide to move builtins selection to the backend.
Simon Atanasyan [Tue, 17 Jul 2012 08:15:06 +0000 (08:15 +0000)]
Revert commit r160308. We decide to move builtins selection to the backend.

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

12 years agoMove RefactoringCallbacks to Tooling to avoid dependency from
Daniel Jasper [Tue, 17 Jul 2012 08:03:01 +0000 (08:03 +0000)]
Move RefactoringCallbacks to Tooling to avoid dependency from
ASTMatchers (lower level abstraction) to Tooling (higher level
abstraction).

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

12 years agoFixup for r160345 - uintptr_t is not always unsigned
Alexey Samsonov [Tue, 17 Jul 2012 07:46:40 +0000 (07:46 +0000)]
Fixup for r160345 - uintptr_t is not always unsigned

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

12 years agoMake the isDerivedFrom matcher more generic.
Daniel Jasper [Tue, 17 Jul 2012 07:39:27 +0000 (07:39 +0000)]
Make the isDerivedFrom matcher more generic.

It now accepts an arbitrary inner matcher but is fully backwards
compatible.

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

12 years agoFixed few warnings.
Galina Kistanova [Tue, 17 Jul 2012 06:25:13 +0000 (06:25 +0000)]
Fixed few warnings.

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

12 years ago[Win32] Rework crash-report since r145389.
NAKAMURA Takumi [Tue, 17 Jul 2012 05:09:29 +0000 (05:09 +0000)]
[Win32] Rework crash-report since r145389.

  - lib/Driver/Driver.cpp, tools/driver/driver.cpp: Exit status should not be propagated, although clang driver should catch exceptions.
  - test/Driver/crash-report.c: Add REQUIRES:shell for now.
    FIXME: setenv should work also on Lit.InternalShellRunner.
  - test/Driver/crash-report.c: Remove XFAIL.

Thanks to Chad, To point out the issue.

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

12 years agotest/Driver/crash-report.c: Small tweaks. 1) Use %t instead %T for TMP. 2) Set all...
NAKAMURA Takumi [Tue, 17 Jul 2012 05:09:20 +0000 (05:09 +0000)]
test/Driver/crash-report.c: Small tweaks. 1) Use %t instead %T for TMP. 2) Set all of $TMPDIR, $TEMP and $TMP, or a certain host might set $TEMP.

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

12 years agoRecord visibility pragmas when we see a tag declaration. We might use it
Rafael Espindola [Tue, 17 Jul 2012 04:22:25 +0000 (04:22 +0000)]
Record visibility pragmas when we see a tag declaration. We might use it
to build a type before seeing the definition.

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

12 years agoUninitialized variables: two little changes:
Richard Smith [Tue, 17 Jul 2012 01:27:33 +0000 (01:27 +0000)]
Uninitialized variables: two little changes:
 * Treat compound assignment as a use, at Jordy's request.
 * Always add compound assignments into the CFG, so we can correctly diagnose the use in 'return x += 1;'

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

12 years agoclang/test/Tooling/clang-ast-dump.cpp: Mark it as REQUIRES: asserts, for now.
NAKAMURA Takumi [Tue, 17 Jul 2012 00:33:36 +0000 (00:33 +0000)]
clang/test/Tooling/clang-ast-dump.cpp: Mark it as REQUIRES: asserts, for now.

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

12 years agoMove clang_Cursor_getBriefCommentText implementation under `extern "C"'.
Dmitri Gribenko [Tue, 17 Jul 2012 00:17:45 +0000 (00:17 +0000)]
Move clang_Cursor_getBriefCommentText implementation under `extern "C"'.

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

12 years ago-Wuninitialized: Split the classification of DeclRefExprs as initialization or
Richard Smith [Tue, 17 Jul 2012 00:06:14 +0000 (00:06 +0000)]
-Wuninitialized: Split the classification of DeclRefExprs as initialization or
use out of TransferFunctions, and compute it in advance rather than on-the-fly.

This allows us to handle compound assignments with DeclRefExprs on the RHS
correctly, and also makes it trivial to treat const& function parameters as not
initializing the argument. The patch also makes both of those changes.

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

12 years ago[analyzer] Handle new-expressions with initializers for scalars.
Jordan Rose [Mon, 16 Jul 2012 23:38:09 +0000 (23:38 +0000)]
[analyzer] Handle new-expressions with initializers for scalars.

<rdar://problem/11818967>

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

12 years agoWeaken Unicode fixit test to work even if the character is printed escaped.
Jordan Rose [Mon, 16 Jul 2012 22:18:33 +0000 (22:18 +0000)]
Weaken Unicode fixit test to work even if the character is printed escaped.

This should fix the failure on Windows.

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

12 years agoFix BlockCommandComment::classof() to return true for objects of derived classes.
Dmitri Gribenko [Mon, 16 Jul 2012 22:13:46 +0000 (22:13 +0000)]
Fix BlockCommandComment::classof() to return true for objects of derived classes.

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

12 years agoThis test appears to fail on win32.
Ted Kremenek [Mon, 16 Jul 2012 21:43:16 +0000 (21:43 +0000)]
This test appears to fail on win32.

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

12 years agoAdd hack (provided by Jonathan Sauer) to fall back to assuming Xcode is installed...
Ted Kremenek [Mon, 16 Jul 2012 21:39:29 +0000 (21:39 +0000)]
Add hack (provided by Jonathan Sauer) to fall back to assuming Xcode is installed in /Developer
when using Python < 2.7.0.  This is the case on Snow Leopard, where the tools are always
installed in /Developer.  This isn't a proper fix for really figuring out where Xcode
is installed, but should work to fix an obvious problem on Snow Leopard.

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

12 years agoThis test appears to be passing on win32.
Ted Kremenek [Mon, 16 Jul 2012 21:17:01 +0000 (21:17 +0000)]
This test appears to be passing on win32.

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

12 years agoDon't crash when emitting fixits following Unicode characters.
Jordan Rose [Mon, 16 Jul 2012 20:52:12 +0000 (20:52 +0000)]
Don't crash when emitting fixits following Unicode characters.

This code is very sensitive to the difference between "columns" as printed
and "bytes" (SourceManager columns). All variables are now named explicitly
and our assumptions are (hopefully) documented as both comment and assertion.

Whether parseable fixits should use byte offsets or Unicode character counts
is pending discussion on the mailing list; currently the implementation uses
bytes (and has no problems on lines containing multibyte characters).
This has been added to the user manual.

<rdar://problem/11877454>

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

12 years agoSimplify float comparison checks by using early return.
David Blaikie [Mon, 16 Jul 2012 20:47:22 +0000 (20:47 +0000)]
Simplify float comparison checks by using early return.

Found while investigating PR13330

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

12 years agoFix copy-paste mistake for CMake dependency.
Ted Kremenek [Mon, 16 Jul 2012 20:22:15 +0000 (20:22 +0000)]
Fix copy-paste mistake for CMake dependency.

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

12 years ago[analyzer] Make CmpRuns external-user friendly.
Anna Zaks [Mon, 16 Jul 2012 20:21:42 +0000 (20:21 +0000)]
[analyzer] Make CmpRuns external-user friendly.

CmpRuns can be used for static analyzer bug report comparison. However,
we want to make sure external users do not rely on the way bugs are
represented (plist files). Make sure that we have a user
friendly/documented API for CmpRuns script.

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

12 years agoLooks like libTooling might also depend on ClangDiagnosticCommon.
Ted Kremenek [Mon, 16 Jul 2012 19:44:15 +0000 (19:44 +0000)]
Looks like libTooling might also depend on ClangDiagnosticCommon.

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

12 years agoAdd libEdit dependency on ClangDiagnosticCommon. Hopefully this will unbreak the...
Ted Kremenek [Mon, 16 Jul 2012 18:53:42 +0000 (18:53 +0000)]
Add libEdit dependency on ClangDiagnosticCommon.  Hopefully this will unbreak the VS build.

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

12 years agoMIPS: Implement __builtin_mips_shll_qb builtin function overloading.
Simon Atanasyan [Mon, 16 Jul 2012 18:52:02 +0000 (18:52 +0000)]
MIPS: Implement __builtin_mips_shll_qb builtin function overloading.
This function has two versions. The first one is used for a register operand.
The second one is used for an immediate number.

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

12 years agoFix rejects-valid: explicit specialization of redeclared deleted function template.
David Blaikie [Mon, 16 Jul 2012 18:50:45 +0000 (18:50 +0000)]
Fix rejects-valid: explicit specialization of redeclared deleted function template.

Review by Richard Smith.

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

12 years agomodern objective-c translator: conditionally include
Fariborz Jahanian [Mon, 16 Jul 2012 16:21:45 +0000 (16:21 +0000)]
modern objective-c translator: conditionally include
<string.h>. // rdar://11847319

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

12 years agoFixing an MSVC warning -- the compiler did not like the cast added to work around...
Aaron Ballman [Mon, 16 Jul 2012 15:45:33 +0000 (15:45 +0000)]
Fixing an MSVC warning -- the compiler did not like the cast added to work around a g++ bug (it would claim to possibly emit incorrect code).

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

12 years agoFixing an obvious bug in a test.
Alexander Kornienko [Mon, 16 Jul 2012 13:31:37 +0000 (13:31 +0000)]
Fixing an obvious bug in a test.

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

12 years agoThe new clang-ast-dump tool for selective AST dumping. Moved common command-line...
Alexander Kornienko [Mon, 16 Jul 2012 12:46:48 +0000 (12:46 +0000)]
The new clang-ast-dump tool for selective AST dumping. Moved common command-line tool stuff to CommandLineClangTool

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

12 years agoAdd two more missing parameters in diagnostics.
Daniel Jasper [Mon, 16 Jul 2012 12:12:45 +0000 (12:12 +0000)]
Add two more missing parameters in diagnostics.

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

12 years agoFix diagnostic adding missing parameter.
Daniel Jasper [Mon, 16 Jul 2012 11:51:49 +0000 (11:51 +0000)]
Fix diagnostic adding missing parameter.

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

12 years agoPrevent unused-variable warning in optimized builds.
Daniel Jasper [Mon, 16 Jul 2012 10:25:15 +0000 (10:25 +0000)]
Prevent unused-variable warning in optimized builds.

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

12 years agoAdd refactoring callbacks to make common kinds of refactorings easy.
Daniel Jasper [Mon, 16 Jul 2012 09:18:17 +0000 (09:18 +0000)]
Add refactoring callbacks to make common kinds of refactorings easy.

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

12 years agoAdd correct parenthesis range to CXXConstructExprs inside
Daniel Jasper [Mon, 16 Jul 2012 08:05:07 +0000 (08:05 +0000)]
Add correct parenthesis range to CXXConstructExprs inside
CXXFunctionalCastExprs.

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

12 years agoPlace checker build at alternate URL.
Ted Kremenek [Mon, 16 Jul 2012 04:18:35 +0000 (04:18 +0000)]
Place checker build at alternate URL.

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

12 years agoMore for PR11848: a pack expansion type isn't necessarily type-dependent (its
Richard Smith [Mon, 16 Jul 2012 01:59:26 +0000 (01:59 +0000)]
More for PR11848: a pack expansion type isn't necessarily type-dependent (its
pattern might be an alias template which doesn't use its arguments). It's always
instantiation-dependent, though.

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