Commit Graph

948 Commits

Author SHA1 Message Date
Roman Divacky ce253d89a2 Add support for sse4a and enable it for amdfam10 cpu.
llvm-svn: 143312
2011-10-30 13:47:56 +00:00
Roman Divacky 43eb6f8aeb Add support for amdfam10 cpu.
llvm-svn: 143305
2011-10-30 07:48:46 +00:00
Douglas Gregor 935bc7a214 Make the loading of information attached to an IdentifierInfo from an
AST file more lazy, so that we don't eagerly load that information for
all known identifiers each time a new AST file is loaded. The eager
reloading made some sense in the context of precompiled headers, since
very few identifiers were defined before PCH load time. With modules,
however, a huge amount of code can get parsed before we see an
@import, so laziness becomes important here.

The approach taken to make this information lazy is fairly simple:
when we load a new AST file, we mark all of the existing identifiers
as being out-of-date. Whenever we want to access information that may
come from an AST (e.g., whether the identifier has a macro definition,
or what top-level declarations have that name), we check the
out-of-date bit and, if it's set, ask the AST reader to update the
IdentifierInfo from the AST files. The update is a merge, and we now
take care to merge declarations before/after imports with declarations
from multiple imports.

The results of this optimization are fairly dramatic. On a small
application that brings in 14 non-trivial modules, this takes modules
from being > 3x slower than a "perfect" PCH file down to 30% slower
for a full rebuild. A partial rebuild (where the PCH file or modules
can be re-used) is down to 7% slower. Making the PCH file just a
little imperfect (e.g., adding two smallish modules used by a bunch of
.m files that aren't in the PCH file) tips the scales in favor of the
modules approach, with 24% faster partial rebuilds.

This is just a first step; the lazy scheme could possibly be improved
by adding versioning, so we don't search into modules we already
searched. Moreover, we'll need similar lazy schemes for all of the
other lookup data structures, such as DeclContexts.

llvm-svn: 143100
2011-10-27 09:33:13 +00:00
Argyrios Kyrtzidis 8edffaa611 Use assert(0) instead of duplicating the check, suggestion by Anna.
llvm-svn: 142886
2011-10-25 00:29:44 +00:00
Dan Gohman 93127aecb9 Remove the Blackfin backend.
llvm-svn: 142881
2011-10-25 00:06:12 +00:00
Dan Gohman 53bb0ff685 Remove the SystemZ backend.
llvm-svn: 142879
2011-10-24 23:48:52 +00:00
Akira Hatanaka c12a271b55 Make changes necessary for N32/64 ABI conformance.
- Size of long double is 16 bytes for both N32 and N64.
- Size of pointers and long is 8 bytes for N64.

llvm-svn: 142705
2011-10-22 00:07:27 +00:00
Ted Kremenek 337c5b880c Further refine the diagnostic categories for ARC diagnostics. Addresses <rdar://problem/10245086>.
llvm-svn: 142571
2011-10-20 05:07:47 +00:00
Benjamin Kramer 80ca407610 Use llvm::Triple's methods to parse FreeBSD version numbers.
Who could've thought that FreeBSD would ever reach version 10!
Patch from Dimitry Andric.

llvm-svn: 142349
2011-10-18 10:10:08 +00:00
Douglas Gregor ebf0049901 For modules, all macros that aren't include guards are implicitly
public. Add a __private_macro__ directive to hide a macro, similar to
the __module_private__ declaration specifier.

llvm-svn: 142188
2011-10-17 15:32:29 +00:00
Benjamin Kramer a518b22d6b Place static initializers on linux into the ".text.startup" section, so the linker can group them together for performance.
This only has an effect with fairly new binutils (2.21.51 or later). Other ELF targets probably want this as well, but on BSDs binutils is usually old so it doesn't matter.

llvm-svn: 142076
2011-10-15 17:53:33 +00:00
Anton Korobeynikov f0c267e6e0 Provide half floating point support as a storage only type.
Lack of half FP was a regression compared to llvm-gcc.

llvm-svn: 142016
2011-10-14 23:23:15 +00:00
Eli Friedman 4b72fddd99 Misc fixes for atomics. Biggest fix is doing alignment correctly for _Atomic types.
llvm-svn: 142002
2011-10-14 20:59:01 +00:00
Bob Wilson 73a4deb33d Change __extension__ to disable only diagnostics controlled by -pedantic.
This changes clang to match GCC's behavior for __extension__, which temporarily
disables the -pedantic flag.  Warnings that are enabled without -pedantic
are not affected.  Besides the general goodness of matching GCC's precedent,
my motivation for this is that macros in the arm_neon.h header need to use
__extension__ to avoid pedantic complaints about their use of statement
expressions, yet we still want to warn about incompatible pointer arguments
for those macros.

llvm-svn: 141804
2011-10-12 19:55:31 +00:00
Anton Korobeynikov 804dd056b3 Add target info for Linux on PPC & Sparc.
Patch by Hal Finkel!

llvm-svn: 141772
2011-10-12 09:30:58 +00:00
Argyrios Kyrtzidis 7f6b029c4e Introduce SourceManager::getFileLoc which returns a file location
taking into account macro arguments.

llvm-svn: 141771
2011-10-12 07:07:40 +00:00
Richard Smith 4dd85d6fa1 Add a -Wc++0x-compat warning for C++11 keywords used as identifiers when in
C++98 mode. Only the first occurrence of each keyword will produce a warning.

llvm-svn: 141700
2011-10-11 19:57:52 +00:00
David Meyer bfdbb25af2 Allow regparm attribute for PNaCl target
llvm-svn: 141638
2011-10-11 03:12:01 +00:00
Lang Hames 4f4aa1a03a Fixed natural stack alignment for Linux x86-32. Thanks Eli.
llvm-svn: 141617
2011-10-11 00:52:51 +00:00
Lang Hames 60b2b2ee0d Update target data strings for ARM and X86 to include the natural stack
alignment parameter "S<size>" that was introduced in r141599.

llvm-svn: 141601
2011-10-10 23:44:43 +00:00
Eli Friedman 1f19100451 Add address spaces for TCE target. Patch by Pekka Jääskeläinen.
llvm-svn: 141390
2011-10-07 19:51:42 +00:00
Daniel Dunbar 2fba0979fe Basic/Diagnostics: Apparently, #pragma ... diagnostic is intended to override
the command line options (at least according to GCC's documentation). GCC 4.2
didn't appear to actually do this, but it seems like that has been fixed in
later release, so we will follow the docs.

llvm-svn: 141119
2011-10-04 21:17:24 +00:00
Argyrios Kyrtzidis 25029d499e Make sure SourceManager::getFileIDLoaded doesn't hang in release build because of invalid passed parameter.
rdar://10210140

llvm-svn: 141048
2011-10-03 23:43:01 +00:00
Justin Holewinski 794c205e52 PTX: Add some basic support for OpenCL address spaces
llvm-svn: 141008
2011-10-03 17:28:37 +00:00
Daniel Dunbar 866fcd34a6 Basic/Diagnostic: Kill off a few unnecessary functions now that refactoring is done, and add a note that the new setDiagnosticGroup{...} methods only operate on the current diagnostic state.
llvm-svn: 140771
2011-09-29 02:03:01 +00:00
Daniel Dunbar 58d0af6c5f Basic/Diagnostics: Rewrite DiagnosticIDs::getDiagnosticLevel completely to be straighter line code, use the new DiagnosticMappingInfo flags, and eliminate the odd MAP_WARNING_NO_WERROR and friend mappings.
- This fixes a host of obscure bugs with regards to how warning mapping options composed with one another, and I believe makes the code substantially easier to read and reason about.

llvm-svn: 140770
2011-09-29 01:58:05 +00:00
Daniel Dunbar fffcf21cf2 Basic/Diagnostics: Add three explicit bits to DiagnosticMappingInfo to track "no-warning-as-error", "no-error-as-fatal", and "show-in-system-header", and update DiagnosticsEngine::setDiagnosticGroup{WarningAsError,ErrorAsFatal} and GetDefaultDiagMappingInfo to set them appropriately.
- No actual functionality change for now, we still also use the diag::Mapping::{MAP_WARNING_NO_ERROR,MAP_ERROR_NO_FATAL,MAP_WARNING_SHOW_IN_SYSTEM_HEADER} for a little while longer.

llvm-svn: 140768
2011-09-29 01:52:06 +00:00
Daniel Dunbar d908c12db8 Basic/Diagnostics: Add a DiagnosticIDs::getDiagnosticsInGroup method, and use
that in DiagnosticEngine instead of the convoluted calling into DiagnosticIDs
which then calls back into the DiagnosticsEngine.

llvm-svn: 140766
2011-09-29 01:47:16 +00:00
Daniel Dunbar e8c12a2979 Basic/Diagnostic: Add a DiagSate::getOrAddMappingInfo method.
- Also, spell const_iterator as const_iterator.

llvm-svn: 140765
2011-09-29 01:42:25 +00:00
Daniel Dunbar 458edfa2b7 Basic/Diagnostics: Move setDiagnosticMapping() to using DiagnosticMappingInfo
and eliminate setDiagnosticMappingInternal.

llvm-svn: 140763
2011-09-29 01:34:47 +00:00
Daniel Dunbar a3637e6894 Basic/Diagnostics: Add a DiagnosticMappingInfo helper class, and switch to
storing mappings with that instead of straying some magic constants about the
source.

llvm-svn: 140760
2011-09-29 01:30:00 +00:00
Daniel Dunbar 9c78496d51 Basic/Diagnostics: Eliminate getDiagnosticMappingInfo method, which wasn't worth methodizing.
llvm-svn: 140759
2011-09-29 01:25:14 +00:00
Daniel Dunbar 400e7e3b39 Basic/Diagnostic: Eliminate the extra "mapping" out-parameter now that I killed the sole client.
llvm-svn: 140756
2011-09-29 01:20:28 +00:00
Daniel Dunbar aa11138543 Basic/Diagnostics: Add an isDefaultMappingAsError method, and switch TextDiagnosticPrinter to use that instead of extracting the current mapping via getDiagnosticLevel, which fixes one class of corner cases w.r.t. printing the "-Werror" diagnostic option marker.
- The TextDiagnosticPrinter code is still fragile as it is just "reverse engineering" what the diagnostic engine is doing. Not my current priority to fix though.

llvm-svn: 140752
2011-09-29 01:01:08 +00:00
Daniel Dunbar c2e5ca6e50 Basic/Diagnostic: Factor out
DiagnosticsEngine::setDiagnosticGroup{ErrorAsFatal,WarningAsError} methods which
more accurately model the correct API -- no internal change to the diagnostics
engine yet though.
 - Also, stop honoring -Werror=everything (etc.) as a valid (but oddly behaved) option.

llvm-svn: 140747
2011-09-29 00:53:47 +00:00
Daniel Dunbar 6de48ee860 Basic/Diagnostics: Split out the default warning "no-Werror" and
"show-in-system-header" bits, which is part of teasing them apart from the
diagnostic mapping kind.

llvm-svn: 140742
2011-09-29 00:34:06 +00:00
Chandler Carruth 3270e2619e Fix a typo spotted by Jonathan Sauer.
llvm-svn: 140708
2011-09-28 18:17:30 +00:00
Chandler Carruth 7d8241cf4f Attempt to silence the GCC -Wreturn-type warning...
llvm-svn: 140693
2011-09-28 10:49:06 +00:00
Chandler Carruth cd99bad4ac Generate tests for all of the x86 SIMD instruction feature set
predefines based on the output of GCC as well as the CPU predefines.

Invert tests for __AVX__, Clang's AVX feature is hard coded off still.

Switch Atom from 'SSE3' to 'SSSE3'. This matches GCC's behavior, Intel's
documentation, and ICC's documentation (such as I could dig up).

Switch Athlon and Geode to enable 3dnowa rather than just 3dnow and
nothing (resp.).

llvm-svn: 140692
2011-09-28 10:36:46 +00:00
Chandler Carruth 5d0feef373 Fix a think-o on my part that got enshrined in a FIXME by setting up the
__tune_...__ define as well.

llvm-svn: 140690
2011-09-28 09:54:11 +00:00
Chandler Carruth 3f7ed950fd Move some of the defines down to more natural locations, consolidating
the target identifying macros at the top, including subtarget macros.

llvm-svn: 140689
2011-09-28 09:54:07 +00:00
Chandler Carruth 6e20c2bd35 Teach Clang to reject 32-bit only CPUs when compiling in 64-bit mode.
Add 64-bit preprocessor macro tests.

llvm-svn: 140688
2011-09-28 09:45:08 +00:00
Chandler Carruth df5f48ac99 Simplify the control flow for predefined macro selection by using
fallthrough now that we're working with a switch. Also remove a dubious
"feature" regarding k6 processors and 3dnow and leave a fixme... Not
that anyone is likely to care about correct tuning for k6 processors
with and w/o 3dnow...

llvm-svn: 140687
2011-09-28 09:45:05 +00:00
Chandler Carruth 212334f7ab Switch the X86TargetInfo object from a string representation of the
selected CPU model to the enumeration. This parses the string
representation once using a StringSwitch on SetCPU. It returns an error
for strings which are not recognized (yay!). Finally it replaces
ridiculous if-chains with switches that cover all enumerators.

The last change required adding several missing entries to the features
function. These were obvious on inspection. Yay for a pattern that gives
warnings when we miss one.

No new test cases yet, as I want to get the 64-bit errors working first.
I'll then start fleshing out the testing more. Currently I'm primarily
testing on Linux, but I'm hoping check whether there are interesting
differences on darwin before long...

llvm-svn: 140685
2011-09-28 08:55:37 +00:00
Chandler Carruth 3ac7aeaacb Introduce an enumeration for the x86 CPUs recognized by Clang. I've
tried to give these nice doxyments, but if I've gotten any of my history
wrong, please chime in.

llvm-svn: 140684
2011-09-28 08:55:34 +00:00
Chandler Carruth 8bdcf9ea12 Clean up a bit of the uses of CPU in the TargetInfo classes. This makes
it an error if a CPU is provided for a target that doesn't implement
logic handling CPU settings, to match the ABI settings. It also removes
the CPU parameter from the getDefaultFeatures method. This parameter was
always filled in with the same value as setCPU was called with, and at
this point every single target implementation that referenced the CPU
within this function has needed to store the CPU via setCPU anyways in
order to implement other interface points.

llvm-svn: 140683
2011-09-28 05:56:05 +00:00
Chandler Carruth 5ac1e8e6b1 Begin fixing Clang's predefined macros for various architectures. This
is *very* much a WIP that I'll be refining over the next several
commits, but I need to get this checkpoint in place for sanity.

This also adds a much more comprehensive test for architecture macros,
which is roughly generated by inspecting the behavior of a trunk build
of GCC. It still requires some massaging, but eventually I'll even check
in the script that generates these so that others can use it to append
more tests for more architectures, etc.

Next up is a bunch of simplification of the Targets.cpp code, followed
by a lot more test cases once we can reject invalid architectures.

llvm-svn: 140673
2011-09-28 02:59:25 +00:00
Argyrios Kyrtzidis 04a6e5f82e Break SourceManager::translateFileLineCol into translateFile, no functionality change.
llvm-svn: 140610
2011-09-27 17:22:25 +00:00
Argyrios Kyrtzidis 4bdd6aa198 Associate the macro arguments location map with a FileID instead
of a ContentCache, since multiple FileIDs can have the same ContentCache
but the expanded macro arguments locations will be different.

llvm-svn: 140521
2011-09-26 08:01:50 +00:00
David Blaikie b5784324b3 Rename DiagnosticInfo to Diagnostic as per issue 5397
llvm-svn: 140493
2011-09-26 01:18:08 +00:00