| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
| |
contain assignments
or similar side-effects.
llvm-svn: 100676
|
| |
|
|
|
|
|
|
| |
that protected members be used on objects of types which derive from the
naming class of the lookup. My first N attempts at this were poorly-founded,
largely because the standard is very badly worded here.
llvm-svn: 100562
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
poor (and wrong) approximation of the actual rules governing when to
build a copy and when it can be elided.
The correct implementation is actually simpler than the
approximation. When we only enumerate constructors as part of
initialization (e.g., for direct initialization or when we're copying
from a class type or one of its derived classes), we don't create a
copy. When we enumerate all conversion functions, we do create a
copy. Before, we created some extra copies and missed some
others. The new test copy-initialization.cpp shows a case where we
missed creating a (required, non-elidable) copy as part of a
user-defined conversion, which resulted in a miscompile. This commit
also fixes PR6757, where the missing copy made us reject well-formed
code in the ternary operator.
This commit also cleans up our handling of copy elision in the case
where we create an extra copy of a temporary object, which became
necessary now that we produce the right copies. The code that seeks to
find the temporary object being copied has moved into
Expr::getTemporaryObject(); it used to have two different
not-quite-the-same implementations, one in Sema and one in CodeGen.
Note that we still do not attempt to perform the named return value
optimization, so we miss copy elisions for return values and throw
expressions.
llvm-svn: 100196
|
| |
|
|
| |
llvm-svn: 100027
|
| |
|
|
|
|
|
| |
null checks, and make sure we elide null checks when accessing base class
members.
llvm-svn: 99963
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
the underlying/instantiated decl) through a lot of API, including "intermediate"
MemberExprs required for (e.g.) template instantiation. This is necessary
because of the access semantics of member accesses to using declarations:
only the base class *containing the using decl* need be accessible from the
naming class.
This allows us to complete an access-controlled selfhost, if there are no
recent regressions.
llvm-svn: 99936
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
dyn_cast) invocations for C++ and Objective-C types, declarations,
expressions, and statements. The statistics will be printed when
-print-stats is provided to Clang -cc1, with results such as:
277073 clang - Number of checks for C++ declaration nodes
13311 clang - Number of checks for C++ expression nodes
18 clang - Number of checks for C++ statement nodes
174182 clang - Number of checks for C++ type nodes
92300 clang - Number of checks for Objective-C declaration nodes
9800 clang - Number of checks for Objective-C expression nodes
7 clang - Number of checks for Objective-C statement nodes
65733 clang - Number of checks for Objective-C type nodes
The statistics are only gathered when NDEBUG is not defined, since
they introduce potentially-expensive operations into very low-level
routines (isa).
llvm-svn: 99912
|
| |
|
|
|
|
| |
objective-c methods. (radar 7418262).
llvm-svn: 99903
|
| |
|
|
|
|
|
| |
code when we are printing the name of an Objective-C method
whose class has not been declared. Fixes <rdar://problem/7495713>.
llvm-svn: 98874
|
| |
|
|
|
|
| |
a property which is not lvalue.
llvm-svn: 98848
|
| |
|
|
|
|
|
|
| |
voids in sub-expressions. Patch by Mike M!
Fixes PR4806.
llvm-svn: 98335
|
| |
|
|
|
|
|
|
|
|
| |
therefore not creating ElaboratedTypes, which are still pretty-printed
with the written tag).
Most of these testcase changes were done by script, so don't feel too
sorry for my fingers.
llvm-svn: 98149
|
| |
|
|
|
|
| |
of the class name.
llvm-svn: 97943
|
| |
|
|
|
|
| |
Fixes PR6373.
llvm-svn: 97037
|
| |
|
|
|
|
|
|
| |
This was causing buildbot breakage.
This reverts commit d46e952cc8cb8d9eed8657d9a0b267910a0f745a.
llvm-svn: 96652
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
to initializer expressions in an array allocated using ASTContext.
This plugs a memory leak when ASTContext uses a BumpPtrAllocator to
allocate memory for AST nodes.
In my mind this isn't an ideal solution; it would be nice to have
a general "vector"-like class that allocates memory using ASTContext,
but whose guts could be separated from the methods of InitListExpr
itself. I haven't gone and taken this approach yet because it isn't
clear yet if we'll eventually want an alternate solution for recylcing
memory using by InitListExprs as we are constructing the ASTs.
llvm-svn: 96642
|
| |
|
|
|
|
|
|
| |
which describes temporary objects of class type in C++. Use this to
provide a more-specific, remappable diagnostic when takin the address
of such a temporary.
llvm-svn: 96396
|
| |
|
|
|
|
| |
unused-value warnings. This is a common macro idiom.
llvm-svn: 96326
|
| |
|
|
|
|
| |
in objective-c++ mode (do it for objective-c only).
llvm-svn: 96012
|
| |
|
|
|
|
| |
associated with ASTContext. This fixes yet another leak (<rdar://problem/7639260>).
llvm-svn: 95930
|
| |
|
|
|
|
| |
complete function type of the member functions (using PredefinedExpr::ComputeName.
llvm-svn: 95887
|
| |
|
|
|
|
| |
using property dot-syntax. Fixes radar 7628953.
llvm-svn: 95838
|
| |
|
|
|
|
|
|
| |
with
out-of-line initializers as integer constant expressions. Fixes PR6206.
llvm-svn: 95463
|
| |
|
|
|
|
| |
working code, for no apparent reason.
llvm-svn: 95244
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Don't use GlobalAliases with non-0 GEPs (GNU runtime) - this was unsupported and LLVM will be generating errors if you do it soon. This also simplifies the code generated by the GNU runtime a bit.
- Make GetSelector() return a constant (GNU runtime), not a load of a store of a constant.
- Recognise @selector() expressions as valid static initialisers (as GCC does).
- Add methods to GCObjCRuntime to emit selectors as constants (needed for using @selector() expressions as constants. These need implementing for the Mac runtimes - I couldn't figure out how to do this, they seem to require a load.
- Store an ObjCMethodDecl in an ObjCSelectorExpr so that we can get at the type information for the selector. This is needed for generating typed selectors from @selector() expressions (as GCC does). Ideally, this information should be stored in the Selector, but that would be an invasive change. We should eventually add checks for common uses of @selector() expressions. Possibly adding an attribute that can be applied to method args providing the types of a selector so, for example, you'd do something like this:
- (id)performSelector: __attribute__((selector_types(id, SEL, id)))(SEL)
withObject: (id)object;
Then, any @selector() expressions passed to the method will be check to ensure that it conforms to this signature. We do this at run time on the GNU runtime already, but it would be nice to do it at compile time on all runtimes.
- Made @selector() expressions emit type info if available and the runtime supports it.
Someone more familiar with the Mac runtime needs to implement the GetConstantSelector() function in CGObjCMac. This currently just assert()s.
llvm-svn: 95189
|
| |
|
|
|
|
| |
appropriately. Call out a few missing cases in the expression mangler.
llvm-svn: 95176
|
| |
|
|
|
|
| |
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
|
| |
|
|
| |
llvm-svn: 94963
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
requires a temporary. Previously, we were building an initialization
sequence that bound to the bit-field as if it were a real lvalue. Note
that we previously (and still) diagnose binding of non-const
references to bit-fields, as we should.
There's no real way to test that this code is correct, since reference
binding does not *currently* have any representation in the AST. This
fix should make it easier for that to happen, so I've verified this
fix with...
Added InitializationSequence::dump(), to print an initialization
sequence for debugging purposes.
llvm-svn: 94826
|
| |
|
|
| |
llvm-svn: 94791
|
| |
|
|
|
|
|
|
| |
references a const variable of integral type, the initializer may be
in a different declaration than the one that name-lookup saw. Find the
initializer anyway. Fixes PR6045.
llvm-svn: 93514
|
| |
|
|
|
|
| |
ASTContext. Fixes <rdar://problem/7495428>.
llvm-svn: 92867
|
| |
|
|
|
|
|
|
| |
caught several cases where we were not doing the right thing. I'm
not completely sure all cases are being handled correctly, but this should
be an improvement.
llvm-svn: 92281
|
| |
|
|
|
|
| |
functions in __PRETTY_FUNCTION__ predefined expressions.
llvm-svn: 92171
|
| |
|
|
| |
llvm-svn: 92095
|
| |
|
|
| |
llvm-svn: 91807
|
| |
|
|
| |
llvm-svn: 91803
|
| |
|
|
|
|
| |
is an lvalue. Fixes PR5787.
llvm-svn: 91765
|
| |
|
|
|
|
| |
using objective-c property. (fixes radar 7449707)
llvm-svn: 91474
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
- During instantiation, drop default arguments from constructor and
call expressions; they'll be recomputed anyway, and we don't want
to instantiate them twice.
- Rewrote the instantiation of variable initializers to cope with
non-dependent forms properly.
Together, these fix a handful of problems I introduced with the switch
to always rebuild expressions from the source code "as written."
llvm-svn: 91315
|
| |
|
|
|
|
| |
no extra safety anyway.
llvm-svn: 91207
|
| |
|
|
|
|
| |
(fixes radar 7465023).
llvm-svn: 91171
|
| |
|
|
|
|
| |
(fixes radar 7457534).
llvm-svn: 90995
|
| |
|
|
| |
llvm-svn: 90902
|
| |
|
|
|
|
| |
Template instantiation can re-use DeclRefExprs.
llvm-svn: 90848
|
| |
|
|
|
|
| |
generating a predefined expr for them.
llvm-svn: 90725
|
| |
|
|
| |
llvm-svn: 90549
|
| |
|
|
|
|
| |
don't infinitely recurse for cases we can't evaluate.
llvm-svn: 90480
|
| |
|
|
| |
llvm-svn: 90313
|
| |
|
|
|
|
|
|
| |
Create a new UnresolvedMemberExpr for these lookups. Assorted hackery
around qualified member expressions; this will all go away when we
implement the correct (i.e. extremely delayed) implicit-member semantics.
llvm-svn: 90161
|