]> granicus.if.org Git - clang/log
clang
12 years ago[analyzer] Address Jordan's review of DynamicTypePropagation.
Anna Zaks [Tue, 7 Aug 2012 05:12:24 +0000 (05:12 +0000)]
[analyzer] Address Jordan's review of  DynamicTypePropagation.

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

12 years agoFix the test RUN line for this better.
Eric Christopher [Tue, 7 Aug 2012 05:04:19 +0000 (05:04 +0000)]
Fix the test RUN line for this better.

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

12 years agoEnhance ClangDiagnosticsEmitter to reject diagnostics that are errors that are also
Ted Kremenek [Tue, 7 Aug 2012 05:01:49 +0000 (05:01 +0000)]
Enhance ClangDiagnosticsEmitter to reject diagnostics that are errors that are also
included in warning groups.  Warning groups can only contain warnings, because only
warnings can be mapped to errors or ignored.

This caught a few diagnostics that were incorrectly in diagnostic groups, and
could have resulted in a compiler crash when those diagnostic groups were mapped.

Fixes <rdar://problem/12044436>

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

12 years agoTeach Expr::HasSideEffects about all the Expr types, and fix a bug where it
Richard Smith [Tue, 7 Aug 2012 04:16:51 +0000 (04:16 +0000)]
Teach Expr::HasSideEffects about all the Expr types, and fix a bug where it
was mistakenly classifying dynamic_casts which might throw as having no side
effects.

Switch it from a visitor to a switch, so it is kept up-to-date as future Expr
nodes are added. Move it from ExprConstant.cpp to Expr.cpp, since it's not
really related to constant expression evaluation.

Since we use HasSideEffect to determine whether to emit an unused global with
internal linkage, this has the effect of suppressing emission of globals in
some cases.

I've left many of the Objective-C cases conservatively assuming that the
expression has side-effects. I'll leave it to someone with better knowledge
of Objective-C than mine to improve them.

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

12 years ago[analyzer] Add a test case for OS X 10.8's NSMakeCollectable under non-GC.
Jordan Rose [Tue, 7 Aug 2012 01:11:14 +0000 (01:11 +0000)]
[analyzer] Add a test case for OS X 10.8's NSMakeCollectable under non-GC.

This is an additional test for r161349 (ignoring 10.8's annotations for
NSMakeCollectable).

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

12 years agoIf we don't have a complete type for the array type yet either then
Eric Christopher [Tue, 7 Aug 2012 00:48:43 +0000 (00:48 +0000)]
If we don't have a complete type for the array type yet either then
just let the alignment be zero.

PR13531

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

12 years agoRemove two fall through diagnostics from the IgnoredAttributes group, since they...
Ted Kremenek [Tue, 7 Aug 2012 00:34:48 +0000 (00:34 +0000)]
Remove two fall through diagnostics from the IgnoredAttributes group, since they are errors, not warnings.

Only warnings should be in warning groups.  This was causing an assertion failure in
code using pragmas to map -Wignored-attributes to ignored, but this kind of
diagnostic mapping is disallowed for builtin errors.  We should just wire
up tablegen to reject errors being in diagnostic groups.

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

12 years ago[ms-inline asm] Stmt destructors are never called, so allocate the AsmToks using
Chad Rosier [Tue, 7 Aug 2012 00:29:06 +0000 (00:29 +0000)]
[ms-inline asm] Stmt destructors are never called, so allocate the AsmToks using
the ASTContext BumpPtr.  Also use the preferred llvm::ArrayRef interface.

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

12 years agoSpecify a triple on this to make it easier to test.
Eric Christopher [Tue, 7 Aug 2012 00:28:23 +0000 (00:28 +0000)]
Specify a triple on this to make it easier to test.

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

12 years agoRemove some unintended changes from my last patch.
Eric Christopher [Tue, 7 Aug 2012 00:18:40 +0000 (00:18 +0000)]
Remove some unintended changes from my last patch.

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

12 years agoMake sure when we get the replacement type for a template argument
Eric Christopher [Tue, 7 Aug 2012 00:14:25 +0000 (00:14 +0000)]
Make sure when we get the replacement type for a template argument
that we attach the lost qualifiers.

Fixes rdar://11882155

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

12 years agoHandle null suffixes in GetTemporaryPath (PCH files don't have suffixes).
Ted Kremenek [Tue, 7 Aug 2012 00:02:30 +0000 (00:02 +0000)]
Handle null suffixes in GetTemporaryPath (PCH files don't have suffixes).

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

12 years ago[analyzer] DynTypes: Add a test for improper cast performed by user.
Anna Zaks [Mon, 6 Aug 2012 23:58:16 +0000 (23:58 +0000)]
[analyzer] DynTypes: Add a test for improper cast performed by  user.

Dynamic type inference does the right thing in this case. However, as
Jordan suggested, it would be nice to add a warning here as well.

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

12 years agoobjective-c: Implement gcc's -Wdirect-ivar-access option.
Fariborz Jahanian [Mon, 6 Aug 2012 23:50:51 +0000 (23:50 +0000)]
objective-c: Implement gcc's -Wdirect-ivar-access option.
// rdar://6505197

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

12 years agoComment parsing: fix crash on \tparam followed immediately by another block
Dmitri Gribenko [Mon, 6 Aug 2012 23:48:44 +0000 (23:48 +0000)]
Comment parsing: fix crash on \tparam followed immediately by another block
command, for example: \tparam\brief.

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

12 years ago[analyzer] Dynamic type info - propagate through implicit casts.
Anna Zaks [Mon, 6 Aug 2012 23:25:45 +0000 (23:25 +0000)]
[analyzer] Dynamic type info - propagate through implicit casts.

I currently have a bit of redundancy with the cast kind switch statement
inside the ImplicitCast callback, but I might be adding more casts going
forward.

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

12 years ago[analyzer] Add a checker to manage dynamic type propagation.
Anna Zaks [Mon, 6 Aug 2012 23:25:39 +0000 (23:25 +0000)]
[analyzer] Add a checker to manage dynamic type propagation.

Instead of sprinkling dynamic type info propagation throughout
ExprEngine, the added checker would add the more precise type
information on known APIs (Ex: ObjC alloc, new) and propagate
the type info in other cases (ex: ObjC init method, casts (the second is
not implemented yet)).

Add handling of ObjC alloc, new and init to the checker.

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

12 years agoRefactor checks for unevaluated contexts into a common utility function.
David Blaikie [Mon, 6 Aug 2012 22:47:24 +0000 (22:47 +0000)]
Refactor checks for unevaluated contexts into a common utility function.

The one caller that's surrounded by nearby code manipulating the underlying
evaluation context list is left unmodified for readability.

Review by Sean Silva and Richard Smith.

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

12 years agoComment AST: DeclInfo: collapse a bunch of boolean flags into an enum.
Dmitri Gribenko [Mon, 6 Aug 2012 21:31:15 +0000 (21:31 +0000)]
Comment AST: DeclInfo: collapse a bunch of boolean flags into an enum.

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

12 years ago[analyzer] Add plist output checks for all four "path notes" tests.
Jordan Rose [Mon, 6 Aug 2012 21:28:14 +0000 (21:28 +0000)]
[analyzer] Add plist output checks for all four "path notes" tests.

No functionality change, but from now on, any new path notes should be
tested both with plain-text output (for ease of human auditing) and with
plist output (to ensure control flow and events are being correctly
represented in Xcode).

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

12 years ago[analyzer] Improve arrow locations for PseudoObjectExprs.
Jordan Rose [Mon, 6 Aug 2012 21:28:11 +0000 (21:28 +0000)]
[analyzer] Improve arrow locations for PseudoObjectExprs.

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

12 years ago[analyzer] Ignore OS X 10.8's annotations for NSMakeCollectable.
Jordan Rose [Mon, 6 Aug 2012 21:28:02 +0000 (21:28 +0000)]
[analyzer] Ignore OS X 10.8's annotations for NSMakeCollectable.

The frameworks correctly use the 'cf_consumed' and 'ns_returns_retained'
attributes for NSMakeCollectable, but we can model the behavior under
garbage collection more precisely than that.

No functionality change.

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

12 years agoFor global record types, the self reference checker was called twice, resulting
Richard Trieu [Mon, 6 Aug 2012 21:09:23 +0000 (21:09 +0000)]
For global record types, the self reference checker was called twice, resulting
in duplicate -Wuninitialized warnings.  Change so that only the check in
TryConstructorInitialization() will be used and a single warning be emitted.

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

12 years agoscan-build: factor out setting of environment variables.
Ted Kremenek [Mon, 6 Aug 2012 20:19:19 +0000 (20:19 +0000)]
scan-build: factor out setting of environment variables.

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

12 years ago[ms-inline asm] Pass Tokens to Sema and store them in the AST. No functional
Chad Rosier [Mon, 6 Aug 2012 20:03:45 +0000 (20:03 +0000)]
[ms-inline asm] Pass Tokens to Sema and store them in the AST.  No functional
change intended.  No test case as there's no real way to test at this time.

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

12 years agoFix MIPS DSP Rev1 intrinsics memory properties.
Simon Atanasyan [Mon, 6 Aug 2012 19:48:16 +0000 (19:48 +0000)]
Fix MIPS DSP Rev1 intrinsics memory properties.
The patch reviewed by Akira Hatanaka.

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

12 years agoComment parser and sema: remove useless return values
Dmitri Gribenko [Mon, 6 Aug 2012 19:03:12 +0000 (19:03 +0000)]
Comment parser and sema: remove useless return values

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

12 years agoPull 'xcodebuild' wrapper logic into a separate function.
Ted Kremenek [Mon, 6 Aug 2012 18:54:19 +0000 (18:54 +0000)]
Pull 'xcodebuild' wrapper logic into a separate function.

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

12 years agoComment diagnostics: warn on duplicate \brief and \return commands.
Dmitri Gribenko [Mon, 6 Aug 2012 17:08:27 +0000 (17:08 +0000)]
Comment diagnostics: warn on duplicate \brief and \return commands.

Doxygen manual claims that multiple \brief or \returns commands will be merged
together, but actual behavior is different (second \brief command becomes a
part of a discussion, second \returns becomes a "Returns: blah" paragraph on
its own).  Anyway, it seems to be a bad idea to use multiple \brief or \returns
commands in a single command.

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

12 years agoComment diagnostics: \return in void function: specialize diagnostic text for
Dmitri Gribenko [Mon, 6 Aug 2012 16:29:26 +0000 (16:29 +0000)]
Comment diagnostics: \return in void function: specialize diagnostic text for
ObjC methods.

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

12 years agoRe-enable pcmpistri/pcmpestri builtins in clang now that llvm supports them properly.
Craig Topper [Mon, 6 Aug 2012 07:07:06 +0000 (07:07 +0000)]
Re-enable pcmpistri/pcmpestri builtins in clang now that llvm supports them properly.

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

12 years agoPR13529: Don't crash if the driver sees an unused input file when running as
Richard Smith [Mon, 6 Aug 2012 04:09:06 +0000 (04:09 +0000)]
PR13529: Don't crash if the driver sees an unused input file when running as
'clang-cpp'.

For now, the test uses "REQUIRES: shell" to determine if the host system
supports "ln -s", which it uses to create a 'clang-cpp' symlink. This is a bit
hacky and should likely be directly supported by lit.cfg.

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

12 years agoPR13499: Don't try to check whether 'override' has been validly applied until
Richard Smith [Mon, 6 Aug 2012 03:25:17 +0000 (03:25 +0000)]
PR13499: Don't try to check whether 'override' has been validly applied until
we know whether the function is virtual. But check it as soon as we do know;
in some cases we don't need to wait for an instantiation.

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

12 years agoPR13527: don't assert if a function is explicitly defaulted when it's already
Richard Smith [Mon, 6 Aug 2012 02:25:10 +0000 (02:25 +0000)]
PR13527: don't assert if a function is explicitly defaulted when it's already
been defined.

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

12 years agoAdd __builtin_readcyclecounter() to produce the @llvm.readcyclecounter() intrinsic.
Hal Finkel [Sun, 5 Aug 2012 22:03:08 +0000 (22:03 +0000)]
Add __builtin_readcyclecounter() to produce the @llvm.readcyclecounter() intrinsic.

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

12 years agoSimplify code, no functionality change.
Benjamin Kramer [Sat, 4 Aug 2012 17:00:46 +0000 (17:00 +0000)]
Simplify code, no functionality change.

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

12 years ago[analyzer] Malloc: remove assert since is not valid as of r161248
Anna Zaks [Sat, 4 Aug 2012 02:04:27 +0000 (02:04 +0000)]
[analyzer] Malloc: remove assert since is not valid as of r161248

We can be in the situation where we did not track the symbol before
realloc was called on it.

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

12 years agoobjective-C string literal has no side-effect,
Fariborz Jahanian [Sat, 4 Aug 2012 01:24:33 +0000 (01:24 +0000)]
objective-C string literal has no side-effect,
resulting in issuance of unused static variable
warning now. // rdar://10777111

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

12 years ago[analyzer] Use a more robust check for null in CallAndMessageChecker.
Jordan Rose [Sat, 4 Aug 2012 01:04:52 +0000 (01:04 +0000)]
[analyzer] Use a more robust check for null in CallAndMessageChecker.

This should fix the failing test on the buildbot as well.

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

12 years ago[analyzer] Don't assume values bound to references are automatically non-null.
Jordan Rose [Sat, 4 Aug 2012 00:25:30 +0000 (00:25 +0000)]
[analyzer] Don't assume values bound to references are automatically non-null.

While there is no such thing as a "null reference" in the C++ standard,
many implementations of references (including Clang's) do not actually
check that the location bound to them is non-null. Thus unlike a regular
null dereference, this will not cause a problem at runtime until the
reference is actually used. In order to catch these cases, we need to not
prune out paths on which the input pointer is null.

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

12 years agoFix the name of this variable.
Eric Christopher [Sat, 4 Aug 2012 00:11:22 +0000 (00:11 +0000)]
Fix the name of this variable.

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

12 years agoUpdate comment to accurately reflect what should happen.
Eric Christopher [Sat, 4 Aug 2012 00:11:20 +0000 (00:11 +0000)]
Update comment to accurately reflect what should happen.

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

12 years ago[analyzer] Update initializer assertion for delegating constructors.
Jordan Rose [Fri, 3 Aug 2012 23:31:15 +0000 (23:31 +0000)]
[analyzer] Update initializer assertion for delegating constructors.

Like base constructors, delegating constructors require no further
processing in the CFGInitializer node.

Also, add PrettyStackTraceLoc to the initializer and destructor logic
so we can get better stack traces in the future.

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

12 years ago[analyzer] When a symbol is null, we should track its constraints.
Jordan Rose [Fri, 3 Aug 2012 23:09:01 +0000 (23:09 +0000)]
[analyzer] When a symbol is null, we should track its constraints.

Because of this, we would previously emit NO path notes when a parameter
is constrained to null (because there are no stores). Now we show where we
made the assumption, which is much more useful.

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

12 years ago[analyzer] Flatten path diagnostics for text output like we do for HTML.
Jordan Rose [Fri, 3 Aug 2012 23:08:54 +0000 (23:08 +0000)]
[analyzer] Flatten path diagnostics for text output like we do for HTML.

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

12 years ago[analyzer] Track null/uninitialized C++ objects used in method calls.
Jordan Rose [Fri, 3 Aug 2012 23:08:49 +0000 (23:08 +0000)]
[analyzer] Track null/uninitialized C++ objects used in method calls.

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

12 years ago[analyzer] Provide useful PathDiagnosticLocations for CallEnter/Exit events.
Jordan Rose [Fri, 3 Aug 2012 23:08:44 +0000 (23:08 +0000)]
[analyzer] Provide useful PathDiagnosticLocations for CallEnter/Exit events.

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

12 years ago[analyzer] FindLastStoreBRVisitor was not actually finding stores.
Jordan Rose [Fri, 3 Aug 2012 23:08:42 +0000 (23:08 +0000)]
[analyzer] FindLastStoreBRVisitor was not actually finding stores.

The visitor walks back through the ExplodedGraph as expected, but
it wasn't actually keeping track of when a value was assigned. This
meant that it only worked when the value was assigned when the variable
was defined.

Tests in the next commit (dependent on another change).

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

12 years agoEnhance getImplicitObjectArgument to look through ->*.
Jordan Rose [Fri, 3 Aug 2012 23:08:39 +0000 (23:08 +0000)]
Enhance getImplicitObjectArgument to look through ->*.

This only applies in the case where ->* is not overloaded, since it
specifically looks for BinaryOperator and not CXXOperatorCallExpr.

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

12 years ago[analyzer] Add a test for copy-constructor inlining.
Jordan Rose [Fri, 3 Aug 2012 23:08:36 +0000 (23:08 +0000)]
[analyzer] Add a test for copy-constructor inlining.

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

12 years agoMake property synthesis the default on Windows.
Fariborz Jahanian [Fri, 3 Aug 2012 21:51:38 +0000 (21:51 +0000)]
Make property synthesis the default on Windows.

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

12 years ago[analyzer] Fixup: remove the extra whitespace
Anna Zaks [Fri, 3 Aug 2012 21:49:42 +0000 (21:49 +0000)]
[analyzer] Fixup: remove the extra whitespace

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

12 years ago[analyzer] ObjC Inlining: Start tracking dynamic type info in the GDM
Anna Zaks [Fri, 3 Aug 2012 21:43:37 +0000 (21:43 +0000)]
[analyzer] ObjC Inlining: Start tracking dynamic type info in the GDM

In the following code, find the type of the symbolic receiver by
following it and updating the dynamic type info in the state when we
cast the symbol from id to MyClass *.

  MyClass *a = [[self alloc] init];
  return 5/[a testSelf];

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

12 years agoComment diagnostics: warn if \returns is used in a non-function comment or if
Dmitri Gribenko [Fri, 3 Aug 2012 21:15:32 +0000 (21:15 +0000)]
Comment diagnostics: warn if \returns is used in a non-function comment or if
the function returns void.

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

12 years agoFix crash if a literal operator template's template parameter pack is not a non-type...
Richard Smith [Fri, 3 Aug 2012 21:14:57 +0000 (21:14 +0000)]
Fix crash if a literal operator template's template parameter pack is not a non-type template parameter pack. Patch by Andy Gibbs!

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

12 years ago[analyzer] Fix a typo. Thanks Jordan.
Anna Zaks [Fri, 3 Aug 2012 18:30:20 +0000 (18:30 +0000)]
[analyzer] Fix a typo. Thanks Jordan.

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

12 years ago[analyzer] Malloc: track non-allocated but freed memory
Anna Zaks [Fri, 3 Aug 2012 18:30:18 +0000 (18:30 +0000)]
[analyzer] Malloc: track non-allocated but freed memory

There is no reason why we should not track the memory which was not
allocated in the current function, but was freed there. This would
allow to catch more use-after-free and double free with no/limited IPA.

Also fix a realloc issue which surfaced as the result of this patch.

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

12 years agoFix line endings.
Michael Han [Fri, 3 Aug 2012 17:40:43 +0000 (17:40 +0000)]
Fix line endings.

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

12 years agoTableGen: Remove extraneous \ character from arm_neon.h definitions.
Jim Grosbach [Fri, 3 Aug 2012 17:30:46 +0000 (17:30 +0000)]
TableGen: Remove extraneous \ character from arm_neon.h definitions.

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

12 years agoFlesh out test for defaulted key functions a bit more.
Benjamin Kramer [Fri, 3 Aug 2012 15:43:22 +0000 (15:43 +0000)]
Flesh out test for defaulted key functions a bit more.

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

12 years agoReduce temp file pollution in some test cases.
Benjamin Kramer [Fri, 3 Aug 2012 10:35:06 +0000 (10:35 +0000)]
Reduce temp file pollution in some test cases.

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

12 years agoFix failed to generate vtables in certain cases.
Benjamin Kramer [Fri, 3 Aug 2012 08:39:58 +0000 (08:39 +0000)]
Fix failed to generate vtables in certain cases.

By C++ standard, the vtable should be generated if the first non-inline
virtual function is defined in the TU.  Current version of clang doesn't
generate vtable if the first virtual function is defaulted, because the
key function is regarded as the defaulted function.

Patch by Li Kan!

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

12 years agoAdd some missing functions to builtins.py.
Eric Christopher [Fri, 3 Aug 2012 00:13:44 +0000 (00:13 +0000)]
Add some missing functions to builtins.py.

rdar://10112601

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

12 years agoComment AST: convert a huge if -- else if statement on Decl's type into a
Dmitri Gribenko [Fri, 3 Aug 2012 00:01:01 +0000 (00:01 +0000)]
Comment AST: convert a huge if -- else if statement on Decl's type into a
switch.  Thanks Sean Silva for suggestion!

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

12 years ago[analyzer] Solve another source of non-determinism in the diagnostic
Anna Zaks [Thu, 2 Aug 2012 23:41:05 +0000 (23:41 +0000)]
[analyzer] Solve another source of non-determinism in the diagnostic
engine.

The code that was supposed to split the tie in a deterministic way is
not deterministic. Most likely one of the profile methods uses a
pointer. After this change we do finally get the consistent diagnostic
output. Testing this requires running the analyzer on large code bases
and diffing the results.

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

12 years agoComments AST: refactor DeclInfo to use an enum for decl kind instead of
Dmitri Gribenko [Thu, 2 Aug 2012 21:45:39 +0000 (21:45 +0000)]
Comments AST: refactor DeclInfo to use an enum for decl kind instead of
separate flags.

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

12 years ago[driver] Lipo can handle the lto-bc type.
Chad Rosier [Thu, 2 Aug 2012 21:39:47 +0000 (21:39 +0000)]
[driver] Lipo can handle the lto-bc type.
rdar://12000401

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

12 years agoComments: handle template paramter documentation in alias-declaration
Dmitri Gribenko [Thu, 2 Aug 2012 21:36:57 +0000 (21:36 +0000)]
Comments: handle template paramter documentation in alias-declaration
templates.

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

12 years ago[analyzer] Add a simple check for initializing reference variables with null.
Jordan Rose [Thu, 2 Aug 2012 21:33:42 +0000 (21:33 +0000)]
[analyzer] Add a simple check for initializing reference variables with null.

There's still more work to be done here; this doesn't catch reference
parameters or return values. But it's a step in the right direction.

Part of <rdar://problem/11212286>.

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

12 years agoAttaching comments to declarations: handle using-declaration.
Dmitri Gribenko [Thu, 2 Aug 2012 20:49:51 +0000 (20:49 +0000)]
Attaching comments to declarations: handle using-declaration.

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

12 years agoobjc-arc: Modify test for more prcecise fixit.
Fariborz Jahanian [Thu, 2 Aug 2012 18:38:41 +0000 (18:38 +0000)]
objc-arc: Modify test for more prcecise fixit.
// rdar://11913153

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

12 years agoobjective-c arc: Patch to suggest bridge casting of CF
Fariborz Jahanian [Thu, 2 Aug 2012 18:03:58 +0000 (18:03 +0000)]
objective-c arc: Patch to suggest bridge casting of CF
objects used as dictionary subscript objects.
// rdar://11913153

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

12 years agoASTContext.h: replace include by a forward declaration.
Dmitri Gribenko [Thu, 2 Aug 2012 17:39:44 +0000 (17:39 +0000)]
ASTContext.h: replace include by a forward declaration.

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

12 years agoAdd OpenBSD arch targets for powerpc, arm, mips64, mips64el and sparc.
Hans Wennborg [Thu, 2 Aug 2012 13:45:48 +0000 (13:45 +0000)]
Add OpenBSD arch targets for powerpc, arm, mips64, mips64el and sparc.

Contributed by Brad Smith <brad@comstyle.com>

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

12 years agoCorrect AddDefaultCIncludePaths for OpenBSD to not include /usr/local/include
Hans Wennborg [Thu, 2 Aug 2012 12:27:08 +0000 (12:27 +0000)]
Correct AddDefaultCIncludePaths for OpenBSD to not include /usr/local/include
in the default search path. Compilers on *BSD OS's only include /usr/include by
default.

Contributed by Brad Smith <brad@comstyle.com>

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

12 years agoadd a comment to explain this test case
Nuno Lopes [Thu, 2 Aug 2012 12:12:26 +0000 (12:12 +0000)]
add a comment to explain this test case

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

12 years agotest/Sema/tls.c: don't use -verify to check if TLS is supported
Hans Wennborg [Thu, 2 Aug 2012 09:04:56 +0000 (09:04 +0000)]
test/Sema/tls.c: don't use -verify to check if TLS is supported

Use "%clang_cc1" vs "not %clang_cc1" instead.
Also use -fsyntax-only.

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

12 years ago[analyzer] Also emit Prev/Next links for macros in HTML output. Oops.
Jordan Rose [Thu, 2 Aug 2012 02:43:42 +0000 (02:43 +0000)]
[analyzer] Also emit Prev/Next links for macros in HTML output. Oops.

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

12 years ago[analyzer] Add Prev/Next links to the HTML output.
Jordan Rose [Thu, 2 Aug 2012 02:26:19 +0000 (02:26 +0000)]
[analyzer] Add Prev/Next links to the HTML output.

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

12 years ago[analyzer] Flush bug reports in deterministic order.
Anna Zaks [Thu, 2 Aug 2012 00:41:43 +0000 (00:41 +0000)]
[analyzer] Flush bug reports in deterministic order.

This makes the diagnostic output order deterministic.
1) This makes order of text diagnostics consistent from run to run.

2) Also resulted in different bugs being reported (from one run to
another) with plist-html output.

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

12 years ago[analyzer] CmpRuns should include file name in the issue identifier.
Anna Zaks [Thu, 2 Aug 2012 00:41:40 +0000 (00:41 +0000)]
[analyzer] CmpRuns should include file name in the issue identifier.

This prevents us from treating the issues from different files with the
same function names and same offsets as the same.

The issue identifier now includes the file name. Also added a way to
strip off the root directories form the source file names.

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

12 years agoMake sure we don't emit IR for unused EH cleanups. PR13359.
Eli Friedman [Thu, 2 Aug 2012 00:10:24 +0000 (00:10 +0000)]
Make sure we don't emit IR for unused EH cleanups.  PR13359.

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

12 years agoComment parser tests: test that we allow placing no whitespace between \param
Dmitri Gribenko [Wed, 1 Aug 2012 23:49:32 +0000 (23:49 +0000)]
Comment parser tests: test that we allow placing no whitespace between \param
and [direction].

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

12 years agoComment to HTML conversion: correct typo in CSS class name: taram -> tparam
Dmitri Gribenko [Wed, 1 Aug 2012 23:47:30 +0000 (23:47 +0000)]
Comment to HTML conversion: correct typo in CSS class name: taram -> tparam

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

12 years agoComment diagnostics fixit tests: move exected-warning constructs from the
Dmitri Gribenko [Wed, 1 Aug 2012 23:29:52 +0000 (23:29 +0000)]
Comment diagnostics fixit tests: move exected-warning constructs from the
comment being tested.

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

12 years agoComment diagnostics: add tests for \tparam fixits.
Dmitri Gribenko [Wed, 1 Aug 2012 23:27:13 +0000 (23:27 +0000)]
Comment diagnostics: add tests for \tparam fixits.

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

12 years agoInitialize flag in DeclInfo.
Dmitri Gribenko [Wed, 1 Aug 2012 23:21:57 +0000 (23:21 +0000)]
Initialize flag in DeclInfo.

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

12 years agoComment AST: add DeclInfo to store information about the declaration. Sema was
Dmitri Gribenko [Wed, 1 Aug 2012 23:08:09 +0000 (23:08 +0000)]
Comment AST: add DeclInfo to store information about the declaration.  Sema was
already extracting most of this, but discarding at the end of semantic analysis.

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

12 years agoComment to HTML conversion: refactor. Extracted a class to for FullComment
Dmitri Gribenko [Wed, 1 Aug 2012 22:48:16 +0000 (22:48 +0000)]
Comment to HTML conversion: refactor.  Extracted a class to for FullComment
semantic parts -- this will be reused for comment to XML conversion.

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

12 years agoFix an assertion failure instantiating a constexpr function from within a -dealloc...
Eli Friedman [Wed, 1 Aug 2012 21:02:59 +0000 (21:02 +0000)]
Fix an assertion failure instantiating a constexpr function from within a -dealloc method.  PR13401.

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

12 years agoTLS is not supported on OpenBSD
Hans Wennborg [Wed, 1 Aug 2012 18:53:19 +0000 (18:53 +0000)]
TLS is not supported on OpenBSD

This fixes PR13502 and adds a test to keep track of which
targets support TLS and which do not.

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

12 years agoadd test for PR13497
Nuno Lopes [Wed, 1 Aug 2012 17:02:30 +0000 (17:02 +0000)]
add test for PR13497

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

12 years agoFix typo.
Manuel Klimek [Wed, 1 Aug 2012 08:48:27 +0000 (08:48 +0000)]
Fix typo.

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

12 years agoAdd missing tests for class template specialization and template
Daniel Jasper [Wed, 1 Aug 2012 08:40:24 +0000 (08:40 +0000)]
Add missing tests for class template specialization and template
argument matchers.

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

12 years agoWhen devirtualizing the conversion to a virtual base subobject,
John McCall [Wed, 1 Aug 2012 05:04:58 +0000 (05:04 +0000)]
When devirtualizing the conversion to a virtual base subobject,
don't explode if the offset we get is zero.  This can happen if
you have an empty virtual base class.

While I'm at it, remove an unnecessary block from the IR-generation
of the null-check, mark the eventual GEP as inbounds, and generally
prettify.

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

12 years agoComment to HTML conversion: skip \tparam commands with whitespace paragraphs
Dmitri Gribenko [Wed, 1 Aug 2012 00:48:00 +0000 (00:48 +0000)]
Comment to HTML conversion: skip \tparam commands with whitespace paragraphs

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

12 years agoComment to HTML conversion: escape HTML special characters in command arguments
Dmitri Gribenko [Wed, 1 Aug 2012 00:21:12 +0000 (00:21 +0000)]
Comment to HTML conversion: escape HTML special characters in command arguments

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

12 years agoExplicitly defaulted constructors cannot be used for default initialization.
Aaron Ballman [Tue, 31 Jul 2012 22:40:31 +0000 (22:40 +0000)]
Explicitly defaulted constructors cannot be used for default initialization.

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

12 years agoComment parsing: add support for \tparam command on all levels.
Dmitri Gribenko [Tue, 31 Jul 2012 22:37:06 +0000 (22:37 +0000)]
Comment parsing: add support for \tparam command on all levels.

The only caveat is renumbering CXCommentKind enum for aesthetic reasons -- this
breaks libclang binary compatibility, but should not be a problem since API is
so new.

This also fixes PR13372 as a side-effect.

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

12 years agoWhen testing whether we can perform copy or move initialization, be
Douglas Gregor [Tue, 31 Jul 2012 22:15:04 +0000 (22:15 +0000)]
When testing whether we can perform copy or move initialization, be
sure to supply an initialization location. Fixes <rdar://problem/11951661>.

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