Skip to content
  1. Oct 18, 2009
    • Daniel Dunbar's avatar
      2c422dc9
    • John McCall's avatar
      When performing template-substitution into a type, don't just replace the · cebee16b
      John McCall authored
      TemplateTypeParmType with the substituted type directly;  instead, replace it
      with a SubstTemplateTypeParmType which will note that the type was originally
      written as a template type parameter.  This makes it reasonable to preserve
      source information even through template substitution.
      
      Also define the new SubstTemplateTypeParmType class, obviously.
      
      For consistency with current behavior, we stringize these types as if they
      were the underlying type.  I'm not sure this is the right thing to do.
      At any rate, I paled at adding yet another clause to the don't-desugar 'if'
      statement, so I extracted a function to do it.  The new function also does
      The Right Thing more often, I think:  e.g. if we have a chain of typedefs
      leading to a vector type, we will now desugar all but the last one.
      
      llvm-svn: 84412
      cebee16b
    • John McCall's avatar
      Clone the full Type hierarchy into the TypeLoc hierarchy. Normalize · 1700197e
      John McCall authored
      TypeLoc class names to be $(Type classname)Loc.  Rewrite the visitor.
      Provide skeleton implementations for all the new TypeLocs.
      
      Handle all cases in PCH.  Handle a few more cases when inserting
      location information in SemaType.
      
      It should be extremely straightforward to add new location information
      to existing TypeLoc objects now.
      
      llvm-svn: 84386
      1700197e
    • Daniel Dunbar's avatar
      Switch to llvm::HashString. · f8502d50
      Daniel Dunbar authored
      llvm-svn: 84375
      f8502d50
  2. Oct 17, 2009
    • Douglas Gregor's avatar
      Merge the "types" and "declarations" blocks in the precompiled header · 12bfa385
      Douglas Gregor authored
      format, so that we don't end up with multiple declaration and types
      blocks. Also, fix a few obscure bugs with PCH loading and generation:
      
        - If the DeclIDs DenseMap reallocates while we are writing a
          declaration (due to recursively writing other declarations), we
          could end up writing a bad ID to ExternalDefinitions.
        - When loading an ArrayLoc (part of DeclaratorInfo), we need to set
          the size expression to NULL if no size expression was provided.
      
      PCH -> AST rewriting is still partly broken, unfortunately.
      
      llvm-svn: 84293
      12bfa385
  3. Oct 16, 2009
  4. Oct 05, 2009
  5. Sep 29, 2009
  6. Sep 24, 2009
  7. Sep 22, 2009
  8. Sep 21, 2009
  9. Sep 17, 2009
    • Daniel Dunbar's avatar
      PCH: When deserializing an explicit "external definition", don't pass it to... · 865c2a7f
      Daniel Dunbar authored
      PCH: When deserializing an explicit "external definition", don't pass it to HandleTopLevelDecl -- this is already being done inside the reader.
      
      This is something of a hack, since whether the reader actually did this depends on the "isConsumerInterestedIn" predicate. I think we need to rework how this works, but I need to discuss with Doug.
      
      llvm-svn: 82111
      865c2a7f
  10. Sep 09, 2009
  11. Sep 08, 2009
  12. Sep 05, 2009
    • John McCall's avatar
      Basic support for representing elaborated type specifiers · fcc33b07
      John McCall authored
      directly in the AST.  The current thinking is to create these
      only in C++ mode for efficiency.  But for now, they're not being
      created at all; patch to follow.
      
      This will let us do things like verify that tags match during
      template instantation, as well as signal that an elaborated type
      specifier was used for clients that actually care.
      
      Optimally, the TypeLoc hierarchy should be adjusted to carry tag
      location information as well.
      
      llvm-svn: 81057
      fcc33b07
  13. Sep 03, 2009
  14. Aug 24, 2009
  15. Aug 23, 2009
  16. Aug 21, 2009
  17. Aug 05, 2009
  18. Jul 29, 2009
    • Ted Kremenek's avatar
      Change uses of: · c23c7e6a
      Ted Kremenek authored
        Type::getAsReferenceType() -> Type::getAs<ReferenceType>()
        Type::getAsRecordType() -> Type::getAs<RecordType>()
        Type::getAsPointerType() -> Type::getAs<PointerType>()
        Type::getAsBlockPointerType() -> Type::getAs<BlockPointerType>()
        Type::getAsLValueReferenceType() -> Type::getAs<LValueReferenceType>()
        Type::getAsRValueReferenceType() -> Type::getAs<RValueReferenceType>()
        Type::getAsMemberPointerType() -> Type::getAs<MemberPointerType>()
        Type::getAsReferenceType() -> Type::getAs<ReferenceType>()
        Type::getAsTagType() -> Type::getAs<TagType>()
        
      And remove Type::getAsReferenceType(), etc.
      
      This change is similar to one I made a couple weeks ago, but that was partly
      reverted pending some additional design discussion. With Doug's pending smart
      pointer changes for Types, it seemed natural to take this approach.
      
      llvm-svn: 77510
      c23c7e6a
  19. Jul 28, 2009
  20. Jul 21, 2009
  21. Jul 18, 2009
  22. Jul 17, 2009
  23. Jul 15, 2009
    • Steve Naroff's avatar
      Implement the ObjC pseudo built-in types as clang "BuiltinType's". I say... · 1329fa0e
      Steve Naroff authored
      Implement the ObjC pseudo built-in types as clang "BuiltinType's". I say pseudo built-in types, since Sema still injects a typedef for recognition (i.e. they aren't truly built-ins from a parser perspective).
      
      This removes the static data/methods on ObjCObjectPointerType while preserving the nice API (no need to fiddle with ASTContext:-).
      
      This patch also adds Type::isObjCBuiltinType().
      
      This should be the last fairly large patch related to recrafting the ObjC type system. The follow-on patches should be fairly small.
      
      llvm-svn: 75808
      1329fa0e
  24. Jul 14, 2009
  25. Jul 11, 2009
    • Steve Naroff's avatar
      This patch includes a conceptually simple, but very intrusive/pervasive change. · 7cae42b0
      Steve Naroff authored
      The idea is to segregate Objective-C "object" pointers from general C pointers (utilizing the recently added ObjCObjectPointerType). The fun starts in Sema::GetTypeForDeclarator(), where "SomeInterface *" is now represented by a single AST node (rather than a PointerType whose Pointee is an ObjCInterfaceType). Since a significant amount of code assumed ObjC object pointers where based on C pointers/structs, this patch is very tedious. It should also explain why it is hard to accomplish this in smaller, self-contained patches.
      
      This patch does most of the "heavy lifting" related to moving from PointerType->ObjCObjectPointerType. It doesn't include all potential "cleanups". The good news is additional cleanups can be done later (some are noted in the code). This patch is so large that I didn't want to include any changes that are purely aesthetic.
      
      By making the ObjC types truly built-in, they are much easier to work with (and require fewer "hacks"). For example, there is no need for ASTContext::isObjCIdStructType() or ASTContext::isObjCClassStructType()! We believe this change (and the follow-up cleanups) will pay dividends over time. 
      
      Given the amount of code change, I do expect some fallout from this change (though it does pass all of the clang tests). If you notice any problems, please let us know asap! Thanks.
      
      llvm-svn: 75314
      7cae42b0
  26. Jul 07, 2009
    • Douglas Gregor's avatar
      Make ASTContext explicitly keep track of the declaration for the C · 27821cee
      Douglas Gregor authored
      FILE type, rather than using name lookup to find FILE within the
      translation unit. Within precompiled headers, FILE is treated as yet
      another "special type" (like __builtin_va_list).
      
      This change should provide a performance improvement (not verified),
      since the lookup into the translation unit declaration 
      forces the (otherwise unneeded) construction of a large hash table.
      More importantly, with precompiled headers, the construction
      of that table requires deserializing most of the top-level
      declarations from the precompiled header, which are then unused.
      
      Fixes PR 4509.
      
      llvm-svn: 74911
      27821cee
    • Douglas Gregor's avatar
      Introduce the notion of "Relocatable" precompiled headers, which are built · 0086a5a3
      Douglas Gregor authored
      with a particular system root directory and can be used with a different
      system root directory when the headers it depends on have been installed.
      Relocatable precompiled headers rewrite the file names of the headers used
      when generating the PCH file into the corresponding file names of the 
      headers available when using the PCH file.
      
      Addresses <rdar://problem/7001604>.
      
      llvm-svn: 74885
      0086a5a3
  27. Jul 06, 2009
  28. Jul 02, 2009
    • Douglas Gregor's avatar
      Add support for retrieving the Doxygen comment associated with a given · c6d5edd2
      Douglas Gregor authored
      declaration in the AST. 
      
      The new ASTContext::getCommentForDecl function searches for a comment
      that is attached to the given declaration, and returns that comment, 
      which may be composed of several comment blocks.
      
      Comments are always available in an AST. However, to avoid harming
      performance, we don't actually parse the comments. Rather, we keep the
      source ranges of all of the comments within a large, sorted vector,
      then lazily extract comments via a binary search in that vector only
      when needed (which never occurs in a "normal" compile).
      
      Comments are written to a precompiled header/AST file as a blob of
      source ranges. That blob is only lazily loaded when one requests a
      comment for a declaration (this never occurs in a "normal" compile). 
      
      The indexer testbed now supports comment extraction. When the
      -point-at location points to a declaration with a Doxygen-style
      comment, the indexer testbed prints the associated comment
      block(s). See test/Index/comments.c for an example.
      
      Some notes:
        - We don't actually attempt to parse the comment blocks themselves,
        beyond identifying them as Doxygen comment blocks to associate them
        with a declaration.
        - We won't find comment blocks that aren't adjacent to the
        declaration, because we start our search based on the location of
        the declaration.
        - We don't go through the necessary hops to find, for example,
        whether some redeclaration of a declaration has comments when our
        current declaration does not. Similarly, we don't attempt to
        associate a \param Foo marker in a function body comment with the
        parameter named Foo (although that is certainly possible).
        - Verification of my "no performance impact" claims is still "to be
        done".
      
      llvm-svn: 74704
      c6d5edd2
  29. Jun 26, 2009
Loading