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

863 Коммитов

Автор SHA1 Сообщение Дата
Argyrios Kyrtzidis b94b62c3b1 [libclang] Make sure tokens from preprocessor directives are annotated as such,
even if the directive is inside a declaration.

Fixes rdar://11548788 & http://llvm.org/PR12970

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169949 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-12 01:05:25 +00:00
Argyrios Kyrtzidis e1c2c2023e [libclang] Declarations inside anonymous namespaces have internal linkage so
their USR should contain a location.

This uniques them from other declarations with the same name but in different translation units.
rdar://10546541

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169647 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-07 22:41:46 +00:00
Argyrios Kyrtzidis 838eb7e865 [libclang] Introduce a new indexing mode where we skip function bodies
that were already parsed in the same "indexing session".

An indexing session is defined as using the same CXIndexAction object
for multiple clang_indexSourceFile calls.
Passing CXIndexOpt_SkipParsedBodiesInSession as an indexing option will
enable the mode where we try to skip bodies that were already parsed in
another translation unit.

If a function's body was skipped, the "flags" field in the CXIdxDeclInfo
structure will have "CXIdxDeclFlag_Skipped" bit was set.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169539 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-06 19:41:16 +00:00
Dmitri Gribenko 1eb60825f0 libclang: Add a function to libclang for retrieving the bit width value
Patch by Jyun-Yan You.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169276 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-04 15:13:46 +00:00
Chandler Carruth f59edb96b2 Sort #include lines for tools/...
Completely automated with sort_includes.py

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169240 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-04 09:25:21 +00:00
Argyrios Kyrtzidis 9f9e0d2ecd [libclang] Avoid copying the CompileCommand related strings when wrapping them to a CXString.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169227 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-04 07:26:48 +00:00
Argyrios Kyrtzidis 7e96bfb4d5 Introduce CompilationDatabase::getAllCompileCommands() that returns all
compile commands of the database and expose it via the libclang API.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169226 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-04 07:26:44 +00:00
Argyrios Kyrtzidis 7aa7eb9d02 [libclang] Remove WorkingDir field from CIndexer, it has been rendered useless.
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168738 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-27 22:49:42 +00:00
Benjamin Kramer 4d9f4e5bfa Make helpers static/anonymous.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168500 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-22 15:02:44 +00:00
Daniel Dunbar 6e64973789 Revert r167801, "[preprocessor] When #including something that contributes no
tokens at all,". This change broke External/Nurbs in LLVM test-suite.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167858 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-13 19:12:37 +00:00
Argyrios Kyrtzidis 4d10b40ea8 [preprocessor] When #including something that contributes no tokens at all,
don't recursively continue lexing.

This avoids a stack overflow with a sequence of many empty #includes.
rdar://11988695

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167801 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-13 01:03:15 +00:00
Ted Kremenek 3d615b2a42 Remove completely irrelevant code from USR generation.
Thanks to Richard Smith for pointing this out.  This code stopped
serving its purpose during r103212 in a refactoring.  My initial
fix was to add back the logic to abort the USR generation for
InternalLinkage, but enough tests broke suspiciously that I fear
that USR generation for cursors with InternalLinkage is now expected
by some clients (where it wasn't the case when the refactoring
took place).  I don't own this code anymore and have not looked
at it for some time, but clearly this code is dead and can be removed
pending further review on the proper logic here.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167442 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-06 06:36:45 +00:00
Argyrios Kyrtzidis e4a990f349 [libclang] Introduce clang_Cursor_getReceiverType which returns the CXType for
the receiver of an ObjC message expression.

rdar://12578643

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167201 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-01 02:01:34 +00:00
Nick Lewycky 76dd1d9169 Add missing emacs major mode marker.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166914 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-29 06:03:58 +00:00
Nick Lewycky 6cd2bf886c Fix name of this file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166913 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-29 06:03:40 +00:00
Nick Lewycky eb86dcc008 Add missing emacs major mode marker.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166912 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-29 06:02:59 +00:00
Dmitri Gribenko 7c98499ba5 Comment to XML conversion: avoid memory allocation while pretty-printing the
declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166707 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-25 18:28:26 +00:00
Douglas Gregor 02c23ebf41 Make DiagnosticOptions intrusively reference-counted, and make sure
the various stakeholders bump up the reference count. In particular,
the diagnostics engine now keeps the DiagnosticOptions object alive.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166508 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-23 22:26:28 +00:00
Argyrios Kyrtzidis 28f3a0e491 [libclang] Add an environment variable to disable thread background priotity, for testing
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166466 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-23 04:09:38 +00:00
Dmitri Gribenko 8cfabf2cb2 Remove const_casts by propagating constness down to called functions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166287 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-19 16:51:38 +00:00
Fariborz Jahanian 262e60c1cc [doc parsing] use getParamName to access parameter
for current(rewritten) comment and getParamNameAsWritten
to access param name coming with \param marker.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166231 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-18 21:42:42 +00:00
NAKAMURA Takumi 922fbc41e4 libclang/CXComment.cpp: Fix abuse of StringRef.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166163 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-18 01:38:53 +00:00
Argyrios Kyrtzidis 8d7a24e94b [libclang] Invoke a ppIncludedFile callback when indexing implicit module imports.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166161 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-18 00:17:05 +00:00
Fariborz Jahanian 1bfb00dabf [Doc parsing]: This patch adds <Declaration> tag to
XML comment for declarations which pretty-prints
declaration. I had to XFAIL one test annotate-comments.cpp.
This test is currently unmaintainable as written.
Dmitri G., can you see what we can do about this test.
We should change this test such that adding a new tag does not wreck
havoc to the test.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166130 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-17 21:58:03 +00:00
Derek Schuff 263366f924 Add pnaclcall convention to Native Client targets.
Because PNaCl bitcode must be target-independent, it uses some
different bitcode representations from other targets (e.g. byval and
sret for structures). This means that without additional type
information, it cannot meet some native ABI requirements for some
targets (e.g. passing structures containing unions by value on
x86-64). To allow generation of code which uses the correct native
ABIs, we also support triples such as x86_64-nacl, which uses
target-dependent IR (as opposed to le32-nacl, which uses byval and
sret).

To allow interoperation between the two types of code, this patch adds
a calling convention attribute to be used in code compiled with the
target-dependent triple, which will generate code using the le32-style
bitcode. This calling convention does not need to be explicitly
supported in the backend because it determines bitcode representation
rather than native conventions (the backend just needs to undersand
how to handle byval and sret for the Native Client OS).

This patch implements __attribute__((pnaclcall)) to generate calls in
bitcode according to the le32 bitcode conventions, an attribute which
is accepted by any Native Client target, but issues a warning
otherwise.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166065 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-16 22:30:41 +00:00
Fariborz Jahanian 88d285cc0f Fixes location of overriding declaration with no comment
of their own.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165972 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-15 20:57:52 +00:00
Fariborz Jahanian 6553c686cb structured document comment: patch to provide comment for overriding function
template when comment is comming from overridden declaration. 
// rdar://12378793


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165953 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-15 18:58:50 +00:00
Fariborz Jahanian 749ace614b search for overridden methods with comment when overriding method
has none of its own. Factor in Doug's comments.
// rdar://12378793


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165771 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-11 23:52:50 +00:00
Sean Silva b43d87b064 Remove pointless classof()'s.
Updates to llvm/Support/Casting.h have rendered these classof()'s
irrelevant.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165770 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-11 23:31:23 +00:00
Argyrios Kyrtzidis 900ab95e12 [libclang] Improve AST serialization done by ASTUnit::Save().
The ASTUnit needs to initialize an ASTWriter at the beginning of
parsing to fully handle serialization of a translation unit that
imports modules. Do this by introducing an option to enable it, which
corresponds to CXTranslationUnit_ForSerialization on the C API side.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165717 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-11 16:05:00 +00:00
Fariborz Jahanian bf967be66e [Doc parsing] This patch searches overridden objc/c++
methods looking for documentation on a particular base
class inherited by any method that overrides the base class.
In case of redeclaration, as when objc method is defined
in the implementation, it also looks up for documentation
in class/class extension being redeclared.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165643 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-10 18:34:52 +00:00
Jordan Rose 1e4691b9d8 Rename ObjCMethodDecl::isSynthesized to isPropertyAccessor.
This more accurately reflects its use: this flag is set when a method
matches the getter or setter name for a property in the same class,
and does not actually specify whether or not the definition of the method
will be synthesized (either implicitly or explicitly with @synthesize).

This renames the setter and backing field as well, and changes the
(soon-to-be-obsolete?) XML dump format to use 'property_accessor'
instead of 'synthesized'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165626 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-10 16:42:25 +00:00
Bill Wendling d34eca2a5b Place temporary LTO files into their own subdirectory.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165600 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-10 05:30:49 +00:00
Argyrios Kyrtzidis 93cd6e8e17 Disable the preprocessing record when indexing a source file
and modules are not enabled.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165593 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-10 02:12:50 +00:00
Argyrios Kyrtzidis 62288edde2 When indexing a module file, for the ppIncludedFile callback give
an invalid location if the location points to the synthetic buffer
for the module input.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165592 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-10 02:12:47 +00:00
Bob Wilson 1be79391b3 Revert "Use a special path to place the .o files in."
This reverts commit 165429 in an attempt to get our buildbots going.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165573 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-09 23:57:08 +00:00
Argyrios Kyrtzidis 21c3607282 Move the logic that searches for overridden methods from libclang to
ASTContext so that it can be widely available.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165473 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-09 01:23:50 +00:00
Bill Wendling 09655fcc08 Use a special path to place the .o files in.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165429 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-08 21:17:59 +00:00
Argyrios Kyrtzidis 53d6ded0ed [libclang] Don't disable the preprocessing record while indexing so as
to not mess up with module building.

It was not worth trying to combine indexing without preprocessing record
and building modules with one because:

-just importing a module/PCH that was built with a pp record, enables it anyway
-the performance gain of indexing without the preprocessing record is insignificant.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165352 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-06 01:18:35 +00:00
Argyrios Kyrtzidis 134d1e8a0b [libclang] Now that we have a CXModule object, pass it to the
importedASTFile indexing callback.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165281 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-05 00:22:40 +00:00
Argyrios Kyrtzidis 5d04b1af7b [libclang] Introduce new C functions that provide information about modules:
clang_Cursor_getModule
clang_Module_getParent
clang_Module_getName
clang_Module_getFullName
clang_Module_getNumTopLevelHeaders
clang_Module_getTopLevelHeader

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165280 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-05 00:22:37 +00:00
Argyrios Kyrtzidis 6a01012e6b [libclang] Introduce CXCursor_ModuleImportDecl cursor kind, used for a module
import declaration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165277 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-05 00:22:24 +00:00
Bill Wendling 731a26202d Add an explicit -object_path_lto flag during linking with a uniquified temporary
file name if building Apple-style.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165184 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-03 23:49:57 +00:00
Argyrios Kyrtzidis 3da76bfbd2 [libclang] When indexing, invoke the importedASTFile for PCH files as well.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165161 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-03 21:05:51 +00:00
Argyrios Kyrtzidis 37f2f52fbc [libclang] Simplify indexing of module imports by handling implicit
imports via ImportDecls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165160 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-03 21:05:44 +00:00
Dmitri Gribenko 7d9c975bf2 Comment to XML conversion: escape XML special chars correctly; use correct
regex for version tuples.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165104 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-03 09:04:56 +00:00
Argyrios Kyrtzidis 95c579cae0 Some renames to use the 'visitor' nomenclature, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165083 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-03 01:58:28 +00:00
Fariborz Jahanian 8da68b8b03 [Doc parse]: SUpport for message in deprecated/unavailable
attribute going iinto XML document.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165066 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-02 23:01:04 +00:00
Argyrios Kyrtzidis 2093e0bc4e [libclang] When indexing an AST file, only deserialize the file level
declarations of the current primary module.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165046 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-02 21:09:13 +00:00
Fariborz Jahanian 2a46533633 [Doc parsing]: Add available and deprecated attribute info
to XML output. // rdar://12378879


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165039 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-02 20:05:47 +00:00