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

354 Коммитов

Автор SHA1 Сообщение Дата
Daniel Dunbar 1bda434673 Driver: Drop ToolChain::getHost()
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91960 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 00:46:38 +00:00
Daniel Dunbar a91320b8af 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91855 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-21 23:28:17 +00:00
Daniel Dunbar ee788e70fc Add ToolChain::getDriver() and use it instead of going through the HostInfo
object.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91830 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-21 18:54:17 +00:00
Daniel Dunbar 97f52ac453 ARM: Use front-end specific target features "soft-float" and "soft-float-abi" to communicate FP mode to target; __SOFTFP__ is set correctly now.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91755 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 04:15:38 +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 5f12232ef3 Driver: Pass -resource-dir to clang -cc1, since the driver presumably already found itself.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91384 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-15 01:02:52 +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 6feaf57b46 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>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91191 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-12 00:38:18 +00:00
Daniel Dunbar 8ff5b28d6e Driver: Switch to using "clang" "-cc1" instead of "clang-cc".
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91174 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 23:00:49 +00:00
Daniel Dunbar 87667aafe6 Unbreak clang-cc handling of -msoft-float / -mfloat-abi=, which I borked.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90873 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-08 19:49:51 +00:00
Ted Kremenek b40d06dec2 Enable '-analyzer-opt-analyze-nested-blocks' by default for testing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90812 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 22:26:14 +00:00
Rafael Espindola 7ca7987669 Shorten the help test for -no-canonical-prefixes, put it behind HelpHidden and
claim it in Driver.cpp instead of Tools.cpp.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90777 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 18:28:29 +00:00
Rafael Espindola 0f4c59c3be Add gcc's -no-canonical-prefixes option to clang.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90577 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 19:31:58 +00:00
Daniel Dunbar ba8d86172c Fix Clang tool translation to forward -fvisibility as separate arguments, the
old syntax isn't supported.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90469 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 18:42:11 +00:00
Daniel Dunbar daab7b1016 Driver: Add Command::Creator member variable, which tracks the tool that was
used to create a particular command.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90287 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 03:23:25 +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 a28690e5b0 Always pass -fmessage-length using separate arguments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90121 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 08:40:54 +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 7674352cf3 clang-cc: Change -fsigned-char=0 to -fno-unsigned-char and pass -pic-level using separate args.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90054 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-29 02:39:08 +00:00
Daniel Dunbar cdd9686b89 What the FIXMEs want, the FIXMEs shall have.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89861 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-25 11:53:23 +00:00
Daniel Dunbar 6d2eb4d07d Don't pass -fexceptions=0 (it is the default).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89853 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-25 10:14:30 +00:00
Daniel Dunbar e6c9ae1478 Fix refacto, gcc's cc1 needs to see --output-pch=, which is not just an alias
for -output-pch=.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89534 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-21 02:31:29 +00:00
Daniel Dunbar a31100e62f Pass '-mcpu' 'FOO' instead of '-mcpu=FOO'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89498 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-20 22:21:52 +00:00
Daniel Dunbar 66861e09d5 Standardize Driver translation to call clang-cc using '-foo' form instead of '--foo'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89497 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-20 22:21:36 +00:00
Daniel Dunbar 53e8484581 Switch -f{builtin,math-errno,rtti} and -analyzer-purge-dead to -...no... variants instead of using llvm:🆑:init(true) arguments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89315 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-19 04:55:23 +00:00
Daniel Dunbar 265e9ef9f3 Driver: ArgList doesn't depend on Options.h anymore.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89313 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-19 04:25:22 +00:00
Daniel Dunbar e4bdae78c6 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89308 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-19 04:00:53 +00:00
Daniel Dunbar b827a0541b Use Option::matches instead of direct ID comparison.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89305 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-19 03:26:40 +00:00
Edward O'Callaghan 69203e108b Fix passing stdc++ correctly in the FreeBSD toolchain support, Credit to Roman Divacky.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89205 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-18 14:51:31 +00:00
David Chisnall 5e530af5d5 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89134 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17 19:33:30 +00:00
Daniel Dunbar 9e5cc6b703 Add -fblocks, -stack-protector, and -fobjc-nonfragile-abi defaulting to driver,
instead of using getDefaultLangOptions.
 - Remove unused -fobjc-tight-layout while at it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89065 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17 08:07:36 +00:00
Daniel Dunbar c5a97ec194 Move -fnext-runtime defaulting to driver (and change clang-cc default to
-fnext-runtime), instead of using getDefaultLangOptions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89058 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17 07:07:28 +00:00
Daniel Dunbar 0be42c44f0 Move -fms-extensions defaulting to driver, instead of using getDefaultLangOptions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89057 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17 07:06:20 +00:00
Daniel Dunbar 1f95e6567f Move char-is-signed defaulting to driver, instead of using
getDefaultLangOptions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89053 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17 06:37:03 +00:00
Daniel Dunbar f86feddbd5 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).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88819 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-14 22:04:54 +00:00
Edward O'Callaghan 76e80c0e96 Fix for FreeBSD toolchain in regards to CPP, Credit to Roman Divacky.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86459 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-08 10:13:36 +00:00
John Thompson a6fda124bf Adding -fshort-wchar option.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86167 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-05 20:14:16 +00:00
Daniel Dunbar 838be483dc Move -fcolor-diagnostics logic to driver.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86014 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-04 06:24:57 +00:00
Daniel Dunbar 55efe142a8 Move logic for selection -fmessage-length= to driver.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86013 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-04 06:24:47 +00:00
Daniel Dunbar 294691eb1c Fix indentation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86011 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-04 06:24:38 +00:00
Tanya Lattner 59876c2713 Merge constant array and structures. This will create a global variables for arrays and structs that are constant and their initializer is constant. It is on by default but can be disable with the flag -fno-merge-all-constants.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85991 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-04 01:18:09 +00:00
Chris Lattner e6113de52d Implement support for the -undef command line option, patch by
Roman Divacky! PR5363


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85932 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-03 19:50:27 +00:00
Mike Stump 4d63f8bc26 Fix -pthread on dragonfly. Patch by Sascha Wildner.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85679 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-31 20:11:46 +00:00
Daniel Dunbar dd4fe00f03 Change the driver to do the Darwin triple mangling itself instead of forwarding
-mmacosx-version-min and -miphoneos-version-min to clang-cc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85600 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-30 18:12:20 +00:00
Daniel Dunbar ee848a73e5 Remove some obsolete or unnecessary FIXMEs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85475 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 02:39:57 +00:00
Daniel Dunbar 6e8371eb97 PR5328: Allow duplicatic -pedantic (and -pedantic-errors) options.
- clang-cc doesn't care about their relative order with other -W options.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85473 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 02:24:45 +00:00
Daniel Dunbar f7fb31f475 Kill off MakeFormattedString helper function.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85472 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 02:24:37 +00:00
Daniel Dunbar 607d7f6d8f Reject -I- in driver instead of clang-cc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85469 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 01:53:44 +00:00
Douglas Gregor 55d3f7ae51 [llvm up]
Switch a few ugly switch-on-string-literal constructs to use the new
llvm::StringSwitch.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85461 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 00:41:01 +00:00
Edward O'Callaghan e7e18200e6 Fix for PR4887, Credit to Jonathan Gray.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85392 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 15:13:08 +00:00
Rafael Espindola 8d737cc78c Rename -nostdclanginc to -nobuiltininc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85116 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-26 13:36:57 +00:00
Edward O'Callaghan ff430e6d68 AuroraUX toolchain should call GNU assembler not the Solaris assembler.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84469 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 07:02:08 +00:00
Edward O'Callaghan 3cecc19f60 dynamic linker arg is incorrectly invoking gnu ld arg syntax instead of svr4 ld syntax in AuroraUX toolchain.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84266 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-16 19:44:18 +00:00
Nuno Lopes 528365d318 fix -ansi in c++: it means -std=c++98
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84254 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-16 14:28:06 +00:00
Daniel Dunbar 0ebd9321ba Driver: Default to using PTH for C++ precompiled header support, PCH for C++
isn't implemented yet.
 - <rdar://problem/7297571> Clang should use pretokenized headers for C++ PCH
   files

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84197 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-15 20:02:44 +00:00
Edward O'Callaghan 7adf94906e AuroraUX toolchain fixes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84176 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-15 07:44:07 +00:00
Edward O'Callaghan c37691068d -funit-at-a-time is the default however some current makefiles pass -fno-unit-at-a-time which is ignored by GCC, we should warn about this not error out.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83976 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-13 16:41:34 +00:00
Rafael Espindola 6961fdd661 Add the -nostdclanginc option to clang (the driver).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83377 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 12:45:37 +00:00
Fariborz Jahanian 85caf03ee4 Set __EXCEPTIONS by checking on darwin's triple.
Patch by Rafael Espindola.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83209 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-01 20:30:46 +00:00
Rafael Espindola f759df06d9 Move the "needs exception support" logic to clang. This also fixes
-fno-exceptions in C++ code. We used to always define __EXCEPTIONS in
C++.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83199 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-01 13:33:33 +00:00
Ted Kremenek b8bb3e797c Turn on 'RegionStore' as the default store manager both for 'clang --analyze' and 'scan-build'. Leave 'BasicStore' as the default store manager in 'clang-cc'. While there are still known warts with RegionStore, it's ready to be tested by general users.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82752 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 05:55:59 +00:00
Daniel Dunbar 1d4612b829 Split Darwin toolchain into Clang and GCC Darwin toolchains with a common base.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82213 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-18 08:15:13 +00:00
Daniel Dunbar 6cd4154b90 Lift AddLinkRuntimeLibArgs into Darwin tool chain.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82212 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-18 08:15:03 +00:00
Daniel Dunbar 608d04cb7b Move isMacosxVersionLT helpers to Darwin tool chain.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82211 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-18 08:14:55 +00:00
Daniel Dunbar 48d5aae438 Lift getMacosxVersionMin out into Darwin ToolChain.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82210 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-18 08:14:46 +00:00
Daniel Dunbar 6b200b2b69 Lift AddLinkerSearchPaths() into Darwin tool chain.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82209 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-18 08:14:36 +00:00
Daniel Dunbar ae54af2fdc Rename a variable to match its semantics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82208 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-18 08:14:24 +00:00
Daniel Dunbar 20f0eacf16 Driver: Change -O to mean -O2, -O1 is meaningless.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82131 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-17 06:53:36 +00:00
Daniel Dunbar e3b8d07e02 We don't need a -compile-ast clang-cc action, we can just use -S.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82105 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-17 00:47:53 +00:00
Daniel Dunbar 6bea73b330 Incremental improvement to logic determining whether we emit unwind tables or
not.
 - PR4932.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82021 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-16 06:17:29 +00:00
Daniel Dunbar 2030d8f46b Support -mabi= for clang/ARM.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81734 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-14 00:34:46 +00:00
Daniel Dunbar f4aa4f61de Swizzle the target triple based on -mthumb, and update clang-cc to recognize
thumb-foo-bar as an ARM target.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81497 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 01:14:50 +00:00
Daniel Dunbar cbd1933f83 Initial handling of -m{soft-float,hard-float,float-abi=} for ARM.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81471 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 23:00:09 +00:00
Daniel Dunbar e6ad3f9fce Move X86 handling of -m[no-]soft-float and -m[no-]red-zone into AddX86TargetArgs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81470 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 22:59:57 +00:00
Daniel Dunbar 1d65e4be6f Change getLLVMArchNameForARM to just get the suffix.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81469 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 22:59:51 +00:00
Daniel Dunbar 728a512753 Add code to mangle the triple for LLVM on ARM.
- I think we should get rid of this distinction though, but I need to discuss with the interested parties.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81435 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 06:49:20 +00:00
Daniel Dunbar f84a4a469d Don't pass -fno-builtin-str{cat,cpy} to clang-cc, I forget we don't support that yet. PR4941.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81430 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 04:57:27 +00:00
Daniel Dunbar b163ef7e7a ARM: Pass -mcpu to clang-cc based on -march= and -mcpu=.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81429 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 04:57:17 +00:00
Daniel Dunbar 2ba9157590 Implement Darwin/ARM behavior for defaulting to -fno-builtin-str{cat,cpy}.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81425 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 03:37:02 +00:00
Daniel Dunbar e2fd66418e Add a check that -static is not used with -dynamic or -mdynamic-no-pic.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81421 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 01:21:12 +00:00
Daniel Dunbar 88a3d6cf5e Factor out CheckPreprocessing options to share between Clang/CC1 tools.
Also, fix forwarding of -C/-CC to cc1.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81420 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 01:21:05 +00:00
Daniel Dunbar 6acda16e9c Move Clang X86 cpu/feature argument translation into AddX86TargetArgs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81390 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 22:33:08 +00:00
Daniel Dunbar 5ed34f4c58 Change Get{File,Program}Path to return an std::string (instead of a sys::Path).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81389 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 22:33:00 +00:00
Daniel Dunbar 881376467c Remove gratuitous use of c_str().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81388 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 22:32:48 +00:00
Daniel Dunbar 302e2eacf6 Use Twine concatenation instead of llvm::format.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81387 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 22:32:41 +00:00
Daniel Dunbar 5b750fe618 Simplify.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81386 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 22:32:34 +00:00
Daniel Dunbar cc6f803f98 Use AddDarwinArch for passing arch name to assembler.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81368 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 18:36:27 +00:00
Daniel Dunbar fbefe6bd6f Add DarwinTool base class for all Darwin tools, and move AddDarwin[Sub]Arch there.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81367 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 18:36:20 +00:00
Mike Stump 1eb4433ac4 Remove tabs, and whitespace cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81346 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 15:08:12 +00:00
Daniel Dunbar e0be8b1729 Remove FIXMEs for pedantically-gcc-bug-compatible behavior.
- We aren't going to fix these since they haven't caused problems in practice.

 - Similarly, don't forward -object to Darwin ld.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81224 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08 16:39:16 +00:00
Daniel Dunbar ae33f8ff47 Merge libgcc spec changes for darwin::Link::ConstructJob.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81022 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-04 18:35:47 +00:00
Daniel Dunbar d82f8fa537 Tweak darwin::Link::AddLinkArgs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81021 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-04 18:35:41 +00:00
Daniel Dunbar 78dbd580a0 Implement darwin::Link::AddDarwinArch for ARM.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81020 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-04 18:35:31 +00:00
Daniel Dunbar 30392de468 Darwin: Pass -iphoneos-version-min to ld when building for ARM.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81019 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-04 18:35:21 +00:00
Daniel Dunbar f395528158 Rename Darwin_X86 toolchain to just Darwin, this can support all platforms.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81016 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-04 18:34:51 +00:00
Daniel Dunbar 5345c391c6 Add basic support for -pthread.
- Patch by David Chisnall, with PCH and Darwin support mixed in.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80883 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 04:54:28 +00:00
Daniel Dunbar 5915fbf310 Add driver support for -emit-ast and AST compilation steps.
- <rdar://problem/7185031> Add 'clang' option '-emit-ast'

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80678 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 16:57:46 +00:00
David Chisnall 8a5a9aaddb Updated GNU runtime non-fragile ABI.
Added -fconstant-string-class= option.
Added __has_feature() test for non-fragile ABI.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80591 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 16:41:57 +00:00
Daniel Dunbar 0e2679d29b PR4766: Don't pass -static to 'as' on x86_64 on Darwin.
Also, do pass -static even with -dynamic on i386.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79948 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-24 22:26:16 +00:00
Edward O'Callaghan e7925a075f Second half of, clang, AuroraUX toolchain support.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79713 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-22 01:06:46 +00:00
Benjamin Kramer 21656ddae8 Fix -fno-omit-frame-pointer bug Eli noticed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78233 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 19:47:38 +00:00
Benjamin Kramer 8e9ef0d87d Translate -mcmodel=X to -code-model X and pass it to clang-cc. Patch by Pawel Worach!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78190 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 14:30:52 +00:00
Benjamin Kramer 091038cbde Add support for the -fno-omit-frame-pointer option. Patch by Roman Divacky!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78188 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 12:11:11 +00:00
Daniel Dunbar 2bbcf66974 Driver/OpenBSD: Improve ld options.
- Patch by Jonathan Gray!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77935 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 01:28:59 +00:00
Mike Stump 738f8c278d Add beginnigs of rtti generation, wire up more of -fno-exceptions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77751 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 23:15:31 +00:00
Ted Kremenek 11727519fb Have 'clang --analyze' run syntactic static analysis security checks.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76996 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 20:03:11 +00:00
Eli Friedman ceb5c5b7f6 Remove -ftraditional option, which gcc doesn't actually support. Make
using -traditional and -traditional-cpp with clang an error because 
it's unsupported in clang and causes a significant change in the 
semantics of the language.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75690 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-14 21:58:17 +00:00
Douglas Gregor e650c8c3bc Introduce the notion of "Relocatable" precompiled headers, which are built
with a particular system root directory and can be used with a different
system root directory when the headers it depends on have been installed.
Relocatable precompiled headers rewrite the file names of the headers used
when generating the PCH file into the corresponding file names of the 
headers available when using the PCH file.

Addresses <rdar://problem/7001604>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74885 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-07 00:12:59 +00:00
Daniel Dunbar cae087e164 Driver: Add Source argument for Commands to hold the Action which caused a
Command to be generated, to support more advanced diagnostics.
 - No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74627 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-01 19:02:28 +00:00
Daniel Dunbar f7b8eec37c OpenBSD support.
- Patch by Jonathan Gray!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74453 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-29 20:52:51 +00:00
Bill Wendling 45483f7a1b Add stack protector support to clang. This generates the 'ssp' and 'sspreq'
function attributes. There are predefined macros that are defined when stack
protectors are used: __SSP__=1 with -fstack-protector and __SSP_ALL__=2 with
-fstack-protector-all.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74405 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-28 07:36:13 +00:00
Daniel Dunbar 3a183d3d46 Forward -C and -CC to clang.
- <rdar://problem/6945384> Driver should pass down -C and -CC


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73087 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-08 21:48:20 +00:00
Daniel Dunbar 75eb1d6478 PR4016: Forward -fno-show-source-location to clang.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73082 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-08 21:13:54 +00:00
Devang Patel acebb397fa Set function Attribute::NoImplicitFloat appropriately.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72961 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-05 22:05:48 +00:00
Eli Friedman 5a77973d9b Add driver support for -fsigned-char/-funsigned-char.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72930 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-05 07:21:14 +00:00
Torok Edwin a46c71abb1 forward -fno-color-diagnostics to clang-cc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72856 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-04 07:27:53 +00:00
Daniel Dunbar e528028657 Driver: Support -mllvm; this just forwards options to clang-cc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72780 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-03 16:16:27 +00:00
Fariborz Jahanian 34e65770ad This patch adds support for sender-aware dispatch in Objective-C for the GNU runtime, when
compiled with -fobjc-sender-dependent-dispatch.  This is used in AOP, COP, implementing object 
planes, and a few other things.
Patch by David Chisnall.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72275 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-22 20:17:16 +00:00
Daniel Dunbar e027a4b239 Don't warn about -funit-at-a-time, and reject -fno-unit-at-a-time.
- We could just warn about -fno-unit-at-a-time, but in practice people using it
   probably aren't going to get what they want out of clang.

Also, use "clang" specified error for unsupported things instead of driver
unsupported error.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72272 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-22 19:02:20 +00:00
Daniel Dunbar 7cfe31a713 Don't rely on getArchName() to return a constant string reference.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72241 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-22 02:21:04 +00:00
Daniel Dunbar d8fc0f2e77 Add --analyzer-no-default-checks and --analyzer-output options.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72238 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-22 00:38:15 +00:00
Daniel Dunbar f4e2486145 Remove -fprintf-source-range-info from the Driver (this was renamed)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72061 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-18 23:01:24 +00:00
Daniel Dunbar 95a0da7b26 Driver: Emit an unsupported error on -iframework.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71698 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-13 19:05:04 +00:00
Daniel Dunbar 500aec477c Tweak x86 -mcpu defaults.
- Default to yonah on Darwin (to get SSE3).

 - Default to Pentium4 (32-bit) and x86-64 (64-bit) on
   non-Darwin. Welcome to the 21st century.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71069 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-06 04:58:14 +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 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 6ecc7a993f Driver: When using the generic gcc tool, pass -m32 or -m64 if we
recognize the architecture.
 - This is an attempt to force gcc to the write target.

 - PR4094.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70647 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-02 21:41:52 +00:00
Daniel Dunbar a8304f6729 Driver: Generate an error when trying to pass an LLVM bc input to a
non-Darwin linker (sorry Gold + LTO-plugin users).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70641 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-02 20:14:53 +00:00
Daniel Dunbar 11e1b40d75 DragonFly ToolChain definition for driver.
- Patch by Alex Hornung!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70635 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-02 18:28:39 +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
Daniel Dunbar bc85be8577 Make sure to pass the same options to the static analyzer as the
compiler.
 - Code generation options may still affect the language...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70393 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-29 18:32:25 +00:00
Daniel Dunbar ea71a5b388 With -ccc-pch-is-pch, always treat precompiled inputs as PCH,
regardless of extension.
 - Otherwise we can't expect that just plugging in -ccc-pch-is-pch
   will work.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70318 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-28 19:38:45 +00:00
Daniel Dunbar a3ff202ee4 Driver: Add -std-default= option.
- This can be used to supply a default value for -std=; the idea is
   that this can be used in conjunction with CCC_ADD_ARGS or
   QA_OVERRIDE_GCC3_OPTIONS to change the default without having to
   modify the build system.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70102 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-26 01:10:38 +00:00
Daniel Dunbar 9c7db4a209 Driver: -mkernel disables default use of unwind tables (although I
don't yet understand where this is happening in llvm-gcc).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70012 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-25 05:49:54 +00:00
Daniel Dunbar 8abf881c8f Driver: -mkernel and -fapple-kext imply -mno-red-zone.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70010 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-25 05:33:23 +00:00
Daniel Dunbar 3ed2945226 Don't run dsymutil when making a fat executable direct source.
- Otherwise, we will end up with stray .dSYM files which don't get
   lipo'ed or removed.

 - Ideally we would run dsymutil on the result, but we don't have the
   infrastructure for that yet. Note that gcc doesn't handle this case
   either.

 - <rdar://problem/6809621> [driver] clang leaves .dSYM files lying
   around in tmp.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69951 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-24 03:03:52 +00:00
Daniel Dunbar 99612939d0 Call ld, not collect2.
- <rdar://problem/6517382> [driver] call ld directly


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69938 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-23 23:17:23 +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
Daniel Dunbar 7695fba302 Forward f[no-]dollars-in-identifiers to clang, when specified.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69549 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-19 21:20:32 +00:00
Daniel Dunbar 49138fc59e Forward -fno-diagnostics-fixit-info to clang-cc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69546 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-19 21:09:34 +00:00
Douglas Gregor df91ef3d6c Preliminary PCH support in the driver
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69410 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-18 00:34:01 +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 9e820ee054 Pass -fdiagnostics-show-option to clang-cc by default.
- <rdar://problem/6796848> implement -fdiagnostics-show-option


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69276 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-16 06:32:38 +00:00
Daniel Dunbar 06ef3c3e9b Driver: Forward -W* to clang, it can handle all these itself now.
Remove clang_W_Group and clang_ignored_W_Group.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69261 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-16 03:44:10 +00:00
Daniel Dunbar 70d3c92820 Driver: For clang, accept -fsigned-bitfields and reject
-funsigned-bitfields for now (clang defaults to -fsigned-bitfields).
 - <rdar://problem/6790309> ER: Support
   -fsigned-bitfields/-funsigned-bitfields


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69131 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 02:37:43 +00:00
Chris Lattner d82df3ad43 Implement support for GCC's -dD mode, which dumps -E output *and*
macro definitions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68884 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-12 01:56:53 +00:00
Daniel Dunbar ff8857a9e6 Driver: Forward -miphoneos-version-min to clang.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68816 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-10 20:11:50 +00:00
Daniel Dunbar c21c485b4f Driver: Split out CPP specific options for clang so that we don't end
up adding them twice when running with -no-integrated-cpp or
-save-temps.
 - <rdar://problem/6766636> -save-temps falls over with prefix headers


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68660 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-08 23:54:23 +00:00
Daniel Dunbar 3bbc75302f More fixes to builtin preprocessor defines.
- Add -static-define option driver can use when __STATIC__ should be
   defined (instead of __DYNAMIC__).

 - Don't set __OPTIMIZE_SIZE__ on Os, __OPTIMIZE_SIZE__ is tied to Oz.

 - Set __NO_INLINE__ following GCC 4.2.

 - Set __GNU_GNU_INLINE__ or __GNU_STDC_INLINE__ following GCC 4.2.

 - Set __EXCEPTIONS for Objective-C NonFragile ABI.

 - Set __STRICT_ANSI__ for standard conforming modes.

 - I added a clang style test case in utils for this, but its not
   particularly portable and I don't think it belongs in the test
   suite.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68621 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-08 18:03:55 +00:00
Daniel Dunbar edfa02b85b Darwin ld: Unconditionally add -lstdc++ if we are pretending to be
g++.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68601 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-08 06:06:21 +00:00
Daniel Dunbar c9abc043af Make debug info work when using -save-temps.
- This is pretty ugly, but the most obvious solution. Chime in if you
   have a nicer one.

 - The problem is that with -save-temps, clang-cc has no idea what the
   name of the original input file is. However, the user expects to be
   able to set breakpoints based on the input file name.

 - We support this by providing a new option -main-file-name (similar
   to -dumpbase used by gcc) which allows the driver to pass in the
   original file name.

 - <rdar://problem/6753383> building with clang using --save-temps
   gets the compile unit name from the .i file...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68595 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-08 05:11:16 +00:00
Daniel Dunbar 9fd0b1f845 Set __PIC__ (more) correctly.
- Add -pic-level clang-cc option to specify the value for the define,
   updated driver to pass this.

 - Added __pic__

 - Added OBJC_ZEROCOST_EXCEPTIONS define while I was here (to match gcc).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68584 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-08 03:03:23 +00:00
Daniel Dunbar 82d0068852 Driver: Fix forwarding of -fpascal-strings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68570 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 23:51:44 +00:00
Daniel Dunbar d573d26e1a Driver: Fix forwarding of -{std,ansi,trigraphs} when there are
multiple instances of an option.

Also, removed direct -ansi support from clang-cc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68558 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 22:13:21 +00:00
Daniel Dunbar 3aaf082689 Driver: Forward remaining -f options to clang manually.
- Groups are really just intended to hold inherent structure of the
   options, not be abused for individual tool argument translation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68554 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 21:51:40 +00:00
Daniel Dunbar 2ac9fc2ad6 Driver: Only forward last instance of -mmacosx-version-min= and
-isysroot to clang.
 - Don't forward arbitrary -i* options to clang, just the ones we know
   about.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68553 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 21:42:00 +00:00
Daniel Dunbar 48d1ef782c Driver: Manually translate a number of -f with no- variants options to
clang.
 - We will eventually want some more driver infrastructre for this
   probably.

 - For now, the clang-cc interface stays relatively the same, but we
   don't accept multiple instances anymore, or the [no-] variants
   directly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68550 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 21:16:11 +00:00
Daniel Dunbar 5c1aaafbd6 Driver: Explicitly warn that -pg isn't supported (even though we
aren't failing the compilation).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68540 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 19:18:24 +00:00
Daniel Dunbar 16fd3a9f51 Driver: More verbosity reduction.
- Ignore some more -W options and -[fm] options which we can somewhat
   safely ignore.

 - Recognize that -W is an alias for -Wextra

W: -Wdeclaration-after-statement -Werror-implicit-function-declaration -Wfour-char-constants -Winit-self -Wmissing-format-attribute -Wno-#warnings -Wno-comment -Wno-long-long -Wno-variadic-macros -Wold-style-definition -Wstrict-prototypes -Wunused-parameter

f: -fconstant-cfstrings -fdollars-in-identifiers -finline -finline-functions -fno-inline -fno-keep-inline-functions -fno-strict-aliasing -fobjc-atdefs -fobjc-call-cxx-cdtors -fobjc-new-property -fstack-protector

m: -mconstant-cfstrings -mfix-and-continue


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68487 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 02:59:27 +00:00
Daniel Dunbar 0b46e1b538 Driver: Handle properly calling dsymutil when source input is
preceeded by a linker input flag.
 - <rdar://problem/6757236> clang should make a dSYM when going
   straight from source to binary

 - This still matches gcc, but the right way to solve this would be to
   detect the situation we care about (we are compiling from source
   and linking in one step), instead of looking at the suffix of the
   input file. The Tool doesn't quite have enough information to do
   this yet, however.

 - Also, find the suffix correctly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68417 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-04 00:55:30 +00:00
Daniel Dunbar 68fb469aeb Driver: Explicitly ignore -fpch-preprocess when using clang, we don't
need to do anything special to support this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68403 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-03 20:51:31 +00:00
Daniel Dunbar 8a2073a856 Driver: Add missed translation for darwin::Preprocess (gcc), -d*
wasn't being forwarded.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68365 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-03 01:27:06 +00:00
Ed Schouten c66a5a30a2 Add some whitespace to test my commit privileges.
Approved by:	ddunbar


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68343 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-02 19:13:12 +00:00
Daniel Dunbar 78d8a089c8 Driver: Allow -ccc-gcc-name to specify the name/path to use when
calling gcc in generic configurations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68260 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-01 23:34:41 +00:00
Daniel Dunbar bf54a06f9b Quick and dirty (!) fix to make sure we use powerpc in triples.
- PR3922

 - I have a clean solution for this in flight, but it may take a while
   to come to fruition so we'll take a quick fix for now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68241 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-01 20:33:11 +00:00
Daniel Dunbar 008f54a542 Driver: Add freebsd::Link
- Patch by Ed Schouten!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68233 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-01 19:36:32 +00:00
Daniel Dunbar bb71b39272 Remove a FIXME, use -emit-pth to drive PTH generation.
-  c.f. r68164


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68184 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-01 03:28:10 +00:00
Daniel Dunbar 8a8d8afa3d Tweak/cleanup darwin::Link a bit, add several FIXMES, and improve test
case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68182 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-01 03:17:40 +00:00
Daniel Dunbar 8e4fea6750 Tweak darwin::Assemble and add a FIXME.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68165 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-01 00:27:44 +00:00
Daniel Dunbar 077ba6a3ac Driver: Forward -Wp, and -Xpreprocessor arguments to clang when using
the preprocessor.
 - PR3602.

 - As is inherent in the blanket forwarding options, this will only
   work if clang-cc happens to accept what the user passed. Users by
   and large should use driver options to interact with the
   preprocessor, if at all possible.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68144 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-31 20:53:55 +00:00
Daniel Dunbar 68a31d406c Driver: Call 'as' directly on FreeBSD.
- Patch by Ed Schouten!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68121 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-31 17:45:15 +00:00
Daniel Dunbar af07f936b6 (LLVM up) Update to use llvm::sys::getHostTriple().
- Always pass -triple to clang-cc (-arch will be removed).

 - clang-cc doesn't play guess work with the target triple anymore.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68119 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-31 17:35:15 +00:00
Daniel Dunbar 46562b9122 Fix -MD with no -MT when -o is specified (and fix test case).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68042 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-30 17:59:58 +00:00
Daniel Dunbar cd8e4c44dd Driver: Support -M and -MM.
- Not particularly elegant, but my hand is forced by gcc.

Also, tweak -ccc-print-bindings output.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68027 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-30 06:36:42 +00:00
Daniel Dunbar a5a7bd0de7 Improve dependency file support.
- Rip out various bits of logic from clang-cc's dependency file gen,
   force driver to provide instead.

 - -MD output now goes to proper location
<rdar://problem/6723948> clang -MD puts dep file in /tmp with wrong name

 - -M and -MM still don't work correctly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68022 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-30 00:34:04 +00:00
Daniel Dunbar 9120f179fd Driver: Add test case for darwin::Preprocess and darwin::Compile
tools, and enable them.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68019 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-29 22:27:40 +00:00
Daniel Dunbar a3ec60e0cf Driver: Finish porting Darwin::Preprocess and Compile port (still
unused, and lacking a test case).
 - ccc is now on death row, pending some more testing and bug fixes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68012 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-29 18:40:18 +00:00
Daniel Dunbar 40f1265ebd Driver: Start porting Darwin::Preprocess and Compile implementations
(currently unused).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68003 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-29 17:08:39 +00:00
Daniel Dunbar b9f3a777e5 Driver: Pass -f[no-]pascal-strings on to clang, even if it has been
turned into -m[no-]pascal-strings by the tool chain.
 - This still has issue that derived arguments don't propogate "used"
   information correctly so spurious "argument unused" warnings will
   still show up.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67841 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-27 15:22:28 +00:00
Daniel Dunbar 02633b541b Driver: Add darwin::Link tool.
- <rdar://problem/6717381> [driver] implement ld argument translation
   in new driver


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67760 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-26 16:23:12 +00:00
Ted Kremenek 9b646dac1c Turn on -analyzer-eagerly-assume by default when using 'clang-cc' to perform
static analysis.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67665 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-25 00:38:14 +00:00
Daniel Dunbar 337a6271b9 Driver: Handle -flto, -O4, and tweak -emit-llvm to match llvm-gcc.
- -emit-llvm no longer changes what compilation steps are done.

 - -emit-llvm and -emit-llvm -S write output files with .o and .s
    suffixes, respectively.

 - <rdar://problem/6714125> clang-driver should support -O4 and -flto,
   like llvm-gcc


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67645 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-24 20:17:30 +00:00
Daniel Dunbar b3fd500a1c Driver: Translate -fverbose-asm for LLVM backend.
- <rdar://problem/6715707> driver should translate -fverbose-asm into
   -asm-verbose


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67634 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-24 17:59:06 +00:00
Daniel Dunbar 546654a62e Driver: Forward -MMD (not -MM) to clang-cc; this got lost in
translation, the former we support, the later we don't (yet).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67611 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-24 07:20:59 +00:00
Daniel Dunbar d7d5f0223b Rename clang to clang-cc.
Tests and drivers updated, still need to shuffle dirs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67602 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-24 02:24:46 +00:00
Daniel Dunbar a428df828e Driver: lipo wasn't being called correctly (translation failure from
ccc due to the different way we handle output arguments).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67583 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-24 00:24:37 +00:00
Daniel Dunbar a880db0b0f Driver: Add two special groups of "whitelisted" options which we know
clang doesn't support, and don't want to warn are unused. Eventually
these should disappear.

Here is a more readable list than is in the diff:

W options: -Wall, -Wcast-align, -Wchar-align, -Wchar-subscripts,
-Werror, -Wextra, -Winline, -Wint-to-pointer-cast, -Wmissing-braces,
-Wmost, -Wnested-externs, -Wno-format-y2k, -Wno-four-char-constants,
-Wno-missing-field-initializers, -Wno-trigraphs, -Wno-unknown-pragmas,
-Wno-unused-parameter, -Wparentheses, -Wpointer-arith,
-Wpointer-to-int-cast, -Wreturn-type, -Wshorten-64-to-32, -Wswitch,
-Wunused-function, -Wunused-label, -Wunused-value, -Wunused-variable,
-Wwrite-strings.

f options: -fasm-blocks, -fmessage-length=.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67549 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-23 19:03:36 +00:00
Daniel Dunbar 049853d74e Driver: Switch to using -include-pth.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67393 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-20 19:38:56 +00:00
Daniel Dunbar 8cac5f7e1c Driver: Add and use darwin::Assemble tool.
- Based on patch from Pieter de Bie; thanks!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67379 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-20 16:06:39 +00:00
Daniel Dunbar ff7488dc9a Driver: Add darwin::Lipo tool.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67355 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-20 00:52:38 +00:00
Daniel Dunbar 55b3b5f5c6 Driver/clang: -mattr strings were not comma separated.
- Apologies for commits w/o test cases; they are coming.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67310 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-19 17:36:04 +00:00
Daniel Dunbar 7587719c40 Driver: Claim -arch options when pipelining, and claim arguments that
are forwarded to GCC.
 - The later is unfortunate, as it prevents us from generally warning
   about anything interesting on platforms that use a generic
   toolchain. However, we can't do much better without significantly
   complicating things, and generally we should have proper tool chain
   definitions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67293 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-19 07:55:12 +00:00
Daniel Dunbar 115a79277e Driver: Handle "linker input" arguments.
- Make InputInfo a variant of filename, pipe, input argument,
   nothing.

 - Leave a FIXME in InputInfo that this should be revisited.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67292 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-19 07:29:38 +00:00
Daniel Dunbar 5697aa0d75 Driver: Fix bug in translating -O to clang, add clang-translation test
case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67257 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-18 23:39:35 +00:00
Daniel Dunbar ecc636272b Driver: Resolve program path for "cp" (used as part of transparent gcc
PCH support).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67256 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-18 23:34:15 +00:00
Daniel Dunbar 632f50edc0 Driver: Lookup program names using llvm::sys::Program::FindProgramByName
if our usual methods fail. This isn't necessary for running the tool,
but improves the accuracy of logging output.

Also, have GCC tools lookup gcc program path.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67243 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-18 21:34:08 +00:00
Daniel Dunbar 1d46033f76 Driver: Port Clang argument translation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67193 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-18 10:01:51 +00:00