| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| |
|
|
|
|
| |
the right type. It turns out that the code was already doing this.
llvm-svn: 103238
|
| |
|
|
|
|
| |
like a good idea at the time.
llvm-svn: 103237
|
| |
|
|
|
|
|
|
| |
IEEE-754, e.g.,
NAN != NAN ? 1 : 0 should return 1. Also fix the case for complex.
llvm-svn: 102598
|
| |
|
|
|
|
|
|
| |
classes, since we only warn (not error) on offsetof() for non-POD
types. We store the base path within the OffsetOfExpr itself, then
evaluate the offsets within the constant evaluator.
llvm-svn: 102571
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Amadini.
This change introduces a new expression node type, OffsetOfExpr, that
describes __builtin_offsetof. Previously, __builtin_offsetof was
implemented using a unary operator whose subexpression involved
various synthesized array-subscript and member-reference expressions,
which was ugly and made it very hard to instantiate as a
template. OffsetOfExpr represents the AST more faithfully, with proper
type source information and a more compact representation.
OffsetOfExpr also has support for dependent __builtin_offsetof
expressions; it can be value-dependent, but will never be
type-dependent (like sizeof or alignof). This commit introduces
template instantiation for __builtin_offsetof as well.
There are two major caveats to this patch:
1) CodeGen cannot handle the case where __builtin_offsetof is not a
constant expression, so it produces an error. So, to avoid
regressing in C, we retain the old UnaryOperator-based
__builtin_offsetof implementation in C while using the shiny new
OffsetOfExpr implementation in C++. The old implementation can go
away once we have proper CodeGen support for this case, which we
expect won't cause much trouble in C++.
2) __builtin_offsetof doesn't work well with non-POD class types,
particularly when the designated field is found within a base
class. I will address this in a subsequent patch.
Fixes PR5880 and a bunch of assertions when building Boost.Python
tests.
llvm-svn: 102542
|
| |
|
|
|
|
|
|
| |
thing. Audit all uses of Type::isStructure(), changing those calls to
isStructureOrClassType() as needed (which is alsmost
everywhere). Fixes the remaining failure in Boost.Utility/Swap.
llvm-svn: 102386
|
| |
|
|
| |
llvm-svn: 101912
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
this caused us to codegen dead globals like this:
struct foo { int a; int b; };
static struct foo fooarray[] = {
{1, 2},
{4},
};
llvm-svn: 101150
|
| |
|
|
|
|
|
|
| |
expression computation in the wrong bit-width, and end up generating a totally
bogus array reference (_g0+8589934546).
- This showed up on Prolangs/cdecl.
llvm-svn: 99042
|
| |
|
|
|
|
|
|
| |
evaluation of __builtin_nan*. Most of the work to make this work is in LLVM.
Fixes <rdar://problem/7696712> and part of PR 5255.
llvm-svn: 97383
|
| |
|
|
| |
llvm-svn: 96054
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
side-effect of always folding the expression to the default argument of the parameter. For example:
void f(int a = 10) {
return a;
}
would always return 10, regardless of the passed in argument.
This fixes another 600 test failures. We're now down to only 137 failures!
llvm-svn: 95262
|
| |
|
|
|
|
| |
definition. With that in mind, rename getDefinition to getAnyInitializer (to distinguish it from getInit) and reimplement it in terms of isThisDeclarationADefinition. Update all code to use this new function.
llvm-svn: 94999
|
| |
|
|
|
|
|
| |
now that the "InBytes" part of the name is implied by the return type, rename
it to getDeclAlign().
llvm-svn: 94681
|
| |
|
|
|
|
| |
constant Objective-C strings.
llvm-svn: 94274
|
| |
|
|
| |
llvm-svn: 93942
|
| |
|
|
|
|
| |
the LValue-related methods of APValue out of line to avoid header file leaching.
llvm-svn: 93512
|
| |
|
|
|
|
|
|
|
|
| |
"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
|
| |
|
|
|
|
|
| |
try to evaluate an expression as a constant boolean condition. This has
the same intended semantics as used in folding conditional operators.
llvm-svn: 92805
|
| |
|
|
|
|
| |
any side-effects.
llvm-svn: 92453
|
| |
|
|
|
|
| |
it doesn't know how to fold, like derived-to-base casts.
llvm-svn: 92173
|
| |
|
|
| |
llvm-svn: 92162
|
| |
|
|
|
|
|
| |
only takes a boolean second argument now. Update tests accordingly.
Currently the builtin still accepts the full range for compatibility.
llvm-svn: 91983
|
| |
|
|
|
|
| |
functionality change.
llvm-svn: 91118
|
| |
|
|
|
|
| |
recently introduced crash.
llvm-svn: 91070
|
| |
|
|
| |
llvm-svn: 90521
|
| |
|
|
|
|
| |
don't infinitely recurse for cases we can't evaluate.
llvm-svn: 90480
|
| |
|
|
| |
llvm-svn: 90043
|
| |
|
|
|
|
|
|
| |
static member constants. No significant visible difference at the moment
because it conservatively assumes the base has side effects. I'm planning to
use this for CodeGen.
llvm-svn: 89738
|
| |
|
|
|
|
| |
methods. This fixes a crash when writing sizeof(Incomplete&), and lets ASTContext's methods do the right thing for CodeGen, which fixes PR5590.
llvm-svn: 89668
|
| |
|
|
|
|
| |
PR5449.
llvm-svn: 88885
|
| |
|
|
|
|
| |
initialization before main. Fixes pr5396.
llvm-svn: 86145
|
| |
|
|
|
|
|
| |
type to look at the volatile specifier. I found these all from just
hand auditing the code.
llvm-svn: 85967
|
| |
|
|
| |
llvm-svn: 85931
|
| |
|
|
|
|
|
|
|
| |
integral constant expression, make sure to find where the initializer
was provided---inside or outside the class definition---since that can
affect whether we have an integral constant expression (and, we need
to see the initializer itself).
llvm-svn: 85741
|
| |
|
|
| |
llvm-svn: 85538
|
| |
|
|
| |
llvm-svn: 85526
|
| |
|
|
| |
llvm-svn: 85453
|
| |
|
|
|
|
|
|
| |
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" :)
llvm-svn: 85446
|
| |
|
|
|
|
| |
that don't have sizes.
llvm-svn: 85435
|
| |
|
|
|
|
|
|
|
|
| |
side-effects up front, as when we switch to the llvm intrinsic call
for __builtin_object_size later, it will have two evaluations.
We also finish off the intrinsic version of the code so we can just
turn it on once llvm has the intrinsic.
llvm-svn: 85324
|
| |
|
|
| |
llvm-svn: 85174
|
| |
|
|
|
|
| |
to clamp at 0 bytes left. WIP.
llvm-svn: 85157
|
| |
|
|
| |
llvm-svn: 85140
|
| |
|
|
| |
llvm-svn: 85136
|
| |
|
|
| |
llvm-svn: 83267
|
| |
|
|
|
|
|
|
| |
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.
llvm-svn: 82705
|
| |
|
|
|
|
| |
This implements PR5034 and rdar://6836445.
llvm-svn: 82614
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
llvm-svn: 82501
|
| |
|
|
| |
llvm-svn: 81835
|