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

358 Коммитов

Автор SHA1 Сообщение Дата
Eli Friedman c71133f0cf Remove unused LangOptions NoExtensions and Boolean.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70282 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-28 03:28:55 +00:00
Mike Stump fc0fed3fc7 We avoid the count of diagnostics when not generating carent
diagnostics to improve gcc compatibility; useful for dejagnu testing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70278 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-28 01:19:10 +00:00
Chris Lattner cc7dea8f32 -E, -Eonly and -parse-noop now work with PCH!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70259 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-27 22:02:30 +00:00
Chris Lattner d1d64a0275 Teach PCH that ASTContext is optional. Move -parse-noop and -Eonly (so far)
processing to after PCH is loaded.  -Eonly and -parse-noop are close to working
with PCH now but are not quite there yet.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70257 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-27 21:45:14 +00:00
Chris Lattner 1aee61a713 unnest some code, decoupling fixit rewriting from ast stuff.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70250 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-27 21:25:27 +00:00
Daniel Dunbar 57cbfc0c52 Add -empty-input-only option, for timing.
- Forces input file to be empty to time startup/shutdown costs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70249 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-27 21:19:07 +00:00
Douglas Gregor 4fed3f47f6 Implement caching of stat() calls for precompiled headers, which is
essentially the same thing we do with pretokenized headers. stat()
caching improves performance of the Cocoa-prefixed "Hello, World" by
45%.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70223 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-27 18:38:38 +00:00
Sebastian Redl d3a413d3b8 Implement function-try-blocks. However, there's a very subtle bug that I can't track down.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70155 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-26 20:35:05 +00:00
Douglas Gregor 609e72f55a Add a new -ast-dump-full option that traverses the translation unit
declaration rather than printing through the HandleTopLevelDecl
action. Using this, one can deserialize an entire PCH file and dump
it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70108 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-26 02:02:08 +00:00
Chris Lattner c50a280d6c minor cleanups to ast-dump, use getBody(context).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70095 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-25 23:31:28 +00:00
Douglas Gregor 8f36aba016 The ivars in an ObjCImplementationDecl are now stored in the
DeclContext rather than in a separate list. This makes PCH
(de-)serialization trivial, so that ivars can be loaded lazily.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69857 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-23 03:23:08 +00:00
Douglas Gregor 653f1b1bf2 Eliminate the three SmallVectors in ObjCImplDecl (for instance
methods, class methods, and property implementations) and instead
place all of these entities into the DeclContext.

This eliminates more linear walks when looking for class or instance
methods and should make PCH (de-)serialization of ObjCDecls trivial
(and lazy).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69849 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-23 01:02:12 +00:00
Douglas Gregor 370187c8a3 Remove the serialization code that predates precompiled
headers. Future approaches to (de-)serializing ASTs will be based on
the PCH infrastructure.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69828 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-22 21:45:53 +00:00
Douglas Gregor 2deaea37a6 Lazy loading of builtins for precompiled headers.
PCH files now contain complete information about builtins, including
any declarations that have been synthesized as part of building the
PCH file. When using a PCH file, we do not initialize builtins at all;
when needed, they'll be found in the PCH file.

This optimization translations into a 9% speedup for "Hello, World!"
with Carbon.h as a prefix header and roughly a 5% speedup for 403.gcc
with its prefix header. We're also reading less of the PCH file for
"Hello, World!":

*** PCH Statistics:
  286/20693 types read (1.382110%)
  1630/59230 declarations read (2.751984%)
  764/44914 identifiers read (1.701029%)
  1/32954 statements read (0.003035%)
  5/6187 macros read (0.080815%)

down from

*** PCH Statistics:
  411/20693 types read (1.986179%)
  2553/59230 declarations read (4.310316%)
  1093/44646 identifiers read (2.448148%)
  1/32954 statements read (0.003035%)
  21/6187 macros read (0.339421%)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69815 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-22 18:49:13 +00:00
Douglas Gregor b6c8c8bd8d Explictly track tentative definitions within Sema, then hand those
tentative definitions off to the ASTConsumer at the end of the
translation unit. 

Eliminate CodeGen's internal tracking of tentative definitions, and
instead hook into ASTConsumer::CompleteTentativeDefinition. Also,
tweak the definition-deferal logic for C++, where there are no
tentative definitions.

Fixes <rdar://problem/6808352>, and will make it much easier for
precompiled headers to cope with tentative definitions in the future.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69681 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-21 17:11:58 +00:00
Steve Naroff 30833f8d77 Add pch reader/writer support for most of DeclObjC.h. Very close to reading/writing all ObjC AST nodes that we will encounter in header files (still a few FIXME's).
Once selector support is in place, we should be able to take this for a spin (and add test cases).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69674 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-21 15:12:33 +00:00
Chris Lattner e116ccf140 Split preprocessor initialization logic out of clang-cc into
libfrontend.  Patch by Alexei Svitkine!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69664 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-21 05:40:52 +00:00
Chris Lattner 182e09240a rename -fprint-source-range-info -> -fdiagnostics-print-source-range-info.
Temporarily accept both of them, I'll rip out the old one after awhile.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69662 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-21 05:34:31 +00:00
Steve Naroff 33feeb019a Add pch reader/writer support for ObjCContainerDecl, ObjCInterfaceDecl, & ObjCIvarDecl.
Next step: Add selector support to PCHWriter::AddDeclarationName().



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69619 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-20 20:09:33 +00:00
Douglas Gregor e778504010 Introduce the notion of a SemaConsumer, which is an ASTConsumer that
also gets access to the Sema object performing semantic analysis. This
will be used by the PCH writer to serialize Sema state.

No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69595 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-20 15:53:59 +00:00
Douglas Gregor 3432fa591c Make the on-disk hash table usable with non-file
raw_ostreams. Requires LLVM r69583.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69584 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-20 07:36:26 +00:00
Douglas Gregor 9378ba44b3 Move the on-disk hash table code into its own header. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69580 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-20 07:08:21 +00:00
Chris Lattner 3bc172bc6a move group twiddling options into Diagnostic.cpp instead of
Warnings.cpp.  Warnings.cpp now doesn't need to #include
tblgen produced output directly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69559 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-19 22:34:23 +00:00
Chris Lattner 5b912d9832 Fix PR4007: clang doesn't know -Werror-foo is the same as -Werror=foo
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69557 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-19 22:07:21 +00:00
Chris Lattner aa5bf2e8dc implement compiler support for -fno-diagnostics-fixit-info,
rdar://6805442


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69525 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-19 07:44:08 +00:00
Chris Lattner aa269c2e9c invalid directives can occur in #if 0 code, just pass them
through like other directives PTH doesn't care about.  This
should fix rdar://6804029


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69524 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-19 07:32:03 +00:00
Chris Lattner 2135619d93 make PTH not crash on a null directive (# on its own line)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69523 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-19 07:25:40 +00:00
Chris Lattner d4b1446dfa use isNot instead of !is
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69522 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-19 07:15:51 +00:00
Chris Lattner 01638a619a fix -fdollars-in-identifiers to have a default that is overriden
by the command line option if present.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69521 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-19 07:06:52 +00:00
Chris Lattner f5db8f82d5 fix rdar://6804322 by wiring up -fdollars-in-identifiers
with assembler-with-cpp mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69520 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-19 07:00:02 +00:00
Douglas Gregor 7297134f12 FunctionDecl::getBody() is getting an ASTContext argument for use in
lazy PCH deserialization. Propagate that argument wherever it needs to
be. No functionality change, except that I've tightened up a few PCH
tests in preparation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69406 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-18 00:02:19 +00:00
Chris Lattner 75a97cb319 implement a new clang-cc option -dump-build-information=filename which causes the
compiler to dump random stuff from the build into the file.  Right now this
amounts to dumping command line arguments and diagnostics to the file.

The idea is that you can set an envvar, do a world build of an OS, then grep 
through all the logs for interesting things or something.

Daniel, please wire the driver up to do something with this.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69386 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-17 21:05:01 +00:00
Chris Lattner 409d4e716a refactor htmldiags to be created up front like the other diag clients.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69379 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-17 20:40:01 +00:00
Chris Lattner 40469651a3 add a virtual method to DiagnosticClient to get rid of some fragile
casting in clang-cc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69377 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-17 20:16:08 +00:00
Fariborz Jahanian 448f5e6c19 Added -print-ivar-layout option. No change in functionality
yet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69346 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-17 03:04:15 +00:00
Daniel Dunbar ec9587d5be Support QA_OVERRIDE_GCC3_OPTIONS
- Cover your eyes...

 - This is a simple but effective way to allow developers to build a
   project with clang while manipulating the command line, without
   having to edit the project itself.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69342 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-17 01:54:00 +00:00
Chris Lattner d51d74a3e8 implement framework for -fdiagnostics-show-option, but tblgen isn't
passing down the right info yet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69268 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-16 05:44:38 +00:00
Chris Lattner b54b276a92 move handling of -pedantic and -pedantic-errors into Diagnostics,
out of Warnings.cpp.  This simplifies warnings.cpp and makes it more
efficient.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69266 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-16 05:04:32 +00:00
Chris Lattner 2b07d8fe9e arrange for -Wno-error=foo warnings to be immune to -Werror as
they are supposed to be.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69265 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-16 04:32:54 +00:00
Chris Lattner 8ac3af96a1 when tblgen fills in all the subgroup info, clang is ready for it.
This depends on r69249 of llvm.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69250 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-16 00:53:55 +00:00
Chris Lattner 9a7e556470 make unknown warnings a warning, not an error.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69239 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 22:48:58 +00:00
Chris Lattner c83b60de5d add support for -Wextra and -W
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69236 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 22:38:06 +00:00
Chris Lattner d7492c4f91 use tablgen-generated warning groups.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69221 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 20:58:49 +00:00
Chris Lattner af008839f3 now that we've decoupled diagnostic classes from default mappings,
move the remaining default mapping exceptions from C++ code into
the .td files.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69183 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 17:20:11 +00:00
Chris Lattner 9dbbdbf637 rename variable in comment, not just in code :).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69166 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 14:42:02 +00:00
Chris Lattner 27ceb9d77d Rejigger how -pedantic and -pedantic-errors work and their interaction
with other diagnostic mapping.  In the new scheme, -Wfoo or -Wno-foo or 
-Werror=foo all override the -pedantic options, and __extension__ 
robustly silences all extension diagnostics in their scope.

An added bonus of this change is that MAP_DEFAULT goes away, meaning that
per-diagnostic mapping information can now be stored in 2 bits, doubling
the density of the Diagnostic::DiagMapping array.  This also 
substantially simplifies Diagnostic::getDiagnosticLevel.

OTOH, this temporarily introduces some "macro intensive" code in 
Diagnostic.cpp.  This will be addressed in a later patch.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69154 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 07:01:18 +00:00
Chris Lattner e9e0cc7999 remove some commented out -Wstrict-selector-match stuff.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69148 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 04:57:48 +00:00
Chris Lattner 6280dbcb48 clean up error messages.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69142 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 04:51:48 +00:00
Chris Lattner 1d13a5d5ab Add support for -Werror=foo and -Wno-error=foo
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69138 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 04:37:12 +00:00
Chris Lattner 5147e8e018 refactor a bunch of the warning parsing stuff to simplify it. This removes the
-Wfoo=ignore syntax.  GCC supports -Wno-foo, no need to invent our own stuff.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69136 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 04:27:38 +00:00