Commit Graph

464 Commits

Author SHA1 Message Date
Francois Pichet 1c229c0472 Add -fdelayed-template-parsing option. Using this option all templated function definitions are parsed at the end of the translation unit only if it is required by an actual instantiation. As such all the symbols of the TU are available during name lookup.
Using this flag is necessary for compatibility with Microsoft template code.
This also provides some parsing speed improvement.

llvm-svn: 130022
2011-04-22 22:18:13 +00:00
Nick Lewycky 207bce31e1 Wire up the -ftest-coverage and -fprofile-arcs flags to .gcno file emission (at
compile time) and .gcda emission (at runtime). --coverage enables both.

This does not yet add the profile_rt library to the link step if -fprofile-arcs
is enabled when linking.

llvm-svn: 129956
2011-04-21 23:44:07 +00:00
Nick Lewycky ab18d3088a Fix indentation. No functional change.
llvm-svn: 129954
2011-04-21 23:37:32 +00:00
Daniel Dunbar ed904c82b1 Driver/Darwin: Disable movw/movt with -mkernel or -fapple-kext.
llvm-svn: 129721
2011-04-18 21:26:42 +00:00
Douglas Gregor 46ce91a964 Initial work to improve documentation for Clang's diagnostics, from Matthieu Monrocq
llvm-svn: 129614
2011-04-15 22:04:17 +00:00
Chris Lattner 57540c5be0 fix a bunch of comment typos found by codespell. Patch by
Luis Felipe Strano Moraes!

llvm-svn: 129559
2011-04-15 05:22:18 +00:00
Daniel Dunbar dc8355e81a Driver/no-integrated-as: Fix forwarding of -g flag to assembler, when .s input
undergoes preprocessing.

llvm-svn: 129414
2011-04-12 23:59:20 +00:00
Chris Lattner 20b90d061a fix the path to ld.so for darwin/ppc, resolving PR9677. Patch
by Jeremy Huddleston!

llvm-svn: 129299
2011-04-11 21:15:37 +00:00
Dylan Noblesmith 70e73a3d60 refactor -ccc-gcc-name code
Put the logic for deciding the default name for gcc/g++
in the only place that actually cares about it.

This also pushes an ifdef out of the generic driver code
to a little further down, when the target is actually known.
Hopefully it can be changed into just a runtime check
in the future.

llvm-svn: 129212
2011-04-09 13:31:59 +00:00
Evan Cheng 04c9429f34 Rename -mtrap_function= to -ftrap_function= since it's now a target neutral options.
llvm-svn: 129153
2011-04-08 21:37:45 +00:00
Evan Cheng 77cdce9458 Add -mtrap_function=<> option. rdar://9257465
llvm-svn: 129145
2011-04-08 18:47:41 +00:00
Chris Lattner 9242b33de7 fix a typo, patch by PaX team.
llvm-svn: 129141
2011-04-08 18:06:54 +00:00
Daniel Dunbar f28c2ffb84 Driver: Don't attempt to forward some Clang-only options to cc1.
llvm-svn: 129108
2011-04-07 20:41:03 +00:00
Daniel Dunbar 529c03bc1e Driver: Sketch driver support for a CC_LOG_DIAGNOSTICS options, similar to the
existing CC_PRINT_OPTIONS and CC_PRINT_HEADERS, which can be used to
transparently capture the compiler diagnostics from a build.

llvm-svn: 129082
2011-04-07 18:01:20 +00:00
Ted Kremenek 43d47cc397 Add ToolChain support to get Clang to recognize Ubuntu/ppc and Gentoo/ppc64.
llvm-svn: 128944
2011-04-05 22:04:27 +00:00
Daniel Dunbar 16d970950f Driver/Darwin: Tweak simulator link logic a bit more to be closer to GCC.
llvm-svn: 128738
2011-04-01 21:02:42 +00:00
Daniel Dunbar ebc34dff18 Driver/Darwin: Tweak link logic for simulator.
llvm-svn: 128641
2011-03-31 17:12:33 +00:00
Daniel Dunbar 67919b2a5b Integrated-As: Support -Wa,-L when using the integrated assembler.
llvm-svn: 128433
2011-03-28 22:49:28 +00:00
Chandler Carruth b6766f07c8 Add an option to suppress include stack printing on note diagnostics.
These stacks are often less important than those on primary diagnostics.

As the number of notes grows, this becomes increasingly important. The
include stack printing is clever and doesn't print stacks for adjacent
diagnostics from the same file, but when a note is in between a sequence
of errors in a header file, and the notes all refer to some other file,
we end up getting a worst-case ping-pong of include stacks that take up
a great deal of vertical space.

Still, for now, the default behavior isn't changed. We can evaluate user
feedback with the flag.

Patch by Richard Trieu, a couple of style tweaks from me.

llvm-svn: 128371
2011-03-27 01:50:55 +00:00
Chandler Carruth 6e50103acd Add -f[no-]strict-overflow to the Clang driver. Use it to set the
default for -fwrapv if that flag isn't specified explicitly. We always
prefer an explict setting of -fwrapv when present. Also adds support for
-fno-wrapv to allow disabling -fwrapv even when -fno-strict-overflow is
passed.

llvm-svn: 128353
2011-03-27 00:04:55 +00:00
Ted Kremenek 49c79790de Rework checker "packages" and groups to be more hierarchical.
llvm-svn: 128187
2011-03-24 00:28:47 +00:00
Daniel Dunbar 12100e2c7f Frontend: Add a more explicit -backend-option flag for passing backend command
line options, instead of leveraging the blanket -mllvm option.
 - This allows using the frontend itself without requiring the backend have
   those options available (i.e., if the target wasn't built).

llvm-svn: 128087
2011-03-22 16:48:17 +00:00
Bob Wilson d9249414b3 Add clang support for cortex-m0 cpus. Patch by James Orr.
llvm-svn: 128018
2011-03-21 20:40:05 +00:00
Joerg Sonnenberger fcc3ec90a5 Introduce FindTargetProgramPath to check for a target-specific helper
program and fallback to plain version otherwise. Use this for the NetBSD
target to make it try e.g. i486--netbsdelf-as and -ld for target
i486--netbsdelf.

llvm-svn: 127996
2011-03-21 14:01:40 +00:00
Joerg Sonnenberger 6165ab1132 Remember sysroot in Driver. Pass it down to ld for NetBSD, FreeBSD
and DragonFly. Use the --sysroot= form for Linux. Fix handling of =
prefix for -B.

llvm-svn: 127994
2011-03-21 13:51:29 +00:00
Daniel Dunbar 8c3d735118 Driver: Forward -traditional and -traditional-cpp in preprocessing modes.
- We don't really support the majority of the horrible -traditional-cpp
   behavior, but it is unlikely that we ever will either. This allows us to
   start trying to use clang as a /usr/bin/cpp replacement and see what pieces
   of -traditional-cpp mode people actually care about.

llvm-svn: 127911
2011-03-18 21:23:40 +00:00
John McCall 7ef5cb3038 The Darwin kernel does not provide useful guard variable support.
Issue this as an IR-gen error;  it's not really worthwhile doing this
"right", i.e. in Sema, because IR gen knows a lot of tricks beyond
what the constant evaluator knows.

llvm-svn: 127854
2011-03-18 02:56:14 +00:00
Daniel Dunbar c44f8cf7b8 Driver/Obj-C: Be compatible with GCC behavior in that -fno-exceptions *does not*
disable Obj-C exceptions.

llvm-svn: 127836
2011-03-17 23:28:31 +00:00
Daniel Dunbar 033a4bc49e Driver/Darwin: These are command line options, not target features.
llvm-svn: 127820
2011-03-17 18:29:04 +00:00
Daniel Dunbar 1d733e2d7e Driver/Darwin: Suppress spurious warning about -force_cpusubtype_ALL.
llvm-svn: 127819
2011-03-17 17:37:29 +00:00
Daniel Dunbar c9388c11f1 Driver/Darwin/ARM: Kernel/kext code has more strict alignment requirements.
llvm-svn: 127815
2011-03-17 17:10:06 +00:00
Daniel Dunbar b1db4b69cc Driver/ARM: Match GCC behavior in that -msoft-float disables NEON, despite this
not being consistent at all with other parts of the GCC implementation.

llvm-svn: 127777
2011-03-17 00:07:34 +00:00
Ted Kremenek a4a57c10da Re-enable the IdempotentOperations checker for --analyze, and put it and the DeadStores checker into the "deadcode" group.
llvm-svn: 127531
2011-03-12 06:14:28 +00:00
Joerg Sonnenberger b86f5f4106 If called as *cpp or *cpp-[^-]*, run only the preprocessor. If no
input is specified, use stdin implicitly. Based on a patch from
Roman Divacky.

llvm-svn: 127137
2011-03-06 23:31:01 +00:00
Douglas Gregor d9bb152821 Fix driver for thumb-capable ARM hosts, from Mikko Lehtonen!
llvm-svn: 127128
2011-03-06 19:11:49 +00:00
Daniel Dunbar 908b48565d build: Allow disabling movt/movw from build, for testing purposes.
llvm-svn: 126810
2011-03-02 00:55:57 +00:00
Daniel Dunbar 733b0f87df Driver/Darwin: Be bug compatible with GCC and ignore -pg on ARM.
llvm-svn: 126767
2011-03-01 18:49:30 +00:00
Roman Divacky 432f10df68 The default CPU on FreeBSD for i386 should be i486, not pentium4.
Patch by Dimitry Andric!

llvm-svn: 126763
2011-03-01 18:11:37 +00:00
Roman Divacky ee8188a23b For linking on FreeBSD, don't add a hardcoded "-L/usr/lib", but
retrieve the library paths from the ToolChain object instead.

Copy the relevant code from linuxtools::Link::ConstructJob(), and
replace the std::string stuff with llvm::StringRef, while we're here.

Patch by Dimitry Andric!

llvm-svn: 126757
2011-03-01 17:53:14 +00:00
Roman Divacky 65b88cdb3b Implement -mrtd which sets the StdCall calling convention to be the default
one.

llvm-svn: 126756
2011-03-01 17:40:53 +00:00
Rafael Espindola d95a81293b Disable more warnings so that it is safe to use
CC="clang -use-gold-plugin -emit-llvm"
CXX="clang++ -use-gold-plugin -emit-llvm"

llvm-svn: 126740
2011-03-01 05:25:27 +00:00
Rafael Espindola 22f60303f2 Don't warn about "clang -use-gold-plugin -c ...". With this users can say
CC="clang -use-gold-plugin" CFLAGS=-emit-llvm ../configure...
and not be hit with a warning for each .c file.

llvm-svn: 126713
2011-02-28 23:29:45 +00:00
Argyrios Kyrtzidis 9eb02dfa89 [analyzer] Remove '-analyzer-check-objc-mem' flag, the nominee for best misnomer award.
llvm-svn: 126676
2011-02-28 19:49:42 +00:00
David Chisnall da20991a1b Make -fobjc-nonfragile-abi and -fgnu-runtime imply -fblocks (unless -fno-blocks is specified), because this combination of flags defines an Objective-C runtime that includes a blocks runtime.
llvm-svn: 126654
2011-02-28 17:11:43 +00:00
Chandler Carruth 74f8711802 Fix a tiny goof in the Driver's logic which caused the explicit presence
of -fexceptions to disably C++ exceptions. The correct code was in the
ObjC branch, this just mirrors that logic on the C++ side of things.
Thanks to John Wiegley for pointing this out.

llvm-svn: 126640
2011-02-28 07:25:18 +00:00
Anders Carlsson e96ab55b28 Add a -fcxx-exceptions flag to the frontend, which can be used to enable
C++ exceptions, even when exceptions have been turned off using -fno-exceptions.
Make the -fobjc-exceptions flag do the same thing, but for Objective-C exceptions.

C++ and Objective-C exceptions can also be disabled using -fno-cxx-excptions and
-fno-objc-exceptions.

llvm-svn: 126630
2011-02-28 02:27:16 +00:00
Argyrios Kyrtzidis 3e7ab19863 [analyzer] Move the DeadStores checker out of the 'core' package.
-Now it gets enabled with '-analyzer-checker=DeadStores'.
-The driver passes the above flag by default.

llvm-svn: 126612
2011-02-28 01:27:12 +00:00
Anders Carlsson 246ff3f19f Factor code out into a helper function, shouldUseExceptionTablesForObjCExceptions.
llvm-svn: 126601
2011-02-28 00:44:51 +00:00
Anders Carlsson 3320e1575f Make clang -cc1 disable Objective-C exceptions by default, and add a -fobjc-exceptions flag to turn them on.
Update all tests accordingly.

llvm-svn: 126177
2011-02-22 01:52:06 +00:00
Chris Lattner d0257f79bc Pass the right linker flag in openbsd::Link::ConstructJob,
patch by Matthew Dempsky!

llvm-svn: 126133
2011-02-21 18:36:51 +00:00