Граф коммитов

18655 Коммитов

Автор SHA1 Сообщение Дата
Douglas Gregor a7bde20f8c Implement clang_getCursorExtent, which provides a source range for the
cursor itself. In particular, for references this returns the source
range of the reference rather than the source range of the thing it
refers to.

Switch c-index-test from clang_getDeclExtent (which will eventually be
deprecated and removed) over to clang_getCursorExtent. The source
ranges we print for references now make sense; fix up the tests
appropriately.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93823 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 00:34:46 +00:00
Devang Patel 17584204c2 Use llvm::Function name as the linkage name, but strip off leading '01' from display name.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93822 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 00:25:12 +00:00
Devang Patel 428deb524a Refactor.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93814 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 00:00:59 +00:00
Douglas Gregor f46034af49 Teach clang_getCursorLocation() to return the locations of references
rather than the locations that refer to.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93812 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 23:41:10 +00:00
Devang Patel 0d0d327aeb llvm::Function name is the linkage name. If it has a '01' as a prefix then probably there is a reason.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93808 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 23:27:28 +00:00
Ted Kremenek e381c997e2 Tweak USR output for ObjC categories.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93805 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 23:25:32 +00:00
John McCall ad2b804faf Move AccessSpecifier into the new Specifiers.h; fixes the layering violations
inherent in, well, pretty much every use of AccessSpecifier.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93804 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 23:21:37 +00:00
Fariborz Jahanian 83b7b31fff Allow conversion of pointer to an objective-c pointer to
a similar pointer. Fixes radar 7552179.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93803 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 22:59:22 +00:00
Douglas Gregor 547836fad9 Now that a reasonable deprecation cycle has passed, kill
clang_getCursorLine(), clang_getCursorColumn(),
clang_getCursorSource(), and clang_getCursorSourceFile() outright.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93801 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 22:48:04 +00:00
Douglas Gregor 98258afae6 Introduce clang_getCursorLocation(), which supercedes
clang_getCursorLine(), clang_getCursorColumn(),
clang_getCursorSource(), and clang_getCursorSourceFile(). Mark those 4
functions as deprecated and stop using them ourselves.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93800 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 22:46:11 +00:00
Ted Kremenek b82b3beda0 Refactor USR generation for TagDecls into a common method.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93799 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 22:42:20 +00:00
Chris Lattner 046c2277dc allow the HandlerComment callback to push tokens into the
preprocessor.  This could be used by an OpenMP implementation
or something.  Patch by Abramo Bagnara!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93795 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 22:35:47 +00:00
Chris Lattner 2c6b193d57 simplify the code for skipping in a #if 0 block. The CurLexer
pointer is always non-null because the PTH case exits earlier
in the method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93794 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 22:33:01 +00:00
Douglas Gregor 3c7313d96c Clean up the CIndex API slightly.
Renamed CXSourceFileLine to CXSourceLocation and added a CXFile, to
better match Clang's SourceLocation. Teach clang_getDeclExtent to fill
in the CXFile properly.

Renamed CXSourceExtent to CXSourceRange, to better match Clang's
SourceLocation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93783 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 22:13:09 +00:00
Ted Kremenek 6483a773db Explicitly not handle ObjCForwardProtocolDecl in GetCursorKind().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93779 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 22:07:45 +00:00
Ted Kremenek 3adca6d3f3 Tweak USR generation to handle anonymous bitfields.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93778 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 22:02:49 +00:00
Daniel Dunbar 353052194f Add missing newline.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93767 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 20:55:52 +00:00
Douglas Gregor d038f361d2 float, double, and long double do need extra data in the
BuiltinTypeLoc structure. Thanks, Enea!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93763 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 20:37:56 +00:00
Ted Kremenek cf84aa46de Replace clang_getDeclUSR() with clang_getCursorUSR(). Also remove printing 'contexts' from c-index-test output; it wasn't helpful and was extremely brittle.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93760 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 20:23:29 +00:00
John McCall 42f56b5006 Preserve type source information in compound literal expressions.
Patch by Enea Zaffanella!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93752 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 19:35:47 +00:00
Douglas Gregor e44433c29e Print fix-it hints properly around tabs, from Christian Adåker!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93750 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 19:28:01 +00:00
Daniel Dunbar 6cfb3ef451 Remove ../libexec from clang program search path, clang-cc is dead.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93749 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 19:16:53 +00:00
Mike Stump b7fd588ea9 Silence a control reaches end of function warning. Patch by Enea
Zaffanella.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93743 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 18:41:43 +00:00
Fariborz Jahanian 107089f36d Mostly renaming some methods and updating comments to
reflect what these methods are actually doing. One method
template for future work. No change in functionality.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93742 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 18:41:16 +00:00
Douglas Gregor e83b4c17b1 Make CMake's clang++ installation respect DESTDIR, based on a patch by
Ingmar Vanhassel. Fixes PR6046.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93741 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 18:27:29 +00:00
Douglas Gregor ddf889a2ad Improve source-location information for builtin TypeLocs, from Enea
Zaffanella (with a couple of my tweaks).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93733 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 18:04:31 +00:00
Daniel Dunbar 3f693d25d4 Don't build/install clang++ in CLANG_IS_PRODUCTION build mode yet.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93732 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 17:52:48 +00:00
Daniel Dunbar c81d718f60 Fix -Asserts warning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93731 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 17:52:42 +00:00
Daniel Dunbar 80febb9876 Fix race condition in creating objdir.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93730 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 17:52:37 +00:00
Douglas Gregor ab8bbf4ebd Encoding calling conventions in the type system, from Charles Davis!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93726 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 17:14:39 +00:00
Anders Carlsson 35aa62aacf More VTT builder fixes. With these fixes we now correctly handle the very complex VTT example from the Itanium ABI spec.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93725 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 17:13:59 +00:00
Zhongxing Xu 3ed04d3757 Add support for computing size in elements for symbolic regions obtained from
malloc().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93722 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 08:54:31 +00:00
Anders Carlsson 7a2132a5d2 Move some common code into BuildVTT.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93710 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 04:45:46 +00:00
Anders Carlsson 20314fffcf Fix a bunch of VTT layout bugs, add simple tests for VTT layout.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93709 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 04:25:18 +00:00
Zhongxing Xu 425c7ed03b Add test case for pr6069.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93708 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 04:01:40 +00:00
Anders Carlsson 0d8bb8ee72 Update virt.cpp for changes to the LLVM asm printer (?) This test should really be all LLVM IR...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93707 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 03:58:13 +00:00
Zhongxing Xu 7e3cda9744 If the symbol has not been tracked, do not free it. This is possible when free
is called on a pointer that does not get its value directly from malloc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93706 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 03:27:34 +00:00
Anders Carlsson d478cc7c1c Minor VTT builder cleanup, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93696 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-17 23:53:20 +00:00
Anders Carlsson e74f3d07f0 Get the ctor vtable address points directly from the VTT builder.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93681 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-17 17:10:44 +00:00
Nuno Lopes afe859a9a6 PR6055: fix FreeBSD c++ include path. patch by Roman Divacky
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93668 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-17 00:00:11 +00:00
Douglas Gregor 60406bede2 Introduce a second queue of "local" pending implicit instantiation,
which are instantiations of the member functions of local
classes. These implicit instantiations have to occur at the same time
as---and in the same local instantiation scope as---the enclosing
function, since the member functions of the local class can refer to
locals within the enclosing function. This should really, really fix PR5764.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93666 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 22:29:39 +00:00
Sam Weinig ce757a7a1e Add PCH support for CXXStaticCastExpr, CXXDynamicCastExpr, CXXReinterpretCastExpr, CXXConstCastExpr and CXXFunctionalCastExpr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93658 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 21:21:01 +00:00
Douglas Gregor 26997fd58c While determining when to parse inline member functions of a class,
distinguish between nested classes (whose member functions cannot be
parsed until the innermost non-nested class is complete) and local
classes (that are defined within a function but are not necessarily
nested). The upshot of this change, which fixes PR5764, is that the
bodies of member functions of local (non-nested) classes need to be
parsed when the local class is complete (and no later), since they may
refer to function-local static variables, typedefs, enums, etc.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93653 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 20:52:59 +00:00
Douglas Gregor 79c2278a66 When we are instantiating a member function of a local class, be sure
to merge the local instantiation scope with the outer local
instantiation scope, so that we can instantiate declarations from the
function owning the local class. Fixes an assert while instantiating
Boost.MPL's BOOST_MPL_ASSERT_MSG.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93651 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 20:21:20 +00:00
Fariborz Jahanian dfa4fa0fc5 Fix a rewriting crash and correct rewriting of __block
declaration where its initializer has a type-cast.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93650 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 19:36:43 +00:00
Douglas Gregor 6a0166edea Improve the test for unused-expression warnings slightly
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93644 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 18:17:21 +00:00
Douglas Gregor 5d52e47ed6 Partial fix for PR6022, where we were complaining when a friend
function template declared within a class template did not match a
function in another scope. We really need to rework how
friends-in-templates are semantically checked.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93642 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 18:09:52 +00:00
Douglas Gregor 1adb082a70 Give ObjCClassRef cursors a sane representation, which is encapsulated
in CXCursor.cpp. With this sane representation, fix the class
reference that is part of Objective-C category declarations so that
the cursor's location matches up with the reference, not the class
being referred to.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93640 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 17:14:40 +00:00
Douglas Gregor 3db211b617 Improve location information for Objective-C category declarations. We
previously only had a single location (the @ in @interface); now we
know where the @ is (for the start of the declaration), where the
class name is (that's the normal "location" now for diagnostics), and
where the category name is. Also, eliminated the redundant "end"
location, since ObjCContainerDecl already has better @end information.

The only XFAIL'd test is temporary; will un-XFAIL-it once I've taught
CIndex how to use the new locations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93639 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 16:38:58 +00:00
Douglas Gregor 78db0cdd49 Use a sane encoding for CXCursor_ObjCProtocolRef, using the actual
source locations where the protocols were referenced rather than the
location of some random enclosing declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93637 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 15:44:18 +00:00