- Mar 28, 2009
-
-
Chris Lattner authored
pointer. Its purpose in life is to be a glorified void*, but which does not implicitly convert to void* or other OpaquePtr's with a different UID. Introduce Action::DeclPtrTy which is a typedef for OpaquePtr<0>. Change the entire parser/sema interface to use DeclPtrTy instead of DeclTy*. This makes the C++ compiler enforce that these aren't convertible to other opaque types. We should also convert ExprTy, StmtTy, TypeTy, AttrTy, BaseTy, etc, but I don't plan to do that in the short term. The one outstanding known problem with this patch is that we lose the bitmangling optimization where ActionResult<DeclPtrTy> doesn't know how to bitmangle the success bit into the low bit of DeclPtrTy. I will rectify this with a subsequent patch. llvm-svn: 67952
-
Eli Friedman authored
LHS type and the computation result type; this encodes information into the AST which is otherwise non-obvious. Fix Sema to always come up with the right answer for both of these types. Fix IRGen and the analyzer to account for these changes. This fixes PR2601. The approach is inspired by PR2601 comment 2. Note that this changes real *= complex in CodeGen from a silent miscompilation to an explicit error. I'm not really sure that the analyzer changes are correct, or how to test them... someone more familiar with the analyzer should check those changes. llvm-svn: 67889
-
- Mar 27, 2009
-
-
Douglas Gregor authored
to a function or function pointer, it's probably because the user forgot to put in parentheses () to call the function. llvm-svn: 67826
-
rdar://6719156Chris Lattner authored
by changing blocks from being disabled in the parser to being disabled in Sema. llvm-svn: 67816
-
Douglas Gregor authored
llvm-svn: 67800
-
Douglas Gregor authored
uniqued representation that should both save some memory and make it far easier to properly build canonical types for types involving dependent nested-name-specifiers, e.g., "typename T::Nested::type". This approach will greatly simplify the representation of CXXScopeSpec. That'll be next. llvm-svn: 67799
-
- Mar 26, 2009
-
-
rdar://problem/6697053Steve Naroff authored
Treat @package the same as @public. The documentation for @package says it is analogous to private_extern for variables/functions. Fully implementing this requires some kind of linker support (so access is denied to code outside the classes executable image). I don't believe GCC fully implements this semantic. Will discuss with Fariborz offline. llvm-svn: 67755
-
- Mar 24, 2009
-
-
Douglas Gregor authored
types; add another use of RequireCompleteType. llvm-svn: 67644
-
Douglas Gregor authored
incomplete types. RequireCompleteType is needed when the type may be completed by instantiating a template. llvm-svn: 67643
-
- Mar 23, 2009
-
-
Eli Friedman authored
llvm-svn: 67497
-
Eli Friedman authored
incompatibilities in assignments from other pointer incompatibilities. Based off of the patch in PR3342. (This doesn't implement -Wno-pointer-sign, but I don't know the driver code very well.) llvm-svn: 67494
-
Eli Friedman authored
isObjCObjectPointerType to work with qualified types. Adjust test for changes. If the SemaExpr changes are wrong or break existing code, feel free to delete the "ExprTy.addConst();" line and revert my changes to test/Sema/block-literal.c. llvm-svn: 67489
-
- Mar 22, 2009
-
-
Eli Friedman authored
llvm-svn: 67485
-
- Mar 21, 2009
-
-
Douglas Gregor authored
simplify the parsing and action interface for designated initializers. llvm-svn: 67415
-
- Mar 20, 2009
-
-
Ted Kremenek authored
llvm-svn: 67394
-
-
- Mar 19, 2009
-
-
Fariborz Jahanian authored
dot-syntax expression after earching the list of protocols in the qualified-id, must keep searching the protocol list of each of the protocols in the list. llvm-svn: 67314
-
Douglas Gregor authored
dependent qualified-ids such as Fibonacci<N - 1>::value where N is a template parameter. These references are "unresolved" because the name is dependent and, therefore, cannot be resolved to a declaration node (as we would do for a DeclRefExpr or QualifiedDeclRefExpr). UnresolvedDeclRefExprs instantiate to DeclRefExprs, QualifiedDeclRefExprs, etc. Also, be a bit more careful about keeping only a single set of specializations for a class template, and instantiating from the definition of that template rather than a previous declaration. In general, we need a better solution for this for all TagDecls, because it's too easy to accidentally look at a declaration that isn't the definition. We can now process a simple Fibonacci computation described as a template metaprogram. llvm-svn: 67308
-
Douglas Gregor authored
QualifiedNameType and QualifiedDeclRefExpr. We now keep track of the exact nested-name-specifier spelling for a QualifiedDeclRefExpr, and use that spelling when printing ASTs. This fixes PR3493. llvm-svn: 67283
-
Douglas Gregor authored
qualified name, e.g., foo::x so that we retain the nested-name-specifier as written in the source code and can reproduce that qualified name when printing the types back (e.g., in diagnostics). This is PR3493, which won't be complete until finished the other tasks mentioned near the end of this commit. The parser's representation of nested-name-specifiers, CXXScopeSpec, is now a bit fatter, because it needs to contain the scopes that precede each '::' and keep track of whether the global scoping operator '::' was at the beginning. For example, we need to keep track of the leading '::', 'foo', and 'bar' in ::foo::bar::x The Action's CXXScopeTy * is no longer a DeclContext *. It's now the opaque version of the new NestedNameSpecifier, which contains a single component of a nested-name-specifier (either a DeclContext * or a Type *, bitmangled). The new sugar type QualifiedNameType composes a sequence of NestedNameSpecifiers with a representation of the type we're actually referring to. At present, we only build QualifiedNameType nodes within Sema::getTypeName. This will be extended to other type-constructing actions (e.g., ActOnClassTemplateId). Also on the way: QualifiedDeclRefExprs will also store a sequence of NestedNameSpecifiers, so that we can print out the property nested-name-specifier. I expect to also use this for handling dependent names like Fibonacci<I - 1>::value. llvm-svn: 67265
-
- Mar 18, 2009
-
-
Douglas Gregor authored
Type pointer. This allows our nested-name-specifiers to retain more information about the actual spelling (e.g., which typedef did the user name, or what exact template arguments were used in the template-id?). It will also allow us to have dependent nested-name-specifiers that don't map to any DeclContext. llvm-svn: 67140
-
- Mar 15, 2009
-
-
Sebastian Redl authored
Convert a bunch of actions to smart pointers, and also bring PrintParserCallbacks a bit more in line with reality. llvm-svn: 67029
-
- Mar 14, 2009
-
-
Douglas Gregor authored
always, refactored the existing logic to tease apart the parser action and the semantic analysis shared by the parser and template instantiation. llvm-svn: 66987
-
- Mar 13, 2009
-
-
Douglas Gregor authored
- C++ function casts, e.g., T(foo) - sizeof(), alignof() More importantly, this allows us to verify that we're performing overload resolution during template instantiation, with argument-dependent lookup and the "cached" results of name lookup from the template definition. llvm-svn: 66947
-
Douglas Gregor authored
instantiation for binary operators. This change moves most of the operator-overloading code from the parser action ActOnBinOp to a new, parser-independent semantic checking routine CreateOverloadedBinOp. Of particular importance is the fact that CreateOverloadedBinOp does *not* perform any name lookup based on the current parsing context (it doesn't take a Scope*), since it has to be usable during template instantiation, when there is no scope information. Rather, it takes a pre-computed set of functions that are visible from the context or via argument-dependent lookup, and adds to that set any member operators and built-in operator candidates. The set of functions is computed in the parser action ActOnBinOp based on the current context (both operator name lookup and argument-dependent lookup). Within a template, the set computed by ActOnBinOp is saved within the type-dependent AST node and is augmented with the results of argument-dependent name lookup at instantiation time (see TemplateExprInstantiator::VisitCXXOperatorCallExpr). Sadly, we can't fully test this yet. I'll follow up with template instantiation for sizeof so that the real fun can begin. llvm-svn: 66923
-
rdar://problem/6675489Steve Naroff authored
Also changed BlockDecl API to be more consistent (wrt FunctionDecl). llvm-svn: 66904
-
rdar://problem/6451399Steve Naroff authored
This solution is much simpler (and doesn't add any per-scope overhead, which concerned Chris). The only downside is the LabelMap is now declared in two places (Sema and BlockSemaInfo). My original fix tried to unify the LabelMap in "Scope" (which would support nested functions in general). In any event, this fixes the bug given the current language definition. If/when we decide to support GCC style nested functions, this will need to be tweaked. llvm-svn: 66896
-
Steve Naroff authored
Remove ActiveScope (revert http://llvm.org/viewvc/llvm-project?view=rev&revision=65694 and http://llvm.org/viewvc/llvm-project?view=rev&revision=66741). Will replace with something better today... llvm-svn: 66893
-
Douglas Gregor authored
C++ templates. In particular, keep track of the overloaded operators that are visible from the template definition, so that they can be merged with those operators visible via argument-dependent lookup at instantiation time. Refactored the lookup routines for argument-dependent lookup and for operator name lookup, so they can be called without immediately adding the results to an overload set. Instantiation of these expressions is completely wrong. I'll work on that next. llvm-svn: 66851
-
- Mar 12, 2009
-
-
Douglas Gregor authored
llvm-svn: 66837
-
Douglas Gregor authored
should fix the largest problem in <rdar://problem/6669847>. llvm-svn: 66741
-
- Mar 11, 2009
-
-
Douglas Gregor authored
llvm-svn: 66696
-
-
Douglas Gregor authored
template. More importantly, start to sort out the issues regarding complete types and nested-name-specifiers, especially the question of: when do we instantiate a class template specialization that occurs to the left of a '::' in a nested-name-specifier? llvm-svn: 66662
-
-
-
- Mar 10, 2009
-
-
Steve Naroff authored
llvm-svn: 66551
-
- Mar 09, 2009
-
-
Steve Naroff authored
This fixes <rdar://problem/6496506> Implement class setter/getter for properties. llvm-svn: 66465
-
Douglas Gregor authored
Rename DiagnoseIncompleteType to RequireCompleteType, and update the documentation to reflect the fact that we can instantiate templates here llvm-svn: 66421
-
Chris Lattner authored
llvm-svn: 66416
-