Benjamin Kramer
842bf17366
Use StringRef instead of returning a temporary std::string.
...
This fixes a really nasty bug in Darwin::getDarwinArchName where we were going
StringRef -> temporary std::string -> StringRef (and return the dead StringRef).
The StringRefs from Triple live as long as the Triple itself, that should be
long enough.
Hopefully 2 of 4 MSVC buildbot failures are gone now.
llvm-svn: 94892
2010-01-30 15:01:47 +00:00
Daniel Dunbar
1299819f71
Driver: Don't honor -std-default for C++, this makes it hard to run the gdb test
...
suite with clang++ enabled.
The right fix here is PR6175, although we would still have to find a different
work around for the gdb test suite.
llvm-svn: 94838
2010-01-29 21:03:02 +00:00
Douglas Gregor
ac0605e927
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.
llvm-svn: 94740
2010-01-28 06:00:51 +00:00
Daniel Dunbar
6d23b2f503
Driver/Darwin: Simplify target version checks.
...
llvm-svn: 94641
2010-01-27 00:57:03 +00:00
Daniel Dunbar
8360803a8a
Driver/Darwin: Fix a few link arguments when targetting different iPhoneOS
...
versions to match gcc (which is matching linker changes).
llvm-svn: 94640
2010-01-27 00:56:56 +00:00
Daniel Dunbar
b73bb5d085
Driver/Darwin: Switch clang -triple synthesis to use computed target information.
...
llvm-svn: 94639
2010-01-27 00:56:49 +00:00
Daniel Dunbar
15c8942baf
Driver/Darwin: Switch to using isTargetIPhoneOS where appropriate.
...
llvm-svn: 94637
2010-01-27 00:56:37 +00:00
Daniel Dunbar
19afd61201
Simplify.
...
llvm-svn: 94503
2010-01-26 03:56:40 +00:00
Daniel Dunbar
d86666ffd7
Driver/Darwin: Stuff iPhoneOS into environment portion of the (llvm/clang) triple instead of keying off architecture. Also, fix version define to properly include the revision/micro component of the version number.
...
llvm-svn: 94487
2010-01-26 01:44:04 +00:00
Daniel Dunbar
4e29505a95
Driver: Fix fallback to gcc to -c instead of -S if trying to generate an LLVM bc
...
file.
llvm-svn: 94463
2010-01-25 22:35:08 +00:00
Daniel Dunbar
93d7acfcf2
Driver/Darwin/ld: Fix refacto, -force_cpusubtype_ALL should only be forwarded,
...
not always added.
llvm-svn: 94149
2010-01-22 03:37:33 +00:00
Daniel Dunbar
dcc3b657f2
Driver/Darwin/ld: Factor out getDarwinArchName, for getting the "Darwin" arch
...
name being used in an driver invocation.
llvm-svn: 94139
2010-01-22 02:04:58 +00:00
Daniel Dunbar
a48823fdbe
Driver/Darwin/ld: Eliminate AddDarwinSubArch, our linker invocation is going to
...
diverge from gcc anyway.
llvm-svn: 94138
2010-01-22 02:04:52 +00:00
Daniel Dunbar
3f3e2cd820
Driver: Lift clang resource directory computation to the Driver object.
...
llvm-svn: 93971
2010-01-20 02:35:16 +00:00
Daniel Dunbar
1c4788b66b
Darwin/ld: Don't pass '-weak_reference_mismatches non-weak' when
...
-weak_reference_mismatches is not present, it is the default.
llvm-svn: 93086
2010-01-10 00:46:00 +00:00
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
Daniel Dunbar
f4894fe0eb
Driver: Drop ToolChain::getHost()
...
llvm-svn: 91960
2009-12-23 00:46:38 +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
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
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
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
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
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
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
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
84bb793718
Always pass -fmessage-length using separate arguments.
...
llvm-svn: 90121
2009-11-30 08:40:54 +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
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
44b36ee78c
What the FIXMEs want, the FIXMEs shall have.
...
llvm-svn: 89861
2009-11-25 11:53:23 +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
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
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
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
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
0bfb21e4b0
Use Option::matches instead of direct ID comparison.
...
llvm-svn: 89305
2009-11-19 03:26:40 +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