Commit Graph

646 Commits

Author SHA1 Message Date
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