| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
MaterializeTemporaryExpr captures a reference binding to a temporary
value, making explicit that the temporary value (a prvalue) needs to
be materialized into memory so that its address can be used. The
intended AST invariant here is that a reference will always bind to a
glvalue, and MaterializeTemporaryExpr will be used to convert prvalues
into glvalues for that binding to happen. For example, given
const int& r = 1.0;
The initializer of "r" will be a MaterializeTemporaryExpr whose
subexpression is an implicit conversion from the double literal "1.0"
to an integer value.
IR generation benefits most from this new node, since it was
previously guessing (badly) when to materialize temporaries for the
purposes of reference binding. There are likely more refactoring and
cleanups we could perform there, but the introduction of
MaterializeTemporaryExpr fixes PR9565, a case where IR generation
would effectively bind a const reference directly to a bitfield in a
struct. Addresses <rdar://problem/9552231>.
llvm-svn: 133521
|
|
|
|
|
|
|
|
|
|
|
| |
ConvertType on InitListExprs as they are being converted. This is
needed for a forthcoming patch, and improves the IR generated anyway
(see additional type names in testcases).
This patch also converts a bunch of std::vector's in CGObjCMac to use
C arrays. There are a ton more that should be converted as well.
llvm-svn: 133413
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
structs. // rdar://8823265
llvm-svn: 130783
|
|
|
|
| |
llvm-svn: 130696
|
|
|
|
|
|
| |
// rdar://8823265 - wip.
llvm-svn: 130451
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
double data[20000000] = {0};
we would blow out the memory by creating 20M Exprs to fill out the initializer.
To fix this, if the initializer list initializes an array with more elements than
there are initializers in the list, have InitListExpr store a single 'ArrayFiller' expression
that specifies an expression to be used for value initialization of the rest of the elements.
Fixes rdar://9275920.
llvm-svn: 129896
|
|
|
|
|
|
|
| |
As an extension, generic selection support has been added for all
supported languages. The syntax is the same as for C1X.
llvm-svn: 129554
|
|
|
|
|
|
|
|
|
| |
for __unknown_anytype resolution to destructively modify the AST. So that's
what it does now, which significantly simplifies some of the implementation.
Normal member calls work pretty cleanly now, and I added support for
propagating unknown-ness through &.
llvm-svn: 129331
|
|
|
|
| |
llvm-svn: 129269
|
|
|
|
| |
llvm-svn: 129265
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
represents a dynamic cast where we know that the result is always null.
For example:
struct A {
virtual ~A();
};
struct B final : A { };
struct C { };
bool f(B* b) {
return dynamic_cast<C*>(b);
}
llvm-svn: 129256
|
|
|
|
|
|
|
|
|
|
|
|
| |
The idea is that you can create a VarDecl with an unknown type, or a
FunctionDecl with an unknown return type, and it will still be valid to
access that object as long as you explicitly cast it at every use. I'm
still going back and forth about how I want to test this effectively, but
I wanted to go ahead and provide a skeletal implementation for the LLDB
folks' benefit and because it also improves some diagnostic goodness for
placeholder expressions.
llvm-svn: 129065
|
|
|
|
|
|
| |
PIM section 2.5.1 - after initialization all elements have the value specified by the literal
llvm-svn: 128375
|
|
|
|
|
|
| |
to CharUnits. No change in functionality intended.
llvm-svn: 128047
|
|
|
|
| |
llvm-svn: 127938
|
|
|
|
|
|
| |
functionality intended.
llvm-svn: 127927
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 127848
|
|
|
|
|
|
| |
CharUnits. No change in functionality intended.
llvm-svn: 127846
|
|
|
|
|
|
| |
functionality intended.
llvm-svn: 127844
|
|
|
|
|
|
| |
change in functionality intended.
llvm-svn: 127787
|
|
|
|
| |
llvm-svn: 127783
|
|
|
|
|
|
|
| |
make sure that upcasts of member pointer types are covered as constants.
Fixed rdar://problem/9130221
llvm-svn: 127702
|
|
|
|
|
|
|
|
| |
replace some uses of FieldOffsetInBytes. The remaining uses of
FieldOffsetInBytes will be replaced once NextFieldOffsetInBytes is converted
to CharUnits. No change in functionality intended.
llvm-svn: 127641
|
|
|
|
|
|
| |
No change in functionality intended.
llvm-svn: 127538
|
|
|
|
|
|
| |
functionality intended.
llvm-svn: 127513
|
|
|
|
|
|
|
| |
avoid converting to bits and back again. No change in functionality
intended.
llvm-svn: 127455
|
|
|
|
| |
llvm-svn: 126883
|
|
|
|
|
|
| |
by Heikki Kultala!
llvm-svn: 125784
|
|
|
|
|
|
|
|
|
|
|
|
| |
a zero constant for a complete class. rdar://problem/8424975
To make this happen, track the field indexes for virtual bases
in the complete object. I'm curious whether we might be better
off making CGRecordLayoutBuilder *much* more reliant on
ASTRecordLayout; we're currently duplicating an awful lot of the ABI
layout logic.
llvm-svn: 125555
|
|
|
|
| |
llvm-svn: 125538
|
|
|
|
|
|
| |
builders unhappy.
llvm-svn: 125505
|
|
|
|
| |
llvm-svn: 125488
|
|
|
|
|
|
|
| |
CharUnits to sizes in bits, and use it to tidy up the places where the
conversion was done explicitly.
llvm-svn: 125332
|
|
|
|
|
|
| |
functionality intended.
llvm-svn: 125156
|
|
|
|
|
|
|
|
|
|
|
| |
right for anonymous struct/union members led to me discovering some
seemingly broken code in that area of Sema, which I fixed, partly by
changing the representation of member pointer constants so that
IndirectFieldDecls aren't expanded. This led to assorted cleanups with
member pointers in CodeGen, and while I was doing that I saw some random
other things to clean up.
llvm-svn: 124785
|
|
|
|
|
|
|
|
| |
zextOrTrunc(), and APSInt methods extend(), extOrTrunc() and new method
trunc(), to be const and to return a new value instead of modifying the
object in place.
llvm-svn: 121121
|
|
|
|
|
|
| |
that aren't i8 arrays.
llvm-svn: 119980
|
|
|
|
|
|
| |
getBaseClassOffset which returns the offset in CharUnits. Do the same thing for getVBaseClassOffset.
llvm-svn: 117881
|
|
|
|
|
|
| |
ambiguous context.
llvm-svn: 116567
|
|
|
|
|
|
| |
under the ARM ABI.
llvm-svn: 112588
|
|
|
|
|
|
| |
to the new constants.
llvm-svn: 112047
|
|
|
|
|
|
|
|
|
|
|
| |
class; they should just be completely opaque throughout IR gen now,
although I haven't really audited that.
Fix a bug apparently inherited from gcc-4.2 where we failed to null-check
member data pointers when performing derived-to-base or base-to-derived
conversions on them.
llvm-svn: 111789
|
|
|
|
|
|
|
|
|
| |
Make CGT defer to the ABI on all member pointer types.
This requires giving CGT a handle to the ABI.
It's way easier to make that work if we avoid lazily creating the ABI.
Make it so.
llvm-svn: 111786
|
|
|
|
|
|
|
|
|
|
| |
pointers. I find the resulting code to be substantially cleaner, and it
makes it very easy to use the same APIs for data member pointers (which I have
conscientiously avoided here), and it avoids a plethora of potential
inefficiencies due to excessive memory copying, but we'll have to see if it
actually works.
llvm-svn: 111776
|
|
|
|
|
|
|
|
| |
duplication between the constant and non-constant paths in all of this.
Implement ARM ABI semantics for member pointer constants and conversion.
llvm-svn: 111772
|
|
|
|
| |
llvm-svn: 111771
|
|
|
|
| |
llvm-svn: 111768
|