summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExpr.cpp
Commit message (Collapse)AuthorAge
...
* Reapply r95393, without the change to CGExpr. I was wrong in assuming that theDaniel Dunbar2010-02-08
| | | | | | element type always matched the converted LLVM type for ExprType. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95596 91177308-0d34-0410-b5e6-96231b3b80d8
* Standardize the parsing of function type attributes in a way thatJohn McCall2010-02-05
| | | | | | | | | | | | | | 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(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95436 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r95393, which broke Clang's self-host.Douglas Gregor2010-02-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95430 91177308-0d34-0410-b5e6-96231b3b80d8
* IRgen: A few more ConvertType cleanups.Daniel Dunbar2010-02-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95423 91177308-0d34-0410-b5e6-96231b3b80d8
* IRgen: Factor out EmitAggExprToLValue.Daniel Dunbar2010-02-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95416 91177308-0d34-0410-b5e6-96231b3b80d8
* IRgen: Fix some CreateTempAlloca calls to use ConvertTypeForMem when that isDaniel Dunbar2010-02-05
| | | | | | conceptually correct. Review appreciated (Chris, Eli, Anders). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95401 91177308-0d34-0410-b5e6-96231b3b80d8
* Now that we store calling conventions in the types, use them instead ofCharles Davis2010-02-05
| | | | | | | | getting the calling convention from the target function, which may or may not exist. Fixes PR5280. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95399 91177308-0d34-0410-b5e6-96231b3b80d8
* IRgen: Use hasAggregateLLVMType instead of isSingleValueType() for cases thatDaniel Dunbar2010-02-05
| | | | | | | | need to deal with aggregates specially; this is consistent with the rest of IRgen. Also, simplify EmitParmDecl and don't worry about using Decl::getNameAsString. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95393 91177308-0d34-0410-b5e6-96231b3b80d8
* When binding an lvalue to a reference, we always need to pop temporaries.Anders Carlsson2010-02-04
| | | | | | | | | | | | | | With this fix, and the other fixes committed today a make check-all with a clang-built LLVM now gives: Expected Passes : 6933 Expected Failures : 46 Unsupported Tests : 40 Unexpected Failures: 27 which means that we pass 99.96% of all tests :) The resulting 27 tests are all LLVMC tests and seem to be because of differences in the clang and gcc drivers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95313 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug where we would not mark temporaries as conditional when emitting a ↵Anders Carlsson2010-02-04
| | | | | | conditional operator as an lvalue. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95311 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert the new reference binding code; I came up with a way simpler solution ↵Anders Carlsson2010-02-03
| | | | | | for the reference binding bug that is preventing self-hosting. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95223 91177308-0d34-0410-b5e6-96231b3b80d8
* Move pointer to data member emission to CodeGenModule and use it in ↵Anders Carlsson2010-02-02
| | | | | | CGExprConstant. Fixes PR5674. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95063 91177308-0d34-0410-b5e6-96231b3b80d8
* Start creating CXXBindReferenceExpr nodes when binding complex types to ↵Anders Carlsson2010-01-31
| | | | | | references. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94964 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new EmitLValueForFieldInitialization that will be used for ↵Anders Carlsson2010-01-29
| | | | | | initializing fields (and reference type fields in particular). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94799 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify EmitLValueForField - we can get whether the field is part of a ↵Anders Carlsson2010-01-29
| | | | | | union or not from the FieldDecl (through its DeclContext). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94798 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an CXXBindReferenceExpr (not used just yet).Anders Carlsson2010-01-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94791 91177308-0d34-0410-b5e6-96231b3b80d8
* Use CharUnits for alignment in EmitNullInitializationLValue().Ken Dyck2010-01-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94563 91177308-0d34-0410-b5e6-96231b3b80d8
* Roll out ASTContext::getTypeSizeInChars(), replacing instances ofKen Dyck2010-01-11
| | | | | | | | | | | "ASTContext::getTypeSize() / 8". Replace [u]int64_t variables with CharUnits ones as appropriate. Also rename RawType, fromRaw(), and getRaw() in CharUnits to QuantityType, fromQuantity(), and getQuantity() for clarity. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93153 91177308-0d34-0410-b5e6-96231b3b80d8
* implement codegen support for preinc as an lvalue, PR5514.Chris Lattner2010-01-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93076 91177308-0d34-0410-b5e6-96231b3b80d8
* refactor pre/postinc logic into CGF and require the caller to pass in theChris Lattner2010-01-09
| | | | | | | lvalue to poke, no functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93075 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix -Asserts warning.Daniel Dunbar2010-01-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92491 91177308-0d34-0410-b5e6-96231b3b80d8
* Minor optimization; emit proper unsupported messages for a couple of cases.Eli Friedman2009-12-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92153 91177308-0d34-0410-b5e6-96231b3b80d8
* Some small improvements to dead code elimination; helps a bit onEli Friedman2009-12-25
| | | | | | | | LLVM-Code-Symbols test. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92152 91177308-0d34-0410-b5e6-96231b3b80d8
* Pass the return value slot to all call exprs.Anders Carlsson2009-12-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92145 91177308-0d34-0410-b5e6-96231b3b80d8
* Fill in the return value slot in CGExprAgg::VisitCallExpr. This takes us ↵Anders Carlsson2009-12-24
| | | | | | halfway towards fixing PR5824. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92142 91177308-0d34-0410-b5e6-96231b3b80d8
* Pass ReturnValueSlot to EmitCall. No functionality change yet.Anders Carlsson2009-12-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92138 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a ReturnValueSlot class. Change the argument order in EmitCall to match ↵Anders Carlsson2009-12-24
| | | | | | the other overload better. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92136 91177308-0d34-0410-b5e6-96231b3b80d8
* simplify my previous patch.Chris Lattner2009-12-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92057 91177308-0d34-0410-b5e6-96231b3b80d8
* fix opencl extvector element extraction on rvalues. We previouslyChris Lattner2009-12-23
| | | | | | | error_unsupported on test10 and crashed on test11. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92056 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix for PR5524: make reference binding in default argument work correctly.Eli Friedman2009-12-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91733 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement additional undefined checks for additional loads and stores. WIP.Mike Stump2009-12-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91498 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixes a code gen bug related to accessing a nowFariborz Jahanian2009-12-15
| | | | | | | | | | | non-existing 'isa' field of a non-existing struct type all related to legacy type definition for 'id' which we have dropped in clang in favor of a built-in type. (fixes radar 7470820). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91455 91177308-0d34-0410-b5e6-96231b3b80d8
* ShouldDestroyTemporaries? I don't think so.Anders Carlsson2009-12-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91450 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix spacing.Mike Stump2009-12-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91386 91177308-0d34-0410-b5e6-96231b3b80d8
* Ensure we preserve line information for each trap forMike Stump2009-12-15
| | | | | | | -fcatch-undefined-behavior if we aren't optimizing. WIP. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91382 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch codegen for -fcatch-undefined-bahavior over to __builtin_trapMike Stump2009-12-15
| | | | | | | instead of abort to improve codesize and codegen. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91374 91177308-0d34-0410-b5e6-96231b3b80d8
* We have to allow one to form an address for one past the end. WIP.Mike Stump2009-12-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91347 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplifiy.Mike Stump2009-12-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91324 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement runtime checks for undefined behavior. WIP.Mike Stump2009-12-12
| | | | | | | | | | | | | | This implements a new flag -fcatch-undefined-behavior. The flag turns on additional runtime checks for: T a[I]; a[i] abort when i < 0 or i >= I. Future stuff includes shifts by >= bitwidth amounts. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91198 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the code for converting a member pointer to a bool so that it is usableEli Friedman2009-12-11
| | | | | | | | for logical not. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91112 91177308-0d34-0410-b5e6-96231b3b80d8
* When extending the lifetime of a temporary, make sure to emit a branch to ↵Anders Carlsson2009-12-11
| | | | | | the cleanup exit block. This fixes a broken module error in LLVMCConfigurationEmitter.cpp. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91086 91177308-0d34-0410-b5e6-96231b3b80d8
* Code gen for ObjCIsaExpr AST used as lvalue.Fariborz Jahanian2009-12-09
| | | | | | | | (fixes radar 7457534). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90995 91177308-0d34-0410-b5e6-96231b3b80d8
* Add cleanups for exceptional edges. WIP.Mike Stump2009-12-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90940 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix some direct checks of expressions which might be surrounded by parentheses.Eli Friedman2009-12-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90825 91177308-0d34-0410-b5e6-96231b3b80d8
* Make the comma operator consistently call EnsureInsertPoint.Eli Friedman2009-12-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90799 91177308-0d34-0410-b5e6-96231b3b80d8
* use new helpers to simplify code.Chris Lattner2009-12-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90709 91177308-0d34-0410-b5e6-96231b3b80d8
* Make EmitStoreOfScalar generate a more sane representation of boolean stores.Eli Friedman2009-12-01
| | | | | | | | "Fixes" PR5645. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90272 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't pass false (default) for isVolatile parameter to CreateLoad.Daniel Dunbar2009-11-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90098 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement IRGen for MemberExpr referring to static member function.Eli Friedman2009-11-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89938 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate CXXConditionDeclExpr with extreme prejudice.Douglas Gregor2009-11-25
| | | | | | | | | | | | | | | | | | All statements that involve conditions can now hold on to a separate condition declaration (a VarDecl), and will use a DeclRefExpr referring to that VarDecl for the condition expression. ForStmts now have such a VarDecl (I'd missed those in previous commits). Also, since this change reworks the Action interface for if/while/switch/for, use FullExprArg for the full expressions in those expressions, to ensure that we're emitting Note that we are (still) not generating the right cleanups for condition variables in for statements. That will be a follow-on commit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89817 91177308-0d34-0410-b5e6-96231b3b80d8