Commit Graph

450 Commits

Author SHA1 Message Date
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
Anders Carlsson ce8dd3a5d4 Add a new ObjCExceptions member variable to LangOptions. This controls whether Objective-C exceptions are enabled or not (they are by default).
llvm-svn: 126061
2011-02-19 23:53:54 +00:00
Argyrios Kyrtzidis 3b1b3fe039 [analyzer] '-analyzer-check-objc-mem' can go through the llvm/clang codebase without crashing; enable it for C++.
llvm-svn: 126026
2011-02-19 08:03:21 +00:00
Daniel Dunbar 1094bb101b Driver/Darwin: Support -Wl, with -Xarch_. This doesn't work naturally because of
the special way we model "linker input" arguments.

llvm-svn: 126023
2011-02-19 05:33:51 +00:00
Argyrios Kyrtzidis af45aca670 [analyzer] Use the new registration mechanism on the non-path-sensitive-checkers:
DeadStoresChecker
  ObjCMethSigsChecker
  ObjCUnusedIvarsChecker
  SizeofPointerChecker
  ObjCDeallocChecker
  SecuritySyntaxChecker

llvm-svn: 125779
2011-02-17 21:39:33 +00:00
NAKAMURA Takumi 31ea2f14bc Triple::MinGW64 is deprecated and removed. We can use Triple::MinGW32 instead.
No one uses *-mingw64. mingw-w64 is represented as {i686|x86_64}-w64-mingw32.

llvm-svn: 125742
2011-02-17 08:51:38 +00:00
NAKAMURA Takumi 029d74b264 Fix whitespace.
llvm-svn: 125741
2011-02-17 08:50:50 +00:00
Argyrios Kyrtzidis b2400924d9 [analyzer] Use the new registration mechanism on the IdempotentOperationChecker.
llvm-svn: 125611
2011-02-15 22:55:14 +00:00
Argyrios Kyrtzidis a6d04d541d [analyzer] Use the new registration mechanism on some of the internal checks. These are:
StackAddrLeakChecker
ObjCAtSyncChecker
UnixAPIChecker
MacOSXAPIChecker

The rest have/create implicit dependencies between checkers and need to be handled differently.

llvm-svn: 125559
2011-02-15 07:42:33 +00:00
Argyrios Kyrtzidis 556c45e9c5 [analyzer] Overhauling of the checker registration mechanism.
-Checkers will be defined in the tablegen file 'Checkers.td'.
-Apart from checkers, we can define checker "packages" that will contain a collection of checkers.
-Checkers can be enabled with -analyzer-checker=<name> and disabled with -analyzer-disable-checker=<name> e.g:
	Enable checkers from 'cocoa' and 'corefoundation' packages except the self-initialization checker:
	-analyzer-checker=cocoa -analyzer-checker=corefoundation -analyzer-disable-checker=cocoa.SelfInit
-Introduces CheckerManager and CheckerProvider. CheckerProviders get the set of checker names to enable/disable and
 register them with the CheckerManager which will be the entry point for all checker-related functionality.

Currently only the self-initialization checker takes advantage of the new mechanism.

llvm-svn: 125503
2011-02-14 18:13:31 +00:00
Matt Beaumont-Gay 1fe49151c9 Add braces to quiet a gcc warning.
llvm-svn: 125309
2011-02-10 20:35:01 +00:00
Roman Divacky 66f2276aee Adjust the object files to be linked in when mcount profiling
is specified in the FreeBSD linker driver.

llvm-svn: 125285
2011-02-10 16:59:40 +00:00
Roman Divacky 178e0160b7 Implement mcount profiling, enabled via -pg.
llvm-svn: 125282
2011-02-10 16:52:03 +00:00
Daniel Dunbar 0bb0331d95 Driver/Frontend: Wire up -mregparm=.
llvm-svn: 125201
2011-02-09 17:54:19 +00:00
Bob Wilson d1447c45fa Add better support for ARM EABI triples.
Patch by Renato Golin!

llvm-svn: 124878
2011-02-04 17:59:28 +00:00