Benjamin Kramer
54d76db0aa
Remove some dead variables clang-analyzer found.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92162 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-25 15:43:36 +00:00
Daniel Dunbar
7177dee8ae
Remove ';' after method definition. Noticed by clang++, which one would think
...
would have a higher respect for its own code. This is getting old, is this
warning really adding value?
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91779 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 17:50:07 +00:00
Anders Carlsson
0ddb6f7506
It's perfectly fine to see UserDefinedConversion casts when emitting scalar expressions.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91686 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-18 14:42:03 +00:00
Mike Stump
b14e62d5ae
Implement additional undefined checks for additional loads and stores. WIP.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91498 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-16 02:57:00 +00:00
Mike Stump
15037caa15
Switch codegen for -fcatch-undefined-bahavior over to __builtin_trap
...
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
2009-12-15 00:35:12 +00:00
Mike Stump
be07f60131
Add support for detecting undefined shift behavior. WIP.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91341 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-14 21:58:14 +00:00
Fariborz Jahanian
3b27f1a80e
Patch to allow C-style cast from 'void *' to block pointer type.
...
(fixes radar 7465023).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91171 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 22:40:48 +00:00
Eli Friedman
3a1737030e
Move the code for converting a member pointer to a bool so that it is usable
...
for logical not.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91112 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 09:26:29 +00:00
Eli Friedman
b81c786de5
Fix for PR5718: implement equality comparisons for member function pointers.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91108 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 07:36:43 +00:00
Eli Friedman
9dfebdcdcd
Support unary type traits in a scalar context. Not that I've actually seen
...
this construct, but might as well for completeness.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91071 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 22:40:32 +00:00
Fariborz Jahanian
820bca41c3
Code gen for ObjCIsaExpr AST used as lvalue.
...
(fixes radar 7457534).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90995 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 23:35:29 +00:00
Fariborz Jahanian
83dc32594c
Codegen. support for ObjCIsaExpr AST which until now
...
was not needed (fixes radar 7453430).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90981 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 19:05:56 +00:00
Fariborz Jahanian
92ef5d7572
More detailed analysis of typecast to an objective-c pointer
...
in objective-c++ mode without being too lenient.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90895 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-08 23:09:15 +00:00
Eli Friedman
48daf59c9f
Correctly handle conditional operators involving throw.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90800 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 20:25:53 +00:00
Daniel Dunbar
2da84ff228
Don't pass false (default) for isVolatile parameter to CreateLoad.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90098 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-29 21:23:36 +00:00
Benjamin Kramer
85b4521e34
Remove remaining VISIBILITY_HIDDEN from anonymous namespaces.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90044 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-28 19:45:26 +00:00
Eli Friedman
d888962cff
More work on ScalarExprEmitter::EmitCastExpr: for every cast kind, either
...
implement it explicitly or assert that it doesn't make sense for a scalar.
This caught a couple interesting issues: one, CK_BaseToDerivedMemberPointer
casts were getting silently miscompiled, and two, Sema was constructing some
strange implicit casts of type CK_UserDefinedConversion.
The change in SemaExprCXX makes sure the cast kinds are getting set correctly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89987 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-27 04:41:50 +00:00
Eli Friedman
8c3e7e7dda
Cleanup for ScalarExprEmitter::EmitCastExpr; no functional changes.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89986 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-27 02:07:44 +00:00
Eli Friedman
28665272c3
Use the more general Evaluate infrastructure for folding constant DeclRefs
...
instead of checking explicitly for an EnumConstantDecl. This folds references
to constant integer VarDecls, which has two benefits:
1. Slightly smaller emitted code from emitting a constant instead of a load,
and skipping emitting some constant globals.
2. Some code forgets to define static constant member variables; emitting a
load instead of the value in that case leads to a link error. (Such programs
are technically not well-formed, but in practice build with g++.)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89934 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-26 03:22:21 +00:00
Anders Carlsson
c102297fb2
We always need to emit the base expression of a member expression, even when the member decl refers to an enum. Thanks to Eli for pointing this out!
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89775 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-24 16:57:33 +00:00
Anders Carlsson
a1b29a74eb
Don't try to treat an enum constant as an lvalue.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89705 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-23 21:56:41 +00:00
Anders Carlsson
bc0e0781da
Handle converting member pointers to bool.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89692 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-23 20:04:44 +00:00
Anders Carlsson
a3697c9c15
Handle base-to-derived casts. Will land test case shortly.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89678 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-23 17:57:54 +00:00
Anders Carlsson
a36bf8f741
Fix lifetime of conditional temporaries. Patch by Victor Zverovich!
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89467 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-20 17:27:56 +00:00
Eli Friedman
25b825d1a4
Minor cleanup to member pointer handling.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89201 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-18 09:41:26 +00:00
Eli Friedman
ad35a83102
Clean up scalar cast kind handling; make cast kind handling explicitly handle
...
more cases. No intended visible change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88968 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 21:33:53 +00:00
Mike Stump
c849c052d6
Implement most of dynamic_cast. WIP.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88901 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 06:50:58 +00:00
Chris Lattner
41a124aba7
indirectbr seems to work! Rip out the old code.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86256 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-06 17:38:18 +00:00
Mike Stump
df317bf716
Refine volatile handling, specifically, we must have the canonical
...
type to look at the volatile specifier. I found these all from just
hand auditing the code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85967 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-03 23:25:48 +00:00
Anders Carlsson
756b5c4f9d
Add CGException.cpp, to be used for exception related code generation.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85560 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-30 01:42:31 +00:00
Chris Lattner
d9becd1846
Implement clang support for indirect branch and address of label
...
using the new LLVM support for this. This is temporarily hiding
behind horrible and ugly #ifdefs until the time when the optimizer
is stable (hopefully a week or so). Until then, lets make it "opt in" :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85446 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 23:59:40 +00:00
Nate Begeman
a99f08351b
Fix a bug in calculating shufflevector indices when constructing vectors from other vectors.
...
If I can find it again, I will check in a testcase.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85032 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-25 02:26:01 +00:00
Fariborz Jahanian
8bfd31f9da
Complete code gen for '.*' binary expression for
...
both scalar and aggregates.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84910 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-22 22:57:31 +00:00
John McCall
467b27b9a2
Canonicality is a property of qualified types, not unqualified types.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84891 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-22 20:10:53 +00:00
Fariborz Jahanian
f51dc64f90
Code gen for '.*' binary expressions - WIP.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84800 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 23:45:42 +00:00
Nate Begeman
0533b3020c
Support IRgen of OpenCL vector initializers, ensuring the resulting IR is in a
...
form that LLVM code generators can turn into efficient code. For example,
int4 a, b, c;
a = (int4)(b.yzw, a.x)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84434 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-18 20:10:40 +00:00
Anders Carlsson
82debc7d28
Add some more cast kinds.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84423 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-18 18:12:03 +00:00
Chris Lattner
7804bcba90
Fix PR5211: codegen shouldn't assume that the result of ||/&& is int
...
anymore. In C++ it is bool.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84308 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-17 04:24:20 +00:00
Benjamin Kramer
3c0ef8cc0d
Simplify pointer creation with the new Type::getInt*Ptr methods.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83964 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-13 10:07:13 +00:00
Fariborz Jahanian
f7bcc7e6c8
Generate weak read barriers when reading a weak __block
...
variable inside the block.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83729 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-10 20:07:56 +00:00
Benjamin Kramer
ffbb15e54a
Use new predicates for some type equality tests.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83303 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-05 13:47:21 +00:00
John McCall
0953e767ff
Refactor the representation of qualifiers to bring ExtQualType out of the
...
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82705 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-24 19:53:00 +00:00
Mike Stump
45504e568c
Remove now fixed FIXME.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82584 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-22 22:31:44 +00:00
Anders Carlsson
592a2bbc19
No need to null check implicit lvalue cast exprs.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82580 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-22 22:00:46 +00:00
John McCall
183700f494
Change all the Type::getAsFoo() methods to specializations of Type::getAs().
...
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82501 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-21 23:43:11 +00:00
Anders Carlsson
7f9e646b7e
Handle reinterpret_cast between integral types and pointer types.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81837 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-15 04:48:33 +00:00
Anders Carlsson
c1eb14a66f
Codegen support for nullptr from C++0x.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81835 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-15 04:39:46 +00:00
Anders Carlsson
32baf62b9a
When necessary, null check the base value in GetAddressCXXOfBaseClass.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81611 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-12 06:04:24 +00:00
Anders Carlsson
191dfe909d
Handle derived-to-base conversion in CGExprScalar::EmitCast, if the cast kind is CK_DerivedToBase.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81610 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-12 04:57:16 +00:00
Anders Carlsson
5a0f49ebc8
Rename AddressCXXOfBaseClass to GetAddressCXXOfBaseClass. Add a NullCheckValue argument (currently unused).
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81606 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-12 04:26:35 +00:00