]> granicus.if.org Git - clang/log
clang
12 years agoFix undefined behavior: don't bind a dereferenced null pointer to a reference.
Richard Smith [Tue, 14 Aug 2012 04:19:29 +0000 (04:19 +0000)]
Fix undefined behavior: don't bind a dereferenced null pointer to a reference.
No functionality change.

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

12 years agoPlacate the mingw32 buildbot by suffixing 64-bit constants with ULL.
Richard Smith [Tue, 14 Aug 2012 03:55:16 +0000 (03:55 +0000)]
Placate the mingw32 buildbot by suffixing 64-bit constants with ULL.

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

12 years agoFix undefined behavior in code completion, caught by
Richard Smith [Tue, 14 Aug 2012 03:13:00 +0000 (03:13 +0000)]
Fix undefined behavior in code completion, caught by
-fcatch-undefined-behavior. Don't try to fit 34 different flags
into 32 bits. Also, don't use 32-bit signed left shifts for this.

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

12 years agoMake __is_convertible_to handle abstract types correctly. PR13591.
Eli Friedman [Tue, 14 Aug 2012 02:06:07 +0000 (02:06 +0000)]
Make __is_convertible_to handle abstract types correctly.  PR13591.

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

12 years agoFix undefined behavior (and wrong code, as far as I can tell) in NEON builtin
Richard Smith [Tue, 14 Aug 2012 01:28:02 +0000 (01:28 +0000)]
Fix undefined behavior (and wrong code, as far as I can tell) in NEON builtin
tablegen code, found by -fcatch-undefined-behavior. I would appreciate if
someone more familiar with the NEON code could point me in the direction of how
to write a test for this. We appear to have essentially no test coverage
whatsoever for these builtins.

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

12 years agoClean up the basic instructions for getting started with clang to always
Chandler Carruth [Tue, 14 Aug 2012 00:41:30 +0000 (00:41 +0000)]
Clean up the basic instructions for getting started with clang to always
return to the same directory.

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

12 years ago[analyzer] Teach live variable analyzes that super uses self pointer.
Anna Zaks [Tue, 14 Aug 2012 00:36:20 +0000 (00:36 +0000)]
[analyzer] Teach live variable analyzes that super uses self pointer.

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

12 years ago[analyzer] Disable autorelease pool tracking.
Anna Zaks [Tue, 14 Aug 2012 00:36:17 +0000 (00:36 +0000)]
[analyzer] Disable autorelease pool tracking.

The autorelease pool has not been implemented completely: we were adding
the autoreleased symbols to the state, but never looking at them. Until
we have a complete implementation, remove the overhead and comment out
the unused code.

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

12 years ago[analyzer] Refactor RetainReleaseChecker to go through a function call
Anna Zaks [Tue, 14 Aug 2012 00:36:15 +0000 (00:36 +0000)]
[analyzer] Refactor RetainReleaseChecker to go through a function call
to set/get/remove the RefBinding.

No functional change here. Having these setter and getter methods will
make it much easier when replacing the underlining representation of
RefBindings (I just went through the exercise). It makes the code more
readable as well.

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

12 years ago[analyzer] Add getStackFrame() to CheckerContext and ExplodedNode.
Anna Zaks [Tue, 14 Aug 2012 00:36:12 +0000 (00:36 +0000)]
[analyzer] Add getStackFrame() to CheckerContext and ExplodedNode.

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

12 years ago[analyzer] Look up DynamicTypeInfo by region instead of symbol.
Jordan Rose [Mon, 13 Aug 2012 23:59:07 +0000 (23:59 +0000)]
[analyzer] Look up DynamicTypeInfo by region instead of symbol.

This allows us to store type info for non-symbolic regions.

No functionality change.

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

12 years ago[analyzer] Reduce code duplication: make CXXDestructorCall a CXXInstanceCall.
Jordan Rose [Mon, 13 Aug 2012 23:46:05 +0000 (23:46 +0000)]
[analyzer] Reduce code duplication: make CXXDestructorCall a CXXInstanceCall.

While there is now some duplication between SimpleCall and the CXXInstanceCall
sub-hierarchy, this is much better than copy-and-pasting the devirtualization
logic shared by both instance methods and destructors.

An unfortunate side effect is that there is no longer a single CallEvent type
that corresponds to "calls written as CallExprs". For the most part this is a
good thing, but the checker callback eval::Call still takes a CallExpr rather
than a CallEvent (since we're not sure if we want to allow checkers to
evaluate other kinds of calls). A mistake here will be caught by a cast<> in
CheckerManager::runCheckersForEvalCall.

No functionality change.

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

12 years ago[analyzer] Be more careful when downcasting for devirtualization.
Jordan Rose [Mon, 13 Aug 2012 23:46:01 +0000 (23:46 +0000)]
[analyzer] Be more careful when downcasting for devirtualization.

Virtual base regions are never layered, so simply stripping them off won't
necessarily get you to the correct casted class. Instead, what we want is
the same logic for evaluating dynamic_cast: strip off base regions if possible,
but add new base regions if necessary.

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

12 years ago[analyzer] Handle dynamic_casts that turn out to be upcasts.
Jordan Rose [Mon, 13 Aug 2012 22:11:42 +0000 (22:11 +0000)]
[analyzer] Handle dynamic_casts that turn out to be upcasts.

This can occur with multiple inheritance, which jumps from one parent to
the other, and with virtual inheritance, since virtual base regions always
wrap the actual object and can't be nested within other base regions.

This also exposed some incorrect logic for multiple inheritance: even if B
is known not to derive from C, D might still derive from both of them.

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

12 years ago[analyzer] Don't strip CXXBaseObjectRegions when checking dynamic_casts.
Jordan Rose [Mon, 13 Aug 2012 22:11:34 +0000 (22:11 +0000)]
[analyzer] Don't strip CXXBaseObjectRegions when checking dynamic_casts.

...and /do/ strip CXXBaseObjectRegions when casting to a virtual base class.

This allows us to enforce the invariant that a CXXBaseObjectRegion can always
provide an offset for its base region if its base region has a known class
type, by only allowing virtual bases and direct non-virtual bases to form
CXXBaseObjectRegions.

This does mean some slight problems for our modeling of dynamic_cast, which
needs to be resolved by finding a path from the current region to the class
we're trying to cast to.

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

12 years ago[ms-inline asm] Add a helpful assert.
Chad Rosier [Mon, 13 Aug 2012 22:04:09 +0000 (22:04 +0000)]
[ms-inline asm] Add a helpful assert.

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

12 years ago[ms-inline asm] Address a potential buffer overflow.
Chad Rosier [Mon, 13 Aug 2012 21:35:47 +0000 (21:35 +0000)]
[ms-inline asm] Address a potential buffer overflow.

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

12 years agoPR13570: When an unresolved overloaded call appeared in a dependent context, we
Richard Smith [Mon, 13 Aug 2012 21:29:18 +0000 (21:29 +0000)]
PR13570: When an unresolved overloaded call appeared in a dependent context, we
forgot to set it as being instantiation-dependent as well as being type- and
value-dependent.

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

12 years agoARM: enable struct byval for AAPCS-VFP.
Manman Ren [Mon, 13 Aug 2012 21:23:55 +0000 (21:23 +0000)]
ARM: enable struct byval for AAPCS-VFP.

rdar://9877866

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

12 years agoc: small refactoring of checking for __attribute__(const))
Fariborz Jahanian [Mon, 13 Aug 2012 21:15:02 +0000 (21:15 +0000)]
c: small refactoring of checking for __attribute__(const))
per Richard's comment.

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

12 years ago[ms-inline asm] Have patchMSAsmStrings() return a vector or AsmStrings.
Chad Rosier [Mon, 13 Aug 2012 20:32:07 +0000 (20:32 +0000)]
[ms-inline asm] Have patchMSAsmStrings() return a vector or AsmStrings.

The AsmParser expects a single asm instruction, but valid ms-style inline asm
statements may contain  multiple instructions.

This happens with asm blocks

__asm {
  mov ebx, eax
  mov ecx, ebx
}

or when multiple asm statements are adjacent to one another

__asm mov ebx, eax
__asm mov ecx, ebx

and

__asm mov ebx, eax __asm mov ecx, ebx

Currently, asm blocks are not properly handled.

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

12 years agoFactor out computation of whether a typeid's expression is potentially
Richard Smith [Mon, 13 Aug 2012 20:08:14 +0000 (20:08 +0000)]
Factor out computation of whether a typeid's expression is potentially
evaluated into a CXXTypeid member function. No functionality change.

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

12 years agoMinor rework of code example for clarity. No functionality change
Marshall Clow [Mon, 13 Aug 2012 18:56:38 +0000 (18:56 +0000)]
Minor rework of code example for clarity. No functionality change

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

12 years agoc: make __has_attribute(const) work for const
Fariborz Jahanian [Mon, 13 Aug 2012 18:04:58 +0000 (18:04 +0000)]
c: make __has_attribute(const) work for const
function attribute. // rdar://10253857

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

12 years agoIgnore the tools/extra directory.
David Blaikie [Mon, 13 Aug 2012 17:51:45 +0000 (17:51 +0000)]
Ignore the tools/extra directory.

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

12 years agoTeach Git to ignore the tools/extra directory.
David Blaikie [Mon, 13 Aug 2012 17:45:30 +0000 (17:45 +0000)]
Teach Git to ignore the tools/extra directory.

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

12 years agoWhen looking for the comment associated with a declaration, adjust the
Douglas Gregor [Mon, 13 Aug 2012 16:37:30 +0000 (16:37 +0000)]
When looking for the comment associated with a declaration, adjust the
'templated' declaration for a function or class template to refer to
the function or class template itself, to which the documentation will
be attached. Fixes PR13593.

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

12 years agoWhen the header file search resolves a quoted include to a file in the
Douglas Gregor [Mon, 13 Aug 2012 15:47:39 +0000 (15:47 +0000)]
When the header file search resolves a quoted include to a file in the
current directory, propagate the framework and in-index-header-map
from the including header's information down to the included header's
information. Fixes <rdar://problem/11261291>.

As with everything header-map related, we can't really test this in
isolation within Clang, so it's tested elsewhere.

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

12 years agoImplemented -ast-dump, -ast-print, -ast-dump-filter options in clang-check
Alexander Kornienko [Mon, 13 Aug 2012 10:50:08 +0000 (10:50 +0000)]
Implemented -ast-dump, -ast-print, -ast-dump-filter options in clang-check

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

12 years agoAdded some preprocessor memory usage stats to -cc1 -print-stats
Alexander Kornienko [Mon, 13 Aug 2012 10:46:42 +0000 (10:46 +0000)]
Added some preprocessor memory usage stats to -cc1 -print-stats

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

12 years agoThis is always going to be true so the cast isn't necessary.
Eric Christopher [Mon, 13 Aug 2012 02:07:42 +0000 (02:07 +0000)]
This is always going to be true so the cast isn't necessary.

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

12 years agoAttaching comments to declarations: find comment attached to any redeclaration
Dmitri Gribenko [Sat, 11 Aug 2012 00:51:43 +0000 (00:51 +0000)]
Attaching comments to declarations: find comment attached to any redeclaration

Not only look for the comment near the declaration itself, but also walk the
redeclaration chain: the previous declaration might have had a documentation
comment.

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

12 years ago[analyzer] Remove unused StoreManager::CastResult class.
Jordan Rose [Fri, 10 Aug 2012 22:43:32 +0000 (22:43 +0000)]
[analyzer] Remove unused StoreManager::CastResult class.

No functionality change.

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

12 years agoRemoved an unused function I added a while back.
Fariborz Jahanian [Fri, 10 Aug 2012 22:28:13 +0000 (22:28 +0000)]
Removed an unused function I added a while back.

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

12 years ago[analyzer] Strip CXXBaseObjectRegions when devirtualizing method calls.
Jordan Rose [Fri, 10 Aug 2012 22:26:46 +0000 (22:26 +0000)]
[analyzer] Strip CXXBaseObjectRegions when devirtualizing method calls.

This was causing a crash when we tried to re-apply a base object region to
itself. It probably also caused incorrect offset calculations in RegionStore.

PR13569 / <rdar://problem/12076683>

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

12 years ago[analyzer] Try to devirtualize even if the static callee has no definition.
Jordan Rose [Fri, 10 Aug 2012 22:26:43 +0000 (22:26 +0000)]
[analyzer] Try to devirtualize even if the static callee has no definition.

This mostly affects pure virtual methods, but would also affect parent
methods defined inline in the header when analyzing the child's source file.

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

12 years ago[analyzer] Add clang_analyzer_checkInlined for debugging purposes.
Jordan Rose [Fri, 10 Aug 2012 22:26:29 +0000 (22:26 +0000)]
[analyzer] Add clang_analyzer_checkInlined for debugging purposes.

This check is also accessible through the debug.ExprInspection checker.
Like clang_analyzer_eval, you can use it to test the analyzer engine's
current state; the argument should be true or false to indicate whether or
not you expect the function to be inlined.

When used in the positive case (clang_analyzer_checkInlined(true)), the
analyzer prints the message "TRUE" if the function is ever inlined. However,
clang_analyzer_checkInlined(false) should never print a message; this asserts
that there should be no paths on which the current function is inlined, but
then there are no paths on which to print a message! (If the assertion is
violated, the message "FALSE" will be printed.)

This asymmetry comes from the fact that the only other chance to print a
message is when the function is analyzed as a top-level function. However,
when we do that, we can't be sure it isn't also inlined elsewhere (such as
in a recursive function, or if we want to analyze in both general or
specialized cases). Rather than have all checkInlined calls have an appended,
meaningless "FALSE" or "TOP-LEVEL" case, there is just no message printed.

void clang_analyzer_checkInlined(int);

For debugging purposes only!

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

12 years agoobjective-C: test for delayed parsing of K&R funcitons
Fariborz Jahanian [Fri, 10 Aug 2012 22:01:36 +0000 (22:01 +0000)]
objective-C: test for delayed parsing of K&R funcitons
inside objc class implementation. // rdar://10387088

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

12 years ago[ms-inline asm] Avoid extra allocations by making this an array of StringRefs.
Chad Rosier [Fri, 10 Aug 2012 21:36:25 +0000 (21:36 +0000)]
[ms-inline asm] Avoid extra allocations by making this an array of StringRefs.

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

12 years agoAdd comments for turning on byval
Manman Ren [Fri, 10 Aug 2012 21:32:09 +0000 (21:32 +0000)]
Add comments for turning on byval

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

12 years ago[ms-inline asm] PatchMSAsmString() doesn't correctly patch non-simple asm
Chad Rosier [Fri, 10 Aug 2012 21:27:11 +0000 (21:27 +0000)]
[ms-inline asm] PatchMSAsmString() doesn't correctly patch non-simple asm
statements.  Therefore, we can't pass the PatchedAsmString to the AsmParser
and expect things to work.

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

12 years agoDon't emit an invoke whose normal destination is a landingpad. Fixes test
Eli Friedman [Fri, 10 Aug 2012 21:26:17 +0000 (21:26 +0000)]
Don't emit an invoke whose normal destination is a landingpad.  Fixes test
regression on test/CodeGenObjC/2008-10-3-EhValue.m on non-Darwin targets.

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

12 years agoobjective-C++: dalyed parsing of ctors with member
Fariborz Jahanian [Fri, 10 Aug 2012 21:15:06 +0000 (21:15 +0000)]
objective-C++: dalyed parsing of ctors with member
initializer list defined inside an objc class
implementation. wip

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

12 years ago[ms-inline asm] Fix a memory leak introduced in r161686.
Chad Rosier [Fri, 10 Aug 2012 21:06:19 +0000 (21:06 +0000)]
[ms-inline asm] Fix a memory leak introduced in r161686.

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

12 years agoFix horrible regression in control of warnings caused by introduction of -Wpedantic.
Ted Kremenek [Fri, 10 Aug 2012 20:50:00 +0000 (20:50 +0000)]
Fix horrible regression in control of warnings caused by introduction of -Wpedantic.
While -Wpedantic was reasonable, -Wno-pedantic would turn off a bunch of warnings that
are on by default.  This counters the intention of this warning flag.

To fix this, -Wpedantic now includes extentions that are not on by default.  The
remaining warnings will manifest anyway, and won't accidentally get turned off
by -Wno-pedantic.

Fixes <rdar://problem/12076105>

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

12 years agoARM: enable struct byval for AAPCS.
Manman Ren [Fri, 10 Aug 2012 20:42:31 +0000 (20:42 +0000)]
ARM: enable struct byval for AAPCS.

rdar://9877866
PR://13350

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

12 years agoobjective-C++: delay parsing of ctor with try block
Fariborz Jahanian [Fri, 10 Aug 2012 20:34:17 +0000 (20:34 +0000)]
objective-C++: delay parsing of ctor with try block
with member initializer list defined inside
an objc implementation block. wip.

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

12 years agoThread-safety-analysis: adds existential quantification over lock
DeLesley Hutchins [Fri, 10 Aug 2012 20:29:46 +0000 (20:29 +0000)]
Thread-safety-analysis:  adds existential quantification over lock
expressions.  The syntax &MyClass::mutex is interpreted as a
pattern that matches m->mutex for any object m of type MyClass.

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

12 years agoThread safety analysis: refactor to support more sophisticated handling
DeLesley Hutchins [Fri, 10 Aug 2012 20:19:55 +0000 (20:19 +0000)]
Thread safety analysis: refactor to support more sophisticated handling
of expressions, and better error messages.

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

12 years ago[ms-inline asm] Add clobbers to AST representation.
Chad Rosier [Fri, 10 Aug 2012 19:13:14 +0000 (19:13 +0000)]
[ms-inline asm] Add clobbers to AST representation.

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

12 years agoFrontend: define _LP64 in a target-independent way
Dylan Noblesmith [Fri, 10 Aug 2012 19:12:37 +0000 (19:12 +0000)]
Frontend: define _LP64 in a target-independent way

Instead of adding it to each individual subclass in
Targets.cpp, simply check the appropriate target
values.

Where before it was only on x86_64 and ppc64, it's now
also defined on mips64 and nvptx64.

Also add a bunch of negative tests to ensure it is *not*
defined on any other architectures while we're here.

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

12 years ago[analyzer] ObjC Inlining: add tests for ivars and properties.
Anna Zaks [Fri, 10 Aug 2012 18:56:01 +0000 (18:56 +0000)]
[analyzer] ObjC Inlining: add tests for ivars and properties.

TODO:
 - Handle @syncronized properties.
 - Always inline properties declared publicly (do not split the path).
This is tricky since there is no mapping from a Decl to the property in
the AST as far as I can tell.

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

12 years ago[analyzer] Track if a region can be a subclass in the dynamic type info.
Anna Zaks [Fri, 10 Aug 2012 18:55:58 +0000 (18:55 +0000)]
[analyzer] Track if a region can be a subclass in the dynamic type info.

When object is allocated with alloc or init, we assume it cannot be a
subclass (currently used only for bifurcation purposes).

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

12 years ago[analyzer] Optimize dynamic dispatch bifurcation by detecting the cases
Anna Zaks [Fri, 10 Aug 2012 18:55:53 +0000 (18:55 +0000)]
[analyzer] Optimize dynamic dispatch bifurcation by detecting the cases
when we don't need to split.

In some cases we know that a method cannot have a different
implementation in a subclass:
 - the class is declared in the main file (private)
 - all the method declarations (including the ones coming from super
classes) are in the main file.

This can be improved further, but might be enough for the heuristic.
(When we are too aggressive splitting the state, efficiency suffers.
When we fail to split the state coverage might suffer.)

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

12 years agoRefactor thread safety analysis to use a different data structure
DeLesley Hutchins [Fri, 10 Aug 2012 18:39:05 +0000 (18:39 +0000)]
Refactor thread safety analysis to use a different data structure
to track locksets.  This is in preparation for further changes.

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

12 years ago[ms-inline asm] Use asserts as these calls are now guarded by identical checks.
Chad Rosier [Fri, 10 Aug 2012 18:20:12 +0000 (18:20 +0000)]
[ms-inline asm] Use asserts as these calls are now guarded by identical checks.

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

12 years agoobjective-C++: delayed parsing of member function with
Fariborz Jahanian [Fri, 10 Aug 2012 18:10:56 +0000 (18:10 +0000)]
objective-C++: delayed parsing of member function with
function-try-block occuring in objc's implementation
block. wip.

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

12 years agoWhitespace.
Chad Rosier [Fri, 10 Aug 2012 17:56:09 +0000 (17:56 +0000)]
Whitespace.

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

12 years agoobjective-C++: Delayed parsing of most common
Fariborz Jahanian [Fri, 10 Aug 2012 15:54:40 +0000 (15:54 +0000)]
objective-C++: Delayed parsing of most common
member functions defined inside an objc class
implementation. wip.

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

12 years agoAdd missing cctype includes.
Joerg Sonnenberger [Fri, 10 Aug 2012 10:58:18 +0000 (10:58 +0000)]
Add missing cctype includes.

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

12 years agoDecrementing std::string::end is not portable, use array access instead.
Joerg Sonnenberger [Fri, 10 Aug 2012 10:57:52 +0000 (10:57 +0000)]
Decrementing std::string::end is not portable, use array access instead.

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

12 years agoFix a couple of pedantic gcc warnings.
Benjamin Kramer [Fri, 10 Aug 2012 10:06:13 +0000 (10:06 +0000)]
Fix a couple of pedantic gcc warnings.

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

12 years agoc-arcmt-test, c-index-test: Appease Cygwin, to link to libclang.a, not clang.dll.
NAKAMURA Takumi [Fri, 10 Aug 2012 06:10:58 +0000 (06:10 +0000)]
c-arcmt-test, c-index-test: Appease Cygwin, to link to libclang.a, not clang.dll.

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

12 years agoCheck access to friend declarations. There's a number of different
John McCall [Fri, 10 Aug 2012 03:15:35 +0000 (03:15 +0000)]
Check access to friend declarations.  There's a number of different
things going on here that were problematic:
  - We were missing the actual access check, or rather, it was suppressed
    on account of being a redeclaration lookup.
  - The access check would naturally happen during delay, which isn't
    appropriate in this case.
  - We weren't actually emitting dependent diagnostics associated with
    class templates, which was unfortunate.
  - Access was being propagated incorrectly for friend method declarations
    that couldn't be matched at parse-time.

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

12 years agoUpdate VerifyDiagnosticConsumer to only get directives during parsing.
Jordan Rose [Fri, 10 Aug 2012 01:06:16 +0000 (01:06 +0000)]
Update VerifyDiagnosticConsumer to only get directives during parsing.

The old behavior was to re-scan any files (like modules) where we may have
directives but won't actually be parsing during the -verify invocation.
Now, we keep the old behavior in Debug builds as a sanity check (though
modules are a known entity), and expect all legitimate directives to come
from comments seen by the preprocessor.

This also affects the ARC migration tool, which captures diagnostics in
order to filter some out. This change adds an explicit cleanup to
CaptureDiagnosticsConsumer in order to let its sub-consumer handle the
real end of diagnostics.

This was originally split into four patches, but the tests do not run
cleanly without all four, so I've combined them into one commit.

Patches by Andy Gibbs, with slight modifications from me.

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

12 years agoMake sure to call EndSourceFile even if we can't continue compiling.
Jordan Rose [Fri, 10 Aug 2012 01:06:08 +0000 (01:06 +0000)]
Make sure to call EndSourceFile even if we can't continue compiling.

Patch by Andy Gibbs!

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

12 years agoProvide isConst/Volatile on CXXMethodDecl.
David Blaikie [Fri, 10 Aug 2012 00:55:35 +0000 (00:55 +0000)]
Provide isConst/Volatile on CXXMethodDecl.

This also provides isConst/Volatile/Restrict on FunctionTypes to coalesce
the implementation with other callers (& update those other callers).

Patch contributed by Sam Panzer (panzer@google.com).

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

12 years ago[ms-inline asm] Use the new Inline Asm Non-Standard Dialect attribute.
Chad Rosier [Fri, 10 Aug 2012 00:00:34 +0000 (00:00 +0000)]
[ms-inline asm] Use the new Inline Asm Non-Standard Dialect attribute.

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

12 years ago[analyzer] Merge RegionStore's KillStruct and CopyLazyBindings: BindAggregate.
Jordan Rose [Thu, 9 Aug 2012 22:55:54 +0000 (22:55 +0000)]
[analyzer] Merge RegionStore's KillStruct and CopyLazyBindings: BindAggregate.

Both methods need to clear out existing bindings and provide a new default
binding. Originally KillStruct always provided UnknownVal as the default,
but it's allowed symbolic values for quite some time (for handling returned
structs in C).

No functionality change.

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

12 years ago[analyzer] Cluster bindings in RegionStore by base region.
Jordan Rose [Thu, 9 Aug 2012 22:55:51 +0000 (22:55 +0000)]
[analyzer] Cluster bindings in RegionStore by base region.

This should speed up activities that need to access bindings by cluster,
such as invalidation and dead-bindings cleaning. In some cases all we save
is the cost of building the region cluster map, but other times we can
actually avoid traversing the rest of the store.

In casual testing, this produced a speedup of nearly 10% analyzing SQLite,
with /less/ memory used.

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

12 years ago[analyzer] Cache the "concrete offset base" for regions with symbolic offsets.
Jordan Rose [Thu, 9 Aug 2012 22:55:37 +0000 (22:55 +0000)]
[analyzer] Cache the "concrete offset base" for regions with symbolic offsets.

This makes it faster to access and invalidate bindings with symbolic offsets
by only computing this information once.

No intended functionality change.

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

12 years ago[analyzer] Devirtualize StoreManager::evalDerivedToBase(SVal, CastExpr)
Jordan Rose [Thu, 9 Aug 2012 22:48:16 +0000 (22:48 +0000)]
[analyzer] Devirtualize StoreManager::evalDerivedToBase(SVal, CastExpr)

This was triggering -Woverloaded-virtual, but there's really no reason for
the cast version to be virtual anyway. It just calls through to the QualType
entry point.

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

12 years agoFollowup to r161546, to unbreak linking on Bitrig. Patch by David Hill.
Eli Friedman [Thu, 9 Aug 2012 22:42:04 +0000 (22:42 +0000)]
Followup to r161546, to unbreak linking on Bitrig.  Patch by David Hill.

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

12 years agoCMake: Add the new dependency from libSema to LLVM's libs.
Benjamin Kramer [Thu, 9 Aug 2012 22:33:50 +0000 (22:33 +0000)]
CMake: Add the new dependency from libSema to LLVM's libs.

Should fix the failures seen on some linux builders.

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

12 years ago[ms-inline asm] Fix comment.
Chad Rosier [Thu, 9 Aug 2012 21:28:05 +0000 (21:28 +0000)]
[ms-inline asm] Fix comment.

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

12 years ago[analyzer] A CXXBaseObjectRegion should correspond to a DIRECT base.
Jordan Rose [Thu, 9 Aug 2012 21:24:02 +0000 (21:24 +0000)]
[analyzer] A CXXBaseObjectRegion should correspond to a DIRECT base.

An ASTContext's RecordLayoutInfo can only be used to look up offsets of
direct base classes, and we need the offset to make non-symbolic bindings
in RegionStore. This change makes sure that we have one layer of
CXXBaseObjectRegion for each base we are casting through.

This was causing crashes on an internal buildbot.

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

12 years agoobjective-C: refactoring of objc's delayed parsing.
Fariborz Jahanian [Thu, 9 Aug 2012 21:12:39 +0000 (21:12 +0000)]
objective-C: refactoring of objc's delayed parsing.

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

12 years ago[ms-inline asm] Use StringRef here, per Jordan's suggestion.
Chad Rosier [Thu, 9 Aug 2012 21:06:32 +0000 (21:06 +0000)]
[ms-inline asm] Use StringRef here, per Jordan's suggestion.

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

12 years agoTemporarily revert r161612 while we figure out just what the semantics
Chandler Carruth [Thu, 9 Aug 2012 21:02:52 +0000 (21:02 +0000)]
Temporarily revert r161612 while we figure out just what the semantics
of PARALLEL_DIRS are. They apparantly aren't what either Nick, Eric, or
I thought. ;] Should let the bots make forward progress.

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

12 years ago[analyzer] Rename the function to better reflect what it actually does.
Anna Zaks [Thu, 9 Aug 2012 21:02:45 +0000 (21:02 +0000)]
[analyzer] Rename the function to better reflect what it actually does.

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

12 years ago[analyzer] Clarify the values in Dyn. Dispatch Bifurcation map.
Anna Zaks [Thu, 9 Aug 2012 21:02:41 +0000 (21:02 +0000)]
[analyzer] Clarify the values in Dyn. Dispatch Bifurcation map.

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

12 years ago[ms-inline asm] Simplify logic for empty asm statements.
Chad Rosier [Thu, 9 Aug 2012 20:52:43 +0000 (20:52 +0000)]
[ms-inline asm] Simplify logic for empty asm statements.

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

12 years ago[ms-inline asm] Instantiate the various parts to the AsmParser.
Chad Rosier [Thu, 9 Aug 2012 20:47:38 +0000 (20:47 +0000)]
[ms-inline asm] Instantiate the various parts to the AsmParser.

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

12 years agoMake all of the tools build in parallel. Missing this caused incremental
Chandler Carruth [Thu, 9 Aug 2012 20:40:24 +0000 (20:40 +0000)]
Make all of the tools build in parallel. Missing this caused incremental
rebuilds to serially link each tool, which is really really slow.

We still have to build libclang serially first because c-index-test
depends on it.

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

12 years agoRecurse into the extra tools repo the correct way from the Makefile
Chandler Carruth [Thu, 9 Aug 2012 20:21:38 +0000 (20:21 +0000)]
Recurse into the extra tools repo the correct way from the Makefile
build system. Thanks to Nick for pointing at the actual construct which
should be used here.

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

12 years agoIn 'delete []', the '[]' never starts a lambda. Update a FIXME with a standard refere...
Richard Smith [Thu, 9 Aug 2012 19:01:51 +0000 (19:01 +0000)]
In 'delete []', the '[]' never starts a lambda. Update a FIXME with a standard reference and add a test.

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

12 years ago[analyzer] Improve readability of the dyn. dispatch bifurcation patch
Anna Zaks [Thu, 9 Aug 2012 18:43:00 +0000 (18:43 +0000)]
[analyzer] Improve readability of the dyn. dispatch bifurcation patch
r161552.

As per Jordan's feedback.

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

12 years agoRemove absolute file path in test.
Dmitri Gribenko [Thu, 9 Aug 2012 18:35:49 +0000 (18:35 +0000)]
Remove absolute file path in test.

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

12 years agoComment to HTML and XML conversion: ignore commands that contain a declaration
Dmitri Gribenko [Thu, 9 Aug 2012 18:20:29 +0000 (18:20 +0000)]
Comment to HTML and XML conversion: ignore commands that contain a declaration
as their argument.  For example, \fn, \function, \typedef, \method, \class etc.

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

12 years agoFix the test case. Now it does not depend on the method used to pass vector arguments...
Simon Atanasyan [Thu, 9 Aug 2012 17:49:22 +0000 (17:49 +0000)]
Fix the test case. Now it does not depend on the method used to pass vector arguments to the function.
Reviewed by Anton Lokhmotov.

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

12 years agoComment to HTML and XML conversion: use CommandTraits to classify commands.
Dmitri Gribenko [Thu, 9 Aug 2012 17:33:20 +0000 (17:33 +0000)]
Comment to HTML and XML conversion: use CommandTraits to classify commands.

This also fixes a bug in comment to XML conversion: \result was just an
ordinary paragraph, not an alias for \returns.

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

12 years ago[ms-inline asm] Initialize targets and assembly printers/parsers.
Chad Rosier [Thu, 9 Aug 2012 17:33:11 +0000 (17:33 +0000)]
[ms-inline asm] Initialize targets and assembly printers/parsers.

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

12 years ago[ms-inline asm] Add various MC components to clang build to support MS-style inline...
Chad Rosier [Thu, 9 Aug 2012 17:17:01 +0000 (17:17 +0000)]
[ms-inline asm] Add various MC components to clang build to support MS-style inline assembly.

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

12 years agoobjective-C: minor refactoring in method
Fariborz Jahanian [Thu, 9 Aug 2012 17:15:00 +0000 (17:15 +0000)]
objective-C: minor refactoring in method
definition parsing logic.

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

12 years agoUnbreak the build.
Anna Zaks [Thu, 9 Aug 2012 02:57:02 +0000 (02:57 +0000)]
Unbreak the build.

Declaring "const Decl *Decl" is not a good idea.

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

12 years ago[analyzer] Cleanup of malloc checker.
Anna Zaks [Thu, 9 Aug 2012 00:42:24 +0000 (00:42 +0000)]
[analyzer] Cleanup of malloc checker.

Remove Escaped state, which is not really necessary. We can just stop
tracking the symbol instead of keeping it around and marking escaped.

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

12 years agoFix AAPCS ABI. I can't actually test this, but it restores the behavior from before...
Eli Friedman [Thu, 9 Aug 2012 00:31:40 +0000 (00:31 +0000)]
Fix AAPCS ABI.  I can't actually test this, but it restores the behavior from before r159168.  PR13562.

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

12 years ago[analyzer] Bifurcate the path with dynamic dispatch.
Anna Zaks [Thu, 9 Aug 2012 00:21:33 +0000 (00:21 +0000)]
[analyzer] Bifurcate the path with dynamic dispatch.

This is an initial (unoptimized) version. We split the path when
inlining ObjC instance methods. On one branch we always assume that the
type information for the given memory region is precise. On the other we
assume that we don't have the exact type info. It is important to check
since the class could be subclassed and the method can be overridden. If
we always inline we can loose coverage.

Had to refactor some of the call eval functions.

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

12 years agoAdd new file CommentCommandTraits.cpp to CMakeLists.txt.
Dmitri Gribenko [Thu, 9 Aug 2012 00:16:26 +0000 (00:16 +0000)]
Add new file CommentCommandTraits.cpp to CMakeLists.txt.

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

12 years agoAllow the Makefile build system to find the extra repo if it is checked
Chandler Carruth [Thu, 9 Aug 2012 00:05:27 +0000 (00:05 +0000)]
Allow the Makefile build system to find the extra repo if it is checked
out.

Unfortunately, the existing makefiles for the extra repo don't specify
the correct library dependencies. Fixing that next. If you're following
along, you'll get linker errors.

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