summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/TargetInfo.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Silencing a signed vs unsigned comparison mismatch in MSVC.Aaron Ballman2013-06-121-1/+2
| | | | llvm-svn: 183837
* Make va_arg and argument passing to varargs functions work correctly withEli Friedman2013-06-121-14/+35
| | | | | | | | AVX vectors when AVX is turned on. Fixes <rdar://problem/10513611>. llvm-svn: 183813
* Fix a very silly mistake in r183590.Eli Friedman2013-06-111-1/+0
| | | | llvm-svn: 183720
* Fix va_arg on x86-64 for a struct containing a single int128_t. PR16248Eli Friedman2013-06-071-4/+17
| | | | llvm-svn: 183590
* Fix line endings.Eli Friedman2013-06-071-2/+2
| | | | llvm-svn: 183583
* Diagnose malformed x86 inline asm using 'y' constraint.Tim Northover2013-06-071-1/+9
| | | | | | | | X86's 'y' inline assembly constraint represents an MMX register, this change prevents Clang from hitting an assertion when passed an incompatible type to deal with. llvm-svn: 183467
* Implement SparcV9ABIInfo::EmitVAArg.Jakob Stoklund Olesen2013-06-051-2/+46
| | | | | | | | | | | | This could actually be implemented with the LLVM IR va_arg instruction, but it doesn't seem to offer any advantages over accessing the va_list pointer directly. Using the va_list pointer directly makes it possible to perform type coercion directly from the argument array, and the va_list updates are exposed to the optimizers. llvm-svn: 183292
* Adding support for MSVC #pragma detect_mismatch functionality by emitting a ↵Aaron Ballman2013-06-041-0/+12
| | | | | | FAILIFMISMATCH linker command into the object file. llvm-svn: 183178
* Build correct coercion types in SparcV9ABIInfo.Jakob Stoklund Olesen2013-05-281-3/+127
| | | | | | | | | | | | | | | | The coercion type serves two purposes: 1. Pad structs to a multiple of 64 bits, so they are passed 'left-aligned' in registers. 2. Expose aligned floating point elements as first-level elements, so the code generator knows to pass them in floating point registers. We also compute the InReg flag which indicates that the struct contains aligned 32-bit floats. This flag is used by the code generator to pick the right registers. llvm-svn: 182753
* Add a SparcV9ABIInfo class for handling the standard SPARC v9 ABI.Jakob Stoklund Olesen2013-05-271-0/+93
| | | | | | | | | | | | | | | | - All integer arguments smaller than 64 bits are extended. - Large structs are passed indirectly, not using 'byval'. - Structs up to 32 bytes in size are returned in registers. Some things are not implemented yet: - EmitVAArg can be implemented in terms of the va_arg instruction. - When structs are passed in registers, float members require special handling because they are passed in the floating point registers. - Structs are left-aligned when passed in registers. This may require padding. llvm-svn: 182745
* Suffixing #pragma comment(lib) library names with .lib if necessary. This ↵Aaron Ballman2013-05-241-2/+13
| | | | | | matches MSVC behavior, as well as allows us to properly link libraries such as the ones provided by the MSDN examples. llvm-svn: 182647
* Forward #pragma comment(lib/linker) through as flags metadataReid Kleckner2013-05-081-2/+30
| | | | | | | | | | | | | | | | | | | | | | Summary: Most of this change is wiring the pragma all the way through from the lexer, parser, and sema to codegen. I considered adding a Decl AST node for this, but it seemed too heavyweight. Mach-O already uses a metadata flag called "Linker Options" to do this kind of auto-linking. This change follows that pattern. LLVM knows how to forward the "Linker Options" metadata into the COFF .drectve section where these flags belong. ELF support is not implemented, but possible. This is related to auto-linking, which is http://llvm.org/PR13016. CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D723 llvm-svn: 181426
* Add SystemZ supportUlrich Weigand2013-05-061-0/+290
| | | | | | | | | | | | | | This patch then adds all the usual platform-specific pieces for SystemZ: driver support, basic target info, register names and constraints, ABI info and vararg support. It also adds new tests to verify pre-defined macros and inline asm, and updates a test for the minimum alignment change. 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: 181211
* Set SRet flags properly in '-cxx-abi microsoft'.Timur Iskhodzhanov2013-04-171-72/+79
| | | | | | | | | Also, - abstract out the indirect/in memory/in registers decisions into the CGCXXABI - fix handling of empty struct arguments for '-cxx-abi microsoft' - add/fix tests llvm-svn: 179681
* Standardize accesses to the TargetInfo in IR-gen.John McCall2013-04-161-20/+19
| | | | | | Patch by Stephen Lin! llvm-svn: 179638
* The PNaCl target no longer permits __attribute__((regparm)).Eli Bendersky2013-04-081-32/+14
| | | | | | | Remove the custom lowering code dealing with it, disallow it in PNaclTargetInfo and adjust tests accordingly. llvm-svn: 179059
* Proper prefix for doxygen commentsEli Bendersky2013-04-051-3/+3
| | | | llvm-svn: 178878
* Add some documentation for PNaClABIInfo.Eli Bendersky2013-04-041-8/+17
| | | | llvm-svn: 178802
* Use kernel metadata to differentiate between kernel and deviceJustin Holewinski2013-03-301-27/+25
| | | | | | functions for the NVPTX target. llvm-svn: 178418
* IR-gen should not generate an MMX types unless the code is explicitly using MMXChad Rosier2013-03-251-28/+13
| | | | | | | intrinsics. rdar://13213542 llvm-svn: 177911
* Revert r177329.Rafael Espindola2013-03-191-2/+1
| | | | | | | | | If this should not happen, we should have an assert. If it should happen, we should have a test and remove the comment. In no case should we have this self inconsistent code. llvm-svn: 177399
* This code works around what appears to be a bug in another part of clang.Reed Kotler2013-03-181-1/+2
| | | | | | | | | | | | I have filed http://llvm.org/bugs/show_bug.cgi?id=15538 against clang. This code is safer anyway because "cast" assumes you really know that it's okay to make the cast. In this case isa should not be false and dyn_cast should not return null as far as I understand. But everything else is valid so I did not want to revert my previous patch for attributes mips16/nomips16 or use an llvm_unreachable here which would make a number of our tests fail for mips. llvm-svn: 177329
* Cause the mips16/nomips16 attribute to be passed to LLVM from ClangReed Kotler2013-03-131-4/+10
| | | | | | in the LLVM assembly language output. llvm-svn: 176971
* Change hasAggregateLLVMType, which conflates complex andJohn McCall2013-03-071-1/+1
| | | | | | | | | | | | | | | aggregate types in a profoundly wrong way that has to be worked around in every call site, to getEvaluationKind, which classifies and distinguishes between all of these cases. Also, normalize the API for loading and storing complexes. I'm working on a larger patch and wanted to pull these changes out, but it would have be annoying to detangle them from each other. llvm-svn: 176656
* Use the actual ABI-determined C calling convention for runtimeJohn McCall2013-02-281-28/+46
| | | | | | | | | | | | | | | | | | | | | | calls and declarations. LLVM has a default CC determined by the target triple. This is not always the actual default CC for the ABI we've been asked to target, and so we sometimes find ourselves annotating all user functions with an explicit calling convention. Since these calling conventions usually agree for the simple set of argument types passed to most runtime functions, using the LLVM-default CC in principle has no effect. However, the LLVM optimizer goes into histrionics if it sees this kind of formal CC mismatch, since it has no concept of CC compatibility. Therefore, if this module happens to define the "runtime" function, or got LTO'ed with such a definition, we can miscompile; so it's quite important to get this right. Defining runtime functions locally is quite common in embedded applications. llvm-svn: 176286
* Add support for AArch64 target.Tim Northover2013-01-311-0/+418
| | | | | | | | | | | | | In cooperation with the LLVM patch, this should implement all scalar front-end parts of the C and C++ ABIs for AArch64. This patch excludes the NEON support also reviewed due to an outbreak of batshit insanity in our legal department. That will be committed soon bringing the changes to precisely what has been approved. Further reviews would be gratefully received. llvm-svn: 174055
* [mips] Do not emit i32 padding if target ABI is O32. This was causing backendAkira Hatanaka2013-01-241-1/+2
| | | | | | to pass floating point arguments to be passed in integer registers. llvm-svn: 173375
* Use the AttributeSet when adding multiple attributes and an Attribute::AttrKindBill Wendling2013-01-231-2/+4
| | | | | | when adding a single attribute to the function. llvm-svn: 173211
* First step in implementation of mips16 and nomips16 attributes.Reed Kotler2013-01-161-0/+7
| | | | | | Waiting for new llvm attribute code for the next step. llvm-svn: 172626
* This patch addresses varargs processing for small complex types underBill Schmidt2013-01-141-1/+39
| | | | | | | | | | | | | | | | | | | the 64-bit PowerPC ELF ABI. The ABI requires that the real and imaginary parts of a complex argument each occupy their own doubleword. Arguments smaller than 8 bytes are right-adjusted within the doubleword. Clang expects EmitVAARG() to return a pointer to a structure in which the real and imaginary parts are packed adjacently in memory. To accomplish this, we generate code to load the code appropriately from the varargs location and pack the values into a temporary variable in the form Clang expects, returning a pointer to that structure. The test case demonstrates correct code generation for all "small" complex types on PPC64: int, short, char, and float. llvm-svn: 172438
* Rewrite #includes for llvm/Foo.h to llvm/IR/Foo.h as appropriate toChandler Carruth2013-01-021-2/+2
| | | | | | | | reflect the migration in r171366. Re-sort the #include lines to reflect the new paths. llvm-svn: 171369
* Rename llvm::Attributes to llvm::Attribute.Bill Wendling2012-12-201-5/+5
| | | | llvm-svn: 170722
* Revert r170500. It over-zealously converted *ALL* things named Attributes, ↵Bill Wendling2012-12-201-5/+5
| | | | | | which is wrong here. llvm-svn: 170721
* Rename the 'Attributes' class to 'Attribute'. It's going to represent a ↵Bill Wendling2012-12-191-5/+5
| | | | | | single attribute in the future. llvm-svn: 170500
* This patch fixes PR13624, which notes a 64-bit PowerPC ELF ABIBill Schmidt2012-12-171-0/+3
| | | | | | | | | | incompatibility with how complex values are returned. It is sufficient to flag all complex types as direct rather than indirect. A new test case is provided that checks correct IR generation for the various supported flavors of _Complex. llvm-svn: 170302
* s/AttrListPtr/AttributeSet/g to better label what this class is going to be ↵Bill Wendling2012-12-071-1/+1
| | | | | | in the near future. llvm-svn: 169652
* Adapt to LLVM commit 169291 which streamlines the usage of NaCl/NativeClientEli Bendersky2012-12-041-4/+4
| | | | | | in the triple. llvm-svn: 169292
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-2/+2
| | | | | | | | | | | | | 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 a small calling-convention bug for x86-32. PR14453.Eli Friedman2012-11-291-2/+8
| | | | llvm-svn: 168959
* This patch addresses an incompatibility relative to the 64-bit PowerPCBill Schmidt2012-11-271-0/+3
| | | | | | | | | | | | | | | ELF ABI. Complex values are to be passed in registers as though the real and imaginary parts were passed as separate parameters. Prior to this patch, complex values were passed as byval aggregates. It turns out that specifying getDirect() for all complex types when classifying the argument type results in the desired behavior. The new Clang test case verifies that the correct LLVM IR is generated for caller and callee for each of the underlying types for _Complex. llvm-svn: 168673
* MSPGCC renamed ISR vectors from vector_<address> to __isr_<number>. This ↵Anton Korobeynikov2012-11-261-2/+2
| | | | | | | | patch makes Clang reflect this scheme. Patch by Job Noorman! llvm-svn: 168598
* A step towards sorting out handling of triviality of special members in C++11.Richard Smith2012-11-161-1/+1
| | | | | | | | | | | | | | Separate out the notions of 'has a trivial special member' and 'has a non-trivial special member', and use them appropriately. These are not opposites of one another (there might be no special member, or in C++11 there might be a trivial one and a non-trivial one). The CXXRecordDecl predicates continue to produce incorrect results, but do so in fewer cases now, and they document the cases where they might be wrong. No functionality changes are intended here (they will come when the predicates start producing the right answers...). llvm-svn: 168119
* Cleanup: 80-column violationManman Ren2012-11-061-4/+6
| | | | llvm-svn: 167476
* ARM byval: when type alignment is bigger than ABI alignment, instead ofManman Ren2012-11-061-5/+4
| | | | | | | | | | | | disabling byval, we set realign to true. It will perform an aligned alloca, and call memcpy to copy the byval argument to the local variable. Change the size threshold back to 64 bytes. rdar://12596507 llvm-svn: 167440
* ARM byval: when type alignment is bigger than ABI alignment, we can't guaranteeManman Ren2012-11-051-2/+10
| | | | | | | | | | | the type alignment of the byval argument. This patch will disable byval in this case, it also increases the size threshold for turning on byval. A backend fix will be attempted. rdar://12596507 llvm-svn: 167416
* On PowerPC64, integer arguments and return values need to be sign- orUlrich Weigand2012-11-051-0/+58
| | | | | | | | | | | | | | | | zero-extended to 64 bits. This information is currently provided to the back end by setting "signext" or "zeroext" attributes. However, this is done only for integer types *smaller* than i32, not for i32 itself. This causes clang to generate code violating the ABI, which results in a failure of the tramp3d-v4 test case (due to calling a system library routine without ABI-required extension). This patch implements custom versions of classifyArgumentType and classifyReturnType for PPC64_SVR4_ABIInfo, which are the same as the default versions except that they also classify "int" and "unsigned int" as types needing extending. This fixed tramp3d-v4 on PowerPC64. llvm-svn: 167393
* ARM AAPCS-VFP: fix tracking of allocated VFP registers.Manman Ren2012-10-311-24/+50
| | | | | | | According to the spec, we can backfill VFP registers that were skipped due to alignment constraints. llvm-svn: 167159
* ARM AAPCS-VFP: fix handling of homogeneous aggreate.Manman Ren2012-10-301-6/+80
| | | | | | | If HA can only partially fit into VFP registers, we add padding to make sure HA will be on stack and later VFP CPRCs will be on stack as well. llvm-svn: 167058
* This patch addresses a 64-bit PowerPC ELF ABI compatibility issue withBill Schmidt2012-10-261-15/+0
| | | | | | | | | | | | | | | | | | | | | | | | | varargs parameter passing. A strict reading of the ABI indicates that any argument with alignment greater than 8 may require skipping doublewords in the parameter save area to align the argument, and hence require skipping GPRs. In practice, this is not done by GCC. The alignment restriction is used for internal alignment of a structure, but a structure with 16-byte alignment, for example, is not itself 16-byte aligned in the parameter save area. Although this is messy, it has become the de facto standard used in building existing libraries. My initial varargs support followed the ABI language, but not the de facto standard. Running the GCC compatibility test suite exposed this issue, and indeed showed that LLVM didn't pass parameters self-consistently with my original logic. Removing the additional alignment logic allows the affected tests to now pass. I modified the ppc64-varargs-struct.c test case to remove the existing test for generation of alignment code, which is no longer appropriate. Built and tested on powerpc64-unknown-linux-gnu with no new regressions. llvm-svn: 166805
* Modify the targets to set appropriate calling convention defaults and C ↵David Tweed2012-10-251-3/+5
| | | | | | | | variables when using a gnueabihf or aapcs-vfp target. Tested by me and Wei-Ren Chen. llvm-svn: 166679
OpenPOWER on IntegriCloud