]> granicus.if.org Git - clang/log
clang
12 years agoFixing the return type information for objc_sync_enter and objc_sync_exit. Patch...
Aaron Ballman [Thu, 6 Sep 2012 16:44:16 +0000 (16:44 +0000)]
Fixing the return type information for objc_sync_enter and objc_sync_exit.  Patch thanks to Joe Ranieri!

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

12 years agoc: make __attribute__((unused)) transitive.
Fariborz Jahanian [Thu, 6 Sep 2012 16:43:18 +0000 (16:43 +0000)]
c: make __attribute__((unused)) transitive.
   Don't warn if annotated decl is used inside another
   unused. // rdar://12233989

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

12 years agoTighten up regexps some more.
Jakob Stoklund Olesen [Thu, 6 Sep 2012 16:29:03 +0000 (16:29 +0000)]
Tighten up regexps some more.

These tests were failing for me because the .* was greedily matching up
to the /libexec/ld-elf.so.1" later on the same line.

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

12 years agoRemove unused typedefs. Found by gcc48.
Roman Divacky [Thu, 6 Sep 2012 16:14:37 +0000 (16:14 +0000)]
Remove unused typedefs. Found by gcc48.

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

12 years agoDont cast away const needlessly. Found by gcc48 -Wcast-qual.
Roman Divacky [Thu, 6 Sep 2012 15:59:27 +0000 (15:59 +0000)]
Dont cast away const needlessly. Found by gcc48 -Wcast-qual.

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

12 years agoUpdate AddressSanitizer docs
Alexey Samsonov [Thu, 6 Sep 2012 09:49:03 +0000 (09:49 +0000)]
Update AddressSanitizer docs

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

12 years agoFix a mistake in an HTML example code snippet.
Jordan Rose [Thu, 6 Sep 2012 02:19:13 +0000 (02:19 +0000)]
Fix a mistake in an HTML example code snippet.

Caught by Kurt Arnlund!

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

12 years agoPR13775: When checking for a tag type being shadowed by some other declaration,
Richard Smith [Thu, 6 Sep 2012 01:37:56 +0000 (01:37 +0000)]
PR13775: When checking for a tag type being shadowed by some other declaration,
don't trample over the caller's LookupResult in the case where the check fails.

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

12 years ago[analyzer] Enhance the member expr tracking to account for references.
Anna Zaks [Wed, 5 Sep 2012 23:41:54 +0000 (23:41 +0000)]
[analyzer] Enhance the member expr tracking to account for references.

As per Jordan's suggestion. (Came out of code review for r163261.)

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

12 years agoContinue including temporary destructors in the CFG used for warnings.
Jordan Rose [Wed, 5 Sep 2012 23:11:06 +0000 (23:11 +0000)]
Continue including temporary destructors in the CFG used for warnings.

...and hopefully unbreak buildbots. My apologies!

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

12 years agoFormat strings: suggest casts for NS(U)Integer and [SU]Int32 on Darwin.
Jordan Rose [Wed, 5 Sep 2012 22:56:26 +0000 (22:56 +0000)]
Format strings: suggest casts for NS(U)Integer and [SU]Int32 on Darwin.

These types are defined differently on 32-bit and 64-bit platforms, and
trying to offer a fixit for one platform would only mess up the format
string for the other. The Apple-recommended solution is to cast to a type
that is known to be large enough and always use that to print the value.

This should only have an impact on compile time if the format string is
incorrect; in cases where the format string matches the definition on the
current platform, no warning will be emitted.

<rdar://problem/9135072&12164284>

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

12 years agoFormat string checking: change long if-statement to early returns.
Jordan Rose [Wed, 5 Sep 2012 22:56:19 +0000 (22:56 +0000)]
Format string checking: change long if-statement to early returns.

No functionality change.

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

12 years ago[analyzer] Always include destructors in the analysis CFG.
Jordan Rose [Wed, 5 Sep 2012 22:55:23 +0000 (22:55 +0000)]
[analyzer] Always include destructors in the analysis CFG.

While destructors will continue to not be inlined (unless the analyzer
config option 'c++-inlining' is set to 'destructors'), leaving them out
of the CFG is an incomplete model of the behavior of an object, and
can cause false positive warnings (like PR13751, now working).

Destructors for temporaries are still not on by default, since
(a) we haven't actually checked this code to be sure it's fully correct
    (in particular, we probably need to be very careful with regard to
    lifetime-extension when a temporary is bound to a reference,
    C++11 [class.temporary]p5), and
(b) ExprEngine doesn't actually do anything when it sees a temporary
    destructor in the CFG -- not even invalidate the object region.

To enable temporary destructors, set the 'cfg-temporary-dtors' analyzer
config option to '1'. The old -cfg-add-implicit-dtors cc1 option, which
controlled all implicit destructors, has been removed.

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

12 years ago[analyzer] Fix a crash PR13762.
Anna Zaks [Wed, 5 Sep 2012 22:31:58 +0000 (22:31 +0000)]
[analyzer] Fix a crash PR13762.

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

12 years ago[analyzer] NullOrUndef diagnostics: track symbols binded to regions.
Anna Zaks [Wed, 5 Sep 2012 22:31:55 +0000 (22:31 +0000)]
[analyzer] NullOrUndef diagnostics: track symbols binded to regions.

If a region is binded to a symbolic value, we should track the symbol.

(The code I changed was not previously exercised by the regression
tests.)

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

12 years ago[analyzer] Remove unneeded code.
Anna Zaks [Wed, 5 Sep 2012 22:31:49 +0000 (22:31 +0000)]
[analyzer] Remove unneeded code.

This region is set as interesting as part of trackNullOrUndefValue call,
no need to mark it as interesting twice.

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

12 years agoAdd test missed in previous commit.
Eric Christopher [Wed, 5 Sep 2012 21:50:35 +0000 (21:50 +0000)]
Add test missed in previous commit.

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

12 years agoTry to fix the windows bots.
Eric Christopher [Wed, 5 Sep 2012 21:50:30 +0000 (21:50 +0000)]
Try to fix the windows bots.

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

12 years agoApply some driver improvements for freebsd-*-mips*.
Eric Christopher [Wed, 5 Sep 2012 21:32:44 +0000 (21:32 +0000)]
Apply some driver improvements for freebsd-*-mips*.

Patch by Brooks Davis.

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

12 years ago[cindex.py] Make the use of a compatibilty check explicit
Tobias Grosser [Wed, 5 Sep 2012 20:23:53 +0000 (20:23 +0000)]
[cindex.py] Make the use of a compatibilty check explicit

At the moment, we implictly check compatibility between the python
bindings and libclang, as the python bindings will fail to load in
case a method we use in libclang is not available.

This patch makes the use of this compatibility check explicit and introduces a
flag to optionally disable the check. This will allow us to further harden the
compatibility check, but it also gives the user the possibility to disable the
compatibility check to evaluate compatibility with older libclang versions.

I added documentation that makes clear the python bindings are only tested
with the libclang version they have been shipped with.

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

12 years agoThread-safety analysis: bugfix for case where a trylock occurs in an
DeLesley Hutchins [Wed, 5 Sep 2012 20:01:16 +0000 (20:01 +0000)]
Thread-safety analysis: bugfix for case where a trylock occurs in an
expression involving temporaries.

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

12 years agoobjective-c++11: c++11 does not change pod-ness when
Fariborz Jahanian [Wed, 5 Sep 2012 19:51:20 +0000 (19:51 +0000)]
objective-c++11: c++11 does not change pod-ness when
type is an unqualified objc pointer in arc. Treat it just
as being treated in c++98. This fixes a bogus vararg warning
with -std=c++11. //rdar://12229679

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

12 years agoUpdate for r163231.
Chad Rosier [Wed, 5 Sep 2012 19:01:07 +0000 (19:01 +0000)]
Update for r163231.

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

12 years agoAdded missing test.
Abramo Bagnara [Wed, 5 Sep 2012 18:06:49 +0000 (18:06 +0000)]
Added missing test.

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

12 years agoc error recovery. treat an invalid redeclaration
Fariborz Jahanian [Wed, 5 Sep 2012 17:52:12 +0000 (17:52 +0000)]
c error recovery. treat an invalid redeclaration
of a c-function for what it is. Otherwise, this func
is treated as an overloadable c-function resulting in
a crash much later. // rdar://11743706

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

12 years ago[analyzer] Fix bad test from r163220.
Jordan Rose [Wed, 5 Sep 2012 17:34:50 +0000 (17:34 +0000)]
[analyzer] Fix bad test from r163220.

Add a FIXME to the test while I track down the real problem.

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

12 years agoAllow disabling of wchar_t type.
Abramo Bagnara [Wed, 5 Sep 2012 17:30:57 +0000 (17:30 +0000)]
Allow disabling of wchar_t type.

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

12 years ago[analyzer] Be more forgiving about calling methods on struct rvalues.
Jordan Rose [Wed, 5 Sep 2012 17:11:26 +0000 (17:11 +0000)]
[analyzer] Be more forgiving about calling methods on struct rvalues.

The problem is that the value of 'this' in a C++ member function call
should always be a region (or NULL). However, if the object is an rvalue,
it has no associated region (only a conjured symbol or LazyCompoundVal).
For now, we handle this in two ways:

1) Actually respect MaterializeTemporaryExpr. Before, it was relying on
   CXXConstructExpr to create temporary regions for all struct values.
   Now it just does the right thing: if the value is not in a temporary
   region, create one.

2) Have CallEvent recognize the case where its 'this' pointer is a
   non-region, and just return UnknownVal to keep from confusing clients.

The long-term problem is being tracked internally in <rdar://problem/12137950>,
but this makes many test cases pass.

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

12 years ago[analyzer] Clean up a couple uses of getPointeeType().
Jordan Rose [Wed, 5 Sep 2012 17:11:22 +0000 (17:11 +0000)]
[analyzer] Clean up a couple uses of getPointeeType().

No intended functionality change.

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

12 years agoRevert "[analyzer] Treat all struct values as regions (even rvalues)."
Jordan Rose [Wed, 5 Sep 2012 17:11:15 +0000 (17:11 +0000)]
Revert "[analyzer] Treat all struct values as regions (even rvalues)."

This turned out to have many implications, but what eventually seemed to
make it unworkable was the fact that we can get struct values (as
LazyCompoundVals) from other places besides return-by-value function calls;
that is, we weren't actually able to "treat all struct values as regions"
consistently across the entire analyzer core.

Hopefully we'll be able to come up with an alternate solution soon.

This reverts r163066 / 02df4f0aef142f00d4637cd851e54da2a123ca8e.

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

12 years agoIntroduces DynTypedMatcher as a new concept that replaces the UntypedBaseMatcher...
Manuel Klimek [Wed, 5 Sep 2012 12:12:07 +0000 (12:12 +0000)]
Introduces DynTypedMatcher as a new concept that replaces the UntypedBaseMatcher and TypedMatcher.

Due to DynTypedNode the basic dynamically typed matcher interface can now be simplified.

Also switches the traversal interfaces to use DynTypedNode;
this is in preperation for the hasAncestor implementation, and
also allows us to need fewer changes when we want to add new
nodes to traverse, thus making the code a little more decoupled.

Main design concerns: I went back towards the original design
of getNodeAs to return a pointer, and switched DynTypedNode::get
to always return a pointer (in case of value types like QualType
the pointer points into the storage of DynTypedNode, thus allowing
us to treat all the nodes the same from the point of view of a
user of the DynTypedNodes.

Adding the QualType implementation for DynTypedNode was needed
for the recursive traversal interface changes.

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

12 years agoNew clang-check vim integration script
Alexander Kornienko [Wed, 5 Sep 2012 12:11:13 +0000 (12:11 +0000)]
New clang-check vim integration script

Summary: New clang-check vim integration with the 're-run the last invocation when executed from .h file' feature.

Reviewers: klimek

Reviewed By: klimek

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D35

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

12 years agoDo not add using directives to a function decl context when instantiating.
Abramo Bagnara [Wed, 5 Sep 2012 09:55:10 +0000 (09:55 +0000)]
Do not add using directives to a function decl context when instantiating.

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

12 years agoFixed lexical decl context of out of line class template instantiations.
Abramo Bagnara [Wed, 5 Sep 2012 09:05:18 +0000 (09:05 +0000)]
Fixed lexical decl context of out of line class template instantiations.

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

12 years agoChanging of type checking order on InitListExpr
Jin-Gu Kang [Wed, 5 Sep 2012 08:37:43 +0000 (08:37 +0000)]
Changing of type checking order on InitListExpr
- UnionType is checked eariler than RecordType.

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

12 years agoUpdate for r163187.
Chad Rosier [Wed, 5 Sep 2012 01:16:06 +0000 (01:16 +0000)]
Update for r163187.

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

12 years ago[ms-inline asm] Update test case for r163181.
Chad Rosier [Wed, 5 Sep 2012 00:08:54 +0000 (00:08 +0000)]
[ms-inline asm] Update test case for r163181.

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

12 years ago[ms-inline asm] Set the inline assembly dialect in CodeGen.
Chad Rosier [Tue, 4 Sep 2012 23:08:24 +0000 (23:08 +0000)]
[ms-inline asm] Set the inline assembly dialect in CodeGen.

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

12 years agoFix indentation.
Ted Kremenek [Tue, 4 Sep 2012 22:48:59 +0000 (22:48 +0000)]
Fix indentation.

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

12 years ago[ms-inline asm] Remove the Inline Asm Non-Standard Dialect attribute. This
Chad Rosier [Tue, 4 Sep 2012 22:23:54 +0000 (22:23 +0000)]
[ms-inline asm] Remove the Inline Asm Non-Standard Dialect attribute.  This
implementation does not co-exist well with how the sideeffect and alignstack
attributes are handled.

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

12 years agoMinor cleanup to improve code readability. No functional change intended.
Chad Rosier [Tue, 4 Sep 2012 19:50:17 +0000 (19:50 +0000)]
Minor cleanup to improve code readability.  No functional change intended.

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

12 years ago[analyzer] Don't use makeIntVal to create a floating-point value.
Jordan Rose [Tue, 4 Sep 2012 19:34:58 +0000 (19:34 +0000)]
[analyzer] Don't use makeIntVal to create a floating-point value.

SimpleSValBuilder processes a couple trivial identities, including 'x - x'
and 'x ^ x' (both 0). However, the former could appear with arguments of
floating-point type, and we weren't checking for that. This started
triggering an assert with r163069, which checks that a constant value is
actually going to be used as an integer or pointer.

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

12 years agoRevert r163083 per chandlerc's request.
Joao Matos [Tue, 4 Sep 2012 17:49:35 +0000 (17:49 +0000)]
Revert r163083 per chandlerc's request.

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

12 years agoRevert r163099 per chandlerc's request.
Joao Matos [Tue, 4 Sep 2012 17:33:09 +0000 (17:33 +0000)]
Revert r163099 per chandlerc's request.

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

12 years agoRevert r163076 per chandlerc's request.
Joao Matos [Tue, 4 Sep 2012 17:29:52 +0000 (17:29 +0000)]
Revert r163076 per chandlerc's request.

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

12 years agoRevert r163078 per chandlerc's request.
Joao Matos [Tue, 4 Sep 2012 17:18:12 +0000 (17:18 +0000)]
Revert r163078 per chandlerc's request.

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

12 years ago[ms-inline asm] The MCInstrDesc only tracks register definitions. For now,
Chad Rosier [Tue, 4 Sep 2012 16:39:38 +0000 (16:39 +0000)]
[ms-inline asm] The MCInstrDesc only tracks register definitions.  For now,
assume that if the 1st operands is an expression and the instruction mayStore,
then it is a memory definition.

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

12 years ago[ms-inline asm] Fix an illegal index and an 80-column violation.
Chad Rosier [Tue, 4 Sep 2012 16:36:26 +0000 (16:36 +0000)]
[ms-inline asm] Fix an illegal index and an 80-column violation.

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

12 years agoFix 80-column violation.
Chad Rosier [Tue, 4 Sep 2012 15:58:44 +0000 (15:58 +0000)]
Fix 80-column violation.

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

12 years ago[ms-inline asm] Use the new GetMCInstOperandNum() interface in the front-end.
Chad Rosier [Mon, 3 Sep 2012 20:40:52 +0000 (20:40 +0000)]
[ms-inline asm] Use the new GetMCInstOperandNum() interface in the front-end.

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

12 years ago[cindex.py] Allow to configure the path of libclang
Tobias Grosser [Mon, 3 Sep 2012 18:32:30 +0000 (18:32 +0000)]
[cindex.py] Allow to configure the path of libclang

By calling cindex.Config.set_library_path(path) or
cindex.Config.set_library_file(file) it is possible to specify from where
we load libclang. This fixes an open FIXME.

We also point the user to these functions, in case libclang can not be
loaded sucessfully.

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

12 years agotest/Driver/android-standalone.cpp: Fix test failure on Windowns, again.
NAKAMURA Takumi [Mon, 3 Sep 2012 11:49:36 +0000 (11:49 +0000)]
test/Driver/android-standalone.cpp: Fix test failure on Windowns, again.

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

12 years agoImproved the warning for the #@ Microsoft charizing operator. The existing one misspe...
Joao Matos [Mon, 3 Sep 2012 10:41:45 +0000 (10:41 +0000)]
Improved the warning for the #@ Microsoft charizing operator. The existing one misspelled the token as "@#" and didn't capitalize Microsoft.

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

12 years agoFix test failure on Windowns.
Evgeniy Stepanov [Mon, 3 Sep 2012 10:24:57 +0000 (10:24 +0000)]
Fix test failure on Windowns.

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

12 years agoFollow-up on r163110 - forgot to commit some new tests...
Timur Iskhodzhanov [Mon, 3 Sep 2012 09:20:57 +0000 (09:20 +0000)]
Follow-up on r163110 - forgot to commit some new tests...

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

12 years agoFix PR13444 - wrong mangling of "const char * const *" and friends with "-cxx-abi...
Timur Iskhodzhanov [Mon, 3 Sep 2012 09:08:10 +0000 (09:08 +0000)]
Fix PR13444 - wrong mangling of "const char * const *" and friends with "-cxx-abi microsoft"

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

12 years agoAndroid standalone toolchain support.
Evgeniy Stepanov [Mon, 3 Sep 2012 09:05:50 +0000 (09:05 +0000)]
Android standalone toolchain support.

This change adds detection of C++ headers and libraries paths when
building with the standalone toolchain from Android NDK. They are in a
slightly unusual place.

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

12 years agoRemoved unused argument.
Chad Rosier [Mon, 3 Sep 2012 03:16:15 +0000 (03:16 +0000)]
Removed unused argument.

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

12 years ago[ms-inline asm] Update for the MatchInstruction API change in r163101.
Chad Rosier [Mon, 3 Sep 2012 02:30:13 +0000 (02:30 +0000)]
[ms-inline asm] Update for the MatchInstruction API change in r163101.

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

12 years agoAdded a new cursor for SEHLeaveStmt to libclang.
Joao Matos [Mon, 3 Sep 2012 00:23:40 +0000 (00:23 +0000)]
Added a new cursor for SEHLeaveStmt to libclang.

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

12 years agoRename ANDROIDEABI to Android.
Logan Chien [Sun, 2 Sep 2012 09:30:11 +0000 (09:30 +0000)]
Rename ANDROIDEABI to Android.

Most of the code guarded with ANDROIDEABI are not
ARM-specific, and having no relation with arm-eabi.
Thus, it will be more natural to call this
environment "Android" instead of "ANDROIDEABI".

Note: We are not using ANDROID because several projects
are using "-DANDROID" as the conditional compilation
flag.

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

12 years agoDocumentation cleanup: Add \file comment for ASTContest.h, add \brief to many
James Dennett [Sun, 2 Sep 2012 08:14:22 +0000 (08:14 +0000)]
Documentation cleanup: Add \file comment for ASTContest.h, add \brief to many
items, remove redundant names from doc comments, fix various typos, and tidy
up some wording.

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

12 years agoImplemented parsing and AST support for the MS __leave exception statement. Also...
Joao Matos [Sun, 2 Sep 2012 03:45:41 +0000 (03:45 +0000)]
Implemented parsing and AST support for the MS __leave exception statement. Also a minor fix to __except printing in StmtPrinter.cpp. Thanks to Aaron Ballman for review.

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

12 years agoInclude the diagnostic introduced in r163078 in a group.
Joao Matos [Sun, 2 Sep 2012 00:48:08 +0000 (00:48 +0000)]
Include the diagnostic introduced in r163078 in a group.

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

12 years agoAdded a diagnostic for mismatched MS inheritance attributes. Also fixed the incomplet...
Joao Matos [Sun, 2 Sep 2012 00:13:48 +0000 (00:13 +0000)]
Added a diagnostic for mismatched MS inheritance attributes. Also fixed the incomplete type member pointer size calculation under the MS ABI.

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

12 years agoFixed typo causing tests to fail on non-MSVC machines.
Joao Matos [Sat, 1 Sep 2012 23:24:10 +0000 (23:24 +0000)]
Fixed typo causing tests to fail on non-MSVC machines.

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

12 years agoRefactored the Windows headers location lookup code. Expose it so standalone tools...
Joao Matos [Sat, 1 Sep 2012 22:33:43 +0000 (22:33 +0000)]
Refactored the Windows headers location lookup code. Expose it so standalone tools can have access to it.

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

12 years ago[analyzer] Silence unused variable warnings in NDEBUG builds.
Jordan Rose [Sat, 1 Sep 2012 19:15:13 +0000 (19:15 +0000)]
[analyzer] Silence unused variable warnings in NDEBUG builds.

No functionality change.

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

12 years ago[libclang] Fix indexing type alias declarations. rdar://11878406
Argyrios Kyrtzidis [Sat, 1 Sep 2012 19:08:08 +0000 (19:08 +0000)]
[libclang] Fix indexing type alias declarations. rdar://11878406

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

12 years ago[libclang] The annotation of tokens operation visits statement nodes code-recursively.
Argyrios Kyrtzidis [Sat, 1 Sep 2012 18:27:30 +0000 (18:27 +0000)]
[libclang] The annotation of tokens operation visits statement nodes code-recursively.
This can blow the stack with extremely deep hierarchies. Switch it to data-recursive.

This is implemented by introducing a post-children visitation callback that the
CursorVisitor is calling after child nodes of a cursor have been visited.
This is used by the annotate-tokens visitor to do extra work at that point.

rdar://11979525.

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

12 years ago[analyzer] Disallow creation of int vals with explicit bit width / signedness.
Jordan Rose [Sat, 1 Sep 2012 17:39:24 +0000 (17:39 +0000)]
[analyzer] Disallow creation of int vals with explicit bit width / signedness.

All clients of BasicValueFactory should be using QualTypes instead, and
indeed it seems they are. This caught the (fortunately harmless) bug
fixed in the previous commit.

No intended functionality change.

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

12 years ago[analyzer] Don't attempt to create a floating-point value of "1" for ++/--.
Jordan Rose [Sat, 1 Sep 2012 17:39:17 +0000 (17:39 +0000)]
[analyzer] Don't attempt to create a floating-point value of "1" for ++/--.

The current logic would actually create a float- or double-sized signed
integer value of 1, which is not at all the same.

No test because the value would be swallowed by an Unknown as soon as it
gets added or subtracted to the original value, but it enables the cleanup
in the next patch.

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

12 years ago[analyzer] Future-proofing r163012 (nameless functions and RetainCountChecker)
Jordan Rose [Sat, 1 Sep 2012 17:39:13 +0000 (17:39 +0000)]
[analyzer] Future-proofing r163012 (nameless functions and RetainCountChecker)

Any future exceptions need to go INSIDE the test that checks if the
IdentifierInfo is non-null!

No functionality change. Thanks for the review, Ted.

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

12 years ago[analyzer] Treat all struct values as regions (even rvalues).
Jordan Rose [Sat, 1 Sep 2012 17:39:09 +0000 (17:39 +0000)]
[analyzer] Treat all struct values as regions (even rvalues).

This allows us to correctly symbolicate the fields of structs returned by
value, as well as get the proper 'this' value for when methods are called
on structs returned by value.

This does require a moderately ugly hack in the StoreManager: if we assign
a "struct value" to a struct region, that now appears as a Loc value being
bound to a region of struct type. We handle this by simply "dereferencing"
the struct value region, which should create a LazyCompoundVal.

This should fix recent crashes analyzing LLVM and on our internal buildbot.

<rdar://problem/12137950>

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

12 years ago[analyzer] Always derive a CallEvent's return type from its origin expr.
Jordan Rose [Sat, 1 Sep 2012 17:39:00 +0000 (17:39 +0000)]
[analyzer] Always derive a CallEvent's return type from its origin expr.

Previously, we preferred to get a result type by looking at the callee's
declared result type. This allowed us to handlereferences, which are
represented in the AST as lvalues of their pointee type. (That is, a call
to a function returning 'int &' has type 'int' and value kind 'lvalue'.)

However, this results in us preferring the original type of a function
over a casted type. This is a problem when a function  pointer is casted
to another type, because the conjured result value will have the wrong
type. AdjustedReturnValueChecker is supposed to handle this, but still
doesn't handle the case where there is no "original function" at all,
i.e. where the callee is unknown.

Now, we instead look at the call expression's value kind (lvalue, xvalue,
or prvalue), and adjust the expr's type accordingly. This will have no
effect when the function is inlined, and will conjure the value that will
actually be used when it is not.

This makes AdjustedReturnValueChecker /nearly/ unnecessary; unfortunately,
the cases where it would still be useful are where we need to cast the
result of an inlined function or a checker-evaluated function, and in these
cases we don't know what we're casting /from/ by the time we can do post-
call checks. In light of that, remove AdjustedReturnValueChecker, which
was already not checking quite a few calls.

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

12 years ago[cindex.py] Add helper to initialize libclang functions
Tobias Grosser [Sat, 1 Sep 2012 08:55:17 +0000 (08:55 +0000)]
[cindex.py] Add helper to initialize libclang functions

The helper allows us to define how the initialization of functions should
behave. We use this patch to provide an informative error message, in case a
function is not available:

"LibclangError: /home/grosser/Projekte/llvm/install/lib/libclang.so: undefined
symbol: clang_method_added_in_2020. Please ensure that your python bindings are
compatible with your libclang.so version."

This patch also ensures that no spelling mistakes slip into the library
initialization. At the moment, there are a couple of 'argtype' -> 'argtypes'
mispellings that have been overlooked.

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

12 years agoComment that clang.dll is unavailable on cygming yet.
Ted Kremenek [Sat, 1 Sep 2012 07:38:58 +0000 (07:38 +0000)]
Comment that clang.dll is unavailable on cygming yet.

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

12 years agoc-arcmt-test/Makefile: Restore some stuff. clang.dll is unavailable on cygming yet.
NAKAMURA Takumi [Sat, 1 Sep 2012 06:38:53 +0000 (06:38 +0000)]
c-arcmt-test/Makefile: Restore some stuff. clang.dll is unavailable on cygming yet.

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

12 years agoTweak link order to hopefully resolve a buildbot failure.
Ted Kremenek [Sat, 1 Sep 2012 06:20:25 +0000 (06:20 +0000)]
Tweak link order to hopefully resolve a buildbot failure.

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

12 years agoSplit library clangRewrite into clangRewriteCore and clangRewriteFrontend.
Ted Kremenek [Sat, 1 Sep 2012 05:09:24 +0000 (05:09 +0000)]
Split library clangRewrite into clangRewriteCore and clangRewriteFrontend.
This is similar to how we divide up the StaticAnalyzer libraries to separate
core functionality to what is clearly associated with Frontend actions.

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

12 years agoChanged the remaining dead asserts to llvm_unreachable.
Joao Matos [Sat, 1 Sep 2012 00:13:24 +0000 (00:13 +0000)]
Changed the remaining dead asserts to llvm_unreachable.

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

12 years agodon't warn about unused values when the unused value is a statement expression expand...
Chris Lattner [Fri, 31 Aug 2012 22:39:21 +0000 (22:39 +0000)]
don't warn about unused values when the unused value is a statement expression expanded from a macro.  This is of dubious utility in general, but is specifically a major issue for the linux kernel.  This resolves PR13747.

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

12 years agoNormalize line endings of r163013 (part 2).
Joao Matos [Fri, 31 Aug 2012 22:18:20 +0000 (22:18 +0000)]
Normalize line endings of r163013 (part 2).

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

12 years agoRemove windows line endings.
Benjamin Kramer [Fri, 31 Aug 2012 22:14:25 +0000 (22:14 +0000)]
Remove windows line endings.

While there fix a dead assert.

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

12 years agoThread-safety analysis: fix handling of LOCK_RETURNED attribute so that the
DeLesley Hutchins [Fri, 31 Aug 2012 22:09:53 +0000 (22:09 +0000)]
Thread-safety analysis: fix handling of LOCK_RETURNED attribute so that the
latest definition of a function is always used when computing lock expressions.

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

12 years agoUpdate a warning to point to the DiagGroup created in DiagnosticGroups.td
Richard Trieu [Fri, 31 Aug 2012 22:03:03 +0000 (22:03 +0000)]
Update a warning to point to the DiagGroup created in DiagnosticGroups.td
instead of referring to the flag name.

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

12 years agoThread-safety analysis: fix handling of string constants in mutex
DeLesley Hutchins [Fri, 31 Aug 2012 21:57:32 +0000 (21:57 +0000)]
Thread-safety analysis: fix handling of string constants in mutex
expressions, which should be ignored right now.

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

12 years agoFix the build (-Wswitch violation introduced by r163013).
David Blaikie [Fri, 31 Aug 2012 21:55:26 +0000 (21:55 +0000)]
Fix the build (-Wswitch violation introduced by r163013).

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

12 years agoNormalize line endings of r163013.
Joao Matos [Fri, 31 Aug 2012 21:41:22 +0000 (21:41 +0000)]
Normalize line endings of r163013.

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

12 years agoNormalize line endings of r163022.
Joao Matos [Fri, 31 Aug 2012 21:34:27 +0000 (21:34 +0000)]
Normalize line endings of r163022.

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

12 years agoEmulate MSVC's preprocessor macro argument separator behavior by not considering...
Joao Matos [Fri, 31 Aug 2012 21:10:54 +0000 (21:10 +0000)]
Emulate MSVC's preprocessor macro argument separator behavior by not considering commas from nested macro expansions as argument separators. Fixes parsing of VS 2012 headers.

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

12 years agoobjective-C ARC; detect and warn on retain cycle when
Fariborz Jahanian [Fri, 31 Aug 2012 20:04:47 +0000 (20:04 +0000)]
objective-C ARC; detect and warn on retain cycle when
property-dot syntax is used on an object whose
capture causes retain cycle. // rdar://11702054

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

12 years agoImproved MSVC __interface support by adding first class support for it, instead of...
Joao Matos [Fri, 31 Aug 2012 18:45:21 +0000 (18:45 +0000)]
Improved MSVC __interface support by adding first class support for it, instead of aliasing to "struct" which had some incorrect behaviour. Patch by David Robins.

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

12 years ago[analyzer] RetainCountChecker: don't assume all functions have names.
Jordan Rose [Fri, 31 Aug 2012 18:19:18 +0000 (18:19 +0000)]
[analyzer] RetainCountChecker: don't assume all functions have names.

Fixes a hard-to-reach crash when calling a non-member overloaded operator
with arguments that may be callbacks.

Future-proofing: don't make the same assumption in MallocSizeofChecker.
Aside from possibly respecting attributes in the future, it might be
possible to call 'malloc' through a function pointer.

I audited all other uses of FunctionDecl::getIdentifier() in the analyzer;
they all now correctly test to see if the identifier is present before
using it.

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

12 years agoFixed invalid iterators. Since the iterator is invalidated after the erase() call...
Joao Matos [Fri, 31 Aug 2012 17:28:09 +0000 (17:28 +0000)]
Fixed invalid iterators. Since the iterator is invalidated after the erase() call, we need to replace it with the new one returned. This was triggering an assert under MSVC 2012 and making all the ARCMT/ tests fail.

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

12 years ago[analyzer] Though C++ inlining is enabled, don't inline ctors and dtors.
Jordan Rose [Fri, 31 Aug 2012 17:06:49 +0000 (17:06 +0000)]
[analyzer] Though C++ inlining is enabled, don't inline ctors and dtors.

More generally, this adds a new configuration option 'c++-inlining', which
controls which C++ member functions can be considered for inlining. This
uses the new -analyzer-config table, so the cc1 arguments will look like this:

... -analyzer-config c++-inlining=[none|methods|constructors|destructors]

Note that each mode implies that all the previous member function kinds
will be inlined as well; it doesn't make sense to inline destructors
without inlining constructors, for example.

The default mode is 'methods'.

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

12 years agoobjective-C: underline name of the missing method
Fariborz Jahanian [Fri, 31 Aug 2012 17:03:18 +0000 (17:03 +0000)]
objective-C: underline name of the missing method
in the diagnbostic. // rdar://11303469

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

12 years agoRemove the useless CommentOptions class.
Dmitri Gribenko [Fri, 31 Aug 2012 10:35:30 +0000 (10:35 +0000)]
Remove the useless CommentOptions class.

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

12 years agoUse LLVM_DELETED_FUNCTION instead of a comment.
Dmitri Gribenko [Fri, 31 Aug 2012 10:23:13 +0000 (10:23 +0000)]
Use LLVM_DELETED_FUNCTION instead of a comment.

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

12 years agoMake AnalyzerOptions a shared object between CompilerInvocation and
Ted Kremenek [Fri, 31 Aug 2012 04:36:05 +0000 (04:36 +0000)]
Make AnalyzerOptions a shared object between CompilerInvocation and
AnalysisManager, allowing the StringMap of configuration values to
be propagated.

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