| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Because references must be initialized using some evaluated expression, they
must point to something, and a callee can assume the reference parameter is
dereferenceable. Taking advantage of a new attribute just added to LLVM, mark
them as such.
Because dereferenceability in addrspace(0) implies nonnull in the backend, we
don't need both attributes. However, we need to know the size of the object to
use the dereferenceable attribute, so for incomplete types we still emit only
nonnull.
llvm-svn: 213386
|
|
|
|
|
|
| |
type in a function type where the C++ type is a reference. Update the tests.
llvm-svn: 209723
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Update our mangling to match the discussion on cxx-abi-dev.
This involves using a seq-id instead of an optional number.
Reviewers: rsmith
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D3631
llvm-svn: 208140
|
|
|
|
|
|
|
| |
Reference temporaries inherited many properties from the variable that
they correspond to but visibility wasn't one of them.
llvm-svn: 207496
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
A reference temporary should inherit the linkage of the variable it
initializes. Otherwise, we may hit cases where a reference temporary
wouldn't have the same value in all translation units.
Reviewers: rsmith
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D3515
llvm-svn: 207451
|
|
|
|
|
|
|
| |
This is at least good documentation, but also opens the possibility of
using pipefail.
llvm-svn: 185652
|
|
|
|
|
|
| |
created through binding a reference-to-array to an initializer list.
llvm-svn: 183594
|
|
|
|
|
|
|
|
|
| |
handle temporaries which have been lifetime-extended to static storage duration
within constant expressions. This correctly handles nested lifetime extension
(through reference members of aggregates in aggregate initializers) but
non-constant-expression emission hasn't yet been updated to do the same.
llvm-svn: 183283
|
|
|
|
|
|
| |
initialize it with a store or a memcpy, not by emitting the initializer expression. This is not required for correctness, but more closely aligns with people's expectations, and is cheap (since we've already evaluated the initializer).
llvm-svn: 183082
|
|
|
|
|
|
|
|
|
| |
initialized by a reference constant expression.
Our odr-use modeling still needs work here: we don't yet implement the 'set of
potential results of an expression' DR.
llvm-svn: 166361
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
was mistakenly classifying dynamic_casts which might throw as having no side
effects.
Switch it from a visitor to a switch, so it is kept up-to-date as future Expr
nodes are added. Move it from ExprConstant.cpp to Expr.cpp, since it's not
really related to constant expression evaluation.
Since we use HasSideEffect to determine whether to emit an unused global with
internal linkage, this has the effect of suppressing emission of globals in
some cases.
I've left many of the Objective-C cases conservatively assuming that the
expression has side-effects. I'll leave it to someone with better knowledge
of Objective-C than mine to improve them.
llvm-svn: 161388
|
|
|
|
|
|
|
|
| |
multidimensional array of class type. Also, preserve zero-initialization when
evaluating an initializer list for an array, in case the initializers refer to
later elements (which have preceding zero-initialization).
llvm-svn: 159904
|
|
|
|
|
|
|
|
|
|
|
| |
actually perform value initialization rather than trying to fake it with a call
to the default constructor. Fixes various bugs related to the previously-missing
zero-initialization in this case.
I've also moved this and the other list initialization 'special case' from
TryConstructorInitialization into TryListInitialization where they belong.
llvm-svn: 159733
|
|
|
|
|
|
|
|
|
| |
in-class initializer for one of its fields. Value-initialization of such
a type should use the in-class initializer!
The former was just a bug, the latter is a (reported) standard defect.
llvm-svn: 156274
|
|
|
|
|
|
|
|
|
| |
initialize an array of unsigned char. Outside C++11 mode, this bug was benign,
and just resulted in us emitting a constant which was double the required
length, padded with 0s. In C++11, it resulted in us generating an array whose
first element was something like i8 ptrtoint ([n x i8]* @str to i8).
llvm-svn: 154756
|
|
|
|
|
|
| |
converting from std::nullptr_t, the subexpression might have side-effects.
llvm-svn: 154278
|
|
|
|
|
|
| |
in general. Found by inspection.
llvm-svn: 153720
|
|
|
|
|
|
| |
is not usable in a constant expression. ~2.5% speedup on 403.gcc / combine.c.
llvm-svn: 152193
|
|
|
|
|
|
|
|
|
| |
scalar emission of DeclRefExprs to const bools: emit scalar bools as i1,
not as i8.
In addition to the extra unit testing, this has successfully bootstrapped.
llvm-svn: 151955
|
|
|
|
|
|
|
|
| |
variables in contexts where there" and "Fix buildbot: make this test less dependent on the value names in the produced IR."
They broke bootstrap.
llvm-svn: 151922
|
|
|
|
|
|
| |
produced IR.
llvm-svn: 151880
|
|
|
|
|
|
|
| |
is no odr-use of the variable. Go slightly beyond what the standard requires
for variables of reference type.
llvm-svn: 151879
|
|
|
|
|
|
| |
forget the vptrs.
llvm-svn: 151245
|
|
|
|
|
|
|
|
|
|
|
| |
1) It has a const-qualified type, and
2) It has no mutable members, and
3) It has no dynamic initialization, and
4) It has trivial destruction.
Remove the unnecessary requirement that the type be POD. This allows us to
mark all constexpr objects with no mutable members as 'constant'.
llvm-svn: 150792
|
|
|
|
|
|
| |
can be represented by an LValue, and use that to simplify the code a little.
llvm-svn: 150789
|
|
|
|
|
|
|
| |
zero-initialize class types with virtual bases when constant-evaluating an
initializer.
llvm-svn: 150770
|
|
|
|
|
|
|
|
|
|
|
| |
constructor, and that constructor is used to initialize an object of static
storage duration such that all members and bases are initialized by constant
expressions, constant initialization is performed. In this case, the object
can still have a non-trivial destructor, and if it does, we must emit a dynamic
initializer which performs no initialization and instead simply registers that
destructor.
llvm-svn: 150419
|
|
|
|
|
|
|
| |
function definition can produce a constant expression. This also provides the
last few checks for [dcl.constexpr]p3 and [dcl.constexpr]p4.
llvm-svn: 149108
|
|
|
|
|
|
| |
when asking for a ConstantStruct with all undef elements.
llvm-svn: 149025
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
APValue::Array and APValue::MemberPointer. All APValue values can now be emitted
as constants.
Add new CGCXXABI entry point for emitting an APValue MemberPointer. The other
entrypoints dealing with constant member pointers are no longer necessary and
will be removed in a later change.
Switch codegen from using EvaluateAsRValue/EvaluateAsLValue to
VarDecl::evaluateValue. This performs caching and deals with the nasty cases in
C++11 where a non-const object's initializer can refer indirectly to
previously-initialized fields within the same object.
Building the intermediate APValue object incurs a measurable performance hit on
pathological testcases with huge initializer lists, so we continue to build IR
directly from the Expr nodes for array and record types outside of C++11.
llvm-svn: 148178
|
|
address-of-label differences).
llvm-svn: 147631
|