Ted Kremenek
ea903067e1
For now, add back clang_getDeclSource().
...
llvm-svn: 93003
2010-01-08 17:11:32 +00:00
Ted Kremenek
32b79317a2
More crashtracer enhancements to CIndex. When "popping" a crashtracer string
...
restore to the one most recently created.
llvm-svn: 92959
2010-01-07 23:13:53 +00:00
Ted Kremenek
7a5ede2ff0
Tidy up crashtracer logic in CIndex.
...
llvm-svn: 92955
2010-01-07 22:49:05 +00:00
Ted Kremenek
b58514e613
Add FileCheck prefix to another location in the output of c-index-test.
...
llvm-svn: 92890
2010-01-07 01:17:12 +00:00
Ted Kremenek
2a43fd58ee
Change clang_getDeclExtent() to have the endpoint point to the last character in the last token.
...
llvm-svn: 92869
2010-01-06 23:43:31 +00:00
Daniel Dunbar
4ff42d6500
Add _clang_getDeclExtent to export list.
...
llvm-svn: 92825
2010-01-06 05:41:00 +00:00
Ted Kremenek
991eb3f6c0
Add enhanced crash reporter breadcrumbs for clang_createTranslationUnitFromSourceFile().
...
llvm-svn: 92820
2010-01-06 03:42:32 +00:00
Ted Kremenek
e50486bbca
Remove unused variables.
...
llvm-svn: 92804
2010-01-05 23:22:20 +00:00
Ted Kremenek
bde648030b
Remove deprecated function 'clang_getDeclSource()'. Use 'clang_getDeclFile()' instead.
...
llvm-svn: 92803
2010-01-05 23:21:30 +00:00
Ted Kremenek
a44d99c934
Add C API hook 'clang_getDeclExtent()', which returns the source extent of a declaration. This implements <rdar://problem/7280072>.
...
llvm-svn: 92802
2010-01-05 23:18:49 +00:00
Ted Kremenek
9cd9f6d861
Split (mostly nonexistent) USR code out from the main CIndex logic.
...
llvm-svn: 92789
2010-01-05 22:06:45 +00:00
Ted Kremenek
902292d7ac
Add back #include of 'cstdio' to hopefully unbreak the build on Linux.
...
llvm-svn: 92765
2010-01-05 20:55:39 +00:00
Ted Kremenek
0ec2cca8f2
Split code in CIndex.cpp into multiple source files, and remove some unnecessary #includes.
...
llvm-svn: 92756
2010-01-05 19:32:54 +00:00
Douglas Gregor
51af7f628c
Turn on code-completion for macros within CIndex
...
llvm-svn: 92500
2010-01-04 19:45:17 +00:00
Daniel Dunbar
b2138e5529
Driver: Use "g++" as generic gcc name when running in C++ mode, for platforms
...
that lack real tool definitions.
llvm-svn: 92164
2009-12-25 20:21:23 +00:00
Kovarththanan Rajaratnam
55e74a1a6a
Remove RewriteBlocks. It has been superseded by RewriteObjC
...
llvm-svn: 92014
2009-12-23 18:03:34 +00:00
Ted Kremenek
c0895eb730
Add c++-analyzer symlink (which is used by scan-build)
...
llvm-svn: 91937
2009-12-22 23:00:32 +00:00
Douglas Gregor
b3fa919c2d
Extend code-completion results with the type of each result
...
llvm-svn: 91702
2009-12-18 18:53:37 +00:00
Douglas Gregor
f72b6ac87f
Change clang_codeComplete API to return the results in a structure on
...
the heap, so that clients are not forced to copy the results during
the initial iteration. A separate clang_disposeCodeCompleteResults
function frees the returned results.
llvm-svn: 91690
2009-12-18 16:20:58 +00:00
Chandler Carruth
65ce1b7c61
Test for errors during fread() inside c-index-test and handle them
...
appropriately. This also silences some pedantic GCC warnings.
llvm-svn: 91596
2009-12-17 09:18:43 +00:00
Ted Kremenek
22a8a4bfb9
Compute the right extension for preprocessed Objective-C++ files.
...
llvm-svn: 91547
2009-12-16 18:32:41 +00:00
Daniel Dunbar
282c9b9cc1
Fix pretty stack traces.
...
llvm-svn: 91537
2009-12-16 11:47:38 +00:00
Ted Kremenek
dca6816d6a
Add logic for computing preprocessor file extensions for C++ files.
...
llvm-svn: 91505
2009-12-16 05:02:47 +00:00
Ted Kremenek
f65a0c6768
scan-build/ccc-analyzer: start analyzing C++ FTW.
...
llvm-svn: 91398
2009-12-15 02:35:54 +00:00
Daniel Dunbar
a5a166d01a
Add -resource-dir to clang -cc1, this allows the base directory for compiler
...
resources (e.g., /usr/lib/clang/1.1) to be passed on the command line instead of
computed.
llvm-svn: 91370
2009-12-15 00:06:45 +00:00
Daniel Dunbar
8d4a202aad
Lift builtin-include-path logic out of ASTUnit::LoadFromCommandLine and fix CIndex to pass in the right directory (previously it was using the path to the main executable, which generally is wrong).
...
llvm-svn: 91238
2009-12-13 03:46:13 +00:00
Daniel Dunbar
d613677ec9
CompilerInvocation: Move builtin-include-path logic out of CompilerInvocation::CreateFromArgs.
...
llvm-svn: 91237
2009-12-13 03:45:58 +00:00
Jeffrey Yasskin
1615d45daa
Un-namespace-qualify llvm_unreachable. It's a macro, so the qualification gave
...
no extra safety anyway.
llvm-svn: 91207
2009-12-12 05:05:38 +00:00
Daniel Dunbar
3c6d1b52a0
Remove clang-cc tool, it has joined in unholy union with clang.
...
- tools/driver will be renamed to tools/clang at some point.
llvm-svn: 91195
2009-12-12 00:56:47 +00:00
Ted Kremenek
f5303fe492
scan-build: when the build command is 'make', override the CC and CXX options by passing them as arguments to make. This fixes <rdar://problem/6790224>.
...
llvm-svn: 91179
2009-12-11 23:22:52 +00:00
Ted Kremenek
f92b446dd4
Remove more old references to clang-cc.
...
llvm-svn: 91177
2009-12-11 23:12:52 +00:00
Ted Kremenek
5c512e63f4
Convert scan-build and ccc-analyzer over to using 'clang -cc1' instead of using 'clang-cc'.
...
llvm-svn: 91172
2009-12-11 22:44:53 +00:00
Daniel Dunbar
f72bdf7eed
Implement clang -cc1.
...
- I apologize for the link time horrors, my goal is to kill off clang-cc in fairly short order.
llvm-svn: 91170
2009-12-11 22:20:12 +00:00
Douglas Gregor
01ddf7a65f
clang_getCompletionChunkText() will treat optional strings as empty text blocks
...
llvm-svn: 91072
2009-12-10 22:46:19 +00:00
Jeffrey Yasskin
567ae47b4a
Remove several .c_str() to be forward-compatible with StringRef.
...
llvm-svn: 90822
2009-12-08 01:46:24 +00:00
Ted Kremenek
7bea9a1672
Enable '-analyzer-opt-analyze-nested-blocks' by default for testing.
...
llvm-svn: 90812
2009-12-07 22:26:14 +00:00
Daniel Dunbar
1597da4c05
Document that CompilerInvocation::createDiagnostics keeps a reference to the DiagnosticOptions, and update callers to make sure they don't pass in a temporary.
...
llvm-svn: 90704
2009-12-06 09:56:30 +00:00
Steve Naroff
c275f70bf9
Remove 'LangOpts' from Diagnostic (added in http://llvm.org/viewvc/llvm-project?view=rev&revision=90642 ).
...
Simply use the 'LangOpts' member already present in TextDiagnosticPrinter.
Sorry for the confusion!
llvm-svn: 90664
2009-12-05 12:23:07 +00:00
Daniel Dunbar
72fe5b1bcc
CIndex: For the time being, don't return translation units if we encounter an error during parsing.
...
- We need to be more careful in the rest of CIndex if we are to handle
possibly-invalid ASTs, and don't have much experience with this yet.
llvm-svn: 90643
2009-12-05 02:17:18 +00:00
Steve Naroff
4fb3d9fcd7
Integrate the following from the 'objective-rewrite' branch:
...
http://llvm.org/viewvc/llvm-project?view=rev&revision=71086
Note - This commit only includes the fix for:
<rdar://problem/6309338> slightly different error message format for Visual Studio.
The fix for <rdar://problem/6845623> from protocol to template. is separate/forthcoming.
llvm-svn: 90642
2009-12-05 02:14:08 +00:00
Rafael Espindola
73d4637545
Add gcc's -no-canonical-prefixes option to clang.
...
llvm-svn: 90577
2009-12-04 19:31:58 +00:00
Daniel Dunbar
644dca07b9
ASTUnit/CIndex: Explicitly track the top-level decls when using an ASTUnit made
...
from a source file.
- This allows CIndex to avoid iterating over all the top-level decls when using
a PCH, which means we deserialize far fewer decls.
llvm-svn: 90559
2009-12-04 08:17:33 +00:00
Daniel Dunbar
b066116b30
Kill off one last exit() call.
...
llvm-svn: 90439
2009-12-03 09:13:43 +00:00
Daniel Dunbar
0905b7f3be
clang-cc: Move to CompilerInvocation based command line parsing.
...
llvm-svn: 90426
2009-12-03 07:23:38 +00:00
Daniel Dunbar
215ca5f199
clang-cc: Honor -help and -version when using new style option parsing.
...
llvm-svn: 90422
2009-12-03 07:01:58 +00:00
Daniel Dunbar
3eff927255
Update test and CIndex to use -FOO BAR form for -{remap-file,code-completion-at}.
...
llvm-svn: 90416
2009-12-03 05:32:40 +00:00
Daniel Dunbar
da7a52289f
Add clang -cc1 -load option.
...
llvm-svn: 90413
2009-12-03 05:11:05 +00:00
Daniel Dunbar
1108966959
Switch clang_createTranslationUnitFromSourceFile to use ASTUnit::LoadFromCommandLine.
...
- This is much faster, as it avoids the overhead of dumping an AST file to disk and reloading it.
- For debugging purposes, there is a clang_setUseExternalASTGeneration hook which can be used to disable this.
On the Sketch Cocoa app, the speedup is pretty nice, especially when using a PCH file while scanning the source:
Wall time to c-index-test all files (no PCH):
Old: 23.4221
New: 12.3884
Wall time to c-index-test all files (with a PCH, and "local" mode):
Old: 10.9233
New: 1.9038
llvm-svn: 90385
2009-12-03 01:54:28 +00:00
Daniel Dunbar
59203007ac
Fix ASTUnit to allows require a (persistent) Diagnostic object be provided; propogate and simplify.
...
llvm-svn: 90379
2009-12-03 01:45:44 +00:00
Daniel Dunbar
845a87bd04
Normalize CIndex/c-index-test/index-test link lines in the hopes it will fix
...
*something*.
- We really need to fix how LLVM's build systems manage
linking. Pretty-please-someone-else-do-this? :)
llvm-svn: 90350
2009-12-02 21:47:55 +00:00