Commit Graph

318 Commits

Author SHA1 Message Date
Douglas Gregor a643780483 Revert r95393, which broke Clang's self-host.
llvm-svn: 95430
2010-02-05 21:10:36 +00:00
Daniel Dunbar 9c4e4651d5 IRgen: A few more ConvertType cleanups.
llvm-svn: 95423
2010-02-05 20:02:42 +00:00
Daniel Dunbar d0bc7b9d13 IRgen: Factor out EmitAggExprToLValue.
llvm-svn: 95416
2010-02-05 19:38:31 +00:00
Daniel Dunbar 8848175547 IRgen: Fix some CreateTempAlloca calls to use ConvertTypeForMem when that is
conceptually correct. Review appreciated (Chris, Eli, Anders).

llvm-svn: 95401
2010-02-05 18:56:49 +00:00
Charles Davis 5a5473f0f8 Now that we store calling conventions in the types, use them instead of
getting the calling convention from the target function, which may or may not
exist. Fixes PR5280.

llvm-svn: 95399
2010-02-05 18:13:10 +00:00
Daniel Dunbar 363589bded IRgen: Use hasAggregateLLVMType instead of isSingleValueType() for cases that
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.

llvm-svn: 95393
2010-02-05 17:51:33 +00:00
Anders Carlsson 824e0613de When binding an lvalue to a reference, we always need to pop temporaries.
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.

llvm-svn: 95313
2010-02-04 17:32:58 +00:00
Anders Carlsson 9b942c65a5 Fix a bug where we would not mark temporaries as conditional when emitting a conditional operator as an lvalue.
llvm-svn: 95311
2010-02-04 17:26:01 +00:00
Anders Carlsson 3b227bd629 Revert the new reference binding code; I came up with a way simpler solution for the reference binding bug that is preventing self-hosting.
llvm-svn: 95223
2010-02-03 16:38:03 +00:00
Anders Carlsson 259688ce29 Move pointer to data member emission to CodeGenModule and use it in CGExprConstant. Fixes PR5674.
llvm-svn: 95063
2010-02-02 03:37:46 +00:00
Anders Carlsson ab0ddb57b1 Start creating CXXBindReferenceExpr nodes when binding complex types to references.
llvm-svn: 94964
2010-01-31 18:34:51 +00:00
Anders Carlsson db78f0ad04 Add a new EmitLValueForFieldInitialization that will be used for initializing fields (and reference type fields in particular).
llvm-svn: 94799
2010-01-29 05:24:29 +00:00
Anders Carlsson 5d8645b150 Simplify EmitLValueForField - we can get whether the field is part of a union or not from the FieldDecl (through its DeclContext).
llvm-svn: 94798
2010-01-29 05:05:36 +00:00
Anders Carlsson ba6c437d52 Add an CXXBindReferenceExpr (not used just yet).
llvm-svn: 94791
2010-01-29 02:39:32 +00:00
Ken Dyck e5402e4749 Use CharUnits for alignment in EmitNullInitializationLValue().
llvm-svn: 94563
2010-01-26 18:35:11 +00:00
Ken Dyck 40775003e6 Roll out ASTContext::getTypeSizeInChars(), replacing instances of
"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.

llvm-svn: 93153
2010-01-11 17:06:35 +00:00
Chris Lattner bb8976e36e implement codegen support for preinc as an lvalue, PR5514.
llvm-svn: 93076
2010-01-09 21:44:40 +00:00
Chris Lattner 116ce8f172 refactor pre/postinc logic into CGF and require the caller to pass in the
lvalue to poke, no functionality change.

llvm-svn: 93075
2010-01-09 21:40:03 +00:00
Daniel Dunbar 5b9019515a Fix -Asserts warning.
llvm-svn: 92491
2010-01-04 18:02:28 +00:00
Eli Friedman b8841af8bd Minor optimization; emit proper unsupported messages for a couple of cases.
llvm-svn: 92153
2009-12-25 06:17:05 +00:00
Eli Friedman 2e06e8bbcc Some small improvements to dead code elimination; helps a bit on
LLVM-Code-Symbols test.

llvm-svn: 92152
2009-12-25 05:29:40 +00:00
Anders Carlsson bfb3671b25 Pass the return value slot to all call exprs.
llvm-svn: 92145
2009-12-24 21:13:40 +00:00
Anders Carlsson 1749083e2e Fill in the return value slot in CGExprAgg::VisitCallExpr. This takes us halfway towards fixing PR5824.
llvm-svn: 92142
2009-12-24 20:40:36 +00:00
Anders Carlsson 61a401caec Pass ReturnValueSlot to EmitCall. No functionality change yet.
llvm-svn: 92138
2009-12-24 19:25:24 +00:00
Anders Carlsson 0435ed5875 Add a ReturnValueSlot class. Change the argument order in EmitCall to match the other overload better.
llvm-svn: 92136
2009-12-24 19:08:58 +00:00
Chris Lattner f0a9ba37d4 simplify my previous patch.
llvm-svn: 92057
2009-12-23 21:33:41 +00:00
Chris Lattner 4e1a323b85 fix opencl extvector element extraction on rvalues. We previously
error_unsupported on test10 and crashed on test11.

llvm-svn: 92056
2009-12-23 21:31:11 +00:00
Eli Friedman 357e8c94d6 Fix for PR5524: make reference binding in default argument work correctly.
llvm-svn: 91733
2009-12-19 00:20:10 +00:00
Mike Stump 3f6f9febad Implement additional undefined checks for additional loads and stores. WIP.
llvm-svn: 91498
2009-12-16 02:57:00 +00:00
Fariborz Jahanian 2b9fc83db5 Fixes a code gen bug related to accessing a now
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).

llvm-svn: 91455
2009-12-15 21:34:52 +00:00
Anders Carlsson 6e997b2993 ShouldDestroyTemporaries? I don't think so.
llvm-svn: 91450
2009-12-15 20:51:39 +00:00
Mike Stump cf16d2cc42 Fix spacing.
llvm-svn: 91386
2009-12-15 01:22:35 +00:00
Mike Stump 9a4e0128a8 Ensure we preserve line information for each trap for
-fcatch-undefined-behavior if we aren't optimizing.  WIP.

llvm-svn: 91382
2009-12-15 00:59:40 +00:00
Mike Stump e8c3b3eca4 Switch codegen for -fcatch-undefined-bahavior over to __builtin_trap
instead of abort to improve codesize and codegen.

llvm-svn: 91374
2009-12-15 00:35:12 +00:00
Mike Stump 590d18f103 We have to allow one to form an address for one past the end. WIP.
llvm-svn: 91347
2009-12-14 22:14:31 +00:00
Mike Stump f8858af909 Simplifiy.
llvm-svn: 91324
2009-12-14 20:52:00 +00:00
Mike Stump d954638f02 Implement runtime checks for undefined behavior. WIP.
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.

llvm-svn: 91198
2009-12-12 01:27:46 +00:00
Eli Friedman 68396b16f6 Move the code for converting a member pointer to a bool so that it is usable
for logical not.

llvm-svn: 91112
2009-12-11 09:26:29 +00:00
Anders Carlsson 0c6a7d8f42 When extending the lifetime of a temporary, make sure to emit a branch to the cleanup exit block. This fixes a broken module error in LLVMCConfigurationEmitter.cpp.
llvm-svn: 91086
2009-12-11 01:00:09 +00:00
Fariborz Jahanian 531c16f9fb Code gen for ObjCIsaExpr AST used as lvalue.
(fixes radar 7457534).

llvm-svn: 90995
2009-12-09 23:35:29 +00:00
Mike Stump aff69af918 Add cleanups for exceptional edges. WIP.
llvm-svn: 90940
2009-12-09 03:35:49 +00:00
Eli Friedman 8aaff69e86 Fix some direct checks of expressions which might be surrounded by parentheses.
llvm-svn: 90825
2009-12-08 02:09:46 +00:00
Eli Friedman 5445f6e5b6 Make the comma operator consistently call EnsureInsertPoint.
llvm-svn: 90799
2009-12-07 20:18:11 +00:00
Chris Lattner 72ecc68e11 use new helpers to simplify code.
llvm-svn: 90709
2009-12-06 17:22:42 +00:00
Eli Friedman b2b120f664 Make EmitStoreOfScalar generate a more sane representation of boolean stores.
"Fixes" PR5645.

llvm-svn: 90272
2009-12-01 22:31:51 +00:00
Daniel Dunbar c76493a65d Don't pass false (default) for isVolatile parameter to CreateLoad.
llvm-svn: 90098
2009-11-29 21:23:36 +00:00
Eli Friedman d15eb34d4b Implement IRGen for MemberExpr referring to static member function.
llvm-svn: 89938
2009-11-26 06:08:14 +00:00
Douglas Gregor 7bab5ff8e7 Eliminate CXXConditionDeclExpr with extreme prejudice.
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.

llvm-svn: 89817
2009-11-25 00:27:52 +00:00
Douglas Gregor 48a409eb39 Rename CleanupScope -> DelayedCleanupBlock. No functionality change.
llvm-svn: 89769
2009-11-24 16:21:10 +00:00
Anders Carlsson 8c793172c2 Handle base-to-derived casts. Will land test case shortly.
llvm-svn: 89678
2009-11-23 17:57:54 +00:00