summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/TargetInfo.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Driver: Push triple objects around instead of going to std::string all the time.Benjamin Kramer2013-06-291-2/+1
| | | | | | No functionality change. llvm-svn: 185261
* Allow targets to define minimum alignment for global variablesUlrich Weigand2013-05-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a new common code feature that allows platform code to request minimum alignment of global symbols. The background for this is that on SystemZ, the most efficient way to load addresses of global symbol is the LOAD ADDRESS RELATIVE LONG (LARL) instruction. This instruction provides PC-relative addressing, but only to *even* addresses. For this reason, existing compilers will guarantee that global symbols are always aligned to at least 2. [ Since symbols would otherwise already use a default alignment based on their type, this will usually only affect global objects of character type or character arrays. ] GCC also allows creating symbols without that extra alignment by using explicit "aligned" attributes (which then need to be used on both definition and each use of the symbol). To enable support for this with Clang, this patch adds a TargetInfo::MinGlobalAlign variable that provides a global minimum for the alignment of every global object (unless overridden via explicit alignment attribute), and adds code to respect this setting. Within this patch, no platform actually sets the value to anything but the default 1, resulting in no change in behaviour on any existing target. This version of the patch incorporates feedback from reviews by Eric Christopher and John McCall. Thanks to all reviewers! Patch by Richard Sandiford. llvm-svn: 181210
* Add comment to describe cleverness.Benjamin Kramer2013-04-181-0/+2
| | | | llvm-svn: 179806
* Reject asm output constraints that consist of modifiers only.Benjamin Kramer2013-04-181-1/+1
| | | | | | Fixes PR15759. llvm-svn: 179756
* Excise <cctype> from Clang (except clang-tblgen) in favor of CharInfo.h.Jordan Rose2013-02-081-3/+3
| | | | | | | Nearly all of these changes are one-to-one replacements; the few that aren't have to do with custom identifier validation. llvm-svn: 174768
* First pass at abstracting out a class for the target C++ ABI.John McCall2013-01-251-1/+15
| | | | llvm-svn: 173514
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-1/+1
| | | | | | | | | | | | | uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
* Fix the definition of the vfork() builtin on Haiku. PR14378.Eli Friedman2012-11-271-0/+1
| | | | llvm-svn: 168674
* Handle '*' and '#' asm constraint modifiers.Ulrich Weigand2012-10-291-0/+4
| | | | llvm-svn: 166924
* Teach TargetInfo to hold on to the TargetOptions with which it wasDouglas Gregor2012-10-151-1/+2
| | | | | | created. llvm-svn: 165943
* Add a per target max vector alignment field (e.g., 32-byte alignment for x86 ↵Chad Rosier2012-07-131-0/+1
| | | | | | | | | | due to AVX). Currently, if no aligned attribute is specified the alignment of a vector is inferred from its size. Thus, very large vectors will be over-aligned with no benefit. Target owners should set this target max. llvm-svn: 160209
* objective-c modern translator: buildit objc boolFariborz Jahanian2012-04-161-0/+1
| | | | | | | type for rewriter project will be BoolTy. // rdar://11231426. llvm-svn: 154861
* Add support for bitcasts to vector type in Evaluate.Eli Friedman2011-12-221-0/+1
| | | | llvm-svn: 147137
* Add the value of "suitably aligned" from the C++11 standard to Basic/TargetInfo.Nick Lewycky2011-12-161-0/+1
| | | | | | | | This is equal to alignof(std::max_align_t) on the platform and equal to the alignment provided by malloc. (Platform owners please double-check your platform's value.) llvm-svn: 146762
* In x86_64, when calling an Objective-C method that returns a _Complex long ↵Anders Carlsson2011-10-311-0/+3
| | | | | | double, make sure to use the objc_msgSend_fp2ret function which ensures that the return value will be {0, 0} if the receiver is nil. llvm-svn: 143350
* Provide half floating point support as a storage only type.Anton Korobeynikov2011-10-141-0/+3
| | | | | | Lack of half FP was a regression compared to llvm-gcc. llvm-svn: 142016
* Misc fixes for atomics. Biggest fix is doing alignment correctly for ↵Eli Friedman2011-10-141-0/+1
| | | | | | _Atomic types. llvm-svn: 142002
* Fix missing includes for llvm_unreachableDavid Blaikie2011-09-231-0/+1
| | | | llvm-svn: 140368
* Switch assert(0/false) llvm_unreachable.David Blaikie2011-09-231-5/+5
| | | | llvm-svn: 140367
* Added missing initialization.Abramo Bagnara2011-09-081-0/+2
| | | | llvm-svn: 139291
* Add partial support for using anonymous bitfields (e.g., int : 0) to enforce Chad Rosier2011-08-041-0/+2
| | | | | | | | | | | | | | | | alignment. This fixes cases where the anonymous bitfield is followed by a non-bitfield member. E.g., struct t4 { int foo : 1; long : 0; char bar; }; Part of rdar://9859156 llvm-svn: 136858
* After further discussion it has been determined that alignof should report Chad Rosier2011-07-261-3/+0
| | | | | | the preferred alignment. Thus, revert r135934, r135935, and r135940. llvm-svn: 136062
* Allow target to specify about using minimum alignment vs preferred. Takes ↵Chad Rosier2011-07-251-0/+3
| | | | | | | | | care of FIXME: Override "preferred align" for double and long long for ARM apcs-gnu ABI. Also part of rdar://9802874 llvm-svn: 135940
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-5/+5
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* Split out logic for valid clobbers and valid inline asm registers.Eric Christopher2011-06-281-3/+8
| | | | | | Fixes rdar://9281377 llvm-svn: 134016
* Move additional register names to their own lookup, separate fromEric Christopher2011-06-211-0/+28
| | | | | | | | register aliases. Fixes unnecessary renames of clobbers. Fixes part of rdar://9425559 llvm-svn: 133485
* fix a bunch of comment typos found by codespell. Patch byChris Lattner2011-04-151-1/+1
| | | | | | Luis Felipe Strano Moraes! llvm-svn: 129559
* Implement a new 'availability' attribute, that allows one to specifyDouglas Gregor2011-03-231-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | which versions of an OS provide a certain facility. For example, void foo() __attribute__((availability(macosx,introduced=10.2,deprecated=10.4,obsoleted=10.6))); says that the function "foo" was introduced in 10.2, deprecated in 10.4, and completely obsoleted in 10.6. This attribute ties in with the deployment targets (e.g., -mmacosx-version-min=10.1 specifies that we want to deploy back to Mac OS X 10.1). There are several concrete behaviors that this attribute enables, as illustrated with the function foo() above: - If we choose a deployment target >= Mac OS X 10.4, uses of "foo" will result in a deprecation warning, as if we had placed attribute((deprecated)) on it (but with a better diagnostic) - If we choose a deployment target >= Mac OS X 10.6, uses of "foo" will result in an "unavailable" warning (in C)/error (in C++), as if we had placed attribute((unavailable)) on it - If we choose a deployment target prior to 10.2, foo() is weak-imported (if it is a kind of entity that can be weak imported), as if we had placed the weak_import attribute on it. Naturally, there can be multiple availability attributes on a declaration, for different platforms; only the current platform matters when checking availability attributes. The only platforms this attribute currently works for are "ios" and "macosx", since we already have -mxxxx-version-min flags for them and we have experience there with macro tricks translating down to the deprecated/unavailable/weak_import attributes. The end goal is to open this up to other platforms, and even extension to other "platforms" that are really libraries (say, through a #pragma clang define_system), but that hasn't yet been designed and we may want to shake out more issues with this narrower problem first. Addresses <rdar://problem/6690412>. As a drive-by bug-fix, if an entity is both deprecated and unavailable, we only emit the "unavailable" diagnostic. llvm-svn: 128127
* Add support for language-specific address spaces. On top of that,Peter Collingbourne2011-03-181-0/+6
| | | | | | | | | add support for the OpenCL __private, __local, __constant and __global address spaces, as well as the __read_only, _read_write and __write_only image access specifiers. Patch originally by ARM; language-specific address space support by myself. llvm-svn: 127915
* Implement mcount profiling, enabled via -pg.Roman Divacky2011-02-101-0/+1
| | | | llvm-svn: 125282
* PowerPC fixes.Roman Divacky2011-01-061-0/+1
| | | | | | | | | | | | | Fix the width and align of bool type on Darwin to be 32bits while keeping it 8 everywhere else. Change the definition of va_list to default to SV4 ABI one and let darwin subtarget override this. Both changes submitted by Nathan Whitehorn and reviewed by Rafael Espindola. llvm-svn: 122956
* The -fshort-wchar option causes wchar_t to become unsigned, in addition to beingChris Lattner2010-12-251-1/+1
| | | | | | | 16-bits in size. Implement this by splitting WChar into two enums, like we have for char. This fixes a miscompmilation of XULRunner, PR8856. llvm-svn: 122558
* Add missing standard includes. Patch by Joerg Sonnenberger!Nick Lewycky2010-12-191-0/+1
| | | | llvm-svn: 122194
* When setting a tied check if it's already tied. If it's tied to another ↵Anders Carlsson2010-11-031-0/+10
| | | | | | constraint it's invalid. Fixes PR3905. llvm-svn: 118146
* A number in an input constraint can't point to a read-write ('+') ↵Anders Carlsson2010-11-031-0/+4
| | | | | | constraint. Fixes PR3904. llvm-svn: 118145
* Fix Whitespace.Michael J. Spencer2010-10-181-7/+7
| | | | llvm-svn: 116699
* Fixed pr20314-2.c failure, added E, F, p constraint letters.John Thompson2010-09-211-0/+4
| | | | llvm-svn: 114490
* Added '|' delimiter to separate inline asm multiple alternative constraints ↵John Thompson2010-09-181-2/+1
| | | | | | for Clang side of support. llvm-svn: 114253
* Allow 'o' and 'V' as constraints for output asm operands.Dale Johannesen2010-09-071-3/+9
| | | | | | Allow '<' and '>' as constraints for input or output. llvm-svn: 113246
* The ARM C++ ABI is sufficiently different from the Itanium C++ ABI thatJohn McCall2010-08-211-0/+3
| | | | | | | it deserves its own enumerator. Obviously the implementations should closely follow the Itanium ABI except in cases of divergence. llvm-svn: 111749
* Fix oversight with symbolic names in TargetInfo::validateInputConstraint.Eli Friedman2010-08-111-0/+1
| | | | llvm-svn: 110870
* Fix for pr7869, inline asm mult-alt constraints.John Thompson2010-08-111-5/+3
| | | | llvm-svn: 110764
* Slightly revised handling of mult-alt constraints, to avoid an assert, until ↵John Thompson2010-08-101-4/+16
| | | | | | we have the full fix. llvm-svn: 110706
* CodeGen/ObjC/NeXT: Fix Obj-C message send to match llvm-gcc when choosingDaniel Dunbar2010-07-141-0/+3
| | | | | | | | whether to use objc_msgSend_fpret; the choice is target dependent, not Obj-C ABI dependent. - <rdar://problem/8139758> arm objc _objc_msgSend_fpret bug llvm-svn: 108379
* Hack for dealing with commas until we support multiple alternative ↵John Thompson2010-07-091-0/+4
| | | | | | constraints, per pr7338. llvm-svn: 108028
* Correctly align large arrays in x86-64. This fixes PR5599.Rafael Espindola2010-06-041-0/+2
| | | | llvm-svn: 105500
* Sema: Reject '#pragma options align=mac68k' everywhere except i386-apple-darwin.Daniel Dunbar2010-05-271-0/+1
| | | | llvm-svn: 104789
* david conrad points out that {|} in inline assembly on arm are not asmChris Lattner2010-04-231-0/+1
| | | | | | variants. This fixes neon inline asm which my patch for PR6780 broke. llvm-svn: 102181
* clang -cc1: Add a -fno-bitfield-type-align option, for my own testing purposes.Daniel Dunbar2010-04-151-2/+3
| | | | llvm-svn: 101370
* Tweak spelling (Bitfield -> BitField)Daniel Dunbar2010-04-151-1/+1
| | | | llvm-svn: 101369
OpenPOWER on IntegriCloud