summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/TargetInfo.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Basic: [asmSymbolicName] follows the same rule as numbers in asm inputsDavid Majnemer2015-01-111-0/+4
| | | | | | | | | Input constraints like "0" and "[foo]" should be treated the same when it comes to their corresponding output constraint. This fixes PR21850. llvm-svn: 225605
* Basic: The asm constraint '#m' isn't valid, reject itDavid Majnemer2015-01-111-1/+7
| | | | llvm-svn: 225603
* Basic: The asm constraint '+#r' isn't valid, reject itDavid Majnemer2015-01-111-1/+5
| | | | llvm-svn: 225600
* Sema: The asm constraint '+&m' isn't valid, reject itDavid Majnemer2015-01-101-0/+7
| | | | | | Don't permit '+&m' to make it to CodeGen, it's invalid. llvm-svn: 225586
* Sema: analyze I,J,K,M,N,O constraintsSaleem Abdulrasool2015-01-061-0/+2
| | | | | | | | | | Add additional constraint checking for target specific behaviour for inline assembly constraints. We would previously silently let all arguments through for these constraints. In cases where the constraints were violated, we could end up failing to select instructions and triggering assertions or worse, silently ignoring instructions. llvm-svn: 225244
* Fix assertion on asm register that are "%"Olivier Goffart2014-08-171-0/+2
| | | | | | | | | | | Name might be empty again after we removed the '%' prefix and Name[0] would assert. Found on code like register int foo asm("%" MACRO); where MACRO was supposed to be defined in a header file that was not found. llvm-svn: 215834
* Change __INTx_TYPE__ to be always signed. This changes the value forJoerg Sonnenberger2014-07-281-1/+1
| | | | | | | | | | char-based types from "char" to "signed char". Adjust stdint.h to use __INTx_TYPE__ directly without prefixing it with signed and to use __UINTx_TYPE__ for unsigned ones. The value of __INTx_TYPE__ now matches GCC. llvm-svn: 214119
* If char/short are shorter than int, do not use U as suffix forJoerg Sonnenberger2014-07-171-1/+5
| | | | | | | | constants. Comparing int against a constant of the given type like UINT8_MAX will otherwise force a promotion to unsigned int, which is typically not expected. llvm-svn: 213301
* Provide builtin macros as template for PRIab and SCNab, matching theJoerg Sonnenberger2014-07-151-0/+19
| | | | | | underlaying types. llvm-svn: 213063
* Drop separate UIntMaxType and just derive it from IntMaxType.Joerg Sonnenberger2014-07-141-2/+0
| | | | llvm-svn: 212987
* Constify a read-only parameter and give function a better nameAlp Toker2014-07-061-2/+2
| | | | | | | This makes it clear that TargetInfo doesn't capture the LangOptions object, rather uses it to apply adjustments. llvm-svn: 212386
* Implement predefined stdint macrosJF Bastien2014-06-251-0/+15
| | | | | | | | | | | | Add predefined stdint macros that match the given patterns: U?INT{_,_FAST,_LEAST}{8,16,32,64}_{MAX,TYPE} U?INT{PTR,MAX}_{MAX,TYPE} http://reviews.llvm.org/D4141 Author: binji llvm-svn: 211657
* [C++11] Use 'nullptr'.Craig Topper2014-05-081-1/+1
| | | | llvm-svn: 208280
* Use the new Windows environment for target detectionSaleem Abdulrasool2014-03-271-1/+1
| | | | | | | | | This follows the LLVM change to canonicalise the Windows target triple spellings. Rather than treating each Windows environment as a single entity, the environments are now modelled properly as an environment. This is a mechanical change to convert the triple use to reflect that change. llvm-svn: 204978
* Remove the -cxx-abi command-line flag.Hans Wennborg2014-01-141-2/+4
| | | | | | | | | | | | | | | This makes the C++ ABI depend entirely on the target: MS ABI for -win32 triples, Itanium otherwise. It's no longer possible to do weird combinations. To be able to run a test with a specific ABI without constraining it to a specific triple, new substitutions are added to lit: %itanium_abi_triple and %ms_abi_triple can be used to get the current target triple adjusted to the desired ABI. For example, if the test suite is running with the i686-pc-win32 target, %itanium_abi_triple will expand to i686-pc-mingw32. Differential Revision: http://llvm-reviews.chandlerc.com/D2545 llvm-svn: 199250
* OpenCL: Do not force 64 bit floats for (embedded) targets with only 32bit ↵Pekka Jaaskelainen2013-12-181-2/+8
| | | | | | floats. llvm-svn: 197592
* Stop crashing on empty asm input constraintsDuncan P. N. Exon Smith2013-12-161-0/+3
| | | | | | | | | | An empty string for an ASM input constraint is invalid, and will crash during clang CodeGen. Change TargetInfo::validateInputConstraint to reject an empty string. <rdar://problem/15552191> llvm-svn: 197362
* Every target sets DescriptionString. Assert that.Rafael Espindola2013-12-131-2/+1
| | | | llvm-svn: 197268
* Certain multi-platform languages, such as OpenCL, have the concept ofDavid Tweed2013-09-131-0/+1
| | | | | | | | | | | | | | 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
* Fix minor coding style issue in r190296 pointed out by Richard Smith.David Tweed2013-09-101-4/+4
| | | | llvm-svn: 190390
* The OpenCL standard specifies the sizes and alignments of various types than ↵David Tweed2013-09-091-0/+29
| | | | | | | | | | | 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
* Additional fix for PR16752 and for commit 190044:Stepan Dyatkovskiy2013-09-091-1/+2
| | | | | | -- For TargetInfo::getRealTypeByWidth also added support for IEEEQuad float type. llvm-svn: 190294
* Add new methods for TargetInfo:Stepan Dyatkovskiy2013-09-051-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* 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
OpenPOWER on IntegriCloud