Daniel Dunbar
fe908a805b
Frontend: Change CC_PRINT_HEADERS to not print header depth markers, these don't
...
really make any sense in this environment.
llvm-svn: 128014
2011-03-21 19:37:38 +00:00
Ted Kremenek
5e14d39a88
Improve crash recovery cleanup to recovery CompilerInstances during crash recovery. This was a huge resource "root" during crashes.
...
This change requires making a bunch of fundamental Clang structures (optionally) reference counted to allow correct
ownership semantics of these objects (e.g., ASTContext) to play out between an active ASTUnit and CompilerInstance
object.
llvm-svn: 128011
2011-03-21 18:40:17 +00:00
Ted Kremenek
84de4a1781
Use CrashRecoveryContextCleanup objects to reclaim resources from CompilerInstance objects.
...
llvm-svn: 128009
2011-03-21 18:40:07 +00:00
Daniel Dunbar
5366ff1865
Preprocessor: Don't define __STDC__ in -traditional-cpp mode.
...
llvm-svn: 127933
2011-03-19 01:04:12 +00:00
Peter Collingbourne
599cb8e430
Add support for language-specific address spaces. On top of that,
...
add support for the OpenCL __private, __local, __constant and
__global address spaces, as well as the __read_only, _read_write and
__write_only image access specifiers. Patch originally by ARM;
language-specific address space support by myself.
llvm-svn: 127915
2011-03-18 22:38:29 +00:00
Daniel Dunbar
1057f86d0e
Lexer: Add extremely limited support for -traditional-cpp, ignoring BCPL
...
comments.
llvm-svn: 127910
2011-03-18 21:23:38 +00:00
Anders Carlsson
9583f794c3
Use the newly added FileManager::getNoncachedStatValue when trying to determine if any files in the preamble have changed.
...
llvm-svn: 127894
2011-03-18 19:23:38 +00:00
Anders Carlsson
c30dcecb5c
Correctly store and keep track of the FileSystemOptions in ASTUnit and in clang_codeCompleteAt.
...
llvm-svn: 127890
2011-03-18 18:22:40 +00:00
John McCall
7ef5cb3038
The Darwin kernel does not provide useful guard variable support.
...
Issue this as an IR-gen error; it's not really worthwhile doing this
"right", i.e. in Sema, because IR gen knows a lot of tricks beyond
what the constant evaluator knows.
llvm-svn: 127854
2011-03-18 02:56:14 +00:00
Ted Kremenek
4422bfea50
Use CrashRecoveryContextCleanup objects to recover an ASTUnit if we crash in ASTUnit::LoadFromCommandLine() and ASTUnit::LoadFromCompilerInvocation().
...
llvm-svn: 127851
2011-03-18 02:06:56 +00:00
Sandeep Patel
5a4a0f75d4
Fix duplicate argument processing
...
llvm-svn: 127746
2011-03-16 19:14:34 +00:00
NAKAMURA Takumi
63b4b456be
lib/Frontend/InitHeaderSearch.cpp: Introduce AddMinGW64CXXPaths(Base) for x86_64-w64-mingw32.
...
llvm-svn: 127652
2011-03-15 02:32:36 +00:00
Douglas Gregor
7ee23a8698
Add include paths for Gentoo Linux, from Marcin Mirosław!
...
llvm-svn: 127582
2011-03-14 15:33:44 +00:00
Anders Carlsson
9ba8fb1e48
Get rid of the static FileManager::FixupRelativePath.
...
llvm-svn: 127573
2011-03-14 01:13:54 +00:00
Argyrios Kyrtzidis
35dcda7922
Introduce '-chain-include' option to specify headers that will be converted to chained PCHs in memory
...
without having to use multiple runs and intermediate files.
Intended for testing & debugging of chained PCH.
llvm-svn: 127339
2011-03-09 17:21:42 +00:00
Argyrios Kyrtzidis
97d3a38c3e
Add 'OverridenFilesKeepOriginalName' field in SourceManager which if true the SourceManager
...
should report the original file name for contents of files that were overriden by other files,
otherwise it should report the name of the new file. Default is true.
Also add similar field in PreprocessorOptions and pass similar parameter in ASTUnit::LoadFromCommandLine.
llvm-svn: 127289
2011-03-08 23:35:24 +00:00
Argyrios Kyrtzidis
bc1f48f654
Allow passing '-###' to ASTUnit::LoadFromCommandLine to print out the cc1 options.
...
llvm-svn: 127183
2011-03-07 22:45:01 +00:00
Douglas Gregor
cfee35b845
Remove the AST printer (-ast-print-xml), which is too incomplete and
...
too low-level to actually be useful but is just interesting enough for
people to try to use it (which won't actually work beyond toy examples).
To bring back the AST printer, it needs to be:
- Complete, covering all of C/C++/Objective-C
- Documented, with appropriate Schema against which we can validate
the output
- Designed for C/C++/Objective-C, not Clang's specific ASTs
- Stable across Clang versions
- Well-tested
llvm-svn: 127141
2011-03-07 01:03:30 +00:00
Anders Carlsson
b5c356a4d5
Convert FileManager::FixupRelativePath over to using PathV2.
...
llvm-svn: 127133
2011-03-06 22:25:35 +00:00
Douglas Gregor
189c0e8923
Add MinGW GCC 4.5.2 include paths, from Matthieu Monrocq
...
llvm-svn: 127124
2011-03-06 18:00:59 +00:00
Argyrios Kyrtzidis
11e6f0a6c3
Currently we can only remap a file by creating a MemoryBuffer and replacing the file contents with it.
...
Allow remapping a file by specifying another filename whose contents should be loaded if the original
file gets loaded. This allows to override files without having to create & load buffers in advance.
llvm-svn: 127052
2011-03-05 01:03:53 +00:00
Argyrios Kyrtzidis
4954bc1d9d
Introduce OwnsRemappedFileBuffers field in ASTUnit, indicating whether the ASTUnit should delete the remapped buffers.
...
llvm-svn: 127051
2011-03-05 01:03:48 +00:00
Rafael Espindola
c4eb31e5e5
Apply sysroot to system c++ headers too. Fixes PR9372.
...
llvm-svn: 126884
2011-03-02 21:30:07 +00:00
Roman Divacky
315c1675e8
On FreeBSD, make sure /usr/local/include is *not* in the default include
...
path. This avoids accidentally including the wrong headers.
Patch by Dimitry Andric!
llvm-svn: 126761
2011-03-01 18:08:03 +00:00
Roman Divacky
65b88cdb3b
Implement -mrtd which sets the StdCall calling convention to be the default
...
one.
llvm-svn: 126756
2011-03-01 17:40:53 +00:00
Argyrios Kyrtzidis
9eb02dfa89
[analyzer] Remove '-analyzer-check-objc-mem' flag, the nominee for best misnomer award.
...
llvm-svn: 126676
2011-02-28 19:49:42 +00:00
Peter Collingbourne
938f7d0e46
Kill 18 month old #if 0'd code in StmtXML.cpp
...
llvm-svn: 126670
2011-02-28 19:42:30 +00:00
Peter Collingbourne
2f1e36bfd0
Rename tok::eom to tok::eod.
...
The previous name was inaccurate as this token in fact appears at
the end of every preprocessing directive, not just macro definitions.
No functionality change, except for a diagnostic tweak.
llvm-svn: 126631
2011-02-28 02:37:51 +00:00
Argyrios Kyrtzidis
0a9ce3ec8f
[analyzer] Migrate ArrayBoundCheckerV2 to CheckerV2.
...
Turns -analyzer-check-buffer-overflows into -analyzer-checker=core.experimental.Overflow
llvm-svn: 126609
2011-02-28 01:26:57 +00:00
Argyrios Kyrtzidis
560bbb1241
[analyzer] Turn -analyzer-stats into -analyzer-checker=debug.Stats
...
llvm-svn: 126608
2011-02-28 01:26:50 +00:00
Argyrios Kyrtzidis
21c9423ef4
[analyzer] Remove '-analyzer-experimental-checks' flag.
...
llvm-svn: 126607
2011-02-28 01:26:43 +00:00
Fariborz Jahanian
40c5e1ada7
Teach objc-rewriter to pass -fobjc-exceptions along.
...
llvm-svn: 126497
2011-02-25 17:24:55 +00:00
Ted Kremenek
b6f9ab6378
Teach TextDiagnosticPrinter to print out '-Werror' in addition to the warning flag for a warning mapped to an error.
...
For example:
t.c:7:9: error: using the result of an assignment as a condition without parentheses [-Werror,-Wparentheses]
llvm-svn: 126466
2011-02-25 01:28:26 +00:00
Argyrios Kyrtzidis
17bee3e70a
Intoduce '-analyzer-checker-help' flag which outputs a list of all available static analyzer checkers.
...
This is pretty basic for now, eventually checkers should be grouped according to package, hidden checkers should be indicated etc.
llvm-svn: 126454
2011-02-25 00:09:51 +00:00
Argyrios Kyrtzidis
b388f77ad9
[analyzer] Remove '-analyzer-experimental-internal-checks' flag, it doesn't have any checkers associated with it anymore.
...
llvm-svn: 126440
2011-02-24 21:43:08 +00:00
Argyrios Kyrtzidis
c08d89e6c2
Allow passing a list of comma separated checker names to -analyzer-checker, e.g:
...
-analyzer-checker=cocoa,unix
llvm-svn: 126372
2011-02-24 08:42:20 +00:00
Chris Lattner
d767a0300e
Reimplement DefineTypeSize in terms of APInt. This eliminates some
...
magic integer arithmetic and allows it to work with types larger
than 64 bits.
llvm-svn: 126365
2011-02-24 06:54:56 +00:00
Douglas Gregor
7b26ff912f
Teach NestedNameSpecifier to keep track of namespace aliases the same
...
way it keeps track of namespaces. Previously, we would map from the
namespace alias to its underlying namespace when building a
nested-name-specifier, losing source information in the process.
llvm-svn: 126358
2011-02-24 02:36:08 +00:00
Nick Lewycky
3607989847
Preserve what the user passed to -include when emitting .d files. Fixes PR8974!
...
llvm-svn: 126334
2011-02-23 21:16:44 +00:00
Anders Carlsson
33e56a047f
Add a -fcxx-exceptions flag to clang -cc1. This controls the newly added CXXExceptions flag.
...
llvm-svn: 126300
2011-02-23 03:16:42 +00:00
Chandler Carruth
1aef0c5621
Switch the VerifyDiagnosticsClient to use PresumedLocs now that they
...
exist. Cheat and do this by adding some wrappers around the PresumedLoc
machinery that directly return the line and column number.
llvm-svn: 126281
2011-02-23 00:47:48 +00:00
Joerg Sonnenberger
fe74286a48
Remove the storage for -cxx-system-include. Make libcxx toolchain
...
use -nostdinc++ and -cxx-isystem.
llvm-svn: 126223
2011-02-22 15:19:35 +00:00
Anders Carlsson
3320e1575f
Make clang -cc1 disable Objective-C exceptions by default, and add a -fobjc-exceptions flag to turn them on.
...
Update all tests accordingly.
llvm-svn: 126177
2011-02-22 01:52:06 +00:00
Joerg Sonnenberger
cc9c8eb837
Bug#8945: Add -cxx-isystem option to specify C++ system directories.
...
It works like -isystem and the search path keeps -isystem and
-cxx-isystem in order relative to each other. -cxx-isystem is only used
for C++ sources though. Drop the existing -cxx-system-include option for
cc1 as it is now redundant.
llvm-svn: 126167
2011-02-22 00:40:56 +00:00
Anders Carlsson
ce8dd3a5d4
Add a new ObjCExceptions member variable to LangOptions. This controls whether Objective-C exceptions are enabled or not (they are by default).
...
llvm-svn: 126061
2011-02-19 23:53:54 +00:00
Peter Collingbourne
8f5cf74c77
Re-instate r125819 and r125820 with no functionality change
...
llvm-svn: 126060
2011-02-19 23:03:58 +00:00
Rafael Espindola
a6d2bff0c5
Revert 125820 and 125819 to fix PR9266.
...
llvm-svn: 126050
2011-02-19 21:39:31 +00:00
Douglas Gregor
3a69eafa88
When code-completing a case statement for a switch on a value of
...
enumeration type, prioritize the enumeration constants and don't
provide completions for any other expressions. Fixes <rdar://problem/7283668>.
llvm-svn: 125991
2011-02-18 23:30:37 +00:00
Peter Collingbourne
14a552b2d7
Move CompilerInstance::LLVMContext and LLVMContext ownership to CodeGenAction
...
This removes the final dependency edge from any lib outside of CodeGen
to core. As a result we can, and do, trim the dependency on core
from libclang, PrintFunctionNames, the unit tests and c-index-test.
While at it, review and trim other unneeded dependencies.
llvm-svn: 125820
2011-02-18 02:25:12 +00:00
Chris Lattner
d12b480e29
handle labeldecls.
...
llvm-svn: 125806
2011-02-18 00:52:55 +00:00