Commit Graph

1451 Commits

Author SHA1 Message Date
Petar Jovanovic c19a284182 [Mips] Allocate NaClTargetInfo for MIPSEL NaCl
A patch to AllocateTarget function to recognize llvm::Triple::NaCl for
MIPSEL and return NaClTargetInfo. Additional test has been added to check
if the expected macros get defined.

llvm-svn: 191124
2013-09-21 01:27:01 +00:00
Ben Langmuir 58078d0103 Add C intrinsics for Intel SHA Extensions
Intrinsics added shaintrin.h, which is included from x86intrin.h if __SHA__ is
enabled. SHA implies SSE2, which is needed for the __m128i type.

Also add the -msha/-mno-sha option.

llvm-svn: 190999
2013-09-19 13:22:04 +00:00
Craig Topper 2956112308 Use curly braces all the way through long if/else chain for consistency and readability.
llvm-svn: 190982
2013-09-19 01:13:07 +00:00
Craig Topper 5f79e2661d Disabling sse2 should disable aes and pclmul support.
llvm-svn: 190977
2013-09-19 00:01:05 +00:00
Fariborz Jahanian 1c900bcf26 ObjectiveC migrator: For consistency, also infer
'instancetype' for known family of methods
with related result type; such as 'init'
methods. // rdar://14987948

llvm-svn: 190956
2013-09-18 20:35:47 +00:00
Joey Gouly 1e8637b259 [ARMv8] Add builtins for CRC instructions.
Patch by Bradley Smith!

llvm-svn: 190931
2013-09-18 10:07:09 +00:00
Craig Topper 86d79ef4b8 Push contents of X86TargetInfo::setFeatureEnabled down to a static function called by the virtual version and all the places in getDefaultFeatures. This way getDefaultFeatures doesn't make so many virtual calls.
llvm-svn: 190847
2013-09-17 04:51:29 +00:00
Craig Topper 13f61a6c37 Mark setSSELevel/setMMXLevel/setXOPLevel as static since they don't access anything in the class.
llvm-svn: 190846
2013-09-17 04:12:55 +00:00
Amara Emerson 8c3de546d6 Add error checking to reject neon_vector_type attribute on targets without NEON.
Patch by Artyom Skrobov.

llvm-svn: 190801
2013-09-16 18:07:35 +00:00
Benjamin Kramer 4d6efbb28a Add a define for the ObjFW runtime ABI version.
This removes __has_feature(objc_msg_lookup_stret), as it is not required
anymore after this patch.

Patch by Jonathan Schleifer!

llvm-svn: 190791
2013-09-16 16:31:49 +00:00
Craig Topper 31db3a2efc Make F16C feature imply AVX. Matches GCC behavior.
llvm-svn: 190776
2013-09-16 04:54:13 +00:00
Cameron Esfahani 556d91e2c3 Clean up some Triple usage in clang.
llvm-svn: 190737
2013-09-14 01:09:11 +00:00
Preston Gurd a3c58c02f1 Update Atom Silvermont (SLM) support by adding enabled features.
llvm-svn: 190718
2013-09-13 19:27:17 +00:00
Renato Golin 1a04f22356 Add more Cortex CPUs and tests
llvm-svn: 190703
2013-09-13 17:02:54 +00:00
Renato Golin eefb577be8 Fix Neon detection for Cortex-A class, plus adds some more CPUs to default features
llvm-svn: 190702
2013-09-13 17:02:45 +00:00
David Tweed 31d09b0cef Certain multi-platform languages, such as OpenCL, have the concept of
address spaces which is both (1) a "semantic" concept and
(2) possibly a hardware level restriction. It is desirable to
be able to discard/merge the LLVM-level address spaces on arguments for which
there is no difference to the current backend while keeping
track of the semantic address spaces in a funciton prototype. To do this
enable addition of the address space into the name-mangling process. Add
some tests to document this behaviour against inadvertent changes.

Patch by Michele Scandale!

llvm-svn: 190684
2013-09-13 12:04:22 +00:00
Jordan Rose f31f5f8488 [CMake] Put controversial always-recheck-revision-number behind an option.
CMake does not have the ability to perform actions before calculating
dependencies, so it can't know whether it needs to rebuild clangBasic
to update for a new revision number. CLANG_ALWAYS_CHECK_VC_REV (off by
default) will cause clangBasic to always be dirty by deleting the
generated SVNVersion.inc after use; otherwise, SVNVersion.inc will
always be updated, but only included in the final binary when clangBasic
is rebuilt.

It'd be great to find a better way to do this, but hopefully this is
still an improvement over the complete lack of version information before.

llvm-svn: 190613
2013-09-12 16:17:41 +00:00
Jordan Rose e51d5f6706 [CMake] Fix repository version checking dependencies harder.
Just always regenerate SVNVersion.inc. Don't worry about it not changing.

llvm-svn: 190560
2013-09-11 23:12:55 +00:00
Jordan Rose 206d4c4678 [CMake] Always include the Clang repo version, just like the autoconf build.
Now that LLVM's helper script GetSVN.cmake actually works consistently,
there's no reason not to use it. This does mean that the clangBasic target
is potentially always dirty, because CMake-generated projects do not
necessarily recalculate dependencies after running each target.

This should end the issues of the AST format changing and breaking old
module files; CMake-Clang should now detect that the version changed just
like Autoconf-Clang has.

llvm-svn: 190557
2013-09-11 22:46:46 +00:00
Craig Topper c0070a4320 Fix a bug where -msse followed by -mno-sse would leave MMX enabled.
llvm-svn: 190496
2013-09-11 06:48:53 +00:00
Alexey Samsonov 3767ccf318 Delete unused static class members
llvm-svn: 190394
2013-09-10 09:26:48 +00:00
David Tweed 6c2149b3e5 Fix minor coding style issue in r190296 pointed out by Richard Smith.
llvm-svn: 190390
2013-09-10 08:00:34 +00:00
Craig Topper 7481d8aa17 Separate popcnt and sse4.2 feature control somewhat to match gcc behavior.
Enabling sse4.2 will implicitly enable popcnt unless popcnt is explicitly disabled.
Disabling sse4.2 will not disable popcnt if popcnt is explicitly enabled.

llvm-svn: 190387
2013-09-10 06:55:47 +00:00
David Tweed 2da6438969 The OpenCL standard specifies the sizes and alignments of various types than other C-family
languages, as well as specifying errno is not set by the math functions. Make the
clang front-end set those appropriately when the OpenCL language option is set.

Patch by Erik Schnetter!

llvm-svn: 190296
2013-09-09 09:17:24 +00:00
Stepan Dyatkovskiy a4a59d7468 Additional fix for PR16752 and for commit 190044:
-- For TargetInfo::getRealTypeByWidth also added support for IEEEQuad float type.

llvm-svn: 190294
2013-09-09 07:46:54 +00:00
David Blaikie 3e8aa9a6f3 Unbreak the Clang -Werror build after r190183.
Best guess at the right answer here - no guarantees of fitness for any
particular purpose.

llvm-svn: 190203
2013-09-06 20:58:25 +00:00
Sylvestre Ledru 15832288f4 Fix the profile of the function (fix commit 190048)
llvm-svn: 190051
2013-09-05 13:58:07 +00:00
Sylvestre Ledru 4afe74ac26 Fix bug #17104 - Target info for GNU/kFreeBSD were missing.
As a result, Clang doesn't define the pre-processor macros that are expected
on this platform.

Thanks to Robert Millan for the patch

llvm-svn: 190048
2013-09-05 13:47:07 +00:00
Stepan Dyatkovskiy 5a63792239 Add new methods for TargetInfo:
getRealTypeByWidth and getIntTypeByWidth
  for ASTContext names are almost same(invokes new methods from TargetInfo):
     getIntTypeForBitwidth and getRealTypeForBitwidth.

As first commit for PR16752 fix: 'mode' attribute for unusual targets doesn't work properly
Description:
Troubles could be happened due to some assumptions in handleModeAttr function (see SemaDeclAttr.cpp).
For example, it assumes that 32 bit integer is 'int', while it could be 16 bit only.
Instead of asking target: 'which type do you want to use for int32_t ?' it just hardcodes general opinion. That doesn't looks pretty correct.
Please consider the next solution:
1. In Basic/TargetInfo add getIntTypeByWidth and getRealTypeByWidth virtual methods. By default current behaviour could be implemented here.
2. Fix handleModeAttr according to new methods in TargetInfo.
This approach is implemented in the patch attached to this post.

Fixes:
1st Commit (Current): Add new methods for TargetInfo:
     getRealTypeByWidth and getIntTypeByWidth
  for ASTContext names are almost same(invokes new methods from TargetInfo):
     getIntTypeForBitwidth and getRealTypeForBitwidth

2nd Commit (Next): Fix SemaDeclAttr, handleModeAttr function.

llvm-svn: 190044
2013-09-05 11:23:21 +00:00
Benjamin Kramer ffecc84583 Add support for -march=slm, aka Intel Atom Silvermont.
llvm-svn: 189670
2013-08-30 14:05:34 +00:00
Charles Davis b5a214e4f3 Add ms_abi and sysv_abi attribute handling.
Based on a patch by Benno Rice!

llvm-svn: 189644
2013-08-30 04:39:01 +00:00
Fariborz Jahanian 4ccdc73f44 ObjectiveC migrator: remove dead code.
llvm-svn: 189592
2013-08-29 16:22:26 +00:00
Craig Topper b78e9d9b2f Make getDiagnosticsInGroup helper method a static function in the cpp file and move the WarningOption struct into an anonymous namespace instead of clang namespace since it no longer needs to be forward declared in the header.
llvm-svn: 189569
2013-08-29 06:06:18 +00:00
Craig Topper da7cf8ab2b Move individual group name strings from the OptionTable into one big char array. Then only store offsets into it in the OptionTable. Saves about 4K from the clang binary and removes 400 relocation entries from DiagnosticIDs.o.
llvm-svn: 189568
2013-08-29 05:18:04 +00:00
Craig Topper a3891a7568 Reorder and shrink size of NameLen field in diagnostic group table. Shaves ~4K from clang binary.
llvm-svn: 189445
2013-08-28 06:01:10 +00:00
Craig Topper d80c17e060 Merge diagnostic group tables to reduce data size and relocation entries.
The individual group and subgroups tables are now two large tables. The option table stores an index into these two tables instead of pointers. This reduces the size of the options tabe since it doesn't need to store pointers. It also reduces the number of relocations needed.

My build shows this reducing DiagnosticsIDs.o and the clang binary by ~20.5K. It also removes ~400 relocation entries from DiagnosticIDs.o.

llvm-svn: 189438
2013-08-28 04:02:50 +00:00
Reid Kleckner 78af0708b7 Delete CC_Default and use the target default CC everywhere
Summary:
Makes functions with implicit calling convention compatible with
function types with a matching explicit calling convention.  This fixes
things like calls to qsort(), which has an explicit __cdecl attribute on
the comparator in Windows headers.

Clang will now infer the calling convention from the declarator.  There
are two cases when the CC must be adjusted during redeclaration:
1. When defining a non-inline static method.
2. When redeclaring a function with an implicit or mismatched
convention.

Fixes PR13457, and allows clang to compile CommandLine.cpp for the
Microsoft C++ ABI.

Excellent test cases provided by Alexander Zinenko!

Reviewers: rsmith

Differential Revision: http://llvm-reviews.chandlerc.com/D1231

llvm-svn: 189412
2013-08-27 23:08:25 +00:00
Tom Stellard 30687219ba R600: Add local address pointer size to DataLayout
llvm-svn: 189302
2013-08-27 00:55:26 +00:00
Rafael Espindola 890498236b Update now that llvm uses the same feature names as the driver.
llvm-svn: 189142
2013-08-23 20:21:37 +00:00
Rafael Espindola eb26547177 Move -mfpmath handling to -cc1 and implement it for x86.
The original idea was to implement it all on the driver, but to do that the
driver needs to know the sse level and to do that it has to know the default
features of a cpu.

Benjamin Kramer pointed out that if one day we decide to implement support for
' __attribute__ ((__target__ ("arch=core2")))', then the frontend needs to
keep its knowledge of default features of a cpu.

To avoid duplicating which part of clang handles default cpu features,
it is probably better to handle -mfpmath in the frontend.

For ARM this patch is just a small improvement. Instead of a cpu list, we
check if neon is enabled, which allows us to reject things like

-mcpu=cortex-a9 -mfpu=vfp -mfpmath=neon

For X86, since LLVM doesn't support an independent ssefp feature, we just
make sure the selected -mfpmath matches the sse level.

llvm-svn: 188939
2013-08-21 21:59:03 +00:00
Rafael Espindola 8c407dedd3 Remove dead code.
setFeatureEnabled is never called with "32" or "64". The driver never passes it
and mips' getDefaultFeatures sets the Features map directly.

llvm-svn: 188913
2013-08-21 18:13:43 +00:00
Rafael Espindola 4396480358 Move the logic for selecting the last feature in the command line to the driver.
This is a partial revert of r188817 now that the driver handles -target-feature
in a single place.

llvm-svn: 188910
2013-08-21 17:34:32 +00:00
Rafael Espindola 0221d8636e Don't disable SSE4A when disabling AVX.
Thanks for Craig Topper for noticing it.

llvm-svn: 188902
2013-08-21 13:28:02 +00:00
Craig Topper 679b53ac67 Add avx512cd, avx512er, avx512pf feature flags and enable them on KNL CPU.
llvm-svn: 188867
2013-08-21 05:29:10 +00:00
Craig Topper 9c4d17f65c Replace avx-512 with avx512f to match llvm side and what gcc patches appear to be using.
llvm-svn: 188860
2013-08-21 03:59:22 +00:00
Rafael Espindola db0fcfbfae Centralize the logic for handling -m* options and fix pr16943.
This moves the logic for handling -mfoo -mno-foo from the driver to -cc1. It
also changes -cc1 to apply the options in order, fixing pr16943.

The handling of -mno-mmx -msse is now an explicit special case.

llvm-svn: 188817
2013-08-20 18:57:55 +00:00
Rafael Espindola a38ce29576 Remove duplicated error checking.
The driver validates its options, so we don't need to redo the work in
"clang -cc1".

llvm-svn: 188806
2013-08-20 15:30:32 +00:00
Rafael Espindola d9401d664b Remove dead code.
llvm-svn: 188802
2013-08-20 14:18:24 +00:00
Rafael Espindola e62e279f97 Refactor the x86 feature handling.
This removes the very long chains of
Feature["avx"] = Feature["sse42"] = ... = true;

llvm-svn: 188799
2013-08-20 13:44:29 +00:00
Craig Topper 007b059c33 Change 'avx512' to 'avx-512' to match llvm backend.
llvm-svn: 188762
2013-08-20 07:39:54 +00:00