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

12 years agoComment parsing: extract TableGen'able pieces into new CommandTraits class.
Dmitri Gribenko [Thu, 9 Aug 2012 00:03:17 +0000 (00:03 +0000)]
Comment parsing: extract TableGen'able pieces into new CommandTraits class.

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

12 years agoclang support for Bitrig (an OpenBSD fork); patch by David Hill.
Eli Friedman [Wed, 8 Aug 2012 23:57:20 +0000 (23:57 +0000)]
clang support for Bitrig (an OpenBSD fork); patch by David Hill.

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

12 years agoMinor simplification for r161534.
Eli Friedman [Wed, 8 Aug 2012 23:53:27 +0000 (23:53 +0000)]
Minor simplification for r161534.

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

12 years agoobjective-C: refactor/simplify parsing of delayed
Fariborz Jahanian [Wed, 8 Aug 2012 23:41:08 +0000 (23:41 +0000)]
objective-C: refactor/simplify parsing of delayed
method/c-funcs defined in objc class implementation.
No intended functionality change.

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

12 years agoFix r161534 so it actually builds.
Eli Friedman [Wed, 8 Aug 2012 23:35:12 +0000 (23:35 +0000)]
Fix r161534 so it actually builds.

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

12 years agoPR13558: Fix typo 'compatiblity'. Thinking of the children. Apparently.
Richard Smith [Wed, 8 Aug 2012 23:32:13 +0000 (23:32 +0000)]
PR13558: Fix typo 'compatiblity'. Thinking of the children. Apparently.

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

12 years agoHandle deprecation diagnostics correctly for C struct fields and Objective-C properti...
Eli Friedman [Wed, 8 Aug 2012 23:04:35 +0000 (23:04 +0000)]
Handle deprecation diagnostics correctly for C struct fields and Objective-C properties/ivars. <rdar://problem/6642337>.

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

12 years agoComment XML: use xml:space="preserve" in Verbatim tags, so that XML tidy does
Dmitri Gribenko [Wed, 8 Aug 2012 22:10:24 +0000 (22:10 +0000)]
Comment XML: use xml:space="preserve" in Verbatim tags, so that XML tidy does
not compress spaces in verbatim content.

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

12 years agoUnify the codepaths for emitting deprecation warnings. The test changes are just...
Eli Friedman [Wed, 8 Aug 2012 21:52:41 +0000 (21:52 +0000)]
Unify the codepaths for emitting deprecation warnings.  The test changes are just to account for us emitting notes more consistently.

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

12 years agoAddress code review comments for Wstrncat-size warning (r161440).
Anna Zaks [Wed, 8 Aug 2012 21:42:23 +0000 (21:42 +0000)]
Address code review comments for Wstrncat-size warning (r161440).

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

12 years ago[ms-inline asm] Use more idiomatic logic. Thanks, Bill.
Chad Rosier [Wed, 8 Aug 2012 21:42:11 +0000 (21:42 +0000)]
[ms-inline asm] Use more idiomatic logic.  Thanks, Bill.

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

12 years agoImplicitly annotate __CFStringMakeConstantString with format_arg(1).
Jordan Rose [Wed, 8 Aug 2012 21:17:31 +0000 (21:17 +0000)]
Implicitly annotate __CFStringMakeConstantString with format_arg(1).

We handled the builtin version of this function in r157968, but the builtin
isn't used when compiling as -fno-constant-cfstrings.

This should complete <rdar://problem/6157200>.

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

12 years ago[ms-inline asm] Add basic codegen support for simple asm stmts. Currently,
Chad Rosier [Wed, 8 Aug 2012 21:15:52 +0000 (21:15 +0000)]
[ms-inline asm] Add basic codegen support for simple asm stmts.  Currently,
only machine specific clobbers are modeled.

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

12 years agoDon't add attributes for "#pragma pack" and friends to tag declarations which
Eli Friedman [Wed, 8 Aug 2012 21:08:34 +0000 (21:08 +0000)]
Don't add attributes for "#pragma pack" and friends to tag declarations which
are not definitions. This follows the behavior of both gcc and earlier
versions of clang. Regression from r156531.  <rdar://problem/12048621>.

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

12 years ago[ms-inline asm] Make sure IsSimple is correctly handled.
Chad Rosier [Wed, 8 Aug 2012 21:08:20 +0000 (21:08 +0000)]
[ms-inline asm] Make sure IsSimple is correctly handled.

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

12 years agoRemove extraneous comment.
Chad Rosier [Wed, 8 Aug 2012 20:38:22 +0000 (20:38 +0000)]
Remove extraneous comment.

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

12 years ago[ms-inline asm] Add a very simple test case. Basically, we're only testing for
Chad Rosier [Wed, 8 Aug 2012 20:37:31 +0000 (20:37 +0000)]
[ms-inline asm] Add a very simple test case.  Basically, we're only testing for
crashers at the moment (and coincidentally this case was causing a crash).

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

12 years ago[ms-inline asm] Refactor the logic to generate the AsmString into Sema. No
Chad Rosier [Wed, 8 Aug 2012 19:48:07 +0000 (19:48 +0000)]
[ms-inline asm] Refactor the logic to generate the AsmString into Sema.  No
functional change intended.

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

12 years agoWhitespace.
Chad Rosier [Wed, 8 Aug 2012 18:51:50 +0000 (18:51 +0000)]
Whitespace.

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

12 years agoWhitespace.
Chad Rosier [Wed, 8 Aug 2012 18:46:20 +0000 (18:46 +0000)]
Whitespace.

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

12 years ago[analyzer] Clean up the printing of FieldRegions for leaks.
Jordan Rose [Wed, 8 Aug 2012 18:23:36 +0000 (18:23 +0000)]
[analyzer] Clean up the printing of FieldRegions for leaks.

Unfortunately, generalized region printing is very difficult:
- ElementRegions are used both for casting and as actual elements.
- Accessing values through a pointer means going through an intermediate
  SymbolRegionValue; symbolic regions are untyped.
- Referring to implicitly-defined variables like 'this' and 'self' could be
  very confusing if they come from another stack frame.

We fall back to simply not printing the region name if we can't be sure it
will print well. This will allow us to improve in the future.

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

12 years ago[analyzer] Track malloc'd regions stored in structs.
Jordan Rose [Wed, 8 Aug 2012 18:23:31 +0000 (18:23 +0000)]
[analyzer] Track malloc'd regions stored in structs.

The main blocker on this (besides the previous commit) was that
ScanReachableSymbols was not looking through LazyCompoundVals.
Once that was fixed, it's easy enough to clear out malloc data on return,
just like we do when we bind to a global region.

<rdar://problem/10872635>

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

12 years ago[analyzer] Revamp RegionStore to distinguish regions with symbolic offsets.
Jordan Rose [Wed, 8 Aug 2012 18:23:27 +0000 (18:23 +0000)]
[analyzer] Revamp RegionStore to distinguish regions with symbolic offsets.

RegionStore currently uses a (Region, Offset) pair to describe the locations
of memory bindings. However, this representation breaks down when we have
regions like 'array[index]', where 'index' is unknown. We used to store this
as (SubRegion, 0); now we mark them specially as (SubRegion, SYMBOLIC).

Furthermore, ProgramState::scanReachableSymbols depended on the existence of
a sub-region map, but RegionStore's implementation doesn't provide for such
a thing. Moving the store-traversing logic of scanReachableSymbols into the
StoreManager allows us to eliminate the notion of SubRegionMap altogether.

This fixes some particularly awkward broken test cases, now in
array-struct-region.c.

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

12 years agoConstify CXXRecordDecl::isVirtuallyDerivedFrom.
Jordan Rose [Wed, 8 Aug 2012 18:23:20 +0000 (18:23 +0000)]
Constify CXXRecordDecl::isVirtuallyDerivedFrom.

No functionality change. A couple ugly const_casts because the ancestor
search code is used for other purposes as well.

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

12 years ago[ms-inline asm] Add support for detecting simple ms-style inline asm. Simple
Chad Rosier [Wed, 8 Aug 2012 18:22:06 +0000 (18:22 +0000)]
[ms-inline asm] Add support for detecting simple ms-style inline asm.  Simple
asm statements are those that don't reference variable names, function names,
and labels.

Add logic to generate a patched AsmString that will eventually be consumed by
the AsmParser.  No functional change at this point, so unfortunately no test
case.

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

12 years agoAdd the IsSimple/IsVolatile parameters to the MSAsmStmt constructor.
Chad Rosier [Wed, 8 Aug 2012 17:35:36 +0000 (17:35 +0000)]
Add the IsSimple/IsVolatile parameters to the MSAsmStmt constructor.

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

12 years agoImplement warning for integral null pointer constants other than the literal 0.
David Blaikie [Wed, 8 Aug 2012 17:33:31 +0000 (17:33 +0000)]
Implement warning for integral null pointer constants other than the literal 0.

This is effectively a warning for code that violates core issue 903 & thus will
become standard error in the future, hopefully. It catches strange null
pointers such as: '\0', 1 - 1, const int null = 0; etc...

There's currently a flaw in this warning (& the warning for 'false' as a null
pointer literal as well) where it doesn't trigger on comparisons (ptr == '\0'
for example). Fix to come in a future patch.

Also, due to this only being a warning, not an error, it triggers quite
frequently on gtest code which tests expressions for null-pointer-ness in a
SFINAE context (so it wouldn't be a problem if this was an error as in an
actual implementation of core issue 903). To workaround this for now, the
diagnostic does not fire in unevaluated contexts.

Review by Sean Silva and Richard Smith.

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