summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGCall.cpp
Commit message (Collapse)AuthorAgeFilesLines
* IRgen: Add CreateMemTemp, for creating an temporary memory object for a ↵Daniel Dunbar2010-02-091-11/+10
| | | | | | | | | | particular type, and flood fill. - CreateMemTemp sets the alignment on the alloca correctly, which fixes a great many places in IRgen where we were doing the wrong thing. - This fixes many many more places than the test case, but my feeling is we need to audit alignment systematically so I'm not inclined to try hard to test the individual fixes in this patch. If this bothers you, patches welcome! PR6240. llvm-svn: 95648
* Use the correct function info for constructors when applying function ↵Anders Carlsson2010-02-061-0/+13
| | | | | | attributes. Fixes PR6245. llvm-svn: 95474
* Standardize the parsing of function type attributes in a way thatJohn McCall2010-02-051-29/+47
| | | | | | | | | | | | follows (as conservatively as possible) gcc's current behavior: attributes written on return types that don't apply there are applied to the function instead, etc. Only parse CC attributes as type attributes, not as decl attributes; don't accepet noreturn as a decl attribute on ValueDecls, either (it still needs to apply to other decls, like blocks). Consistently consume CC/noreturn information throughout codegen; enforce this by removing their default values in CodeGenTypes::getFunctionInfo(). llvm-svn: 95436
* Revert the new reference binding code; I came up with a way simpler solution ↵Anders Carlsson2010-02-031-4/+1
| | | | | | for the reference binding bug that is preventing self-hosting. llvm-svn: 95223
* Start creating CXXBindReferenceExpr nodes when binding complex types to ↵Anders Carlsson2010-01-311-0/+3
| | | | | | references. llvm-svn: 94964
* Simplify EmitLValueForField - we can get whether the field is part of a ↵Anders Carlsson2010-01-291-2/+2
| | | | | | union or not from the FieldDecl (through its DeclContext). llvm-svn: 94798
* Fill in the return value slot in CGExprAgg::VisitCallExpr. This takes us ↵Anders Carlsson2009-12-241-15/+32
| | | | | | halfway towards fixing PR5824. llvm-svn: 92142
* Pass ReturnValueSlot to EmitCall. No functionality change yet.Anders Carlsson2009-12-241-0/+1
| | | | llvm-svn: 92138
* implement PR5274: mark 'restrict' parameters as noaliasNuno Lopes2009-12-071-0/+3
| | | | llvm-svn: 90778
* Make functions returning a struct indirectly evaluate the returned structEli Friedman2009-12-041-1/+1
| | | | | | | directly into the sret pointer. This is an optimization in C, but is required for correctness in C++ for classes with a non-trivial copy constructor. llvm-svn: 90526
* Add VTT parameter to base ctors/dtors with virtual bases. (They aren't used ↵Anders Carlsson2009-11-251-0/+36
| | | | | | yet). llvm-svn: 89835
* It is common for vtables to contain pointers to functions that have either ↵Anders Carlsson2009-11-241-0/+26
| | | | | | | | incomplete return types or incomplete argument types. Handle this by returning the llvm::OpaqueType for those cases, which CodeGenModule::GetOrCreateLLVMFunction knows about, and treats as being an "incomplete function". llvm-svn: 89736
* The ssp and sspreq function attributes should only be applied to function ↵Anders Carlsson2009-11-161-5/+0
| | | | | | definitions, not declarations or calls. llvm-svn: 88915
* Move CompileOptions -> CodeGenOptions, and sink it into the CodeGen library.Chandler Carruth2009-11-121-4/+4
| | | | | | This resolves the layering violation where CodeGen depended on Frontend. llvm-svn: 86998
* Set OptimizeForSize LLVM function attribute with -Os.Daniel Dunbar2009-10-271-0/+2
| | | | llvm-svn: 85278
* Twinify CodeGenFunction::CreateTempAllocaDaniel Dunbar2009-10-191-3/+2
| | | | llvm-svn: 84456
* Use new predicates for some type equality tests.Benjamin Kramer2009-10-051-2/+1
| | | | llvm-svn: 83303
* Implement code generation of member function pointer calls. Fixes PR5121.Anders Carlsson2009-10-031-0/+15
| | | | llvm-svn: 83271
* Refactor the representation of qualifiers to bring ExtQualType out of theJohn McCall2009-09-241-1/+1
| | | | | | | | Type hierarchy. Demote 'volatile' to extended-qualifier status. Audit our use of qualifiers and fix a few places that weren't dealing with qualifiers quite right; many more remain. llvm-svn: 82705
* Change all the Type::getAsFoo() methods to specializations of Type::getAs().John McCall2009-09-211-2/+2
| | | | | | | | | | | Several of the existing methods were identical to their respective specializations, and so have been removed entirely. Several more 'leaf' optimizations were introduced. The getAsFoo() methods which imposed extra conditions, like getAsObjCInterfacePointerType(), have been left in place. llvm-svn: 82501
* x86-64 ABI: If a type is a C++ record with either a non-trivial destructor ↵Anders Carlsson2009-09-161-1/+3
| | | | | | or a non-trivial copy constructor, it should be passed in a pointer. Daniel, plz review. llvm-svn: 82050
* Change CodeGenModule::ConstructTypeAttributes to return the calling conventionDaniel Dunbar2009-09-121-6/+9
| | | | | | to use, and allow the ABI implementation to override the calling convention. llvm-svn: 81593
* Set the calling convention based on the CGFunctionInfo.Daniel Dunbar2009-09-111-3/+3
| | | | llvm-svn: 81582
* Add CallingConvention argument to CGFunctionInfo.Daniel Dunbar2009-09-111-16/+49
| | | | | | - Currently unused. llvm-svn: 81581
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-73/+73
| | | | llvm-svn: 81346
* Update for LLVM API change.Owen Anderson2009-08-131-3/+4
| | | | llvm-svn: 78946
* map previously ignored __attribute((malloc)) to noalias attribute of llvm ↵Ryan Flynn2009-08-091-0/+2
| | | | | | function's return llvm-svn: 78541
* Add support for global initializers.Anders Carlsson2009-08-081-1/+1
| | | | llvm-svn: 78515
* Use Twine instead of utostrDaniel Dunbar2009-08-021-1/+1
| | | | llvm-svn: 77848
* Update for LLVM API change.Owen Anderson2009-07-311-1/+1
| | | | llvm-svn: 77722
* Allow functions to be marked "implicit return zero" and so mark main().John McCall2009-07-281-0/+13
| | | | | | Codegen by initializing the return value with its LLVM type's null value. llvm-svn: 77288
* Update for LLVM API change, and contextify a bunch of related stuff.Owen Anderson2009-07-141-1/+1
| | | | llvm-svn: 75705
* De-ASTContext-ify DeclContext.Argyrios Kyrtzidis2009-06-301-6/+6
| | | | | | | Remove ASTContext parameter from DeclContext's methods. This change cascaded down to other Decl's methods and changes to call sites started "escalating". Timings using pre-tokenized "cocoa.h" showed only a ~1% increase in time run between and after this commit. llvm-svn: 74506
* Remove the ASTContext parameter from the attribute-related methods of Decl.Argyrios Kyrtzidis2009-06-301-5/+5
| | | | | | | | | The implementations of these methods can Use Decl::getASTContext() to get the ASTContext. This commit touches a lot of files since call sites for these methods are everywhere. I used pre-tokenized "carbon.h" and "cocoa.h" headers to do some timings, and there was no real time difference between before the commit and after it. llvm-svn: 74501
* Make the StackProtector bitfield use enums instead of obscure numbers.Bill Wendling2009-06-281-2/+2
| | | | llvm-svn: 74414
* Add stack protector support to clang. This generates the 'ssp' and 'sspreq'Bill Wendling2009-06-281-0/+5
| | | | | | | | function attributes. There are predefined macros that are defined when stack protectors are used: __SSP__=1 with -fstack-protector and __SSP_ALL__=2 with -fstack-protector-all. llvm-svn: 74405
* fix PR4423.Chris Lattner2009-06-231-1/+2
| | | | llvm-svn: 73938
* Move the static DeclAttrs map into ASTContext. Fixes <rdar://problem/6983177>.Douglas Gregor2009-06-181-5/+6
| | | | llvm-svn: 73702
* Fix PR4372, another case where non-prototyped functions can prevent Chris Lattner2009-06-131-4/+36
| | | | | | always_inline from working. llvm-svn: 73273
* Add new ABIArgInfo kind: Extend. This allows target to implement its own ↵Anton Korobeynikov2009-06-061-20/+26
| | | | | | | | | argument zero/sign extension logic (consider, e.g. target has only 64 bit registers and thus i32's should be extended as well). llvm-svn: 72998
* Factor out TargetABIInfo stuff into separate file. No functionality change.Anton Korobeynikov2009-06-051-1368/+0
| | | | llvm-svn: 72962
* Set function Attribute::NoImplicitFloat appropriately.Devang Patel2009-06-051-0/+2
| | | | llvm-svn: 72961
* ABI handling: Fix nasty thinko where IRgen could generate an out-of-bounds readDaniel Dunbar2009-06-051-7/+8
| | | | | | | | | | when generating a coercion for ABI handling purposes. - This may only manifest itself when building at -O0, but the practical effect is that other arguments may get clobbered. - <rdar://problem/6930451> [irgen] ABI coercion clobbers other arguments llvm-svn: 72932
* Set function attribute llvm::Attribute::NoRedZone appropriately.Devang Patel2009-06-041-0/+4
| | | | llvm-svn: 72902
* When trying to pass an argument on the stack, assume LLVM will do the rightDaniel Dunbar2009-05-261-3/+19
| | | | | | | | | | | | | thing for non-aggregate types. - Otherwise we unnecessarily pin values to the stack and currently end up triggering a backend bug in one case. - This loose cooperation with LLVM to implement the ABI is pretty ugly. - <rdar://problem/6918722> [irgen] clang miscompile of many pointer varargs on x86-64 llvm-svn: 72419
* x86_64 ABI: Account for sret parameters consuming an integer register.Daniel Dunbar2009-05-221-0/+5
| | | | | | - PR4242. llvm-svn: 72268
* Set correct calling convention even if there is a bitcast in the way.Torok Edwin2009-05-221-1/+1
| | | | | | This attempts to fix PR4239. llvm-svn: 72251
* Use v.data() instead of &v[0] when SmallVector v might be empty.Jay Foad2009-05-211-2/+2
| | | | llvm-svn: 72210
* Add EmitReferenceBindingToExpr. Have EmitCallArg use it for now. Doesn't ↵Anders Carlsson2009-05-201-0/+3
| | | | | | support anything but at least we don't crash ;) llvm-svn: 72147
* Pass the destination QualType to EmitStoreOfScalar. No functionality change.Anders Carlsson2009-05-191-3/+3
| | | | llvm-svn: 72118
OpenPOWER on IntegriCloud