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

883 Коммитов

Автор SHA1 Сообщение Дата
Michael J. Spencer 04a4279160 Reduce the amount of state in the Option class by relying on the data from OptTable::Info.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162299 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-21 18:51:17 +00:00
Chad Rosier a7afeb0404 [driver] Add support for the --param ssp-buffer-size= driver option.
PR9673


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162285 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-21 16:16:06 +00:00
John McCall 0a7dd788db Screw around with ObjCRuntime some more, changing the
diagnostics for bad deployment targets and adding a few
more predicates.  Includes a patch by Jonathan Schleifer
to enable ARC for ObjFW.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162252 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-21 02:47:43 +00:00
Michael J. Spencer 4327557dfa Make Option non virtual.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162231 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-20 21:41:17 +00:00
Jordan Rose e1ce783708 [analyzer] Turn -cfg-add-initializers on by default, and remove the flag.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161060 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-31 18:04:59 +00:00
Alexander Kornienko 171af64ef1 Added -ast-list option to dump filterable AST decl node names.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161040 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-31 09:37:40 +00:00
Alexander Kornienko e34a052d64 Added -ast-dump-filter option to clang -cc1.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160784 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-26 16:01:23 +00:00
Chad Rosier d256f8673b Rename -fms-inline-asm to -fenable-experimental-ms-inline-asm.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160590 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-20 23:12:26 +00:00
Chad Rosier 0cfe9a1ceb Revert accidental commit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160574 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-20 21:22:24 +00:00
Chad Rosier f925e0414d Add a new flag, -fms-inline-asm, that enables the output of MS-style inline
assembly.  

By default, we don't emit IR for MS-style inline assembly (see r158833 as to 
why).  This is strictly for testing purposes and should not be enabled with the
expectation that things will work.  This is a temporary flag and will be removed
once MS-style inline assembly is fully supported.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160573 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-20 21:20:33 +00:00
Jordan Rose b13291aa59 Capitalize "Objective-C" and "C++" in user-facing contexts.
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160516 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-19 18:10:18 +00:00
Bob Wilson 455e72e762 Define __FINITE_MATH_ONLY__ based on -ffast-math and -ffinite-math-only.
This macro was being unconditionally set to zero, preceded by a FIXME comment.
This fixes <rdar://problem/11845441>.  Patch by Michael Gottesman!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160491 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-19 03:52:53 +00:00
Tanya Lattner 198871cc90 Add OpenCL metadata for kernel arg names. This output is controlled via a flag as noted in the OpenCL Spec.
Includes a test case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160092 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-11 23:02:10 +00:00
Benjamin Kramer 6994bb61ef Add missing options for -m(no-){pclmul,fma,xop}.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159913 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-08 09:45:00 +00:00
Benjamin Kramer 84f30809a2 Wire up -mrdrnd for X86.
For some reason GCC decided to call the feature rdrnd instead of rdrand,
which requires translating it for LLVM.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159897 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-07 09:39:18 +00:00
Ted Kremenek e8cf7d1434 Re-apply r159875 with fixes.
- Split pedantic driver flag test into separate test file, and XFAIL on cygwin,mingw32
- Fix bug in tablegen logic where a missing '{' caused errors to be included in -Wpedantic.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159892 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-07 05:53:30 +00:00
NAKAMURA Takumi 3b4c532596 Revert rr159875, "Implement -Wpedantic and --no-pedantic to complement -Weverything." It broke several builds.
I suspect FileCheck might match assertion failure, even if clang/test/Misc/warning-flags.c passed the test.

> 0. Program arguments: bin/./clang -### -pedantic -Wpedantic clang/test/Driver/warning-options.cpp

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159886 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-07 02:48:02 +00:00
Ted Kremenek 25570a94ca Implement -Wpedantic and --no-pedantic to complement -Weverything.
This patch introduces some magic in tablegen to create a "Pedantic" diagnostic
group which automagically includes all warnings that are extensions.  This
allows a user to suppress specific warnings traditionally under -pedantic used
an ordinary warning flag.  This also allows users to use #pragma to silence
specific -pedantic warnings, or promote them to errors, within blocks of text
(just like any other warning).

-Wpedantic is NOT an alias for -pedantic.  Instead, it provides another way
to (a) activate -pedantic warnings and (b) disable them.  Where they differ
is that -pedantic changes the behavior of the preprocessor slightly, whereas
-Wpedantic does not (it just turns on the warnings).

The magic in the tablegen diagnostic emitter has to do with computing the minimal
set of diagnostic groups and diagnostics that should go into -Wpedantic, as those
diagnostics that already members of groups that themselves are (transitively) members
of -Wpedantic do not need to be included in the Pedantic group directly.  I went
back and forth on whether or not to magically generate this group, and the invariant
was that we always wanted extension warnings to be included in -Wpedantic "some how",
but the bookkeeping would be very onerous to manage by hand.

-no-pedantic (and --no-pedantic) is included for completeness, and matches many of the
same kind of flags the compiler already supports.  It does what it says: cancels out
-pedantic.  One discrepancy is that if one specifies --no-pedantic and -Weverything or
-Wpedantic the pedantic warnings are still enabled (essentially the -W flags win).  We
can debate the correct behavior here.

Along the way, this patch nukes some code in TextDiagnosticPrinter.cpp and CXStoredDiagnostic.cpp
that determine whether to include the "-pedantic" flag in the warning output.  This is
no longer needed, as all extensions now have a -W flag.

This patch also significantly reduces the number of warnings not under flags from 229
to 158 (all extension warnings).  That's a 31% reduction.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159875 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-06 23:07:31 +00:00
Lang Hames c9686716d2 Add -ffp-contract = { fast | on | off } command line option support.
This flag sets the 'fp-contract' mode, which controls the formation of fused
floating point operations. Available modes are:

- Fast: Form fused operations anywhere. 
- On: Form fused operations where allowed by FP_CONTRACT. This is the default
      mode.
- Off: Don't form fused operations (in future this may be relaxed to forming
       fused operations where it can be proved that the result won't be
       affected).

Currently clang doesn't support the FP_CONTRACT pragma, so the 'On' and 'Off'
modes are equivalent.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159794 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-06 00:59:19 +00:00
Simon Atanasyan d797a85866 MIPS: Add -mdsp/-mno-dsp and -mdspr2/-mno-dspr2 command line options support.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159769 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-05 19:23:00 +00:00
Simon Atanasyan 0b273efa37 MIPS: Add -mips16 / -mno-mips16 command line support.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159747 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-05 14:19:39 +00:00
David Chisnall 2c7886ddec Hoist the logic for selecting the Objective-C dispatch method into the runtime
class, from the target.  No functionality change, just less duplicated logic.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159710 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-04 11:52:24 +00:00
James Dennett 109e6de8db Documentation cleanup:
* Added file header documentation with \file and \brief;
* Cleaned up existing doc comments and added/annotated \brief summaries.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159629 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-02 23:57:26 +00:00
Dmitri Gribenko d99ef536b2 Add a new libclang completion API to get brief documentation comment that is
attached to a declaration in the completion string.

Since extracting comments isn't free, a new code completion option is
introduced.

A new code completion option that enables including brief comments
into CodeCompletionString should be a, err, code completion option.
But because ASTUnit caches global declarations during parsing before
even completion consumer is created, the option is duplicated as a
translation unit option (in both libclang and ASTUnit, like the option
to cache code completion results).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159539 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-02 17:35:10 +00:00
David Blaikie e75d9cfbf4 Use -frewrite-includes for crash reports.
In future changes we should:
* use __builtin_trap rather than derefing 'random' volatile pointers.
* avoid dumping temporary files into /tmp when running tests, instead
  preferring a location that is properly cleaned up by lit.

Review by Chandler Carruth.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159469 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-29 22:03:56 +00:00
Hans Wennborg de981f3ff1 Add -ftls-model command-line flag.
This allows for setting the default TLS model. (PR9788)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159336 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-28 08:01:44 +00:00
Richard Trieu 246b6aa676 Add template type diffing to Clang. This feature will provide a better
comparison between two templated types when they both appear in a diagnostic.
Type elision will remove indentical template arguments, which can be disabled
with -fno-elide-type.  Cyan highlighting is applied to the differing types.

For more formatting, -fdiagnostic-show-template-tree will output the template
type as an indented text tree, with differences appearing inline. Template
tree works with or without type elision.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159216 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-26 18:18:47 +00:00
Chad Rosier 7ed4f66328 [driver] Make -serialize-diagnostics (one dash) and alias for
--serialize-diagnostics.
rdar://11734800


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159208 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-26 16:57:41 +00:00
Alexey Samsonov 7f3260764a Improve support for -g options accepted by Clang:
1. Accept flags -g[0-3], -ggdb[0-3], -gdwarf-[2-4] and collapse them to simple -g (except -g0/-ggdb0).
2. Produce driver error on unsupported formats (-gcoff, -gstabs, -gvms) and options (-gtoggle).
3. Recognize and ignore flags -g[no-]strict-dwarf, -g[no-]record-gcc-switches.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158906 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-21 08:22:39 +00:00
Ted Kremenek 8ab6c24076 Revert "Provide a -no-pedantic to cancel out -pedantic." This needs to be designed
a bit further.  We may wish to just have -Wno flags to silence warnings, and not have a -no-pedantic.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158796 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-20 07:03:37 +00:00
John McCall 260611a325 Restructure how the driver communicates information about the
target Objective-C runtime down to the frontend:  break this
down into a single target runtime kind and version, and compute
all the relevant information from that.  This makes it
relatively painless to add support for new runtimes to the
compiler.  Make the new -cc1 flag, -fobjc-runtime=blah-x.y.z,
available at the driver level as a better and more general
alternative to -fgnu-runtime and -fnext-runtime.  This new
concept of an Objective-C runtime also encompasses what we
were previously separating out as the "Objective-C ABI", so
fragile vs. non-fragile runtimes are now really modelled as
different kinds of runtime, paving the way for better overall
differentiation.

As a sort of special case, continue to accept the -cc1 flag
-fobjc-runtime-has-weak, as a sop to PLCompatibilityWeak.

I won't go so far as to say "no functionality change", even
ignoring the new driver flag, but subtle changes in driver
semantics are almost certainly not intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158793 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-20 06:18:46 +00:00
Rafael Espindola 8af669f2f1 Add a -fuse-init-array option to cc1 and map to the UseInitArray target
option. On the driver, check if we are using libraries from gcc 4.7 or newer
and if so pass -fuse-init-array to the frontend.
The crtbegin*.o files in gcc 4.7 no longer call the constructors listed in
.ctors, so we have to use .init_array.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158694 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-19 01:26:10 +00:00
Hal Finkel c4033f3182 For compatibility with gcc, accept -maltivec as an alias of -faltivec.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158613 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-17 02:29:23 +00:00
James Dennett 86123c6ca9 Documentation cleanup:
* Converted comments to use \brief to provide summaries;
* Fixed uses of \arg that should be \p;
* Fixed \param [in] [out] to \param [in,out];
* Made minor formatting fixes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158510 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-15 08:55:05 +00:00
James Dennett c1a88f27be Documentation cleanup: use \p ParameterName when referring to a parameter,
not \arg ParameterName (which should be used only when documenting that
parameter, not when referring to it from elsewhere).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158509 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-15 08:49:07 +00:00
David Blaikie 940152f726 Support -f[no-]rewrite-includes from the driver.
Review by Chandler Carruth.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158463 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-14 18:55:27 +00:00
David Blaikie f1492f970c Support -frewrite-includes as an option while preprocessing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158460 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-14 17:36:09 +00:00
David Blaikie 60ad16b7e2 Rename -rewrite-includes to -frewrite-includes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158458 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-14 17:36:01 +00:00
Richard Smith f122a138e3 Add -isystem-prefix and -ino-system-prefix arguments, which can be used to
override whether headers are system headers by checking for prefixes of the
header name specified in the #include directive.

This allows warnings to be disabled for third-party code which is found in
specific subdirectories of include paths.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158418 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-13 20:27:03 +00:00
John McCall dc9327a8da Provide a -no-pedantic to cancel out -pedantic.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158416 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-13 19:48:01 +00:00
Jordan Rose b8c5e6b938 Fix Makefile: Options.td depends on CC1Options.td.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158105 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-06 20:46:55 +00:00
David Blaikie 8c0b3787e7 Add a -rewrite-includes option, which is similar to -rewrite-macros, but only expands #include directives.
Patch contributed by Lubos Lunak (l.lunax@suse.cz).
Review by Matt Beaumont-Gay (matthewbg@google.com).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158093 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-06 18:52:13 +00:00
Benjamin Kramer 48d798ce32 Fix typos found by http://github.com/lyda/misspell-check
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157886 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-02 10:20:41 +00:00
Simon Atanasyan 003ab66823 Factor out the code retrieves the last PIC related argument from
the Clang::ConstructJob() to the new ArgList::getLastArg() routine
with eight argument. That simplifies reusing of this code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157633 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-29 18:50:33 +00:00
Argyrios Kyrtzidis d6277fb9e0 [driver] When creating the compiler invocation out of command-line
arguments, force use of clang frontend for the driver.

Fixes rdar://11356765.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157205 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-21 20:11:54 +00:00
Chad Rosier a39238bda4 Add -mno-implicit-float to the M group.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157014 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-17 20:53:37 +00:00
Chad Rosier 005af27c60 Rename the driver option to -mno-implicit-float, per Eli's suggestion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156950 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-16 21:19:55 +00:00
Chad Rosier ee9ad5ce48 [driver] Allow the driver to directly accept the -no-implicit-float option, so that the
generation of implicit floating point instructions can be disable for ARM. 
rdar://11409142


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156942 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-16 20:40:09 +00:00
Sirish Pande 5f9688b7c7 Hexagon V5 FP support.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156567 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-10 20:19:54 +00:00
Nuno Lopes b3198a841e add -fbounds-checking option.
When enabled, clang generates bounds checks for array and pointers dereferences. Work to follow in LLVM's backend.

OK'ed by Chad; thanks for the review.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156431 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-08 22:10:46 +00:00