]> granicus.if.org Git - clang/log
clang
12 years agoUpdate comment to match the reality.
Dmitri Gribenko [Tue, 21 Aug 2012 21:35:58 +0000 (21:35 +0000)]
Update comment to match the reality.

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

12 years agoCommentBriefParser: allow paragraphs to be separated by line of whitespace.
Dmitri Gribenko [Tue, 21 Aug 2012 21:15:34 +0000 (21:15 +0000)]
CommentBriefParser: allow paragraphs to be separated by line of whitespace.
Skip paragraphs that contain only whitespace.

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

12 years ago[analyzer] Push "references are non-null" knowledge up to the common parent.
Jordan Rose [Tue, 21 Aug 2012 20:52:19 +0000 (20:52 +0000)]
[analyzer] Push "references are non-null" knowledge up to the common parent.

This reduces duplication across the Basic and Range constraint managers, and
keeps their internals free of dealing with the semantics of C++. It's still
a little unfortunate that the constraint manager is dealing with this at all,
but this is pretty much the only place to put it so that it will apply to all
symbolic values, even when embedded in larger expressions.

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

12 years ago[ms-inline asm] Do not report a Parser error when matching inline assembly.
Chad Rosier [Tue, 21 Aug 2012 19:37:55 +0000 (19:37 +0000)]
[ms-inline asm] Do not report a Parser error when matching inline assembly.

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

12 years agoModern objc translator: Fixes a crash in rewriter when rewriting the API
Fariborz Jahanian [Tue, 21 Aug 2012 18:56:50 +0000 (18:56 +0000)]
Modern objc translator: Fixes a crash in rewriter when rewriting the API
for structure valued method messaging. // rdar://12142241

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

12 years agoUse LLVM_BUILTIN_TRAP instead of lame volatile int traps.
David Blaikie [Tue, 21 Aug 2012 18:56:49 +0000 (18:56 +0000)]
Use LLVM_BUILTIN_TRAP instead of lame volatile int traps.

(from a todo mentioned in r159469 & originally suggested by Chandler Carruth)

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

12 years agoReduce the amount of state in the Option class by relying on the data from OptTable...
Michael J. Spencer [Tue, 21 Aug 2012 18:51:17 +0000 (18:51 +0000)]
Reduce the amount of state in the Option class by relying on the data from OptTable::Info.

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

12 years agoSwitch some realignment calculations over to llvm::RoundUpToAlignment.
Richard Smith [Tue, 21 Aug 2012 18:18:06 +0000 (18:18 +0000)]
Switch some realignment calculations over to llvm::RoundUpToAlignment.

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

12 years ago[ms-inline asm] Expose the ErrorInfo from the MatchInstructionImpl. In general,
Chad Rosier [Tue, 21 Aug 2012 18:15:08 +0000 (18:15 +0000)]
[ms-inline asm] Expose the ErrorInfo from the MatchInstructionImpl.  In general,
this is the index of the operand that failed to match.

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

12 years agoDeclPrinter, terse mode: don't print function bodies
Dmitri Gribenko [Tue, 21 Aug 2012 17:47:24 +0000 (17:47 +0000)]
DeclPrinter, terse mode: don't print function bodies

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

12 years agoRename PrintingPolicy::DontRecurseInDeclContext to PrintingPolicy::TerseOutput
Dmitri Gribenko [Tue, 21 Aug 2012 17:36:32 +0000 (17:36 +0000)]
Rename PrintingPolicy::DontRecurseInDeclContext to PrintingPolicy::TerseOutput
to reflect the intention, not the implementation.

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

12 years ago[ms-inline asm] Append identifier for better debugging.
Chad Rosier [Tue, 21 Aug 2012 17:02:27 +0000 (17:02 +0000)]
[ms-inline asm] Append identifier for better debugging.

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

12 years ago[ms-inline asm] Remove this test case and the associated special case code.
Chad Rosier [Tue, 21 Aug 2012 17:01:26 +0000 (17:01 +0000)]
[ms-inline asm] Remove this test case and the associated special case code.

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

12 years ago[driver] Add support for the --param ssp-buffer-size= driver option.
Chad Rosier [Tue, 21 Aug 2012 16:16:06 +0000 (16:16 +0000)]
[driver] Add support for the --param ssp-buffer-size= driver option.
PR9673

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

12 years ago[asan] If we are compiling with ASan, add metadata indicating dynamically initialized...
Kostya Serebryany [Tue, 21 Aug 2012 06:53:28 +0000 (06:53 +0000)]
[asan] If we are compiling with ASan, add metadata indicating dynamically initialized globals. Patch by Reid Watson, reviewed by Richard Smith

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

12 years agoFix alignment of array of VarDecl* following array of unsigned in LambdaExpr.
Richard Smith [Tue, 21 Aug 2012 05:42:49 +0000 (05:42 +0000)]
Fix alignment of array of VarDecl* following array of unsigned in LambdaExpr.

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

12 years agoWhen performing a trivial copy of a C++ type, we must be careful not
John McCall [Tue, 21 Aug 2012 04:10:00 +0000 (04:10 +0000)]
When performing a trivial copy of a C++ type, we must be careful not
to overwrite objects that might have been allocated into the type's
tail padding.  This patch is missing some potential optimizations where
the destination is provably a complete object, but it's necessary for
correctness.

Patch by Jonathan Sauer.

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

12 years agoAvoid binding a reference to a dereferenced pointer in diagnostic serialization
Richard Smith [Tue, 21 Aug 2012 03:11:53 +0000 (03:11 +0000)]
Avoid binding a reference to a dereferenced pointer in diagnostic serialization
if a diagnostic is emitted outside of any source file. The fix mirrors the
corresponding code in TextDiagnosticPrinter. This required moving the
functional parts of SDiagRenderer into SDiagWriter so they can be reused in the
non-rendering codepath.

No functionality change.

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

12 years agoScrew around with ObjCRuntime some more, changing the
John McCall [Tue, 21 Aug 2012 02:47:43 +0000 (02:47 +0000)]
Screw around with ObjCRuntime some more, changing the
diagnostics for bad deployment targets and adding a few
more predicates.  Includes a patch by Jonathan Schleifer
to enable ARC for ObjFW.

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

12 years agoDeclPrinter: describe what 'terse' output is.
Dmitri Gribenko [Tue, 21 Aug 2012 02:30:28 +0000 (02:30 +0000)]
DeclPrinter: describe what 'terse' output is.

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

12 years agoWhen this test case was first created it was
Jack Carter [Tue, 21 Aug 2012 00:59:48 +0000 (00:59 +0000)]
When this test case was first created it was
just trying to show it did not crash and burn.

This patch checks that the resultant .ll contents
are correct.

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

12 years agoBetter diagnostics for range-based for loops with bad range types.
Sam Panzer [Tue, 21 Aug 2012 00:52:01 +0000 (00:52 +0000)]
Better diagnostics for range-based for loops with bad range types.

The old error message stating that 'begin' was an undeclared identifier
is replaced with a new message explaining that the error is in the range
expression, along with which of the begin() and end() functions was
problematic if relevant.

Additionally, if the range was a pointer type or defines operator*,
attempt to dereference the range, and offer a FixIt if the modified range
works.

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

12 years ago[analyzer] Assume that reference symbols are non-null.
Jordan Rose [Tue, 21 Aug 2012 00:27:33 +0000 (00:27 +0000)]
[analyzer] Assume that reference symbols are non-null.

By doing this in the constraint managers, we can ensure that ANY reference
whose value we don't know gets the effect, even if it's not a top-level
parameter.

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

12 years agoDeclPrinter: add terse output mode and lots of tests
Dmitri Gribenko [Mon, 20 Aug 2012 23:39:06 +0000 (23:39 +0000)]
DeclPrinter: add terse output mode and lots of tests

Add a flag PrintingPolicy::DontRecurseInDeclContext to provide "terse" output
from DeclPrinter.  The motivation is to use DeclPrinter to print declarations
in user-friendly format, without overwhelming user with inner detail of the
declaration being printed.

Also add many tests for DeclPrinter.  There are quite a few things that we
print incorrectly: search for WRONG in DeclPrinterTest.cpp -- and these tests
check our output against incorrect output, so that we can fix/refactor/rewrite
the DeclPrinter later.

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

12 years agoFix a pair of bugs relating to properties in ARC.
John McCall [Mon, 20 Aug 2012 23:36:59 +0000 (23:36 +0000)]
Fix a pair of bugs relating to properties in ARC.

First, when synthesizing an explicitly strong/retain/copy property
of Class type, don't pretend during compatibility checking that the
property is actually assign.  Instead, resolve incompatibilities
by secretly changing the type of *implicitly* __unsafe_unretained
Class ivars to be strong.  This is moderately evil but better than
what we were doing.

Second, when synthesizing the setter for a strong property of
non-retainable type, be sure to use objc_setProperty.  This is
possible when the property is decorated with the NSObject
attribute.  This is an ugly, ugly corner of the language, and
we probably ought to deprecate it.

The first is rdar://problem/12039404;  the second was noticed by
inspection while fixing the first.

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

12 years agoReapply:
Eric Christopher [Mon, 20 Aug 2012 23:32:17 +0000 (23:32 +0000)]
Reapply:

Author: Eric Christopher <echristo@apple.com>
Date:   Thu Aug 16 23:50:46 2012 +0000

    Add some caching here for the builtin types.

    rdar://12117935

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

after fixing a thinko.

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

12 years agoAttaching comments to declarations: ignore implicit decls. Decl::isImplicit()
Dmitri Gribenko [Mon, 20 Aug 2012 22:36:31 +0000 (22:36 +0000)]
Attaching comments to declarations: ignore implicit decls.  Decl::isImplicit()
does not return true for all implicit decls currently.

This should fix PR13634 for now, but Decl::isImplicit() should be fixed, too.

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

12 years agoFix -Wswitch warning introduced by r162231
David Blaikie [Mon, 20 Aug 2012 22:22:51 +0000 (22:22 +0000)]
Fix -Wswitch warning introduced by r162231

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

12 years agoRemove unused variable.
David Blaikie [Mon, 20 Aug 2012 22:22:48 +0000 (22:22 +0000)]
Remove unused variable.

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

12 years ago[analyzer] More tests for "release and stop tracking".
Jordan Rose [Mon, 20 Aug 2012 22:15:44 +0000 (22:15 +0000)]
[analyzer] More tests for "release and stop tracking".

Under GC, a release message is ignored, so "release and stop tracking" just
becomes "stop tracking". But CFRelease is still honored. This is the main
difference between ns_consumed and cf_consumed.

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

12 years agoUse -fobjc-runtime=macosx10.7 instead of obsolete -fobjc-runtime-has-weak.
Jordan Rose [Mon, 20 Aug 2012 21:55:33 +0000 (21:55 +0000)]
Use -fobjc-runtime=macosx10.7 instead of obsolete -fobjc-runtime-has-weak.

This should unbreak the buildbots (r162220).

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

12 years agoMake Option non virtual.
Michael J. Spencer [Mon, 20 Aug 2012 21:41:17 +0000 (21:41 +0000)]
Make Option non virtual.

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

12 years agoThread-safety analysis: fix scoping issues related to 'this', including an
DeLesley Hutchins [Mon, 20 Aug 2012 21:32:18 +0000 (21:32 +0000)]
Thread-safety analysis: fix scoping issues related to 'this', including an
ICE in friend functions.

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

12 years agoFix InitListExpr::isStringLiteralInit so it handles various edge cases correctly...
Eli Friedman [Mon, 20 Aug 2012 20:55:45 +0000 (20:55 +0000)]
Fix InitListExpr::isStringLiteralInit so it handles various edge cases correctly.  PR13643.

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

12 years agoAdds the most requested doc for the AST matchers: a reference
Manuel Klimek [Mon, 20 Aug 2012 20:54:03 +0000 (20:54 +0000)]
Adds the most requested doc for the AST matchers: a reference
of matchers, categorized by type and fully expanded for the
context in which they can be used.

I used a script to generate this documentation which I'll want
to be scrunitized by a code review before checking it in.

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

12 years ago[analyzer] Add a test for "release and stop tracking" behavior.
Jordan Rose [Mon, 20 Aug 2012 20:01:15 +0000 (20:01 +0000)]
[analyzer] Add a test for "release and stop tracking" behavior.

This is used to handle functions and methods that consume an argument
(annotated with the ns_consumed or cf_consumed attribute), but then the
argument's retain count may be further modified in a callback. We want
to warn about over-releasing, but we can't really track the object afterwards.

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

12 years agoCode-complete 'weak' for properties under ARC-with-weak-references (or GC)
Jordan Rose [Mon, 20 Aug 2012 20:01:13 +0000 (20:01 +0000)]
Code-complete 'weak' for properties under ARC-with-weak-references (or GC)

Also, suggest 'readonly' even if the property has been given an ownership
attribute ('strong', 'weak', etc). This is used when properties are declared
readonly in the public interface but readwrite in a class extension.

<rdar://problem/11500004&11932285>

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

12 years ago[analyzer] Add comments to ExplodedNode::NodeGroup.
Jordan Rose [Mon, 20 Aug 2012 18:59:46 +0000 (18:59 +0000)]
[analyzer] Add comments to ExplodedNode::NodeGroup.

No functionality change.

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

12 years ago[analyzer] Replace boolean IsSink parameters with 'generateSink' methods.
Jordan Rose [Mon, 20 Aug 2012 18:43:42 +0000 (18:43 +0000)]
[analyzer] Replace boolean IsSink parameters with 'generateSink' methods.

Generating a sink is significantly different behavior from generating a
normal node, and a simple boolean parameter can be rather opaque. Per
offline discussion with Anna, adding new generation methods is the
clearest way to communicate intent.

No functionality change.

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

12 years agoPR13619: Make sure we're not at EOF before looking at NextToken().
Richard Smith [Mon, 20 Aug 2012 17:37:52 +0000 (17:37 +0000)]
PR13619: Make sure we're not at EOF before looking at NextToken().

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

12 years ago[ms-inline asm] Remove old cruft now that MS-style asms their own code path.
Chad Rosier [Mon, 20 Aug 2012 17:11:53 +0000 (17:11 +0000)]
[ms-inline asm] Remove old cruft now that MS-style asms their own code path.

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

12 years ago[analyzer] The result of && or || is always a 1 or 0.
Jordan Rose [Mon, 20 Aug 2012 17:04:45 +0000 (17:04 +0000)]
[analyzer] The result of && or || is always a 1 or 0.

Forgetting to at least cast the result was giving us Loc/NonLoc problems
in SValBuilder (hitting an assertion). But the standard (both C and C++)
does actually guarantee that && and || will result in the actual values
1 and 0, typed as 'int' in C and 'bool' in C++, and we can easily model that.

PR13461

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

12 years agoUse correct matcher name in the comment.
Dmitri Gribenko [Mon, 20 Aug 2012 16:48:14 +0000 (16:48 +0000)]
Use correct matcher name in the comment.

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

12 years agoFix comments and variable naming:
Manuel Klimek [Mon, 20 Aug 2012 16:37:20 +0000 (16:37 +0000)]
Fix comments and variable naming:
- use InnerMatcher consistently, fix style violations on the way
- doxygenify code snippets across all comments
- start doxygenifying code references in text
- addeed missing Usable as: sections

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

12 years ago[cindex.py] Cache the number of chunks in CompletionString
Tobias Grosser [Mon, 20 Aug 2012 10:38:16 +0000 (10:38 +0000)]
[cindex.py] Cache the number of chunks in CompletionString

Without this patch, lib.clang_getNumCompletionChunks is called at
each _iteration_ of a 'for chunk in CompletionString' loop. Now we
call it just once.

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

12 years agoBetter wording for reference self-initialization warning.
Hans Wennborg [Mon, 20 Aug 2012 08:52:22 +0000 (08:52 +0000)]
Better wording for reference self-initialization warning.

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

12 years ago[cindex.py] Add CachedProperty to CompletionChunk
Tobias Grosser [Sun, 19 Aug 2012 22:26:15 +0000 (22:26 +0000)]
[cindex.py] Add CachedProperty to CompletionChunk

Suggested by:  Francisco Lopes  <oblita@gmail.com>

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

12 years ago[clang.py] Add CachedProperty decorator
Gregory Szorc [Sun, 19 Aug 2012 21:17:46 +0000 (21:17 +0000)]
[clang.py] Add CachedProperty decorator

It isn't used anywhere yet.

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

12 years ago[cindex.py] Use spaces, not tabs for indentation
Tobias Grosser [Sat, 18 Aug 2012 23:52:41 +0000 (23:52 +0000)]
[cindex.py] Use spaces, not tabs for indentation

Reported by: Francisco Lopes  <oblita@gmail.com>

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

12 years ago[cindex.py] Dispose code completion results properly
Tobias Grosser [Sat, 18 Aug 2012 23:04:08 +0000 (23:04 +0000)]
[cindex.py] Dispose code completion results properly

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

12 years agoAllow -verify to be used with files that don't have an associated FileEntry.
Jordan Rose [Sat, 18 Aug 2012 16:58:52 +0000 (16:58 +0000)]
Allow -verify to be used with files that don't have an associated FileEntry.

In Debug builds, VerifyDiagnosticConsumer checks any files with diagnostics
to make sure we got the chance to parse them for directives (expected-warning
and friends). This check previously relied on every parsed file having a
FileEntry, which broke the cling interpreter's test suite.

This commit changes the extra debug checking to mark a file as unparsed
as soon as we see a diagnostic from that file. At the very end, any files
that are still marked as unparsed are checked for directives, and a fatal
error is emitted (as before) if we find out that there were directives we
missed. -verify directives should always live in actual parsed files, not
in PCH or AST files.

Patch by Andy Gibbs, with slight modifications by me.

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

12 years agoSilence a sign compare warning that only occurs on 32 bit platforms.
Benjamin Kramer [Sat, 18 Aug 2012 10:33:09 +0000 (10:33 +0000)]
Silence a sign compare warning that only occurs on 32 bit platforms.

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

12 years agoWhen mangling a negative number, remember that negating it does not
John McCall [Sat, 18 Aug 2012 04:51:52 +0000 (04:51 +0000)]
When mangling a negative number, remember that negating it does not
always yield a positive number.  Just print the negated result as an
unsigned number.

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

12 years agoPR41111, PR5925, PR13210: Teach tentative parsing to annotate identifiers and
Richard Smith [Sat, 18 Aug 2012 00:55:03 +0000 (00:55 +0000)]
PR41111, PR5925, PR13210: Teach tentative parsing to annotate identifiers and
nested names as id-expressions, using the annot_primary_expr annotation, where
possible. This removes some redundant lookups, and also allows us to
typo-correct within tentative parsing, and to carry on disambiguating past an
identifier which we can determine will fail lookup as both a type and as a
non-type, allowing us to disambiguate more declarations (and thus offer
improved error recovery for such cases).

This also introduces to the parser the notion of a tentatively-declared name,
which is an identifier which we *might* have seen a declaration for in a
tentative parse (but only if we end up disambiguating the tokens as a
declaration). This is necessary to correctly disambiguate cases where a
variable is used within its own initializer.

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

12 years agoAST Matchers tests: test that member() matches member allocation functions:
Dmitri Gribenko [Sat, 18 Aug 2012 00:41:04 +0000 (00:41 +0000)]
AST Matchers tests: test that member() matches member allocation functions:
declare size_t in system-independent way.

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

12 years ago[analyzer] Treat C++ 'throw' as a sink.
Jordan Rose [Sat, 18 Aug 2012 00:30:23 +0000 (00:30 +0000)]
[analyzer] Treat C++ 'throw' as a sink.

Our current handling of 'throw' is all CFG-based: it jumps to a 'catch' block
if there is one and the function exit block if not. But this doesn't really
get the right behavior when a function is inlined: execution will continue on
the caller's side, which is always the wrong thing to do.

Even within a single function, 'throw' completely skips any destructors that
are to be run. This is essentially the same problem as @finally -- a CFGBlock
that can have multiple entry points, whose exit points depend on whether it
was entered normally or exceptionally.

Representing 'throw' as a sink matches our current (non-)handling of @throw.
It's not a perfect solution, but it's better than continuing analysis in an
inconsistent or even impossible state.

<rdar://problem/12113713>

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

12 years ago[analyzer] Treat @throw as a sink (stop processing).
Jordan Rose [Sat, 18 Aug 2012 00:30:20 +0000 (00:30 +0000)]
[analyzer] Treat @throw as a sink (stop processing).

The CFG approximates @throw as a return statement, but that's not good
enough in inlined functions. Moreover, since Objective-C exceptions are
usually considered fatal, we should be suppressing leak warnings like we
do for calls to noreturn functions (like abort()).

The comments indicate that we were probably intending to do this all along;
it may have been inadvertantly changed during a refactor at one point.

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

12 years ago[analyzer] Remove obsolete GenericNodeBuilderRefCount from RetainCountChecker.
Jordan Rose [Sat, 18 Aug 2012 00:30:16 +0000 (00:30 +0000)]
[analyzer] Remove obsolete GenericNodeBuilderRefCount from RetainCountChecker.

This was once an adapter class between callbacks that had CheckerContexts
and those that don't, but for a while now it's essentially just been a
wrapper around a ProgramPointTag. We can just pass the tag around instead.

No functionality change.

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

12 years ago[analyzer] Use PointerUnion to implement ExplodedNode::NodeGroup.
Jordan Rose [Sat, 18 Aug 2012 00:30:10 +0000 (00:30 +0000)]
[analyzer] Use PointerUnion to implement ExplodedNode::NodeGroup.

We shouldn't be reinventing our own wheels. This also paves the way for
marking different kinds of sinks.

No functionality change.

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

12 years agoAST Matchers tests: test that member() matches member allocation functions.
Dmitri Gribenko [Sat, 18 Aug 2012 00:29:27 +0000 (00:29 +0000)]
AST Matchers tests: test that member() matches member allocation functions.

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

12 years agoReapply:
Eric Christopher [Fri, 17 Aug 2012 22:54:57 +0000 (22:54 +0000)]
Reapply:

Make isa part of objc_object at metadata generation time.

Noticed on inspection.

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

12 years agoWhen code completion is enabled, don't do any work in
Douglas Gregor [Fri, 17 Aug 2012 22:17:36 +0000 (22:17 +0000)]
When code completion is enabled, don't do any work in
Sema::ActOnEndOfTranslationUnit(). This is a (minor) optimization.

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

12 years agoc: privide deprecated warning when __private_extern__ storage
Fariborz Jahanian [Fri, 17 Aug 2012 21:44:55 +0000 (21:44 +0000)]
c: privide deprecated warning when __private_extern__ storage
specifier is unsed in a declaration; as it may not make the symbol
local to linkage unit as intended. Suggest using "hidden" visibility
attribute instead. // rdar://7703982

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

12 years ago[ms-inline asm] Update comment.
Chad Rosier [Fri, 17 Aug 2012 21:27:25 +0000 (21:27 +0000)]
[ms-inline asm] Update comment.

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

12 years agoPart of PR13618: visit the TypeLoc when RecursiveASTVisitor visits a CompoundLiteralExpr.
Richard Smith [Fri, 17 Aug 2012 21:23:17 +0000 (21:23 +0000)]
Part of PR13618: visit the TypeLoc when RecursiveASTVisitor visits a CompoundLiteralExpr.

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

12 years ago[ms-inline asm] Extract AsmStmt handling into a separate file, so as to not
Chad Rosier [Fri, 17 Aug 2012 21:19:40 +0000 (21:19 +0000)]
[ms-inline asm] Extract AsmStmt handling into a separate file, so as to not
pollute SemaStmt with extraneous asm handling logic.

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

12 years agomake this test case 64bit test. It fails due to
Fariborz Jahanian [Fri, 17 Aug 2012 20:23:06 +0000 (20:23 +0000)]
make this test case 64bit test. It fails due to
'int' vs. 'long' issue with i386.

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

12 years ago[analyzer] Make BlockDataRegions typed, so that they have DynamicTypeInfo.
Jordan Rose [Fri, 17 Aug 2012 20:16:34 +0000 (20:16 +0000)]
[analyzer] Make BlockDataRegions typed, so that they have DynamicTypeInfo.

Fixes <rdar://problem/12119814>

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

12 years agoRemove -Wbad-function-cast from -Wall.
Fariborz Jahanian [Fri, 17 Aug 2012 18:50:02 +0000 (18:50 +0000)]
Remove -Wbad-function-cast from -Wall.

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

12 years agodarwin/driver: Support using SDKROOT to define the default for -isysroot.
Daniel Dunbar [Fri, 17 Aug 2012 18:43:50 +0000 (18:43 +0000)]
darwin/driver: Support using SDKROOT to define the default for -isysroot.
 - The SDKROOT environment variable is the de facto way to set the default SDK
   for a number of tools, join forces with them.

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

12 years agoAST Matchers: introduce functionTemplate(), classTemplate() and
Dmitri Gribenko [Fri, 17 Aug 2012 18:42:47 +0000 (18:42 +0000)]
AST Matchers: introduce functionTemplate(), classTemplate() and
isExplicitTemplateSpecialization() matchers which do what their name says.

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

12 years agoFixed crash and added a test and a minor output problem
Alexander Kornienko [Fri, 17 Aug 2012 17:38:39 +0000 (17:38 +0000)]
Fixed crash and added a test and a minor output problem

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

12 years agoc: implement gcc's -Wbad-function-cast which warns
Fariborz Jahanian [Fri, 17 Aug 2012 17:22:34 +0000 (17:22 +0000)]
c: implement gcc's -Wbad-function-cast which warns
on unsafe cast of a c-function call. This is
a C-only option.

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

12 years agoDefine __builtin_ffs[ll] with a signed argument instead of unsigned.
Benjamin Kramer [Fri, 17 Aug 2012 16:39:13 +0000 (16:39 +0000)]
Define __builtin_ffs[ll] with a signed argument instead of unsigned.

GCC documents these as unsigned, but defines them as signed.

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

12 years ago[ms-inline asm] Instantiate the MCStreamer as a NullStream. We're parsing
Chad Rosier [Fri, 17 Aug 2012 16:38:04 +0000 (16:38 +0000)]
[ms-inline asm] Instantiate the MCStreamer as a NullStream.  We're parsing
instruction, not emitting them, so a NullStream is fine.

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

12 years agoAdd release notes for type safety attributes.
Dmitri Gribenko [Fri, 17 Aug 2012 16:01:54 +0000 (16:01 +0000)]
Add release notes for type safety attributes.

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

12 years agoFix broken check lines.
Benjamin Kramer [Fri, 17 Aug 2012 12:28:21 +0000 (12:28 +0000)]
Fix broken check lines.

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

12 years agoWarn about self-initialization of references.
Hans Wennborg [Fri, 17 Aug 2012 10:12:33 +0000 (10:12 +0000)]
Warn about self-initialization of references.

Initializing a reference with itself, e.g. "int &a = a;" seems like a
very bad idea.

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

12 years agoMake the spacing of the code completion result for NSDictionary
Douglas Gregor [Fri, 17 Aug 2012 05:40:05 +0000 (05:40 +0000)]
Make the spacing of the code completion result for NSDictionary
literals match the spacing introduced by the ObjC modernizer. Fixes
the rest of <rdar://problem/11889572>.

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

12 years agoWhen we need the complete set of visible declarations from a
Douglas Gregor [Fri, 17 Aug 2012 05:26:33 +0000 (05:26 +0000)]
When we need the complete set of visible declarations from a
declaration context, check whether the primary context---not the
current context---has any external visible declarations. Fixes
PR13616.

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

12 years agoDon't do jump-scope checking when code completion is enabled. It's
Douglas Gregor [Fri, 17 Aug 2012 05:12:08 +0000 (05:12 +0000)]
Don't do jump-scope checking when code completion is enabled. It's
both a waste of time, and prone to crash due to the use of the
error-recovery path in parser. Fixes <rdar://problem/12103608>, which
has been driving me nuts.

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

12 years agoTemporarily revert r162066 and r162062 to see if it brings the gdb
Eric Christopher [Fri, 17 Aug 2012 04:42:07 +0000 (04:42 +0000)]
Temporarily revert r162066 and r162062 to see if it brings the gdb
bots back.

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

12 years agoFix undefined behavior in debug info emission: operator* on WeakVH returns a
Richard Smith [Fri, 17 Aug 2012 04:17:54 +0000 (04:17 +0000)]
Fix undefined behavior in debug info emission: operator* on WeakVH returns a
reference, so &* on an empty WeakVH binds a reference to a dereferenced null
pointer. So don't do that; we have a perfectly good implicit conversion to
Value*.

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

12 years agoFix test so that it doesn't keep failing forever when it's failed once.
Richard Smith [Fri, 17 Aug 2012 04:05:25 +0000 (04:05 +0000)]
Fix test so that it doesn't keep failing forever when it's failed once.

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

12 years agoSwitch PTH format from a 7 byte magic number to an 8 byte one, to avoid
Richard Smith [Fri, 17 Aug 2012 03:55:43 +0000 (03:55 +0000)]
Switch PTH format from a 7 byte magic number to an 8 byte one, to avoid
misaligned reads throughout the file. Bump PTH format version to 10.

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

12 years agoFix -Wl,--no-demangle to actually pass the flag to the linker on Linux instead
Nick Lewycky [Fri, 17 Aug 2012 03:39:16 +0000 (03:39 +0000)]
Fix -Wl,--no-demangle to actually pass the flag to the linker on Linux instead
of silently dropping it on the floor.

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

12 years agoDon't forget to apply #pragma pack to partial and explicit specializations of
Richard Smith [Fri, 17 Aug 2012 03:20:55 +0000 (03:20 +0000)]
Don't forget to apply #pragma pack to partial and explicit specializations of
class templates. This fixes misalignment issues in llvm/Support/Endian.h when
built by Clang.

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

12 years ago[analyzer] Add an internal reference document describing IPA and CallEvent.
Jordan Rose [Fri, 17 Aug 2012 02:11:35 +0000 (02:11 +0000)]
[analyzer] Add an internal reference document describing IPA and CallEvent.

This attempts to be a higher-level description of our inlining heuristics
and decision trees than the source, where the work is spread out between
ExprEngine (mostly in ExprEngineCallAndReturn.cpp) and CallEvent, with a
few other classes participating as well.

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

12 years ago[analyzer] Unbreak the static analyzer buildbot.
Anna Zaks [Fri, 17 Aug 2012 01:09:13 +0000 (01:09 +0000)]
[analyzer] Unbreak the static analyzer buildbot.

We no longer associate the correct HTML file with plist diagnostic.
Fall out from r162028.

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

12 years agoAvoid binding a reference to a dereferenced null pointer, if we try to emit a
Richard Smith [Fri, 17 Aug 2012 00:55:32 +0000 (00:55 +0000)]
Avoid binding a reference to a dereferenced null pointer, if we try to emit a
diagnostic before we have a source manager.

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

12 years agoFix misaligned DeclGroup allocation.
Richard Smith [Fri, 17 Aug 2012 00:34:00 +0000 (00:34 +0000)]
Fix misaligned DeclGroup allocation.

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

12 years agoDon't form a null reference when checking for validity of an anonymous
Richard Smith [Fri, 17 Aug 2012 00:12:27 +0000 (00:12 +0000)]
Don't form a null reference when checking for validity of an anonymous
elaborated type specifier in template instantiation: such a specifier is always
valid because it must be specified within the definition of the type.

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

12 years agoAdd support for "type safety" attributes that allow checking that 'void *'
Dmitri Gribenko [Fri, 17 Aug 2012 00:08:38 +0000 (00:08 +0000)]
Add support for "type safety" attributes that allow checking that 'void *'
function arguments and arguments for variadic functions are of a particular
type which is determined by some other argument to the same function call.

Usecases include:
* MPI library implementations, where these attributes enable checking that
  buffer type matches the passed MPI_Datatype;
* for HDF5 library there is a similar usecase as MPI;
* checking types of variadic functions' arguments for functions like
  fcntl() and ioctl().

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

12 years agoAdd some caching here for the builtin types.
Eric Christopher [Thu, 16 Aug 2012 23:50:46 +0000 (23:50 +0000)]
Add some caching here for the builtin types.

rdar://12117935

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

12 years agoRemove FIXME, the constraints contain more options than the
Eric Christopher [Thu, 16 Aug 2012 23:50:43 +0000 (23:50 +0000)]
Remove FIXME, the constraints contain more options than the
current available documentation.

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

12 years agoAdd a missing 'break' to ensure that we reject inline assembly
Eric Christopher [Thu, 16 Aug 2012 23:50:41 +0000 (23:50 +0000)]
Add a missing 'break' to ensure that we reject inline assembly
constraints we don't recognize.

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

12 years agoRandom string removal.
Eric Christopher [Thu, 16 Aug 2012 23:50:37 +0000 (23:50 +0000)]
Random string removal.

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

12 years agoMake isa part of objc_object at metadata generation time.
Eric Christopher [Thu, 16 Aug 2012 23:50:35 +0000 (23:50 +0000)]
Make isa part of objc_object at metadata generation time.

Noticed on inspection.

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

12 years agoFix misaligned allocation of TemplateParameterList objects.
Richard Smith [Thu, 16 Aug 2012 22:51:34 +0000 (22:51 +0000)]
Fix misaligned allocation of TemplateParameterList objects.

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

12 years ago[ms-inline asm] Comment.
Chad Rosier [Thu, 16 Aug 2012 22:47:10 +0000 (22:47 +0000)]
[ms-inline asm] Comment.

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