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

65 Коммитов

Автор SHA1 Сообщение Дата
Chandler Carruth eb5d7b7526 Add support for '-fgnu-keywords' and '-fasm' to Clang's driver. They are not
implemented precisely the same as GCC, but the distinction GCC makes isn't
useful to represent. This allows parsing code which uses GCC-specific keywords
('asm', etc.) without parsing in a fully GNU mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101667 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17 20:17:31 +00:00
Anders Carlsson 046c294a43 Vtable -> VTable renames across the board.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101666 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17 20:15:18 +00:00
Daniel Dunbar fb937b8c5f clang -cc1: Add a -fno-bitfield-type-align option, for my own testing purposes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101370 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-15 15:06:22 +00:00
Daniel Dunbar 3f87fb08dd Driver/Frontend: Add support for -mllvm, which forwards options to the LLVM option parser.
- Note that this is a behavior change, previously -mllvm at the driver level forwarded to clang -cc1. The driver does a little magic to make sure that '-mllvm -disable-llvm-optzns' works correctly, but other users will need to be updated to use -Xclang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101354 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-15 06:09:03 +00:00
Chris Lattner dd17394d22 implement altivec.h and a bunch of support code, patch by Anton Yartsev!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101215 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-14 03:54:58 +00:00
Zhongxing Xu c09289d104 Add a cc1 option to specify the max number of nodes the analyzer can explore.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101120 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-13 06:44:31 +00:00
Chris Lattner bbea716832 add frontend support for -fdata-sections and -ffunction-sections,
patch by Sylvere Teissier!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101108 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-13 00:38:24 +00:00
Anders Carlsson 46116ce06a Rename -dump-record-layouts to -fdump-record-layouts now that the option behaves like aa flag.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100943 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-10 19:09:13 +00:00
John McCall 7002f4c03c Turn access control on by default in -cc1.
Remove -faccess-control from -cc1; add -fno-access-control.
Make the driver pass -fno-access-control by default.
Update a bunch of tests to be correct under access control.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100880 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-09 19:03:51 +00:00
Daniel Dunbar b69eca5d21 Fronted: Kill overly specialized RecordLayoutDumper, just make -dump-record-layouts a bit that Sema honors.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100747 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-08 02:59:56 +00:00
Chris Lattner 83e7a78a9f rename llvm::llvm_report_error -> llvm::report_fatal_error
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100708 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 22:58:06 +00:00
Chris Lattner c100214fdc add clang -cc1 level support for "-ferror-limit 42"
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100687 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 20:37:06 +00:00
Douglas Gregor 4c2bcad7b8 Implement support for -nostdc++. Fixes PR6446.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99417 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 20:13:48 +00:00
Daniel Dunbar efb0fa9e11 C++: Add support for -fno-use-cxa-atexit.
- So much typing, so little gain...

Also, rename the __cxx_global_initialization function just to match llvm-gcc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99039 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-20 04:15:41 +00:00
Daniel Dunbar 2758595023 clang -cc1: Kill off -empty-input only, and replace with -init-only which is an
actual action.
 - This is easier to use, and more reliable for timing the thing this was
   actually meant to be useful for.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98978 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 19:44:04 +00:00
Douglas Gregor 94dc8f640e Optionally store a PreprocessingRecord in the preprocessor itself, and
tie its creation to a CC1 flag -detailed-preprocessing-record.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98963 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 16:15:56 +00:00
John McCall 4b7a834e0f Add support for -Wwrite-strings. Patch by Mike M! Fixes PR 4804.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98541 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-15 10:54:44 +00:00
John McCall d46f98573b Re-introduce the ctor/dtor alias optimization, this time hidden behind a
command-line option which defaults off.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96649 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-19 01:32:20 +00:00
John McCall b689afb750 Raise the responsibility for passing -disable-llvm-verifier in NDEBUG builds
to the driver, and support it in CodeGenOptsToArgs().  Note that this changes
the default behavior of clang -cc1 to always run the verifier.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96077 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-13 03:50:24 +00:00
John McCall 824e19ed92 Add an option to disable the LLVM verifier pass (which is still always
disabled in NDEBUG builds).  The option applies only to -cc1 invocations and is:
  -disable_llvm_verifier



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96046 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-12 23:47:27 +00:00
Anders Carlsson 824d7ea07a Check in the beginnings of my new vtable layout builder idea.
Right now, it's off by default but can be tested by passing -fdump-vtable-layouts to clang -cc1. This option will cause all vtables that will normally be emitted as part of codegen to also be dumped using the new layout code.

I've also added a very simple new vtable layout test case.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95865 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-11 08:02:13 +00:00
Daniel Dunbar 7348288456 clang -cc1: Add -fsjlj-exceptions, which requires far too much button pushing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95785 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-10 18:48:44 +00:00
Fariborz Jahanian 412e798941 Implement synthesizing properties by default.
This is a non-fragile-abi feature only. Since it
breaks existing code, it is currently placed under
-fobjc-nonfragile-abi2 option for test purposes only
until further notice. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95685 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-09 19:31:38 +00:00
Douglas Gregor 9bed879896 Introduce a testbed for merging multiple ASTs into a single AST
context with the AST importer. WIP, still useless but at least it has
a test.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95683 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-09 19:21:46 +00:00
Anders Carlsson a508b7de6c Add support for threadsafe statics, and make them the default (matching gcc).
Daniel, I'd appreciate a review of the driver/cc1 parts.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95508 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-06 23:23:06 +00:00
Daniel Dunbar da1573f959 clang -cc1: Wire up -emit-obj, for emitting object files.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95182 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-03 01:18:43 +00:00
Daniel Dunbar 984eb8611d Driver/Frontend: Add support for -fobjc-legacy-dispatch, not yet used.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95004 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-01 21:07:25 +00:00
Douglas Gregor d93256e556 Introduce serialization and deserialization of diagnostic information
so that CIndex can report diagnostics through the normal mechanisms
even when executing Clang in a separate process. This applies both
when performing code completion and when using ASTs as an intermediary
for clang_createTranslationUnitFromSourceFile().

The serialized format is not perfect at the moment, because it does
not encapsulate macro-instantiation information. Instead, it maps all
source locations back to the instantiation location. However, it does
maintain source-range and fix-it information. To get perfect fidelity
from the serialized format would require serializing a large chunk of
the source manager; at present, it isn't clear if this code will live
long enough for that to matter.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94740 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-28 06:00:51 +00:00
Chris Lattner 52388f9aef diagnose invalid values of -ftabstop, patch by Christian Adaker!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93288 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 03:06:50 +00:00
Chris Lattner 124fca533d implement -ftabstop=width, patch by Christian Adåker
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93078 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-09 21:54:33 +00:00
Dan Gohman c31176d5eb Use -fno-math-errno by default, and remove the IsMathErrnoDefault
targethook, which is no longer being used. This fixes PR5971.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92987 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-08 02:20:44 +00:00
Kovarththanan Rajaratnam 49ac8e63a0 Remove RewriteBlocks. It has been superseded by RewriteObjC
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92014 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 18:03:34 +00:00
Daniel Dunbar 38b48afd33 clang -cc1: Rename -mcpu to -target-cpu to match other target options and not alias driver/backend option.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91671 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-18 06:30:12 +00:00
Daniel Dunbar f2d8b9f967 Add -dwarf-debug-flags, which provides a way to embed the cc1 level options used
to compile a translation unit into the debug info for that file.
 - Used by parts of Darwin build process to check compiler flags, etc.
 - <rdar://problem/7256886> clang does not emit AT_APPLE_flags

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91661 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-18 02:43:17 +00:00
Daniel Dunbar 8663b18008 Fix -fdollars-in-identifiers Clang translation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91562 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-16 20:10:18 +00:00
Nuno Lopes fc2844846e implement PR5654: add -fassume-sane-operator-new, which is enabled by default, and adds the malloc attribute to the global function new() and to the overloaded new operators.
feel free to chage the name to this lengthy argument

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91543 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-16 16:59:22 +00:00
Daniel Dunbar 8b9adfea5e 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91370 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-15 00:06:45 +00:00
Daniel Dunbar 1e69fe3a9f CompilerInvocation: Move builtin-include-path logic out of CompilerInvocation::CreateFromArgs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91237 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-13 03:45:58 +00:00
Jeffrey Yasskin 9f61aa9e28 Un-namespace-qualify llvm_unreachable. It's a macro, so the qualification gave
no extra safety anyway.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91207 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-12 05:05:38 +00:00
Mike Stump 9c276ae0f2 Implement runtime checks for undefined behavior. WIP.
This implements a new flag -fcatch-undefined-behavior.  The flag turns
on additional runtime checks for:

  T a[I];

  a[i]    abort when i < 0 or i >= I.

Future stuff includes shifts by >= bitwidth amounts.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91198 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-12 01:27:46 +00:00
Ted Kremenek fc576514d0 Add clang-cc option '-analyzer-opt-analyze-nested-blocks' to treat block literals as an entry point for analyzer checks.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90810 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 22:06:12 +00:00
Daniel Dunbar 93ebb1ba9f Switch PCHReader::getOriginalSourceFile to use proper diagnostics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90434 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 09:13:06 +00:00
Daniel Dunbar 9b5e9ae08d clang-cc: Honor -help and -version when using new style option parsing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90422 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 07:01:58 +00:00
Daniel Dunbar e14b5f5237 Add clang -cc1 support for -remap-file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90414 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 05:11:16 +00:00
Daniel Dunbar efba227cc5 Add clang -cc1 -load option.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90413 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 05:11:05 +00:00
Mike Stump de05057932 Change rtti/Rtti to RTTI, as it is an acronym.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90334 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 18:57:08 +00:00
Daniel Dunbar 56ac85c4fd clang -cc1: Move CompilerInvocation deserialization into CompilerInvocation.cpp,
where it belongs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90198 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 03:16:53 +00:00
Daniel Dunbar 3b315264d1 Add CodeGenOptions::{SoftFloat,FloatABI}, and update the all the (far too many) places to use this instead of using the backend -soft-float and -float-abi= options.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90127 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 08:42:00 +00:00
Daniel Dunbar f219e7c152 Move LLVM backend options to explicit clang-cc / clang -cc1 options, which we then manually pass to the command line library; eventually the latter grossness should be fixed by a real API when creating the target machine.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90063 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-29 07:18:39 +00:00
Daniel Dunbar e50c16773b Add clang -cc1 parsing for LangOptions.
- This is the last major parsing piece, main FIXMEs remain.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90059 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-29 05:52:21 +00:00