summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGCall.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Switch assert(0/false) llvm_unreachable.David Blaikie2011-09-231-4/+4
| | | | llvm-svn: 140367
* Extend the ASTContext constructor to delay the initialization ofDouglas Gregor2011-09-021-4/+4
| | | | | | | | 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). llvm-svn: 138985
* Slight optimization enabled by the previous assert: John McCall2011-08-261-1/+3
| | | | | | emit all gl-value arguments as reference bindings. llvm-svn: 138655
* Assert that a call argument is a gl-value iff the parameter is a reference type.John McCall2011-08-261-0/+3
| | | | llvm-svn: 138639
* Track whether an AggValueSlot is potentially aliased, and do notJohn McCall2011-08-251-0/+1
| | | | | | | | | | emit call results into potentially aliased slots. This allows us to properly mark indirect return slots as noalias, at the cost of requiring an extra memcpy when assigning an aggregate call result into a l-value. It also brings us into compliance with the x86-64 ABI. llvm-svn: 138599
* 'pure' and 'const' functions should also be marked nounwind. MigrateEric Christopher2011-08-151-2/+7
| | | | | | | test over from llvm/test/FrontendC++ and update others to account for the change. llvm-svn: 137669
* Handle "homogeneous aggregates" as required by the ARM AAPCS-VFP ABI.Bob Wilson2011-08-031-48/+80
| | | | | | | | | | | | | 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. llvm-svn: 136767
* Move ArrayRef to LLVM.h and eliminate now-redundant qualifiers, patch by Jon ↵Chris Lattner2011-07-231-2/+2
| | | | | | Mulder! llvm-svn: 135855
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-24/+24
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* fix rdar://9780211 - Clang crashes with an assertion failure building ↵Chris Lattner2011-07-201-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | WKView.mm from WebKit This is something of a hack, the problem is as follows: 1. we instantiate both copied of RetainPtr with the two different argument types (an id and protocol-qualified id). 2. We refer to the ctor of one of the instantiations when introducing global "x", this causes us to emit an llvm::Function for a prototype whose "this" has type "RetainPtr<id<bork> >*". 3. We refer to the ctor of the other instantiation when introducing global "y", however, because it *mangles to the same name as the other ctor* we just use a bitcasted version of the llvm::Function we previously emitted. 4. We emit deferred declarations, causing us to emit the body of the ctor, however the body we emit is for RetainPtr<id>, which expects its 'this' to have an IR type of "RetainPtr<id>*". Because of the mangling collision, we don't have this case, and explode. This is really some sort of weird AST invariant violation or something, but hey a bitcast makes the pain go away. llvm-svn: 135572
* de-constify llvm::Type, patch by David Blaikie!Chris Lattner2011-07-181-29/+29
| | | | llvm-svn: 135370
* Convert CallInst and InvokeInst APIs to use ArrayRef.Jay Foad2011-07-151-7/+11
| | | | llvm-svn: 135265
* protect some calls to ConvertType when a function info is under constructionChris Lattner2011-07-151-3/+3
| | | | | | | to prevent recursive compilation problems. This fixes a failure of CodeGen/decl.c on x86-32 targets that don't fill in the coerce-to type. llvm-svn: 135256
* Enhance the IR type lowering code to be much smarter about recursively loweringChris Lattner2011-07-151-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | types. Fore xample, we used to lower: struct bar { int a; }; struct foo { void (*FP)(struct bar); } G; to: %struct.foo = type { {}* } since the function pointer would cause recursive translation of bar and we didn't know if that would get us into trouble. We are now smart enough to know that it is fine, so we get this type instead: %struct.foo = type { void (i32)* } Codegen still needs to be prepared for uncooperative types at any place, which is why I let the maximally uncooperative code sit around for awhile to help shake out the bugs. llvm-svn: 135244
* PR10337 reminds me that calls return values, lets handle them justChris Lattner2011-07-131-3/+9
| | | | | | like arguments. Thanks PR10337! :) llvm-svn: 135030
* insert a bitcast in the 'expand' case of argument passing when needed. ThisChris Lattner2011-07-121-28/+38
| | | | | | fixes the -m32 build of oggenc. llvm-svn: 134971
* fix PR10335 by watching out for IR type compatibility in call argument lists.Chris Lattner2011-07-121-1/+5
| | | | llvm-svn: 134966
* add some aggressive assertions that call arguments match up to calleeChris Lattner2011-07-121-3/+40
| | | | | | expectations in EmitCall. Next patch will take this further. llvm-svn: 134962
* how about we initialize RecursionState.Chris Lattner2011-07-101-2/+1
| | | | llvm-svn: 134855
* Rename CGT::VerifyFuncTypeComplete to isFuncTypeConvertible sinceChris Lattner2011-07-101-10/+9
| | | | | | | | | | | | | | | | | | it is a predicate, not an action. Change the return type to be a bool, not the incomplete member. Enhace it to detect the recursive compilation case, allowing us to compile Eli's testcase on llvmdev: struct T { struct T (*p)(void); } t; into: %struct.T = type { {}* } @t = common global %struct.T zeroinitializer, align 8 llvm-svn: 134853
* clang side to match the LLVM IR type system rewrite patch.Chris Lattner2011-07-091-38/+26
| | | | llvm-svn: 134831
* LValue carries a type now, so simplify the main EmitLoad/Store APIsJohn McCall2011-06-251-5/+4
| | | | | | by removing the redundant type parameter. llvm-svn: 133860
* Automatic Reference Counting.John McCall2011-06-151-10/+264
| | | | | | | | | | 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. llvm-svn: 133103
* Per Chris's suggestion, simplify code using llvm::getOrEnforceKnownAlignment.Eli Friedman2011-06-151-36/+15
| | | | llvm-svn: 133095
* Fix a regression from r132957 involving complex integers. (Fixes failures ↵Eli Friedman2011-06-151-2/+6
| | | | | | on gcc-testsuite bot.) llvm-svn: 133069
* The LLVM IR representation of byval arguments has a rather strange property: ↵Eli Friedman2011-06-141-5/+44
| | | | | | | | | | if the alignment of an argument to a call is less than the specified byval alignment for that argument, there is no way to specify the alignment of the implied copy. Therefore, we must ensure that the alignment of the argument is at least the byval alignment. To do this, we have to mess with the alignment of relevant alloca's in some cases, and insert a copy that conceptually shouldn't be necessary in some cases. This patch tries relatively hard to avoid creating an extra copy if it can be avoided (see test3 in the included testcase), but it is not possible to avoid in some cases (like test2 in the included testcase). rdar://9483886 llvm-svn: 132957
* Skip extra copy from aggregate where it isn't necessary; ↵Eli Friedman2011-05-261-0/+13
| | | | | | | | rdar://problem/8139919 . This shouldn't make much of a difference at -O3, but should substantially reduce the number of generated memcpy's at -O0. Originally r130717, but was backed out due to an ObjC regression. llvm-svn: 132102
* Introduce Type::isSignedIntegerOrEnumerationType() andDouglas Gregor2011-05-201-2/+2
| | | | | | | | | | | | | Type::isUnsignedIntegerOrEnumerationType(), which are like Type::isSignedIntegerType() and Type::isUnsignedIntegerType() but also consider the underlying type of a C++0x scoped enumeration type. Audited all callers to the existing functions, switching those that need to also handle scoped enumeration types (e.g., those that deal with constant values) over to the new functions. Fixes PR9923 / <rdar://problem/9447851>. llvm-svn: 131735
* For calls returning first-class aggregates, store by element instead of ↵Eli Friedman2011-05-171-2/+25
| | | | | | creating aggregate stores in common cases. This is more friendly to fast-isel. llvm-svn: 131490
* More killing of std::vector.John McCall2011-05-151-38/+38
| | | | llvm-svn: 131374
* Revert r130717, which caused a regression (<rdar://problem/9402621>).Douglas Gregor2011-05-071-13/+0
| | | | llvm-svn: 131057
* Skip extra copy from aggregate where it isn't necessary; ↵Eli Friedman2011-05-021-0/+13
| | | | | | rdar://problem/8139919 . This shouldn't make much of a difference at -O3, but should substantially reduce the number of generated memcpy's at -O0. llvm-svn: 130717
* Switch CallArgList from an std::pair to a new CallArg struct (which will ↵Eli Friedman2011-05-021-10/+9
| | | | | | eventually gain more members). Working towards modifying call emission to avoid unnecessary copies. llvm-svn: 130700
* Implement ARM pcs attribute. Basically it's another way of calling ↵Anton Korobeynikov2011-04-141-0/+5
| | | | | | | | | | convention selection (AAPCS or AAPCS+VFP), similar to fastcall / stdcall / whatevercall seen on x86. In particular, all library functions should always be AAPCS regardless of floating point ABI used. llvm-svn: 129534
* PR8369: make __attribute((regparm(0))) work correctly. Original patch byEli Friedman2011-04-091-5/+8
| | | | | | pageexec@freemail.hu, tweaks by me. llvm-svn: 129206
* Add support for language-specific address spaces. On top of that,Peter Collingbourne2011-03-181-1/+2
| | | | | | | | | 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
* Instead of storing an ASTContext* in FunctionProtoTypes with computed ↵Sebastian Redl2011-03-131-1/+1
| | | | | | noexcept specifiers, unique FunctionProtoTypes with a ContextualFoldingSet, as suggested by John McCall. llvm-svn: 127568
* Propagate the new exception information to FunctionProtoType.Sebastian Redl2011-03-121-1/+1
| | | | | | | | Change the interface to expose the new information and deal with the enormous fallout. Introduce the new ExceptionSpecificationType value EST_DynamicNone to more easily deal with empty throw specifications. Update the tests for noexcept and fix the various bugs uncovered, such as lack of tentative parsing support. llvm-svn: 127537
* Use a slightly more semantic interface for emitting call arguments.John McCall2011-03-111-17/+23
| | | | llvm-svn: 127494
* lib/CodeGen/CGCall.cpp: Don't invoke multiple Builder.CreateBitCast() on ↵NAKAMURA Takumi2011-03-101-2/+4
| | | | | | Builder.CreateMemCpy. Or we would see sideeffect incompatibility among gcc and clang. llvm-svn: 127405
* Use the "undergoes default argument promotion" bit on parameters toJohn McCall2011-03-091-17/+38
| | | | | | | | | | simplify the logic of initializing function parameters so that we don't need both a variable declaration and a type in FunctionArgList. This also means that we need to propagate the CGFunctionInfo down in a lot of places rather than recalculating it from the FAL. There's more we can do to eliminate redundancy here, and I've left FIXMEs behind to do it. llvm-svn: 127314
* Encode argument numbering in debug info so that code generator can emit them ↵Devang Patel2011-03-031-8/+10
| | | | | | | | in order. This fixes few blocks.exp regressions. llvm-svn: 126960
* Revert "Add CC_Win64ThisCall and set it in the necessary places."Tilmann Scheller2011-03-021-21/+8
| | | | | | This reverts commit 126863. llvm-svn: 126886
* revert r126858.Devang Patel2011-03-021-10/+8
| | | | llvm-svn: 126874
* Add CC_Win64ThisCall and set it in the necessary places.Tilmann Scheller2011-03-021-8/+21
| | | | llvm-svn: 126863
* Encode argument numbering in debug info so that code generator can emit them ↵Devang Patel2011-03-021-8/+10
| | | | | | | | | | in order. This fixes few blocks.exp regressions. Reapply r126795 with a fix (one character change) for gdb testsuite regressions. llvm-svn: 126858
* Revert r126794.Devang Patel2011-03-021-10/+8
| | | | llvm-svn: 126848
* Encode argument numbering in debug info so that code generator can emit them ↵Devang Patel2011-03-011-8/+10
| | | | | | | | in order. This fixes few blocks.exp regressions. llvm-svn: 126795
* objc IRGen for Next runtime message API.Fariborz Jahanian2011-03-011-1/+2
| | | | | | | | | | The prototype for objc_msgSend() is technically variadic - `id objc_msgSend(id, SEL, ...)`. But all method calls should use a prototype that matches the method, not the prototype for objc_msgSend itself(). // rdar://9048030 llvm-svn: 126754
* Simplify test to check an aggregate argument that has non trivial ↵Devang Patel2011-02-161-1/+1
| | | | | | | | constructor or destructor. This patch rewrites r125142. llvm-svn: 125632
OpenPOWER on IntegriCloud