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

12 years agoInclude clang-check as part of the clang installation.
David Blaikie [Tue, 31 Jul 2012 20:29:59 +0000 (20:29 +0000)]
Include clang-check as part of the clang installation.

This also tidies up a couple of other tools we were (partially) installing:
* c-index-test was being installed but shouldn't be (it's just a clang-dev tool)
* diagtool was being installed in cmake but not make (& shouldn't be installed in either)

Review by Manuel Klimek, Doug Gregor, and Chandler Carruth.

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

12 years agoConsider the visibility of template template arguments. GCC doesn't, but it also
Rafael Espindola [Tue, 31 Jul 2012 19:02:02 +0000 (19:02 +0000)]
Consider the visibility of template template arguments. GCC doesn't, but it also
fails to consider the linkage, which we were already considering.

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

12 years ago[analyzer] Control C++ inlining with a macro in ExprEngineCallAndReturn.cpp.
Jordan Rose [Tue, 31 Jul 2012 18:22:40 +0000 (18:22 +0000)]
[analyzer] Control C++ inlining with a macro in ExprEngineCallAndReturn.cpp.

For now this will stay on, but this way it's easy to switch off if we need
to pull back our support for a while.

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

12 years ago[analyzer] Turn -cfg-add-initializers on by default, and remove the flag.
Jordan Rose [Tue, 31 Jul 2012 18:04:59 +0000 (18:04 +0000)]
[analyzer] Turn -cfg-add-initializers on by default, and remove the flag.

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

12 years ago[analyzer] Don't try to inline if there's no region for a message receiver.
Jordan Rose [Tue, 31 Jul 2012 18:04:53 +0000 (18:04 +0000)]
[analyzer] Don't try to inline if there's no region for a message receiver.

While usually we'd use a symbolic region rather than a straight-up Unknown,
we can still generate unknowns via array subscripts with symbolic indexes.
(And if this ever changes in the future, we still shouldn't crash.)

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

12 years ago[analyzer] Add a FIXME about devirtualization in ctors/dtors.
Jordan Rose [Tue, 31 Jul 2012 18:04:49 +0000 (18:04 +0000)]
[analyzer] Add a FIXME about devirtualization in ctors/dtors.

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

12 years ago-Wformat: better handling of qualifiers on pointer arguments
Hans Wennborg [Tue, 31 Jul 2012 16:37:47 +0000 (16:37 +0000)]
-Wformat: better handling of qualifiers on pointer arguments

Warn about using pointers to const-qualified types as arguments to
scanf. Ignore the volatile qualifier when checking if types match.

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

12 years ago[analyzer] Getting an lvalue for a reference field still requires a load.
Jordan Rose [Tue, 31 Jul 2012 16:34:07 +0000 (16:34 +0000)]
[analyzer] Getting an lvalue for a reference field still requires a load.

This was causing a crash in our array-to-pointer logic, since the region
was clearly not an array.

PR13440 / <rdar://problem/11977113>

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

12 years agoTweak code-completion heuristics deciding between a lambda
Douglas Gregor [Tue, 31 Jul 2012 15:27:48 +0000 (15:27 +0000)]
Tweak code-completion heuristics deciding between a lambda
code-completion and an Objective-C message send, based on Jordan's
feedback.

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

12 years agoThis test actually works on Win32...
Manuel Klimek [Tue, 31 Jul 2012 14:45:10 +0000 (14:45 +0000)]
This test actually works on Win32...

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

12 years agoFixes a segfault in Tooling when using pch's:
Manuel Klimek [Tue, 31 Jul 2012 13:56:54 +0000 (13:56 +0000)]
Fixes a segfault in Tooling when using pch's:
Clear the FileManager's stat cache in between running
translation units, as the stat cache loaded from a pch
is only valid for one compiler invocation.

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

12 years agoRemove deprecated getNameAsCString methods.
Benjamin Kramer [Tue, 31 Jul 2012 11:45:39 +0000 (11:45 +0000)]
Remove deprecated getNameAsCString methods.

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

12 years agoAdd two more .keep files to avoid the missing of empty folders in git repository.
Jiangning Liu [Tue, 31 Jul 2012 10:52:55 +0000 (10:52 +0000)]
Add two more .keep files to avoid the missing of empty folders in git repository.

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

12 years agoAdd two .keep files to avoid the missing of empty folders in git repository.
Jiangning Liu [Tue, 31 Jul 2012 10:24:27 +0000 (10:24 +0000)]
Add two .keep files to avoid the missing of empty folders in git repository.

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

12 years agoAdded -ast-list option to dump filterable AST decl node names.
Alexander Kornienko [Tue, 31 Jul 2012 09:37:40 +0000 (09:37 +0000)]
Added -ast-list option to dump filterable AST decl node names.

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

12 years agoSupport ARM hard float (arm-linux-gnueabihf).
Jiangning Liu [Tue, 31 Jul 2012 08:06:29 +0000 (08:06 +0000)]
Support ARM hard float (arm-linux-gnueabihf).

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

12 years agoFix some minor typos
Sylvestre Ledru [Tue, 31 Jul 2012 06:56:50 +0000 (06:56 +0000)]
Fix some minor typos

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

12 years agoDocument the result type of the matcher functions where
Manuel Klimek [Tue, 31 Jul 2012 06:28:58 +0000 (06:28 +0000)]
Document the result type of the matcher functions where
it's not obvious from the source code.

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

12 years agoIntroduce new queries on ObjCRuntime for how to interpret subscripts
John McCall [Tue, 31 Jul 2012 05:14:30 +0000 (05:14 +0000)]
Introduce new queries on ObjCRuntime for how to interpret subscripts
on object pointers and whether pointer arithmetic on object pointers
is supported.  Make ObjFW interpret subscripts as pseudo-objects.
Based on a patch by Jonathan Schleifer.

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

12 years agoHandle functions with struct arguments or return types and the regparm
Rafael Espindola [Tue, 31 Jul 2012 02:44:24 +0000 (02:44 +0000)]
Handle functions with struct arguments or return types and the regparm
attribute. It is a variation of the x86_64 ABI:

* A struct returned indirectly uses the first register argument to pass the
  pointer.
* Floats, Doubles and structs containing only one of them are not passed in
  registers.
* Other structs are split into registers if they fit on the remaining ones.
  Otherwise they are passed in memory.
* When a struct doesn't fit it still consumes the registers.

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

12 years ago[analyzer] Add a test that messages to super invalidate ivars.
Jordan Rose [Tue, 31 Jul 2012 02:05:30 +0000 (02:05 +0000)]
[analyzer] Add a test that messages to super invalidate ivars.

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

12 years agoAttributes preceding a function declaration are first applied to the return
Rafael Espindola [Tue, 31 Jul 2012 01:54:04 +0000 (01:54 +0000)]
Attributes preceding a function declaration are first applied to the return
type and then propagated to the function. This was failing for destructors,
constructors and constructors templates since they don't have a return type.

Fix that by directly calling processTypeAttrs on the dummy type we use as the
return type in these cases.

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

12 years agoNo longer emitting a PCH file when using -fsyntax-only on a header file. Fixes PR13343.
Aaron Ballman [Tue, 31 Jul 2012 01:21:00 +0000 (01:21 +0000)]
No longer emitting a PCH file when using -fsyntax-only on a header file.  Fixes PR13343.

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

12 years ago[analyzer] Let CallEvent decide what goes in an inital stack frame.
Jordan Rose [Tue, 31 Jul 2012 01:07:55 +0000 (01:07 +0000)]
[analyzer] Let CallEvent decide what goes in an inital stack frame.

This removes explicit checks for 'this' and 'self' from
Store::enterStackFrame. It also removes getCXXThisRegion() as a virtual
method on all CallEvents; it's now only implemented in the parts of the
hierarchy where it is relevant. Finally, it removes the option to ask
for the ParmVarDecls attached to the definition of an inlined function,
saving a recomputation of the result of getRuntimeDefinition().

No visible functionality change!

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

12 years agoExplain why ACC_bottom should never occur in diagnosing ARC casts.
Jordan Rose [Tue, 31 Jul 2012 01:07:43 +0000 (01:07 +0000)]
Explain why ACC_bottom should never occur in diagnosing ARC casts.

This is just a clarification on Fariborz's original patch, per e-mail
discussion. No functionality change.

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

12 years agoWhen we encounter a code-completion token while parsing an ill-formed
Douglas Gregor [Tue, 31 Jul 2012 00:50:07 +0000 (00:50 +0000)]
When we encounter a code-completion token while parsing an ill-formed
lambda-introducer in Objective-C++11, fall back to treating the tokens
as an Objective-C message send to provide those (more likely)
completions. Fixes <rdar://problem/11980263>.

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

12 years agoDon't crash *or* insert a bogus autorelease when emitting a
John McCall [Tue, 31 Jul 2012 00:33:55 +0000 (00:33 +0000)]
Don't crash *or* insert a bogus autorelease when emitting a
this-adjustment thunk in ARC++.

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

12 years ago[analyzer] Handle inlining of instance calls to super.
Anna Zaks [Mon, 30 Jul 2012 23:48:36 +0000 (23:48 +0000)]
[analyzer] Handle inlining of instance calls to super.

Use self-init.m for testing. (It used to have a bunch of failing tests
with dynamic inlining turned on.)

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

12 years ago[analyzer] Only run this test with no IPA
Anna Zaks [Mon, 30 Jul 2012 23:48:31 +0000 (23:48 +0000)]
[analyzer] Only run this test with no IPA

The inlinable portion of the test relies on attributes/instead of the
function implementation.

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

12 years agoPR13479: If we see the definition of an out-of-line destructor in C++11, be
Richard Smith [Mon, 30 Jul 2012 23:48:14 +0000 (23:48 +0000)]
PR13479: If we see the definition of an out-of-line destructor in C++11, be
sure to update the exception specification on the declaration as well as the
definition. If we're building in -fno-exceptions mode, nothing else will
trigger it to be updated.

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

12 years ago[analyzer] Perform post-call checks for all inlined calls.
Jordan Rose [Mon, 30 Jul 2012 23:39:47 +0000 (23:39 +0000)]
[analyzer] Perform post-call checks for all inlined calls.

Previously, we were only checking the origin expressions of inlined calls.
Checkers using the generic postCall and older postObjCMessage callbacks were
ignored. Now that we have CallEventManager, it is much easier to create
a CallEvent generically when exiting an inlined function, which we can then
use for post-call checks.

No test case because we don't (yet) have any checkers that depend on this
behavior (which is why it hadn't been fixed before now).

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

12 years agoExtend the ',' versus ';' diagnostic for -Wvexing-parse to cover the with-arguments...
Richard Smith [Mon, 30 Jul 2012 21:42:05 +0000 (21:42 +0000)]
Extend the ',' versus ';' diagnostic for -Wvexing-parse to cover the with-arguments case as well as the no-arguments case.

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

12 years agoImprovements to vexing-parse warnings. Make the no-parameters case more
Richard Smith [Mon, 30 Jul 2012 21:30:52 +0000 (21:30 +0000)]
Improvements to vexing-parse warnings. Make the no-parameters case more
accurate by asking the parser whether there was an ambiguity rather than trying
to reverse-engineer it from the DeclSpec. Make the with-parameters case have
better diagnostics by using semantic information to drive the warning,
improving the diagnostics and adding a fixit.

Patch by Nikola Smiljanic. Some minor changes by me to suppress diagnostics for
declarations of the form 'T (*x)(...)', which seem to have a very high false
positive rate, and to reduce indentation in 'warnAboutAmbiguousFunction'.

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

12 years agoobjective-c arc: ARC IRGen correctly assumes result
Fariborz Jahanian [Mon, 30 Jul 2012 20:52:48 +0000 (20:52 +0000)]
objective-c arc: ARC IRGen correctly assumes result
type of generated call to super dealloc is 'void'
and asserts if user's dealloc is not of 'void type.
This rule must be enforced in clang front-end (with a
fixit) if this is not the case, instead of asserting in CodeGen.
// rdar://11987838

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

12 years ago[analyzer] Very simple ObjC instance method inlining
Anna Zaks [Mon, 30 Jul 2012 20:31:29 +0000 (20:31 +0000)]
[analyzer] Very simple ObjC instance method inlining

- Retrieves the type of the object/receiver from the state.
- Binds self during stack setup.
- Only explores the path on which the method is inlined (no
bifurcation to explore the path on which the method is not inlined).

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

12 years ago[analyzer] fixup for adding of the "dynamic" ipa option
Anna Zaks [Mon, 30 Jul 2012 20:31:24 +0000 (20:31 +0000)]
[analyzer] fixup for adding of the "dynamic" ipa option

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

12 years agoMark ObjCInterfaceDecl::lookupPrivateMethod as const.
Anna Zaks [Mon, 30 Jul 2012 20:31:21 +0000 (20:31 +0000)]
Mark ObjCInterfaceDecl::lookupPrivateMethod as const.

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

12 years ago[analyzer] Add -analyzer-ipa=dynamic option for inlining dynamically
Anna Zaks [Mon, 30 Jul 2012 20:31:18 +0000 (20:31 +0000)]
[analyzer] Add -analyzer-ipa=dynamic option for inlining dynamically
dispatched methods.

Disabled by default for now.

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

12 years ago[analyzer] Only allow CallEvents to be created by CallEventManager.
Jordan Rose [Mon, 30 Jul 2012 20:22:09 +0000 (20:22 +0000)]
[analyzer] Only allow CallEvents to be created by CallEventManager.

This ensures that it is valid to reference-count any CallEvents, and we
won't accidentally try to reclaim a CallEvent that lives on the stack.
It also hides an ugly switch statement for handling CallExprs!

There should be no functionality change here.

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

12 years ago[analyzer] Remove declaration of refactored evalObjCMessage method.
Jordan Rose [Mon, 30 Jul 2012 20:22:03 +0000 (20:22 +0000)]
[analyzer] Remove declaration of refactored evalObjCMessage method.

No functionality change.

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

12 years agoDo not warn on correct use of the '%n' format specifier.
Matt Beaumont-Gay [Mon, 30 Jul 2012 20:21:58 +0000 (20:21 +0000)]
Do not warn on correct use of the '%n' format specifier.

While '%n' can be used for evil in an attacker-controlled format string, there
isn't any acute danger in using it in a literal format string with an argument
of the appropriate type.

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

12 years ago[analyzer] Introduce a CallEventManager to keep a pool of CallEvents.
Jordan Rose [Mon, 30 Jul 2012 20:21:55 +0000 (20:21 +0000)]
[analyzer] Introduce a CallEventManager to keep a pool of CallEvents.

This allows us to get around the C++ "virtual constructor" problem
when we'd like to create a CallEvent from an ExplodedNode, an inlined
StackFrameContext, or another CallEvent. The solution has three parts:

- CallEventManager uses a BumpPtrAllocator to allocate CallEvent-sized
  memory blocks. It also keeps a cache of freed CallEvents for reuse.
- CallEvents all have protected copy constructors, along with cloneTo()
  methods that use placement new to copy into CallEventManager-managed
  memory, vtables intact.
- CallEvents owned by CallEventManager are now wrapped in an
  IntrusiveRefCntPtr. Going forwards, it's probably a good idea to create
  ALL CallEvents through the CallEventManager, so that we don't accidentally
  try to reclaim a stack-allocated CallEvent.

All of this machinery is currently unused but will be put into use shortly.

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