Commit Graph

1034 Commits

Author SHA1 Message Date
Benjamin Kramer 728ed3f386 Move Storage and StorageAllocator out of the PartialDiagnostic class so we can forward declare them.
Let ASTContext allocate the storage in its BumpPtrAllocator.
This will help us remove ASTContext's depedency on PartialDiagnostic.h soon.

llvm-svn: 149780
2012-02-04 12:30:46 +00:00
Argyrios Kyrtzidis de044e5bb8 Change the fixed array of FixitHints to a SmallVector to lift off
the limit on the number of fixits.

llvm-svn: 149676
2012-02-03 05:58:22 +00:00
Chad Rosier d1956e46dd [frontend] Don't allow a mapping to a warning override an error/fatal mapping.
rdar://10736625

llvm-svn: 149662
2012-02-03 01:49:51 +00:00
Douglas Gregor 3ec6663be0 Back out my heinous hack that tricked the module generation mechanism
into using non-absolute system includes (<foo>)...

... and introduce another hack that is simultaneously more heineous
and more effective. We whitelist Clang-supplied headers that augment
or override system headers (such as float.h, stdarg.h, and
tgmath.h). For these headers, Clang does not provide a module
mapping. Instead, a system-supplied module map can refer to these
headers in a system module, and Clang will look both in its own
include directory and wherever the system-supplied module map
suggests, then adds either or both headers. The end result is that
Clang-supplied headers get merged into the system-supplied module for
the C standard library.

As a drive-by, fix up a few dependencies in the _Builtin_instrinsics
module.

llvm-svn: 149611
2012-02-02 18:42:48 +00:00
Bob Wilson 8e5acc5cc1 Use the new Triple::getMacOSXVersion function in another place.
I removed support for "*-darwin*-iphoneos" triples, since we now have
iOS listed as a separate OS in the triples.

llvm-svn: 149455
2012-01-31 23:52:58 +00:00
Nico Weber 3435ede0ca Fix "long double" and __SIZE_TYPE__ on powerpc, now with test fix.
Fixes PR11867. Patch from Jeremy Huddleston!

llvm-svn: 149334
2012-01-31 02:07:33 +00:00
Nico Weber 2dd5756bf1 Revert r149285, it breaks test/Preprocessor/init.c.
llvm-svn: 149301
2012-01-30 23:53:44 +00:00
Nico Weber aa11e6e28c Fix "long double" and __SIZE_TYPE__ on powerpc.
Fixes PR11867. Patch from Jeremy Huddleston!

llvm-svn: 149285
2012-01-30 22:25:29 +00:00
Douglas Gregor 0070c0bfbe Introduce TargetInfo::hasFeature() to query various feature names in
each of the targets. Use this for module requirements, so that we can
pin the availability of certain modules to certain target features,
e.g., provide a module for xmmintrin.h only when SSE support is
available.

Use these feature names to provide a nearly-complete module map for
Clang's built-in headers. Only mm_alloc.h and unwind.h are missing,
and those two are fairly specialized at the moment. Finishes
<rdar://problem/10710060>.

llvm-svn: 149227
2012-01-30 06:38:25 +00:00
Douglas Gregor 8992928274 Thread a TargetInfo through to the module map; we'll need it for
target-specific module requirements.

llvm-svn: 149224
2012-01-30 06:01:29 +00:00
John McCall eed64c77d2 Complain about attempts to use 'protected' visibility on targets
like Darwin that don't support it.  We should also complain about
invalid -fvisibility=protected, but that information doesn't seem
to exist at the most appropriate time, so I've left a FIXME behind.

llvm-svn: 149186
2012-01-29 01:20:30 +00:00
Bob Wilson 19a2f2bcc0 Use defined-at-zero behavior for CLZ/CTZ builtins on PowerPC.
llvm-svn: 149181
2012-01-28 18:02:29 +00:00
Argyrios Kyrtzidis 059cac4db4 DiagnosticsEngine::setMappingToAllDiagnostics() does not need to return bool,
caught by Chad.

llvm-svn: 149173
2012-01-28 04:35:52 +00:00
Douglas Gregor a686e1b05d Introduce module attributes into the module map grammar, along with a
single attribute ("system") that allows us to mark a module as being a
"system" module. Each of the headers that makes up a system module is
considered to be a system header, so that we (for example) suppress
warnings there.

If a module is being inferred for a framework, and that framework
directory is within a system frameworks directory, infer it as a
system framework.

llvm-svn: 149143
2012-01-27 19:52:33 +00:00
Argyrios Kyrtzidis 9ffada97ce Due to a bug, -Wno-everything works like -Weverything. Fix the bug by having
-Wno-everything remap all warnings to ignored.

We can now use "-Wno-everything -W<warning>" to ignore all warnings except
specific ones.

llvm-svn: 149121
2012-01-27 06:15:43 +00:00
Bob Wilson a7a61e2701 Make clz/ctz builtins defined for zero on ARM targets. rdar://10732455
ARM supports clz and ctz directly and both operations have well-defined
results for zero.  There is no disadvantage in performance to using the
defined-at-zero versions of llvm.ctlz/cttz intrinsics.  We're running into
ARM-specific code written with the assumption that __builtin_clz(0) == 32,
even though that value is technically undefined.  The code is failing now
because of llvm optimizations that are taking advantage of the undef
behavior (specifically svn r147255).  There's nothing wrong with that
optimization on x86 where any incorrect assumptions about __builtin_clz(0)
will quickly be exposed.  For ARM, though, optimizations based on that undef
behavior are likely to cause subtle bugs.  Other targets with defined-at-zero
clz/ctz support may want to override the default behavior as well.

llvm-svn: 149086
2012-01-26 22:14:27 +00:00
Sebastian Pop 422377cfd3 rename -ccc-host-triple into -target
llvm-svn: 148582
2012-01-20 22:01:23 +00:00
Anton Yartsev 68d773cb3d fix for PR11655
changes i64 alignment from 64 to 32 for powerpc-darwin

llvm-svn: 148345
2012-01-17 22:40:00 +00:00
David Blaikie 8a40f700e6 Remove unreachable code in Clang. (replace with llvm_unreachable where appropriate or when GCC requires it)
llvm-svn: 148292
2012-01-17 06:56:22 +00:00
David Blaikie f47fa304a4 Remove unnecessary default cases in switches over enums.
This allows -Wswitch-enum to find switches that need updating when these enums are modified.

llvm-svn: 148281
2012-01-17 02:30:50 +00:00
Eli Friedman d749c6bf2e Revert r148138; it's causing test failures.
llvm-svn: 148141
2012-01-13 21:33:06 +00:00
Sebastian Pop 86500280c6 remove assertions in the Hexagon backend specific clang driver
Patch from Jyotsna Verma:

I have made the changes to remove assertions in the Hexagon backend
specific clang driver. Instead of asserting on invalid arch name, it has
been modified to use the default value.

I have changed the implementation of the CPU flag validation for the
Hexagon backend. Earlier, the clang driver performed the check and
asserted on invalid inputs. In the new implementation, the driver passes
the last CPU flag (or sets to "v4" if not specified) to the compiler (and
also to the assembler and linker which perform their own check) instead of
asserting on incorrect values. This patch changes the setCPU function for
the Hexagon backend in clang/lib/Basic/Targets.cpp which causes the
compiler to error out on incorrect CPU flag values.

llvm-svn: 148139
2012-01-13 20:37:10 +00:00
Sebastian Pop 9a8d528ddf rename -ccc-host-triple into -target
llvm-svn: 148138
2012-01-13 20:37:02 +00:00
Evgeniy Stepanov 48af2a9e66 Fix -mfpu parsing on ARM.
- Support gcc-compatible vfpv3 name in addition to vfp3.
- Support vfpv3-d16.
- Disable neon feature for -mfpu=vfp* (yes, we were emitting Neon instructions
  for those!).

llvm-svn: 147943
2012-01-11 11:21:31 +00:00
Benjamin Kramer 569f215771 Add definitions for AMD's bobcat (aka btver1)
llvm-svn: 147849
2012-01-10 11:50:18 +00:00
Benjamin Kramer edbc59a27e Enable POPCNT and LZCNT with sse4a.
llvm-svn: 147848
2012-01-10 11:50:13 +00:00
Benjamin Kramer e3b442d20c Factor the repetitive cpu macro definition into a helper function.
llvm-svn: 147847
2012-01-10 11:50:09 +00:00
Craig Topper 23b9219765 Merge AVX/AVX2 into the SSE level.
llvm-svn: 147771
2012-01-09 09:19:09 +00:00
Joerg Sonnenberger 1623714010 __FLT_EVAL_METHOD__ should be 1 on NetBSD/i386, since it defaults to
"double" rounding.

llvm-svn: 147669
2012-01-06 18:32:26 +00:00
Douglas Gregor eb90e83085 Store the submodules of a module in source order, as they are stored
in the module map. This provides a bit more predictability for the
user, as well as eliminating the need to sort the submodules when
serializing them.

llvm-svn: 147564
2012-01-04 23:32:19 +00:00
Benjamin Kramer 6dced3b468 Penryn doesn't support sse4.2, don't enable it in the first place.
While the code took care of disabling the sse42 flag it didn't know
about popcnt. This broke -march=native on penryn.

llvm-svn: 147531
2012-01-04 14:36:57 +00:00
Douglas Gregor 663b48f13b Re-uglify #public and #private to #__public_macro and #__private_macro.
llvm-svn: 147469
2012-01-03 19:48:16 +00:00
Douglas Gregor da82e703d1 Eliminate the uglified keyword __import_module__ for importing
modules. This leaves us without an explicit syntax for importing
modules in C/C++, because such a syntax needs to be discussed
first. In Objective-C/Objective-C++, the @import syntax is used to
import modules.

Note that, under -fmodules, C/C++ programs can import modules via the
#include mechanism when a module map is in place for that header. This
allows us to work with modules in C/C++ without committing to a syntax.

llvm-svn: 147467
2012-01-03 19:32:59 +00:00
Douglas Gregor 0bf886d41a Under -fmodules, accept #public <macroname> and #private <macroname>
to make a macro public (the default for headers) or private,
respectively.

llvm-svn: 147455
2012-01-03 18:24:14 +00:00
Douglas Gregor 1fb5c3a63a Implement support for module requirements, which indicate the language
features needed for a particular module to be available. This allows
mixed-language modules, where certain headers only work under some
language variants (e.g., in C++, std.tuple might only be available in
C++11 mode).

llvm-svn: 147387
2011-12-31 04:05:44 +00:00
Craig Topper ffdb46ceef Add FMA4 feature flag. Intrinsics coming soon. Also make sse4a feature flag imply sse3. Matches gcc behavior.
llvm-svn: 147370
2011-12-30 07:33:42 +00:00
Craig Topper 1de8348db7 Add popcnt feature flag to match gcc. This flag is implied when sse42 is enabled, but can be disabled separately. Move popcnt intrinsics to popcntintrin.h to match gcc.
llvm-svn: 147340
2011-12-29 16:10:46 +00:00
Benjamin Kramer cf5014771d Add a target hook for FLT_EVAL_METHOD and use it to set the value on x86 with sse disabled.
x87 math evaluates everything with 80 bits precision, so we have to set FLT_EVAL_METHOD
to "2".

llvm-svn: 147311
2011-12-28 15:47:06 +00:00
Eli Friedman 2b081c2c9e Partially revert r147195; lib/Basic/Version.cpp conditionally depends on config.h.
llvm-svn: 147282
2011-12-26 22:43:17 +00:00
Craig Topper 22967d4a61 Add BMI, BMI2, and LZCNT feature flags to enable adding intrinsics.
llvm-svn: 147262
2011-12-25 05:06:45 +00:00
Benjamin Kramer e56f393249 Mass rename C1x references to C11. The name hasn't proliferated like "C++0x" so this patch is surprisingly small.
Also drop -Wc1x-extensions in favor of -Wc11-extensions. I don't think we need to keep this around for compatibility.

llvm-svn: 147221
2011-12-23 17:00:35 +00:00
Dylan Noblesmith 1ced737ebf remove unneeded config.h includes
llvm-svn: 147195
2011-12-22 22:49:47 +00:00
Eli Friedman 803acb3ff2 Add support for bitcasts to vector type in Evaluate.
llvm-svn: 147137
2011-12-22 03:51:45 +00:00
Argyrios Kyrtzidis e841c901de Fix bugs in SourceManager::computeMacroArgsCache() and add a unit test for it.
llvm-svn: 147057
2011-12-21 16:56:35 +00:00
Argyrios Kyrtzidis 2403797eec For SourceManager::isBeforeInTranslationUnit(), have it consider macro arg expanded
token locations as coming before the closing ')' of a function macro expansion.

Include a unit test for SourceManager.

llvm-svn: 147056
2011-12-21 16:56:29 +00:00
Nick Lewycky f243e0df95 Bump suitable alignment on darwin ppc 32/64 and x86-32 to 16 bytes. I don't
actually know about the other OSes on X86-32 besides Linux...

llvm-svn: 147034
2011-12-21 04:25:47 +00:00
David Blaikie 68e081d606 Unweaken vtables as per http://llvm.org/docs/CodingStandards.html#ll_virtual_anch
llvm-svn: 146959
2011-12-20 02:48:34 +00:00
Fariborz Jahanian 103ae5c48f objc-arc: bridge casts in non-objc-arc mode are ignord.
But, warn too. // rdar://10597832

llvm-svn: 146904
2011-12-19 21:06:15 +00:00
Dylan Noblesmith 2a8bc15230 SourceManager: use getBufferSize()
Forming an out of bounds pointer to check if it's out
of bounds was undefined behavior.

llvm-svn: 146861
2011-12-19 08:51:05 +00:00
Ted Kremenek 8f3c349430 Update CMake dependencies.
llvm-svn: 146836
2011-12-17 20:08:54 +00:00