Mike Stump
b5c775575b
Improve unreachable code warnings with respect to dead member and
...
dead array references.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94115 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-21 23:15:53 +00:00
John McCall
0380043d40
Due to local reversions and re-patching, I accidentally had multiple copies
...
of the 'payload' in this header.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94109 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-21 22:59:41 +00:00
Mike Stump
2d6ceab0ad
Improve unreachable code warnings for with respect to dead functional casts in C++.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94106 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-21 22:12:18 +00:00
Douglas Gregor
2332c117b1
Teach the cursor visitor to walk into typeof types (both kinds). This
...
is hard to test now; tests will come when we can walk stataements and
expressions properly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94099 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-21 20:48:56 +00:00
Mike Stump
44582300b6
Improve unreachable code warnings for with respect to c-style casts.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94094 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-21 19:51:34 +00:00
Mike Stump
e5fba7058c
Improve unreachable code warnings for with respect to ? :.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94093 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-21 19:44:04 +00:00
Ted Kremenek
71842cc07a
Allocate the 'Protocols' array in ObjCInterfaceType and
...
ObjCObjectPointerType using the allocator associated with ASTContext.
Not only does this fix a memory leak, but it also makes these arrays
BumpPtrAllocated (in the typical case).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94090 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-21 19:22:34 +00:00
Benjamin Kramer
5bb4d98223
Revert r94073, it fails in Release-Asserts builds.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94089 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-21 18:14:21 +00:00
Fariborz Jahanian
d8265b8383
Fixes a comment.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94088 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-21 17:39:43 +00:00
Fariborz Jahanian
d0502407c1
Patch to implement rewriting of properties.
...
Fixes radar 7562952.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94087 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-21 17:36:00 +00:00
Mike Stump
45db90de59
Improve unreachable code warnings for with respect to compound
...
assignments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94086 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-21 17:31:41 +00:00
Douglas Gregor
f20dfbcdaa
Teach the cursor visitor to walk into a variety of different TypeLoc
...
kinds, so that we see referenced types, protocols, classes, etc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94085 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-21 17:29:07 +00:00
Mike Stump
55f988efeb
Improve unreachable code warnings with respect to dead binary and
...
unary operators.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94084 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-21 17:21:23 +00:00
Daniel Dunbar
60eea55a98
Add a test for clang_rt support on Darwin. With appropriate massaging, this
...
checks that the runtime library can be linked and works for compiling on 10.6
for 10.{4,5,6} targets. Currently test is only for x86, and misses some
compiler-rt functions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94083 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-21 17:10:39 +00:00
Daniel Dunbar
c67bb59d45
Tweak OptionalTests paths.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94082 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-21 17:09:39 +00:00
Daniel Dunbar
38474aa780
Update to use llvm/utils/GetSourceVersion to detect version number, instead of
...
assuming SVN. This should be fixed to not necessarily be an integer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94081 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-21 16:56:47 +00:00
Daniel Dunbar
6d44f6ea30
Add utils/OptionalTests, a dumping ground for additional (lit) tests which for
...
one reason or another don't belong in the regular test suite.
Inside is utils/OptionalTests/Extra which is specifically for tests that match
the layout of the regular tests.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94080 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-21 16:55:39 +00:00
Anders Carlsson
58b7eee13b
Move the VTT related code into its own file, CGVTT.cpp
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94079 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-21 16:50:45 +00:00
Douglas Gregor
7d0d40e588
Introduce type references into the C API, capturing references to
...
typedefs only (for now).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94078 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-21 16:28:34 +00:00
Douglas Gregor
c0265406a8
Teach code-completion to deal with calls to functions without prototypes.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94076 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-21 15:46:19 +00:00
Mike Stump
4c45aa1b00
Speed up compilation by avoiding generating exceptional edges from
...
CallExprs as those edges help cause a n^2 explosion in the number of
destructor calls. Other consumers, such as static analysis, that
would like to have more a more complete CFG can select the inclusion
of those edges as CFG build time.
This also fixes up the two compilation users of CFGs to be tolerant of
having or not having those edges. All catch code is assumed be to
live if we didn't generate the exceptional edges for CallExprs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94074 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-21 15:20:48 +00:00
Benjamin Kramer
21c57918f4
Match branch labels with the trailing colon so we don't accidentally match something else.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94073 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-21 15:19:14 +00:00
Mike Stump
f8c4921c73
Move some recent checking code into SemaChecking instead.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94067 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-21 03:59:47 +00:00
Mike Stump
d40e94d050
Avoid instantiating std::sort to save on compiler size.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94065 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-21 03:43:13 +00:00
Mike Stump
44fa210545
When checking for unreachable code, we can trivially avoid checking
...
for unreachable loops if all the blocks are already marked live by
this point.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94064 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-21 03:07:51 +00:00
Mike Stump
6bde1ae4b7
When checking for unreachable blocks, we can trivially avoid extra
...
work, if we know we already marked all blocks as live.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94063 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-21 02:55:37 +00:00
Mike Stump
b978a441c7
Add infrastructure to add base initializers and member initializers to
...
the CFG. WIP.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94062 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-21 02:21:40 +00:00
Fariborz Jahanian
481683955a
Fixes comments.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94053 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-21 00:08:17 +00:00
Fariborz Jahanian
f7c43fdd28
Also allow cast of block pointer type to
...
pointer to an any object. Another variation of
radar 7562285.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94052 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-21 00:05:09 +00:00
Douglas Gregor
b2cd487561
Stash a CXXUnit pointer into each cursor. This allows us to simplify
...
the interface to clang_visitChildren() by eliminating the
CXTranslationUnit pointer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94051 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20 23:57:43 +00:00
Devang Patel
d0f251b4cd
A Decl->getName() is not unique. However, the debug info descriptors
...
are uniqued. The debug info descriptor describing record's context is
necessary to keep two Decl's descriptor unique if their name match.
There is more work to do to create descriptors for DeclContext.
As a temp. step use type's name in FwdDecl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94050 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20 23:56:40 +00:00
Douglas Gregor
5bfb8c128c
Eliminate the MakeCXCursor routines that require their callers to know too much about the cursor's storage
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94049 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20 23:34:41 +00:00
Fariborz Jahanian
b351a7daad
In objective-c++ land, a block pointer is another object pointer.
...
So, casting a generic object pointer ('id' or 'Class') to the
block pointer is allowed. Fixes radar 7562285.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94045 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20 22:54:38 +00:00
Douglas Gregor
f55254472e
Yet more Doxygen-comment tweaking in the CIndex library.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94044 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20 22:45:41 +00:00
Douglas Gregor
7f17376e09
Improve Doxygen documentation for the CIndex library, somewhat.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94042 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20 22:28:27 +00:00
John McCall
7264fa161f
Change LLVM/clang #includes to use quotes, not angle-brackets. Just a think-o
...
prompted by the #include <iterator> above.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94040 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20 22:16:29 +00:00
Douglas Gregor
04d1dd476a
Kill CXEntity and CXDecl. The first has never been used, while the
...
second has been wholly replaced by cursors.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94039 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20 22:14:22 +00:00
John McCall
46460a68f6
First pass at collecting access-specifier information along inheritance paths.
...
Triggers lots of assertions about missing access information; fix them.
Will actually consume this information soon.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94038 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20 21:53:11 +00:00
Douglas Gregor
78205d4bad
Kill some CXDecl-related APIs that have been superceded by
...
CXCursor-based APIs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94037 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20 21:45:58 +00:00
Douglas Gregor
68372aa4c5
Kill CXStmt. It isn't being used anywhere, and has no future.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94036 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20 21:38:07 +00:00
Douglas Gregor
002a528ab0
Kill clang_loadDeclaration() and clang_loadTranslationUnit().
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94034 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20 21:37:00 +00:00
Douglas Gregor
e5b72bac83
Switch c-index-test from clang_loadDeclaration() and
...
clang_loadTranslationUnit() over to clang_visitChildren().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94031 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20 21:32:04 +00:00
Douglas Gregor
7b691f3382
Switch the internals of clang_loadTranslationUnit() over to the new
...
cursor-based traversal, and eliminate TUVisitor. We're now down to one
visitor for traversing the AST. Yay!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94025 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20 21:13:59 +00:00
Daniel Dunbar
d31351288e
Use sizeof() instead of hard-coding a size for WrittenBuiltinSpecs, eek!
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94024 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20 21:13:31 +00:00
Douglas Gregor
b1373d03e4
Introduce a new, cursor-based traversal function that visits the
...
children of a given cursor, regardless of what kind of cursor it
is. This is a generalization of clang_loadDeclaration and
clang_loadTranslationUnit that will also extent to statements,
expressions, etc.
As proof-of-concept, switched clang_loadDeclaration() from its own
visitor over to an instance of this traversal function internally.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94022 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20 20:59:29 +00:00
Fariborz Jahanian
3ad230eb62
Settled rule on warning on unimplemented property in
...
category implementation when some implementations
are missing in the primary class implementation.
(fixes radar 6505200).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94014 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20 19:36:21 +00:00
Chris Lattner
3ea5cf8889
reduce redundant are's
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94009 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20 17:53:58 +00:00
Fariborz Jahanian
a84f2e4270
Improve performance of warning when not implementing a required
...
property of a protocol (my previous patch). No change in functionality.
(radar 7544809).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94005 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20 17:27:59 +00:00
Benjamin Kramer
6cd5216bb6
Make some helper functions static.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94004 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20 16:21:40 +00:00
Benjamin Kramer
ab8ae19ea4
Don't store a Twine temporary, it's unsafe.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94003 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20 16:18:11 +00:00