Commit Graph

639 Commits

Author SHA1 Message Date
Chris Lattner e23003d1f1 implement -ftabstop=width, patch by Christian Adåker
llvm-svn: 93078
2010-01-09 21:54:33 +00:00
Dan Gohman d1e76b957b Use -fno-math-errno by default, and remove the IsMathErrnoDefault
targethook, which is no longer being used. This fixes PR5971.

llvm-svn: 92987
2010-01-08 02:20:44 +00:00
Nate Begeman 0e1a625fe4 Allow clang to pass -x cl through to compiler driver.
llvm-svn: 92686
2010-01-05 06:00:15 +00:00
Benjamin Kramer d20ef75b91 Remove some dead variables clang-analyzer found.
llvm-svn: 92162
2009-12-25 15:43:36 +00:00
Nuno Lopes cfca1f0dc1 move a few more symbols to .rodata/.data.rel.ro
llvm-svn: 92012
2009-12-23 17:49:57 +00:00
Daniel Dunbar e0d2691b88 Driver: Fix '... -O4 -O0 ...', which was generating bitcode.
llvm-svn: 91962
2009-12-23 00:47:42 +00:00
Daniel Dunbar f4894fe0eb Driver: Drop ToolChain::getHost()
llvm-svn: 91960
2009-12-23 00:46:38 +00:00
Daniel Dunbar c7a67b7877 Driver: When linking, don't warn about unused arguments which are obviously only
used during compilation.
 - There is no easy way to define this group properly, unfortunately, and maybe
   this is a losing strategy. For now this is unambiguous more friendly, though.

llvm-svn: 91940
2009-12-22 23:19:32 +00:00
Daniel Dunbar 0def3d17cb ARM: Honor -mfpu= and set __VFP_FP__ and __ARM_NEON__ "correctly".
- Correctly is in quotes, because we are following what I interpreted as GCC's
   intent (which diverges from practice, naturally).
 - Also, fix the arch define for arm1136jf-s.

llvm-svn: 91855
2009-12-21 23:28:17 +00:00
Daniel Dunbar 083edf70a5 Add ToolChain::getDriver() and use it instead of going through the HostInfo
object.

llvm-svn: 91830
2009-12-21 18:54:17 +00:00
Daniel Dunbar e017ecc9e2 Remove ';' after method definition. Noticed by clang++, which one would think
would have a higher respect for its own code. This is getting old, is this
warning really adding value?

llvm-svn: 91779
2009-12-19 17:50:07 +00:00
Daniel Dunbar 893d475ba8 ARM: Use front-end specific target features "soft-float" and "soft-float-abi" to communicate FP mode to target; __SOFTFP__ is set correctly now.
llvm-svn: 91755
2009-12-19 04:15:38 +00:00
Daniel Dunbar a7d0231b66 clang -cc1: Rename -mcpu to -target-cpu to match other target options and not alias driver/backend option.
llvm-svn: 91671
2009-12-18 06:30:12 +00:00
Daniel Dunbar 24c7f5efc5 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

llvm-svn: 91661
2009-12-18 02:43:17 +00:00
Daniel Dunbar 15cef0ed42 Fix -fdollars-in-identifiers Clang translation.
llvm-svn: 91562
2009-12-16 20:10:18 +00:00
Nuno Lopes 13c88c7269 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

llvm-svn: 91543
2009-12-16 16:59:22 +00:00
Daniel Dunbar 34e0b8cdee Driver: Pass -resource-dir to clang -cc1, since the driver presumably already found itself.
llvm-svn: 91384
2009-12-15 01:02:52 +00:00
Jeffrey Yasskin 1615d45daa Un-namespace-qualify llvm_unreachable. It's a macro, so the qualification gave
no extra safety anyway.

llvm-svn: 91207
2009-12-12 05:05:38 +00:00
Mike Stump d954638f02 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.

llvm-svn: 91198
2009-12-12 01:27:46 +00:00
Ted Kremenek eadc7c3537 Make using '-fshort-enums' an error until it is actually implemented (changes the ABI, so it is dangerous to not error out if we don't support it). Fixes <rdar://problem/7461006>.
llvm-svn: 91191
2009-12-12 00:38:18 +00:00
Daniel Dunbar 6c536aa0fb Driver: Switch to using "clang" "-cc1" instead of "clang-cc".
llvm-svn: 91174
2009-12-11 23:00:49 +00:00
Nuno Lopes 221c1fd63e spread 'const' love to some variables. this considerably reduces the amount of dirty data around.
llvm-svn: 91002
2009-12-10 00:07:02 +00:00
Daniel Dunbar 6cc525b44e Unbreak clang-cc handling of -msoft-float / -mfloat-abi=, which I borked.
llvm-svn: 90873
2009-12-08 19:49:51 +00:00
Jeffrey Yasskin 567ae47b4a Remove several .c_str() to be forward-compatible with StringRef.
llvm-svn: 90822
2009-12-08 01:46:24 +00:00
Ted Kremenek 7bea9a1672 Enable '-analyzer-opt-analyze-nested-blocks' by default for testing.
llvm-svn: 90812
2009-12-07 22:26:14 +00:00
Rafael Espindola 59ae799efa Shorten the help test for -no-canonical-prefixes, put it behind HelpHidden and
claim it in Driver.cpp instead of Tools.cpp.

llvm-svn: 90777
2009-12-07 18:28:29 +00:00
Daniel Dunbar 1b52d8c4ec Unbreak -ccc-cxx and -ccc-clang-cxx defaulting.
llvm-svn: 90629
2009-12-05 00:13:59 +00:00
Daniel Dunbar acd6957b59 Driver: Switch -ccc-* options to using the standard options functionality.
- I still want to get rid of them, but manually handling them isn't adding value.

llvm-svn: 90602
2009-12-04 21:55:23 +00:00
Daniel Dunbar 78e9de56f4 OptTable: Allow option groups to be used to define "help groups", which will
collate the options inside that group.

llvm-svn: 90592
2009-12-04 21:08:40 +00:00
Daniel Dunbar 250bd17374 OptParser: Add HelpHidden flag.
llvm-svn: 90591
2009-12-04 21:08:25 +00:00
Rafael Espindola 73d4637545 Add gcc's -no-canonical-prefixes option to clang.
llvm-svn: 90577
2009-12-04 19:31:58 +00:00
Daniel Dunbar e357d5689e Fix Clang tool translation to forward -fvisibility as separate arguments, the
old syntax isn't supported.

llvm-svn: 90469
2009-12-03 18:42:11 +00:00
Daniel Dunbar 65b9952c2e Add OptTable::PrintHelp.
llvm-svn: 90420
2009-12-03 07:01:38 +00:00
Daniel Dunbar 120c77e4e9 Driver: Add Command::Creator member variable, which tracks the tool that was
used to create a particular command.

llvm-svn: 90287
2009-12-02 03:23:25 +00:00
Daniel Dunbar c70c39300f clang -cc1: Move CompilerInvocation deserialization into CompilerInvocation.cpp,
where it belongs.

llvm-svn: 90198
2009-12-01 03:16:53 +00:00
Daniel Dunbar a74f8ff15c 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.
llvm-svn: 90127
2009-11-30 08:42:00 +00:00
Daniel Dunbar 91dea8252a clang -cc1: Fix initialization of PreprocessorOptions::TokenCache.
llvm-svn: 90126
2009-11-30 08:41:42 +00:00
Daniel Dunbar 8c317acd2b clang -cc1: Fix -include-pch now that the test code is in clang-cc.
llvm-svn: 90124
2009-11-30 08:41:22 +00:00
Daniel Dunbar 599abb2d56 clang -cc1: Initialize LangOptions::{Optimize,NoInline}
llvm-svn: 90123
2009-11-30 08:41:13 +00:00
Daniel Dunbar 84bb793718 Always pass -fmessage-length using separate arguments.
llvm-svn: 90121
2009-11-30 08:40:54 +00:00
Daniel Dunbar 0429c5ef3a clang -cc1: Initialize LangOptions::DollarIdents correctly.
llvm-svn: 90120
2009-11-30 08:40:46 +00:00
Daniel Dunbar 2c11cd156e Don't try to generate common globals for C++ files, instead of depending on the FE to set NoCommon, and simplify CodeGenOptions initialization.
llvm-svn: 90119
2009-11-30 08:40:34 +00:00
Daniel Dunbar 8e70505692 Eliminate CodeGenOptions::TimePasses.
llvm-svn: 90118
2009-11-30 08:39:52 +00:00
Daniel Dunbar de18224d9c Eliminate CodeGenOptions::SimplifyLibCalls.
llvm-svn: 90117
2009-11-30 08:39:32 +00:00
Daniel Dunbar 0ac66427a9 clang -cc1: Use proper diagnostics for all parsing errors.
llvm-svn: 90100
2009-11-29 21:52:53 +00:00
Daniel Dunbar fcb9caa772 Change CompilerInvocation::CreateFromArgs to report errors using a proper diagnostic engine.
- Clients that care about having the diagnostics output honor the user-controllable diagnostic options can buffer the diagnostics and issue them later.

llvm-svn: 90092
2009-11-29 20:58:50 +00:00
Daniel Dunbar 65ca1c6f02 Change CompilerInvocation::CreateFromArgs to take Argv0 and the address of main (or something in the main executable) so it can find the builtin compiler files.
llvm-svn: 90090
2009-11-29 20:58:32 +00:00
Daniel Dunbar a1b02a2380 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.
llvm-svn: 90063
2009-11-29 07:18:39 +00:00
Daniel Dunbar 0317c4c5b7 Add clang -cc1 parsing for LangOptions.
- This is the last major parsing piece, main FIXMEs remain.

llvm-svn: 90059
2009-11-29 05:52:21 +00:00
Daniel Dunbar 5fe0866b9d clang-cc: Change -fsigned-char=0 to -fno-unsigned-char and pass -pic-level using separate args.
llvm-svn: 90054
2009-11-29 02:39:08 +00:00
Daniel Dunbar 9eac065e67 Move MainFileName option variable into CodeGenOptions instead of LangOptions.
llvm-svn: 90051
2009-11-29 02:38:34 +00:00
Daniel Dunbar 7ab5c491c1 Remove header which is bringing libAST in (on MSVC).
llvm-svn: 89946
2009-11-26 09:57:25 +00:00
Daniel Dunbar 5337f0c842 Fix thinko (-fno-builtin != -nobuiltininc).
llvm-svn: 89918
2009-11-26 02:14:16 +00:00
Daniel Dunbar 81fe60b787 Add clang -cc1 parsing for preprocessor options.
llvm-svn: 89917
2009-11-26 02:14:07 +00:00
Daniel Dunbar cbc693579c Add clang -cc1 parsing for header search options.
llvm-svn: 89916
2009-11-26 02:13:54 +00:00
Daniel Dunbar 44b36ee78c What the FIXMEs want, the FIXMEs shall have.
llvm-svn: 89861
2009-11-25 11:53:23 +00:00
Daniel Dunbar b8c2f7d950 Add an arg_iterator, for iterating over a subset of arguments in an ArgList.
llvm-svn: 89860
2009-11-25 11:33:30 +00:00
Daniel Dunbar ad2278d74c Add clang -cc1 parsing for frontend options.
llvm-svn: 89856
2009-11-25 10:14:52 +00:00
Daniel Dunbar 9efcf351bd Add clang -cc1 parsing for preprocessor output options (-E).
llvm-svn: 89854
2009-11-25 10:14:37 +00:00
Daniel Dunbar 5bdd299bfd Don't pass -fexceptions=0 (it is the default).
llvm-svn: 89853
2009-11-25 10:14:30 +00:00
Edward O'Callaghan c92791193d Fix for Path::isSpecialFile to Path::isRegularFile API in rev 89765.
llvm-svn: 89849
2009-11-25 06:33:27 +00:00
Edward O'Callaghan db521ec23b Fix for PR5568.
llvm-svn: 89766
2009-11-24 15:23:21 +00:00
Daniel Dunbar 8d731964d0 Sketch the rest of the clang -cc1 option definitions, aka fun with C-x C-(.
llvm-svn: 89721
2009-11-24 00:54:16 +00:00
Daniel Dunbar 8a9fa3af69 Add clang -cc1 parsing of diagnostic options.
llvm-svn: 89716
2009-11-23 23:41:17 +00:00
Daniel Dunbar 180f1fe4ce Recognize .hpp as a C++ header.
llvm-svn: 89630
2009-11-22 22:08:27 +00:00
Daniel Dunbar f5835ea2e7 Add clang -cc1 parsing of analyzer options.
llvm-svn: 89629
2009-11-22 22:08:20 +00:00
Daniel Dunbar f4b39e9c95 Fix refacto, gcc's cc1 needs to see --output-pch=, which is not just an alias
for -output-pch=.

llvm-svn: 89534
2009-11-21 02:31:29 +00:00
Daniel Dunbar a764eef0e9 Driver: Add clang -cc1 dependency output options parsing.
llvm-svn: 89508
2009-11-20 23:28:07 +00:00
Daniel Dunbar a604639635 Switch CompilerInvocation::CreateFromArgs to take const char** arguments until Driver itself switches to StringRef.
llvm-svn: 89503
2009-11-20 22:47:55 +00:00
Daniel Dunbar 4274685b63 Pass '-mcpu' 'FOO' instead of '-mcpu=FOO'.
llvm-svn: 89498
2009-11-20 22:21:52 +00:00
Daniel Dunbar 8bed86c43e Standardize Driver translation to call clang-cc using '-foo' form instead of '--foo'.
llvm-svn: 89497
2009-11-20 22:21:36 +00:00
Daniel Dunbar 69fd86dd44 Add clang -cc1 parsing of CodeGenOptions.
llvm-svn: 89464
2009-11-20 17:23:30 +00:00
Daniel Dunbar f7535121a2 Driver: Add parsing for TargetOptions to CompilerInvocation::CreateFromArgs.
llvm-svn: 89435
2009-11-20 01:46:44 +00:00
Daniel Dunbar 84e8a249fa Fix some default in the option classes, and some CompilerInvocation argification
errors.

llvm-svn: 89388
2009-11-19 20:54:59 +00:00
Daniel Dunbar 8c9efca5bd Driver: Move INPUT and UNKNOWN sentinel options into the OptParser.td file.
llvm-svn: 89371
2009-11-19 18:47:17 +00:00
Daniel Dunbar f57e69c78a Add missing dependency for CMake.
llvm-svn: 89332
2009-11-19 07:37:40 +00:00
Daniel Dunbar be6ef3874f Sketch .td file and build system goop for OptTable based clang-cc options.
llvm-svn: 89330
2009-11-19 07:19:04 +00:00
Daniel Dunbar 52ed5feee5 Factor out OptTable::ParseArgs, for parsing an entire argument vector.
llvm-svn: 89327
2009-11-19 06:35:06 +00:00
Daniel Dunbar 484afa2d3b Switch -f{builtin,math-errno,rtti} and -analyzer-purge-dead to -...no... variants instead of using llvm:🆑:init(true) arguments.
llvm-svn: 89315
2009-11-19 04:55:23 +00:00
Daniel Dunbar da13faf982 Driver: ArgList doesn't depend on Options.h anymore.
llvm-svn: 89313
2009-11-19 04:25:22 +00:00
Daniel Dunbar b323fd72ab Driver: Take option ID for {Input,Unknown}Option, to drop dependency on actual options.
llvm-svn: 89312
2009-11-19 04:25:06 +00:00
Daniel Dunbar 8c00957008 Driver: Introduce OptSpecifier class for protecting access to an option id.
llvm-svn: 89310
2009-11-19 04:14:53 +00:00
Daniel Dunbar fffd18167d Driver: Switch to using explicit {getLast,has}ArgNoClaim functions instead of taking a Claim argument.
- Most driver code always claims, and bool arguments don't play nice with the overloads.

llvm-svn: 89308
2009-11-19 04:00:53 +00:00
Daniel Dunbar b3b47b8dde Driver: Resolve inconsistency in matching options against options which are
aliases -- just treat this case as an (unchecked) client error.

llvm-svn: 89306
2009-11-19 03:26:50 +00:00
Daniel Dunbar 0bfb21e4b0 Use Option::matches instead of direct ID comparison.
llvm-svn: 89305
2009-11-19 03:26:40 +00:00
Daniel Dunbar 46fffee081 Driver: Switch to using TableGen'erated Options.inc instead of Options.def file.
llvm-svn: 89288
2009-11-19 01:03:50 +00:00
Daniel Dunbar aa767378ac Driver: Split OptTable out into OptTable.{h,cpp}
llvm-svn: 89283
2009-11-19 00:15:11 +00:00
Daniel Dunbar 7147de2c4e Make MSVC happy.
llvm-svn: 89247
2009-11-18 21:42:57 +00:00
Daniel Dunbar 26228a0d7a Driver: Rework OptTable to have no dependency on the options it manages.
llvm-svn: 89234
2009-11-18 20:19:36 +00:00
Daniel Dunbar a76762c9fb Driver: Make local type name more distinct.
llvm-svn: 89233
2009-11-18 20:19:26 +00:00
Daniel Dunbar f324fa7095 Driver: Store Option ID field as unsigned to drop dependency on the options
type.

llvm-svn: 89232
2009-11-18 20:19:19 +00:00
Daniel Dunbar 21432d38a0 Driver: Switch Options.def to storing flags as a bitmask (instead of mangled
into a string).

llvm-svn: 89212
2009-11-18 17:42:34 +00:00
Edward O'Callaghan c14422223b Fix passing stdc++ correctly in the FreeBSD toolchain support, Credit to Roman Divacky.
llvm-svn: 89205
2009-11-18 14:51:31 +00:00
David Chisnall 950a9518b1 Added block type introspection support.
As per Fariborz's suggestion, committed now but can be reverted later if the used flag is problematic for Apple.

llvm-svn: 89134
2009-11-17 19:33:30 +00:00
Daniel Dunbar 4930e3357b Add -fblocks, -stack-protector, and -fobjc-nonfragile-abi defaulting to driver,
instead of using getDefaultLangOptions.
 - Remove unused -fobjc-tight-layout while at it.

llvm-svn: 89065
2009-11-17 08:07:36 +00:00
Daniel Dunbar f408303a3f Add driver::types::isObjC predicate.
llvm-svn: 89064
2009-11-17 08:07:16 +00:00
Daniel Dunbar 4656c53e12 Move -fnext-runtime defaulting to driver (and change clang-cc default to
-fnext-runtime), instead of using getDefaultLangOptions.

llvm-svn: 89058
2009-11-17 07:07:28 +00:00
Daniel Dunbar 0730e4f7e0 Move -fms-extensions defaulting to driver, instead of using getDefaultLangOptions.
llvm-svn: 89057
2009-11-17 07:06:20 +00:00
Daniel Dunbar d609b7bbe9 Move char-is-signed defaulting to driver, instead of using
getDefaultLangOptions.

llvm-svn: 89053
2009-11-17 06:37:03 +00:00
Daniel Dunbar e13ada6a3b Add clang -mcpu=native support, patch by Roman Divacky, varioustweaks by me.
- We still need support for detecting the target features, since the name
   doesn't actually do a good job of decribing what the CPU supports (for LLVM).

llvm-svn: 88819
2009-11-14 22:04:54 +00:00