Chris Lattner
b35583df52
add a new driver-level -ferror-limit=412 option, which causes clang to stop
...
emitting diagnostics after it has produced that many errors. Give this a
default value of 20 which produces plenty of errors for people to fix before
recompiling but not so many that their entire console scrolls away when the
compiler gets confused. The experience looks like this:
$ clang foo.c
<tons of crap>
foo.c:102:3: error: unknown type name 'somethingbad'
somethingbad x;
^
fatal error: too many errors emitted, stopping now
36 warnings and 20 errors generated.
llvm-svn: 100689
2010-04-07 20:49:23 +00:00
Daniel Dunbar
3d45e17d15
Driver: Add a Tool::hasGoodDiagnostics hook, and use it to simplify logic for
...
deciding when we need to emit an extra "command failed" diagnostic.
- This also fixes the case where we were emitting that extra diagnostics, even
when using clang w/ the integrated assembler, which has good diagnostics.
llvm-svn: 100529
2010-04-06 17:07:49 +00:00
Daniel Dunbar
e43887bd2b
Driver: Add support for a CLANGXX_IS_PRODUCTION build variable, which enable
...
Clang++ support, even in "Production" mode (for testing purposes).
llvm-svn: 100119
2010-04-01 18:21:41 +00:00
Chris Lattner
bf2803fb20
add support for -MQ flag to quote targets in dependency file,
...
PR6661, patch by Ori Avtalion!
llvm-svn: 99821
2010-03-29 17:55:58 +00:00
Daniel Dunbar
9abbebedc8
Driver/Darwin: Support CCC_ENABLE_NEW_DARWIN_TOOLCHAIN as an environment
...
override to enable use of the DarwinClang tool chain on all platforms (not just
ARM).
llvm-svn: 99660
2010-03-26 22:41:03 +00:00
Douglas Gregor
64b046fce4
Implement support for -nostdc++. Fixes PR6446.
...
llvm-svn: 99417
2010-03-24 20:13:48 +00:00
Ted Kremenek
fe449a24a8
Disable the emission of frontend warnings (not errors) under --analyze.
...
Fixes <rdar://problem/7405601>.
llvm-svn: 99222
2010-03-22 22:32:05 +00:00
Kovarththanan Rajaratnam
a6405f7a95
Sort calls to add_clang_library()
...
llvm-svn: 99191
2010-03-22 18:16:06 +00:00
Chandler Carruth
8455924303
Add very limited support for GCC's '-B' flag. This allows us to support unusual
...
toolchain configurations and is a small step toward FreeBSD support.
llvm-svn: 99159
2010-03-22 01:52:07 +00:00
Daniel Dunbar
e543a5e684
Driver: Fix thinkos that prevented Clang from picking the right deployment
...
target when both {MACOSX,IPHONEOS}_DEPLOYMENT_TARGET were set.
llvm-svn: 99055
2010-03-20 08:47:42 +00:00
Daniel Dunbar
6a8efa8a79
Driver: Support CC_PRINT_OPTIONS, used for logging the compile commands (in -v style) to a file.
...
llvm-svn: 99054
2010-03-20 08:01:59 +00:00
Daniel Dunbar
7c4de04c30
Driver: Fix -### to quote shell special characters, following gcc.
...
llvm-svn: 99053
2010-03-20 08:01:53 +00:00
Daniel Dunbar
e46b52a35f
Driver: Fix a number of -fapple-kext issues:
...
- Disable RTTI.
- Disable use of __cxa_atexit.
- Disable unwind tables.
- Enable freestanding mode.
Also, honor -fhosted correctly.
<rdar://problem/7515383> C++ support: -fapple-kext not honored
llvm-svn: 99041
2010-03-20 04:52:14 +00:00
Daniel Dunbar
fe06df4bf3
C++: Add support for -fno-use-cxa-atexit.
...
- So much typing, so little gain...
Also, rename the __cxx_global_initialization function just to match llvm-gcc.
llvm-svn: 99039
2010-03-20 04:15:41 +00:00
Daniel Dunbar
4ea3aea534
Driver: Allow Render{Separate,Joined} option flags on JoinedOrSeparate option types.
...
Also, simplify/fix SeparateArg::render with forced join.
llvm-svn: 99022
2010-03-20 01:12:00 +00:00
Daniel Dunbar
47d25b18db
Driver: Fix possible crash when targetting an unknown (unsupported) Darwin
...
platform, e.g. ppc.
llvm-svn: 99016
2010-03-20 00:50:21 +00:00
John McCall
59bb1d4657
Make -faccess-control and -fno-access-control driver options.
...
llvm-svn: 98703
2010-03-17 01:32:13 +00:00
Daniel Dunbar
35621a9dcc
Driver: Fix forwarding of -fno-lax-vector-conversions.
...
llvm-svn: 98639
2010-03-16 16:57:46 +00:00
Daniel Dunbar
66187b3c6e
Driver: Free Action objects.
...
llvm-svn: 98263
2010-03-11 18:04:58 +00:00
Daniel Dunbar
86d838970b
Driver: Free synthesized derived arguments.
...
llvm-svn: 98262
2010-03-11 18:04:53 +00:00
Daniel Dunbar
66e2768918
Driver: Free jobs in JobList and PipedJob instances.
...
llvm-svn: 98261
2010-03-11 18:04:49 +00:00
Ted Kremenek
1a0c4d5900
Fix -Wsign-compare warnings reported by clang++.
...
llvm-svn: 98174
2010-03-10 19:09:31 +00:00
Douglas Gregor
b1489c67f0
Remove redundant semicolon
...
llvm-svn: 97930
2010-03-08 02:49:35 +00:00
Rafael Espindola
08a692aba4
Don't produce debug info when given -g. Fixes PR6529.
...
llvm-svn: 97897
2010-03-07 04:46:18 +00:00
Chris Lattner
09797543bd
add TCE target support, patch by Pekka J!
...
llvm-svn: 97746
2010-03-04 21:07:38 +00:00
Eric Christopher
0b26a616eb
Add in some more MIPS command line options.
...
Patch by Oleksandr Tymoshenko!
llvm-svn: 97544
2010-03-02 02:41:08 +00:00
Daniel Dunbar
3babf5df64
Driver: Allow driver title (for --help) to be overridden by clients.
...
llvm-svn: 97106
2010-02-25 03:31:53 +00:00
Blaine Garst
fc83aa04db
Unconditionally support block introspection data in a new field at the end
...
of the block descriptor field. This field is the ObjC style @encode
signature of the implementation function, and was to this point
conditionally provided in the block literal data structure. That
provisional support is removed.
Additionally, eliminate unused enumerations for the block literal flags field.
The first shipping ABI unconditionally set (1<<29) but this bit is unused
by the runtime, so the second ABI will unconditionally have (1<<30) set so
that the runtime can in fact distinguish whether the additional data is
present or not.
llvm-svn: 96989
2010-02-23 21:51:17 +00:00
John McCall
8517abc30d
Enable -mconstructor-aliases by default on non-darwin platforms.
...
The linker bug holding this back is Darwin-specific.
llvm-svn: 96655
2010-02-19 02:45:38 +00:00
Daniel Dunbar
0ac9445098
PR5803: clang++: Treat untyped 'C' inputs as C++.
...
- Patch by Andrzej K. Haczewski, with a tweak by me to emit a 'deprecated'
diagnostic when we do this. We'll see what zee users say.
llvm-svn: 96511
2010-02-17 20:32:58 +00:00
Daniel Dunbar
4b8ef28400
Driver: Tweak freebsd::Link, by Roman Divacky.
...
llvm-svn: 96469
2010-02-17 08:07:51 +00:00
John McCall
bb79b5f6f3
Raise the responsibility for passing -disable-llvm-verifier in NDEBUG builds
...
to the driver, and support it in CodeGenOptsToArgs(). Note that this changes
the default behavior of clang -cc1 to always run the verifier.
llvm-svn: 96077
2010-02-13 03:50:24 +00:00
Daniel Dunbar
bcd554f908
Driver: Fix clang -ccc-no-clang -x c++-header foo.h on Darwin.
...
llvm-svn: 95876
2010-02-11 17:33:45 +00:00
Daniel Dunbar
aeea8ac3d8
Driver: Add -rewrite-objc, which is an interface to clang -cc1 -rewrite-objc.
...
llvm-svn: 95849
2010-02-11 03:16:21 +00:00
Daniel Dunbar
84f22f9da1
Driver: Fix infinite loop and wrong message on invalid -ccc-clang-arch argument.
...
llvm-svn: 95848
2010-02-11 03:16:07 +00:00
Daniel Dunbar
3241d400c8
Switch to using -fsjlj-exceptions instead of hard-coding it. Notably, this fixes
...
calls to the UnwindResumeOrRethrow function for C++/Obj-C exception handling,
for Darwin ARM.
llvm-svn: 95787
2010-02-10 18:49:11 +00:00
Anders Carlsson
fcd764a168
Add support for threadsafe statics, and make them the default (matching gcc).
...
Daniel, I'd appreciate a review of the driver/cc1 parts.
llvm-svn: 95508
2010-02-06 23:23:06 +00:00
Ted Kremenek
2f2692f8ca
Rename -cc1 option '-checker-cfref' to '-analyzer-check-objc-mem'.
...
llvm-svn: 95348
2010-02-05 02:06:54 +00:00
Ted Kremenek
b6e400c87c
Rename -cc1 option '-warn-objc-missing-dealloc' to '-analyzer-check-objc-missing-dealloc'.
...
llvm-svn: 95347
2010-02-05 01:59:21 +00:00
Ted Kremenek
61b506aa8f
Rename -cc1 option '-warn-objc-methodsigs' to '-analyzer-check-objc-methodsigs'.
...
llvm-svn: 95346
2010-02-05 01:57:44 +00:00
Ted Kremenek
2d8ef71ae6
Rename -cc1 option '-warn-objc-unused-ivars' to '-analyzer-check-objc-unused-ivars'.
...
llvm-svn: 95345
2010-02-05 01:55:01 +00:00
Ted Kremenek
d519b83757
Rename -cc1 option '-warn-dead-stores' to '-analyzer-check-dead-stores'.
...
llvm-svn: 95343
2010-02-05 01:52:40 +00:00
Ted Kremenek
ec5b3d45c1
Rename -cc1 option '-warn-security-syntactic' to '-analyzer-check-security-syntactic'.
...
llvm-svn: 95342
2010-02-05 01:50:36 +00:00
Daniel Dunbar
c434394d18
Driver: Add -[no-]integrated-as for clang.
...
- Requires backend support, which only exists for i386--darwin currently.
No 'as' required:
--
ddunbar@ozzy:tmp$ cat t.c
int main() { return 42; }
ddunbar@ozzy:tmp$ clang -m32 -integrated-as t.c
ddunbar@ozzy:tmp$ ./a.out; echo $?
42
ddunbar@ozzy:tmp$
--
The random extra whitespace is how you know its working! :)
llvm-svn: 95194
2010-02-03 03:07:56 +00:00
Daniel Dunbar
ffa70e8b27
Driver/Darwin: Don't error/warn on conflicting deployment targets. Apparently
...
this is still a popular thing to do.
llvm-svn: 95093
2010-02-02 17:31:12 +00:00
Daniel Dunbar
98188414ef
Driver/Darwin: Darwin uses -fobjc-legacy-dispatch on ARM.
...
llvm-svn: 95006
2010-02-01 21:07:43 +00:00
Daniel Dunbar
2e3f2c805e
Driver/Frontend: Add support for -fobjc-legacy-dispatch, not yet used.
...
llvm-svn: 95004
2010-02-01 21:07:25 +00:00
Daniel Dunbar
8fa74aa21d
Simplify.
...
llvm-svn: 94929
2010-01-30 23:31:57 +00:00
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
Daniel Dunbar
6596984f3c
Driver/Darwin: Fix a crash when diagnosing conflicting deployment targets.
...
llvm-svn: 94812
2010-01-29 17:02:25 +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
f48d51d693
Driver/Darwin: Eliminate invalid uses of DarwinVersion -- this fixes a number of
...
defaults when targetting iPhoneOS (blocks, non-fragile ABI, stack protector).
llvm-svn: 94642
2010-01-27 00:57:11 +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
7c870175eb
Driver/Darwin: Eliminate confusing IsIPhoneOS parameter -- this was actually
...
just indicating whether the default target should be iPhoneOS.
llvm-svn: 94638
2010-01-27 00:56:44 +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
3b8e50d0ed
Driver/Darwin: Track target platform more explicitly in tool chain, eventually
...
this should just be part of the tool chain itself once we have eliminated
argument translation.
llvm-svn: 94635
2010-01-27 00:56:25 +00:00
Daniel Dunbar
19afd61201
Simplify.
...
llvm-svn: 94503
2010-01-26 03:56:40 +00:00
Daniel Dunbar
d54669d30b
Driver/Darwin: Honor IPHONEOS_DEPLOYMENT_TARGET.
...
llvm-svn: 94488
2010-01-26 01:45:19 +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
fcf2d428e4
ASTUnit: Don't check that input files exist when parsing ASTs from the command
...
line -- they may be remapped (fake) files. This is useful for testing parsing
entirely from memory.
llvm-svn: 94395
2010-01-25 00:44:02 +00:00
Chris Lattner
0bcc858a2b
-fno-rtti is now the default.
...
llvm-svn: 94379
2010-01-24 20:43:31 +00:00
Ted Kremenek
4c0df3dc1d
Rename getClangFullVendorVersion() to getClangFullVersion().
...
llvm-svn: 94273
2010-01-23 02:11:34 +00:00
Ted Kremenek
51b8bc93f8
Move version string generation (e.g., "clang 1.1 ...") to libBasic/Version.cpp, getClangFullVendorVersion().
...
llvm-svn: 94235
2010-01-22 22:29:50 +00:00
Ted Kremenek
18e066f6a9
(1) Rename getClangSubversionRevision() to getClangRevision(), and
...
have it return a StringRef instead of an integer (to be more VCS
agnostic).
(2) Add getClangFullRepositoryVersion(), which contains an
amalgamation of the repository name and the revision.
(3) Change PCH to only emit the string returned by
getClangFullRepositoryVersion() instead of also emitting the value
of getClangSubversionRevision() (which has been removed). This is
functionally equivalent.
More cleanup to version string generation pending...
llvm-svn: 94231
2010-01-22 22:12:47 +00:00
Ted Kremenek
2377a0e0ea
Rename getClangSubversionPath() -> getClangRepositoryPath() and have it return a StringRef.
...
llvm-svn: 94213
2010-01-22 20:55:35 +00:00
Daniel Dunbar
7cde09ac8a
Driver/Darwin: Update tool chain to use static clang_rt libraries provided by
...
compiler-rt. This tool chain now works on x86 and ARM, but isn't the x86 default
yet.
This drastically cleans up the linker invocation, old invocation:
--
"/Developer/usr/bin/../libexec/gcc/i686-apple-darwin10/4.2.1/ld" "-dynamic" "-arch" "x86_64" "-macosx_version_min" "10.6.0" "-weak_reference_mismatches" "non-weak" "-o" "a.out" "-lcrt1.10.6.o" "-L/usr/lib/gcc/i686-apple-darwin10/4.2.1/x86_64" "-L/usr/lib/gcc/i686-apple-darwin10/4.2.1/x86_64" "-L/usr/lib/i686-apple-darwin10/4.2.1" "-L/usr/lib/gcc/i686-apple-darwin10/4.2.1" "-L/usr/lib/gcc/i686-apple-darwin10/4.2.1" "-L/usr/lib/gcc/i686-apple-darwin10/4.2.1/../../../i686-apple-darwin10/4.2.1" "-L/usr/lib/gcc/i686-apple-darwin10/4.2.1/../../.." "t.o" "-lSystem" "-lgcc"
--
New invocation:
--
# For 10.6:
"/usr/bin/ld" "-dynamic" "-arch" "x86_64" "-macosx_version_min" "10.6.0" "-o" "a.out" "-lcrt1.10.6.o" "t.o" "-lSystem"
# For 10.4:
"/usr/bin/ld" "-dynamic" "-arch" "x86_64" "-macosx_version_min" "10.4" "-o" "a.out" "-lcrt1.o" "t.o" "-lSystem" "-lgcc_s.10.4" "/Volumes/Data/ddunbar/llvm.obj.64/Debug/lib/clang/1.1/lib/darwin/libclang_rt.10.4.a"
--
llvm-svn: 94150
2010-01-22 03:38:14 +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
Ted Kremenek
bb1110a7ae
Fix possible memory leak by using an OwningPtr.
...
llvm-svn: 93834
2010-01-19 01:29:05 +00:00
Daniel Dunbar
6bc5be24fa
Remove ../libexec from clang program search path, clang-cc is dead.
...
llvm-svn: 93749
2010-01-18 19:16:53 +00:00
Daniel Dunbar
620327d66b
Fix a FIXME.
...
llvm-svn: 93087
2010-01-10 00:46:10 +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
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