Граф коммитов

177 Коммитов

Автор SHA1 Сообщение Дата
Jan Wen Voung 90306934bc Do not add "byval" attribute to records with non-trivial copy constructors
and destructors in the DefaultABIInfo.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143601 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-03 00:59:44 +00:00
Akira Hatanaka b551dd31f6 Set MinABIStackAlignInBytes to 8 if ABI is N32/64.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143597 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-03 00:05:50 +00:00
Akira Hatanaka d5a257f39b Convert the type of a structure passed by value if it has double precision
fields in order to ease handling of such structures in backend. 



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143596 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-02 23:54:49 +00:00
Akira Hatanaka c0e3b66534 Return function results whose size is smaller than 128-bits in registers if ABI
is N32/64.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143589 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-02 23:14:57 +00:00
Bob Wilson 3b694fab31 Check for homogeneous aggregate return values with ARM's AAPCS-VFP ABI.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143530 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-02 04:51:36 +00:00
Dan Gohman 0986eb5c59 Remove the SystemZ backend.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142879 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-24 23:48:52 +00:00
Peter Collingbourne 2f7aa998c0 TCE target: conversion of OpenCL reqd_work_group_size attr to metadata
Patch by Pekka Jääskeläinen!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141865 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-13 16:24:41 +00:00
Richard Smith a6b8b2c096 Constant expression evaluation refactoring:
- Remodel Expr::EvaluateAsInt to behave like the other EvaluateAs* functions,
   and add Expr::EvaluateKnownConstInt to capture the current fold-or-assert
   behaviour.
 - Factor out evaluation of bitfield bit widths.
 - Fix a few places which would evaluate an expression twice: once to determine
   whether it is a constant expression, then again to get the value.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141561 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-10 18:28:20 +00:00
Ted Kremenek 0628b724ff Free 'TheTargetCodeGenInfo' in the class CodeGenModule. This looks like an obvious memory leak that was reported from LLDB devs. The comment indicates the leak is deliberate, but I have no idea why this needs to be so. Please comment/revert if you know otherwise.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141479 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-08 05:28:26 +00:00
Peter Collingbourne 744d90bfe2 CUDA: set proper calling conventions for PTX
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141296 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-06 16:49:54 +00:00
Justin Holewinski 818eafb6ac PTX: Set proper calling conventions for PTX in OpenCL mode.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141193 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-05 17:58:44 +00:00
David Blaikie eb2d1f1c88 Removing a bunch of dead returns/breaks after llvm_unreachables.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140407 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-23 20:26:49 +00:00
David Blaikie b219cfc4d7 Switch assert(0/false) llvm_unreachable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140367 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-23 05:06:16 +00:00
John McCall 01f151e0ff ANSI C requires that a call to an unprototyped function type succeed
if the definition has a non-variadic prototype with compatible
parameters.  Therefore, the default rule for such calls must be to
use a non-variadic convention.  Achieve this by casting the callee to
the function type with which it is required to be compatible, unless
the target specifically opts out and insists that unprototyped calls
should use the variadic rules.  The only case of that I'm aware of is
the x86-64 convention, which passes arguments the same way in both
cases but also sets a small amount of extra information;  here we seek
to maintain compatibility with GCC, which does set this when calling
an unprototyped function.

Addresses PR10810 and PR10713.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140241 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-21 08:08:30 +00:00
Akira Hatanaka 8c6dfbe044 Create a MipsTargetCodeGenInfo object for mips64/mips64el. The size of the
UnwindException structure is 32 for mips64. 




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140165 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-20 18:30:57 +00:00
Akira Hatanaka e624fa02b2 Add a parameter to MipsTargetCodeGenInfo's constructor.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140161 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-20 18:23:28 +00:00
Douglas Gregor bcfd1f55bf Extend the ASTContext constructor to delay the initialization of
builtin types (When requested). This is another step toward making
ASTUnit build the ASTContext as needed when loading an AST file,
rather than doing so after the fact. No actual functionality change (yet).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138985 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-02 00:18:52 +00:00
John McCall 49e34be6ae The size of struct UnwindException varies by platform with no
apparent general rule.  Just special-case it as appropriate.
PR10789.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138792 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-30 01:42:09 +00:00
Akira Hatanaka 7b0a0383ef Alignment of a va_arg must be at least as large as the ABI's minimum alignment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137420 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-12 02:30:14 +00:00
Akira Hatanaka 3827e42982 Add definition of a static member of a class.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137411 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-12 01:43:14 +00:00
Bob Wilson 194f06a476 Handle "homogeneous aggregates" as required by the ARM AAPCS-VFP ABI.
A homogeneous aggregate is an aggregate data structure where after flattening
any nesting there are 1 to 4 elements of the same base type that is either a
float, double, or Neon vector.  All Neon vectors of the same size, either 64
or 128 bits, are treated as equivalent for this purpose.  When using the
AAPCS-VFP ABI, check for homogeneous aggregates and pass them as arguments by
expanding them into a sequence of their base types.  This requires extending
the existing support for expanded arguments to handle not only structs, but
also constant arrays and complex types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136767 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-03 05:58:22 +00:00
Rafael Espindola e164c18052 Implements alignment for long long and double types in va_arg on ARM AAPCS.
Patch by Jim (Ningjie) Chen.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136734 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-02 22:33:37 +00:00
Bob Wilson 53fc1a6151 Revert "Re-enable byval for ARM in clang. rdar://problem/7662569"
This reverts commit 67d097e123.
We found a miscompile with ARM byval, which is still being investigated.
In the meantime, this works around the problem by disabling ARM byval.

Conflicts:
	lib/CodeGen/TargetInfo.cpp

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136662 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-01 23:39:04 +00:00
Akira Hatanaka c35e69d758 Implement MipsABIInfo::EmitVAArg. This fix enables clang to complete compilation
without bailing out when va_arg is an aggregate expression. However, 
alignment checking needs to be added in isSafeToEliminateVarargsCast in
InstCombineCalls.cpp in order to produce correct mips code (see link below).

http://lists.cs.uiuc.edu/pipermail/llvmdev/2011-July/042047.html





git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136647 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-01 20:48:01 +00:00
Akira Hatanaka 511949bf7e Pass records with non-trivial destructors or constructors indirectly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136630 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-01 18:09:58 +00:00
Chris Lattner 5f9e272e63 remove unneeded llvm:: namespace qualifiers on some core types now that LLVM.h imports
them into the clang namespace.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135852 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-23 10:55:15 +00:00
Chris Lattner 2acc6e3fed de-constify llvm::Type, patch by David Blaikie!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135370 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-18 04:24:23 +00:00
Joerg Sonnenberger e9b5d77b7b Fix typo
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135285 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-15 18:23:44 +00:00
Bruno Cardoso Lopes b8981df0ed Reapply r134946 with fixes. Tested on Benjamin testcase and other test-suite failures.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135091 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-13 21:58:55 +00:00
Bruno Cardoso Lopes 548e478b8b Revert r134946
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135004 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-12 22:30:58 +00:00
Bruno Cardoso Lopes 75d28b58d9 Fix a typo!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134952 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-12 02:47:38 +00:00
Bruno Cardoso Lopes 089d8927ab Do the same as r134946 for arrays. Add more testcases for avx x86_64 arg
passing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134951 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-12 01:27:38 +00:00
Bruno Cardoso Lopes ccafadb68f Fix one x86_64 abi issue and the test to actually look for the right thing,
which is: { <4 x float>, <4 x float> } should continue to go through memory.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134946 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-12 00:30:27 +00:00
Bruno Cardoso Lopes 4943c15df5 Reapply r134754, which turns out to be working correctly and also
add one more testcase.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134934 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-11 22:41:29 +00:00
Jay Foad ef6de3da85 De-constify Types in StructType::get() and TargetData::getIntPtrType().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134893 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-11 09:56:20 +00:00
Chris Lattner 9cbe4f0ba0 clang side to match the LLVM IR type system rewrite patch.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134831 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-09 17:41:47 +00:00
Eli Friedman c3e0fb406f Change -mno-mmx to be more compatible with gcc. Specifically, -mno-mmx should not imply -mno-sse.
Note that because we don't usually touch the MMX registers anyway, all -mno-mmx needs to do is tweak the x86-32 calling convention a little for vectors that look like MMX vectors, and prevent the definition of __MMX__.

clang doesn't actually stop the user from using MMX inline asm operands or MMX builtins in -mno-mmx mode; as a QOI issue, it would be nice to diagnose, but I doubt it really matters much.

<rdar://problem/9694837>



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134770 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-08 23:31:17 +00:00
Bruno Cardoso Lopes 528a8c7b4c Revert x86_64 ABI changes until I have time to check the items raised by Eli.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134765 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-08 22:57:35 +00:00
Bruno Cardoso Lopes df41b4c10a Add support for AVX 256-bit in the x86_64 ABI (as in the 0.99.5 draft)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134754 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-08 22:18:40 +00:00
Eli Friedman 14508ff0bf Don't use x86_mmx where it isn't necessary.
The start of some work on getting -mno-mmx working the way we want it to.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134300 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-02 00:57:27 +00:00
Eli Friedman ded137fcab We don't pass classes with a copy-constructor or destructor byval, so the address takes up an integer register (if one is available). Make sure the x86-64 ABI implementation takes that into account properly.
The fixed implementation is compatible with the implementation both gcc and llvm-gcc use.

rdar://9686430 . (This is the issue that was reported in the thread "[LLVMdev] Segfault calling LLVM libs from a clang-compiled executable".)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134059 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-29 07:04:55 +00:00
NAKAMURA Takumi 4857947d18 De-Unicode-ify in comments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133501 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-21 03:19:28 +00:00
Chris Lattner 7650d95a1a update for api change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133365 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-18 22:49:11 +00:00
John McCall f85e193739 Automatic Reference Counting.
Language-design credit goes to a lot of people, but I particularly want
to single out Blaine Garst and Patrick Beard for their contributions.

Compiler implementation credit goes to Argyrios, Doug, Fariborz, and myself,
in no particular order.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133103 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-15 23:02:42 +00:00
Akira Hatanaka 619e8875d2 Add stuff for o32 ABI conformance.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132443 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-02 00:09:17 +00:00
Chris Lattner de92d739ba make the x86-32 backend specify a byval alignment, even when the
code generator will do it.  With this patch, clang compiles the example
in PR9794 to not have an alloca temporary.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131881 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-22 23:35:00 +00:00
Chris Lattner 855d227967 Fix x86-64 byval passing to specify the alignment even when the code
generator will give it something sufficient.  This is important because
the mid-level optimizer doesn't know what alignment is required otherwise.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131879 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-22 23:21:23 +00:00
Roman Divacky 09345d1c2a Add ARMTargetCodeGenInfo::initDwarfEHRegSizeTable() defining 16 32bit regs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131558 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-18 19:36:54 +00:00
Argyrios Kyrtzidis c5f18f3e8c Revert r131447, see if it fixes the buildbot.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131450 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-17 02:17:52 +00:00
Argyrios Kyrtzidis b7d2516f5d Inside isEmptyRecord function, for CXXRecordDecl just check the isEmpty bit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131447 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-17 00:46:40 +00:00