| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
constant expressions.
llvm-svn: 205757
|
| |
|
|
|
|
| |
iterator_range body(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 204040
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Gracefully fail to evaluate a constant expression if its type is
unknown, rather than failing an assertion trying to access the type.
Reviewers: klimek
Reviewed By: klimek
CC: chandlerc, cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D3075
llvm-svn: 203950
|
| |
|
|
|
|
| |
iterator_range decls(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203947
|
| |
|
|
|
|
| |
iterator_range inits(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203819
|
| |
|
|
|
|
|
|
| |
instead, per post-commit review feedback.
Replacing llvm::copy changes with SmallVector range-based construction which is a considerably cleaner approach.
llvm-svn: 203461
|
| |
|
|
|
|
| |
iterator_range fields(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203355
|
| |
|
|
|
|
| |
Smith.
llvm-svn: 203262
|
| |
|
|
|
|
| |
with iterator_range chains(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203261
|
| |
|
|
|
|
| |
evaluating trivial default initialization of a literal class type.
llvm-svn: 203025
|
| |
|
|
|
|
| |
Suggested by Richard Smith.
llvm-svn: 201753
|
| |
|
|
|
|
|
|
|
|
| |
dependent expression
inside a GNU statement expression.
rdar://16064952
llvm-svn: 201468
|
| |
|
|
|
|
|
|
| |
initialized from a constant expression in C++98, it can be used in
constant expressions, even if it was brace-initialized. Patch by
Rahul Jain!
llvm-svn: 200098
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A return type is the declared or deduced part of the function type specified in
the declaration.
A result type is the (potentially adjusted) type of the value of an expression
that calls the function.
Rule of thumb:
* Declarations have return types and parameters.
* Expressions have result types and arguments.
llvm-svn: 200082
|
| |
|
|
|
|
| |
resolution based on the values of the function arguments at the call site.
llvm-svn: 198996
|
| |
|
|
|
|
| |
so it has been removed. No functional changes intended.
llvm-svn: 198440
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Remove UnaryTypeTraitExpr and switch all remaining type trait related handling
over to TypeTraitExpr.
The UTT/BTT/TT enum prefix and evaluation code is retained pending further
cleanup.
This is part of the ongoing work to unify type traits following the removal of
BinaryTypeTraitExpr in r197273.
llvm-svn: 198271
|
| |
|
|
|
|
|
|
| |
This better describes what the function does.
Cleanup only.
llvm-svn: 198127
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There's nothing special about type traits accepting two arguments.
This commit eliminates BinaryTypeTraitExpr and switches all related handling
over to TypeTraitExpr.
Also fixes a CodeGen failure with variadic type traits appearing in a
non-constant expression.
The BTT/TT prefix and evaluation code is retained as-is for now but will soon
be further cleaned up.
This is part of the ongoing work to unify type traits.
llvm-svn: 197273
|
| |
|
|
|
|
|
|
|
|
| |
With the introduction of explicit address space casts into LLVM, there's
a need to provide a new cast kind the front-end can create for C/OpenCL/CUDA
and code to produce address space casts from those kinds when appropriate.
Patch by Michele Scandale!
llvm-svn: 197036
|
| |
|
|
|
|
|
| |
where we didn't. Extend our constant evaluation for __builtin_strlen to handle
any constant array of chars, not just string literals, to match.
llvm-svn: 194762
|
| |
|
|
|
|
| |
forget to clean up temporaries at the end of it.
llvm-svn: 194213
|
| |
|
|
|
|
| |
when they actually do.
llvm-svn: 194156
|
| |
|
|
|
|
|
| |
earlier 'non-constant' diagnostic with a later one if the earlier one was from
a side-effect we thought we could evaluate past.
llvm-svn: 194117
|
| |
|
|
|
|
| |
checking an expression for constant overflow.
llvm-svn: 194099
|
| |
|
|
|
|
|
|
|
| |
bit more robust against future changes. This includes a slight diagnostic
improvement: if we know we're only trying to form a constant expression, take
the first diagnostic which shows the expression is not a constant expression,
rather than preferring the first one which makes the expression unfoldable.
llvm-svn: 194098
|
| |
|
|
|
|
| |
__builtin_isnan, and __builtin_isnormal. Patch by Karthik Bhat! Tests by me.
llvm-svn: 192729
|
| |
|
|
| |
llvm-svn: 191171
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
LLVM supports applying conversion instructions to vectors of the same number of
elements (fptrunc, fptosi, etc.) but there had been no way for a Clang user to
cause such instructions to be generated when using builtin vector types.
C-style casting on vectors is already defined in terms of bitcasts, and so
cannot be used for these conversions as well (without leading to a very
confusing set of semantics). As a result, this adds a __builtin_convertvector
intrinsic (patterned after the OpenCL __builtin_astype intrinsic). This is
intended to aid the creation of vector intrinsic headers that create generic IR
instead of target-dependent intrinsics (in other words, this is a generic
_mm_cvtepi32_ps). As noted in the documentation, the action of
__builtin_convertvector is defined in terms of the action of a C-style cast on
each vector element.
llvm-svn: 190915
|
| |
|
|
|
|
|
|
|
| |
Like any other type, an init list for a vector can have the same type as
the vector itself; handle that case.
<rdar://problem/14990460>
llvm-svn: 190844
|
| |
|
|
|
|
| |
we try to constant-evaluate it. Patch by Karthik Bhat, test by me.
llvm-svn: 190722
|
| |
|
|
|
|
|
| |
treat such subtractions as being non-constant. Patch by Serge Pavlov! With a
few tweaks by me.
llvm-svn: 190439
|
| |
|
|
|
|
|
|
| |
I changed the diagnostic printing code because it's probably better
to cut off a digit from DBL_MAX than to print something like
1.300000001 when the user wrote 1.3.
llvm-svn: 189625
|
| |
|
|
| |
llvm-svn: 188991
|
| |
|
|
|
|
| |
expression, truncate the stored value to the size of the bitfield.
llvm-svn: 187782
|
| |
|
|
|
|
|
| |
objects to be used once their lifetimes end. This completes the C++1y
constexpr extensions.
llvm-svn: 187025
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This is the same way GenericSelectionExpr works, and it's generally a
more consistent approach.
A large part of this patch is devoted to caching the value of the condition
of a ChooseExpr; it's needed to avoid threading an ASTContext into
IgnoreParens().
Fixes <rdar://problem/14438917>.
llvm-svn: 186738
|
| |
|
|
|
|
|
|
|
|
|
| |
& operator (ignoring any overloaded operator& for the type). The purpose of
this builtin is for use in std::addressof, to allow it to be made constexpr;
the existing implementation technique (reinterpret_cast to some reference type,
take address, reinterpert_cast back) does not permit this because
reinterpret_cast between reference types is not permitted in a constant
expression in C++11 onwards.
llvm-svn: 186053
|
| |
|
|
|
|
| |
why not. Apparently GCC supports this.
llvm-svn: 184396
|
| |
|
|
|
|
|
| |
constructor that does not initialize all members, and that constructor is used
to initialize a global.
llvm-svn: 184211
|
| |
|
|
|
|
| |
possible.
llvm-svn: 183967
|
| |
|
|
| |
llvm-svn: 183890
|
| |
|
|
|
|
| |
__builtin_parity{,l,ll}, __builtin_ffs{,l,ll}, and __builtin_fpclassify.
llvm-svn: 183889
|
| |
|
|
| |
llvm-svn: 183886
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Introduce CXXStdInitializerListExpr node, representing the implicit
construction of a std::initializer_list<T> object from its underlying array.
The AST representation of such an expression goes from an InitListExpr with a
flag set, to a CXXStdInitializerListExpr containing a MaterializeTemporaryExpr
containing an InitListExpr (possibly wrapped in a CXXBindTemporaryExpr).
This more detailed representation has several advantages, the most important of
which is that the new MaterializeTemporaryExpr allows us to directly model
lifetime extension of the underlying temporary array. Using that, this patch
*drastically* simplifies the IR generation of this construct, provides IR
generation support for nested global initializer_list objects, fixes several
bugs where the destructors for the underlying array would accidentally not get
invoked, and provides constant expression evaluation support for
std::initializer_list objects.
llvm-svn: 183872
|
| |
|
|
|
|
|
|
| |
must be initialized by a constant expression (not just a core constant
expression), because we're going to emit it as a global. Core issue for this is
pending.
llvm-svn: 183388
|
| |
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
materialized temporary with the corresponding MaterializeTemporaryExpr. This is
groundwork for providing C++11's guaranteed static initialization for global
references bound to lifetime-extended temporaries (if the initialization is a
constant expression).
In passing, fix a couple of bugs where some evaluation failures didn't trigger
diagnostics, and a rejects-valid where potential constant expression testing
would assume that it knew the dynamic type of *this and would reject programs
which relied on it being some derived type.
llvm-svn: 183093
|
| |
|
|
|
|
|
|
|
| |
* Treat _Atomic(T) as a literal type if T is a literal type.
* Evaluate expressions of this type properly.
* Fix a lurking bug where we built completely bogus ASTs for converting to
_Atomic types in C++ in some cases, caught by the tests for this change.
llvm-svn: 182541
|
| |
|
|
| |
llvm-svn: 181983
|