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

386 Коммитов

Автор SHA1 Сообщение Дата
Anders Carlsson a33d9b4ebf Disable access control by default. It can be enabled with the -faccess-control option. When we have better support for it, we can enable it by default again.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71706 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-13 19:49:53 +00:00
Chris Lattner cfe858aa7c remove the obsolete -fprint-source-range-info option
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71675 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-13 17:08:18 +00:00
Douglas Gregor b64c19365d Make precompiled headers work with -E. When we're only preprocessing
(with -E), we turn the PCH include into an implicit include of the
file from which the PCH file was generated.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71534 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-12 01:31:05 +00:00
Douglas Gregor 67187ceb21 Move terminal-width computation over to llvm::sys. Update to LLVM
r71448 required. Fixes PR 4148 and PR 4183.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71450 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-11 18:06:49 +00:00
Daniel Dunbar 913af35741 Remove -fobjc-tight-layout, seems to work!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71184 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-07 21:58:26 +00:00
Ted Kremenek 2c4036eda9 Fix <rdar://problem/6848739>. When using -analyze, -Werror has no effect.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71172 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-07 19:02:53 +00:00
Daniel Dunbar 1c4483065b If stderr isn't a terminal, don't try to guess the terminal width or
look at COLUMNS.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71120 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-06 21:28:42 +00:00
Daniel Dunbar 17ca3638e8 More x86 target feature support.
- Apologies for the extremely gross code duplication, I want to get
   this working and then decide how to get this information out of the
   back end.

 - This replaces -m[no-]sse4[12] by -m[no-]sse4, it appears gcc
   doesn't distinguish them?

 - -msse, etc. now properly disable/enable related features.

 - Don't always define __SSE3__...

 - The main missing functionality bit here is that we don't initialize
   the features based on the CPU for all -march options.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71117 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-06 21:07:50 +00:00
Chris Lattner 5aeb9e7a21 daniel is buggy :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71065 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-06 04:38:30 +00:00
Daniel Dunbar aa338bc431 Add missing include.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71063 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-06 04:07:06 +00:00
Daniel Dunbar fb4ac7b4bf Cleanup some FIXMEs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71062 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-06 03:48:17 +00:00
Daniel Dunbar 868bd0aa92 Improve handling of (X86) target features.
- This is a WIP...

 - This adds -march= handling to the driver, and fixes the defaulting
   of -mcpu on Darwin (which was using the wrong test).

Instead of handling -m{sse, ...} in the driver, pass them to clang-cc as
 -target-feature [+-]name

In clang-cc, communicate with the (clang) target to discover the legal
features of a target, and the features which are enabled based on
-mcpu. This is currently hardcoded just enough to not be a feature
regression, we need to get this information from the backend's
TableGen information somehow.

This is used to construct the full list of features which are being
used, which is in turn used to initialize the predefines.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71061 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-06 03:16:41 +00:00
Daniel Dunbar d25f00c21b Enable tight Objective-C interface layout unconditionally.
- I will remove the flag when I'm comfortable there is no fallout
   from this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70993 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-05 18:52:50 +00:00
Ted Kremenek 305d2d2b61 Increase scan-view max timeout to 1 minute.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70896 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-04 19:02:41 +00:00
Daniel Dunbar d6884a0b90 Add -fobjc-tight-layout.
- This implements gcc style Objective-C interface layout (I
   think). Currently it is always off, there is no functionality
   change unless this is passed.
   
   For the curious, the deal is that gcc lays out the fields of a
   subclass as if they were part of the superclass. That is, the
   subclass fields immediately follow the super class fields instead
   of being padded to the alignment of the superclass structure.

 - Currently gcc uses the tight layout in 32-bit and 64-bit modes, and
   llvm-gcc uses it in 32-bit only, for reasons which aren't clear
   yet. We probably want to switch to matching gcc, once this makes it
   through testing... my hope is that we can also fix llvm-gcc in
   order to maintain compatibility between the compilers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70827 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-04 05:16:21 +00:00
Daniel Dunbar e5393fb93e PR4063, with feeling: Chain PP callbacks by default.
- This is somewhat cleaner and also fixes PR4063 for real, I had the
   order wrong so we were just creating an empty dependency file.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70687 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03 10:04:17 +00:00
Daniel Dunbar 0a70c64b09 PR4063: Fix dependency generation with -E.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70686 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03 09:35:25 +00:00
Douglas Gregor 44cf08ecf6 Respect the COLUMNS environment variable for word-wrapping (so we get
word-wrapping by default in Emacs; yay!). Thanks, Daniel.

Use LLVM's System layer rather than calling isatty() directly.

Fix a thinko in printing the indentation string that was causing some
weird output.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70654 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03 03:52:38 +00:00
Daniel Dunbar 45d604e039 Remove ccc from the makefile as well.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70650 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-02 23:50:24 +00:00
Daniel Dunbar b83074dfa3 ccc is dead.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70649 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-02 22:13:56 +00:00
Douglas Gregor 68a0d783dd When -fmessage-length=N is not specified, and if standard error is
going to a terminal, word-wrap to the length of the terminal.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70611 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-02 00:03:46 +00:00
Douglas Gregor fffd93f383 Implement -fmessage-length=N, which word-wraps diagnostics to N columns.
Also, put a line of whitespace between the diagnostic and the source
code/caret line when the start of the actual source code text lines up
(or nearly lines up) with the most recent line of the diagnostic. For
example, here it's okay for the last line of the diagnostic to be
(vertically) next to the source line, because there is horizontal
whitespace to separate them:

decl-expr-ambiguity.cpp:12:16: error: function-style cast to a builtin
      type can only take one argument
  typeof(int)(a,5)<<a;

However, here is a case where we need the vertical separation (since
there is no horizontal separation):

message-length.c:10:46: warning: incompatible pointer types initializing 'void
      (int, float, char, float)', expected 'int (*)(int, float, short,
      float)'

      int (*fp1)(int, float, short, float) = f;

This is part one of <rdar://problem/6711348>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70578 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-01 21:53:04 +00:00
Bill Wendling 5532180ae3 Remove two unused options.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70457 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-30 00:55:13 +00:00
Bill Wendling 6e9b8f6d57 Use the new code gen optimization enum instead of passing in the optimization
level. This is more expressive.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70451 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-29 23:53:23 +00:00
Evan Cheng 306a6aa6a2 Match addPassesToEmitFile API change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70409 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-29 21:02:33 +00:00
Steve Naroff 621edce9cd Integrate 3 months of ObjC rewriter fixes (from the Apple/objective-rewrite branch).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70385 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-29 16:37:50 +00:00
Douglas Gregor 1ab86ac922 Make all PCH-incompatibility warnings into errors, and abort
compilation if the user requested a PCH file but no such PCH file
exists.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70332 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-28 22:01:16 +00:00
Douglas Gregor e721f95069 Allow some differences between the predefines buffer used to build a
PCH file and the predefines buffer used when including the PCH
file. We (explicitly) detect conflicting macro definitions (rejecting
the PCH file) and about missing macro definitions (they'll be
automatically pulled from the PCH file anyway).

We're missing some checking to make sure that new macro definitions
won't have any impact on the PCH file itself (e.g., #define'ing an
identifier that the PCH file used).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70316 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-28 18:58:38 +00:00
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