Commit Graph

2377 Commits

Author SHA1 Message Date
Argyrios Kyrtzidis 23de34d6d6 [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

llvm-svn: 169647
2012-12-07 22:41:46 +00:00
Argyrios Kyrtzidis 8b71bc7d6b [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.

llvm-svn: 169539
2012-12-06 19:41:16 +00:00
Argyrios Kyrtzidis f75d498a3c [c-index-test] Introduce '-index-compile-db' which accepts a compilation database file
and does an '-index-file' for all compile commands in the database.

llvm-svn: 169430
2012-12-05 21:53:37 +00:00
NAKAMURA Takumi dfaed1bfde c-index-test.c: Make C89-compliant.
llvm-svn: 169277
2012-12-04 15:32:03 +00:00
Dmitri Gribenko b506ba1d79 libclang: Add a function to libclang for retrieving the bit width value
Patch by Jyun-Yan You.

llvm-svn: 169276
2012-12-04 15:13:46 +00:00
Chandler Carruth cc0694c8a4 Sort #include lines for tools/...
Completely automated with sort_includes.py

llvm-svn: 169240
2012-12-04 09:25:21 +00:00
Argyrios Kyrtzidis 6a33de18a3 [libclang] Avoid copying the CompileCommand related strings when wrapping them to a CXString.
llvm-svn: 169227
2012-12-04 07:26:48 +00:00
Argyrios Kyrtzidis 251ad5e06b Introduce CompilationDatabase::getAllCompileCommands() that returns all
compile commands of the database and expose it via the libclang API.

llvm-svn: 169226
2012-12-04 07:26:44 +00:00
Jordan Rose 85ff8f281e [analyzer] scan-build: Don't forget to close our temp file for Clang's output.
Also, minor whitespace/indentation fixes.

Patch by Peeter Joot!

llvm-svn: 168805
2012-11-28 19:12:44 +00:00
Jordan Rose dbbbf55119 [analyzer] scan-build: Treat '.C' files as C++.
Part of PR14443.

llvm-svn: 168804
2012-11-28 19:12:29 +00:00
Argyrios Kyrtzidis 9923d686d0 [libclang] Remove WorkingDir field from CIndexer, it has been rendered useless.
No functionality change.

llvm-svn: 168738
2012-11-27 22:49:42 +00:00
Rafael Espindola b0448cd52a Remove some dead code. CLANG_IS_PRODUCTION is now just a build flag and
is not used in any #ifdef.

llvm-svn: 168703
2012-11-27 16:10:37 +00:00
Jordan Rose a333f3fba1 scan-build: Respect TMPDIR on all platforms, not just Darwin (PR14438).
llvm-svn: 168672
2012-11-27 02:37:59 +00:00
Benjamin Kramer ba4c85e51d Make helpers static/anonymous.
llvm-svn: 168500
2012-11-22 15:02:44 +00:00
Daniel Dunbar cf3f2c49ea Revert r167801, "[preprocessor] When #including something that contributes no
tokens at all,". This change broke External/Nurbs in LLVM test-suite.

llvm-svn: 167858
2012-11-13 19:12:37 +00:00
Argyrios Kyrtzidis 4f10a3e9f0 [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

llvm-svn: 167801
2012-11-13 01:03:15 +00:00
Chad Rosier ad6e96d59c If we encounter a fatal error, exit with status 70. For BSD systems this is
defined as an internal software error.  This notifies the driver to report
diagnostics information.
rdar://11951540

llvm-svn: 167754
2012-11-12 21:32:24 +00:00
Chad Rosier 7ea7397ebc If we encounter a fatal error, call the interrupt handler to ensure any
temporary files are removed.
rdar://12282296

llvm-svn: 167741
2012-11-12 19:39:37 +00:00
Dmitri Gribenko 9fcad0947c Force C89 for c-index-test.c
MSVC supports only C89, so it is important to keep c-index-test.c
buildable with C89.  However, Clang defaults to C99, so while building
Clang with Clang one can introduce C99 constructs into c-index-test.c
without noticing.

Thanks to Nakamura Takumi for helping with MSVC bits.

llvm-svn: 167561
2012-11-07 23:52:25 +00:00
Jordan Rose 721567af3e [analyzer] Check that the argument to CFMakeCollectable is non-NULL.
Patch by Sean McBride!

llvm-svn: 167537
2012-11-07 17:12:37 +00:00
Argyrios Kyrtzidis d3a20f5974 [c-index-test] When building with BUILD_CLANG_ONLY=YES, include c-index-test.
It is part of libclang and has other uses besides running the clang tests.

llvm-svn: 167478
2012-11-06 19:14:25 +00:00
Ted Kremenek ccf3b4299d 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.

llvm-svn: 167442
2012-11-06 06:36:45 +00:00
Argyrios Kyrtzidis 58a1d90d6a [c-index-test] Do install c-index-test because it's not just for tests,
it's also setup as 'INTERNAL_TOOL'.

llvm-svn: 167432
2012-11-06 02:12:21 +00:00
Richard Smith bd55daf2ee Remove first argument from Arg::getValue; it's been unused since r105760.
llvm-svn: 167211
2012-11-01 04:30:05 +00:00
Richard Smith 33fd551258 Remove CompilerInvocation::toArgs and clang -cc1test mode. These were untested
and apparently unused (and since they are untested, they're presumably also
broken).

llvm-svn: 167210
2012-11-01 03:48:49 +00:00
Argyrios Kyrtzidis b26a24cca2 [libclang] Introduce clang_Cursor_getReceiverType which returns the CXType for
the receiver of an ObjC message expression.

rdar://12578643

llvm-svn: 167201
2012-11-01 02:01:34 +00:00
Nick Lewycky acce2f88f3 Add missing emacs major mode marker.
llvm-svn: 166914
2012-10-29 06:03:58 +00:00
Nick Lewycky f7c59696e2 Fix name of this file.
llvm-svn: 166913
2012-10-29 06:03:40 +00:00
Nick Lewycky 0380545b3d Add missing emacs major mode marker.
llvm-svn: 166912
2012-10-29 06:02:59 +00:00
Dmitri Gribenko 1c1395e902 Comment to XML conversion: avoid memory allocation while pretty-printing the
declaration.

llvm-svn: 166707
2012-10-25 18:28:26 +00:00
NAKAMURA Takumi 4deb9a9b11 c-index-test.c: Split a format string. [-Woverlength-strings]
FIXME: They are still long strings without formatter in printf(3)!
llvm-svn: 166636
2012-10-24 22:52:04 +00:00
Argyrios Kyrtzidis e26c5571b2 [libclang] Add "-index-file-full" option that recursively indexes any imported
modules/PCH files.

llvm-svn: 166605
2012-10-24 18:29:15 +00:00
Douglas Gregor 811db4eac4 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.

llvm-svn: 166508
2012-10-23 22:26:28 +00:00
Sean Silva d901e82ec4 Fix some mdoc nits
Patch by Eitan Adler!

llvm-svn: 166482
2012-10-23 16:35:44 +00:00
Argyrios Kyrtzidis 118fafa301 [libclang] Add an environment variable to disable thread background priotity, for testing
llvm-svn: 166466
2012-10-23 04:09:38 +00:00
Dmitri Gribenko 923f305b2e Remove const_casts by propagating constness down to called functions.
llvm-svn: 166287
2012-10-19 16:51:38 +00:00
Fariborz Jahanian 9d2f1e753b [doc parsing] use getParamName to access parameter
for current(rewritten) comment and getParamNameAsWritten
to access param name coming with \param marker.

llvm-svn: 166231
2012-10-18 21:42:42 +00:00
NAKAMURA Takumi dbefa9b081 libclang/CXComment.cpp: Fix abuse of StringRef.
llvm-svn: 166163
2012-10-18 01:38:53 +00:00
Argyrios Kyrtzidis 5e2ec486bb [libclang] Invoke a ppIncludedFile callback when indexing implicit module imports.
llvm-svn: 166161
2012-10-18 00:17:05 +00:00
Fariborz Jahanian a7d76d2672 [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.

llvm-svn: 166130
2012-10-17 21:58:03 +00:00
Derek Schuff a202096dc0 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.

llvm-svn: 166065
2012-10-16 22:30:41 +00:00
Fariborz Jahanian bbd469bef3 Fixes location of overriding declaration with no comment
of their own.

llvm-svn: 165972
2012-10-15 20:57:52 +00:00
Fariborz Jahanian 14ec3f3acb structured document comment: patch to provide comment for overriding function
template when comment is comming from overridden declaration. 
// rdar://12378793

llvm-svn: 165953
2012-10-15 18:58:50 +00:00
Ted Kremenek 639a17a229 Further harden checking that scan-view isn't serving up pages outside
the server root.

llvm-svn: 165839
2012-10-12 22:56:38 +00:00
Ted Kremenek 3073c58cab Have scan-view guard against serving up pages outside the root directory.
llvm-svn: 165815
2012-10-12 19:16:31 +00:00
NAKAMURA Takumi e259d912ab c-index-test.c: /* Use C style comment. */
llvm-svn: 165797
2012-10-12 14:25:52 +00:00
Fariborz Jahanian 42e31323b6 search for overridden methods with comment when overriding method
has none of its own. Factor in Doug's comments.
// rdar://12378793

llvm-svn: 165771
2012-10-11 23:52:50 +00:00
Sean Silva e2bb2ff576 Remove pointless classof()'s.
Updates to llvm/Support/Casting.h have rendered these classof()'s
irrelevant.

llvm-svn: 165770
2012-10-11 23:31:23 +00:00
Argyrios Kyrtzidis 8585f140bf [libclang] Make sure the index_data.main_filename field is initialized
in c-index-test. index_enteredMainFile is not invoked when indexing a
module file.

llvm-svn: 165735
2012-10-11 19:38:23 +00:00
Argyrios Kyrtzidis 9f57186983 [libclang] Add tests for indexing modules and PCHs using modules.
llvm-svn: 165732
2012-10-11 19:00:44 +00:00