Skip to content
  1. Sep 08, 2008
  2. Sep 07, 2008
  3. Sep 06, 2008
  4. Sep 05, 2008
    • Ted Kremenek's avatar
      Add comment back that Argiris pointed out that I mistakenly removed (the... · 6ddf53e4
      Ted Kremenek authored
      Add comment back that Argiris pointed out that I mistakenly removed (the comments below it were stale, so I accidently removed the whole thing).
      
      llvm-svn: 55841
      6ddf53e4
    • Ted Kremenek's avatar
      Change struct forward declarations and definitions to use unique RecordDecls,... · 21475702
      Ted Kremenek authored
      Change struct forward declarations and definitions to use unique RecordDecls, as opposed to creating a single RecordDecl and reusing it.
      
      This change effects both RecordDecls and CXXRecordDecls, but does not effect EnumDecls (yet).
      
      The motivation of this patch is as follows:
      - Capture more source information, necessary for refactoring/rewriting clients.
      
      - Pave the way to resolve ownership issues with RecordDecls with the forthcoming
        addition of DeclGroups.
      
      Current caveats:
      - Until DeclGroups are in place, we will leak RecordDecls not explicitly
        referenced by the AST.  For example:
      
          typedef struct { ... } x;  
      
        The RecordDecl for the struct will be leaked because the TypedefDecl doesn't
        refer to it.  This will be solved with DeclGroups.
        
      - This patch also (temporarily) breaks CodeGen.  More below.
      
      High-level changes:
      - As before, TagType still refers to a TagDecl, but it doesn't own it.  When
        a struct/union/class is first referenced, a RecordType and RecordDecl are
        created for it, and the RecordType refers to that RecordDecl.  Later, if
        a new RecordDecl is created, the pointer to a RecordDecl in RecordType is
        updated to point to the RecordDecl that defines the struct/union/class.
      
      - TagDecl and RecordDecl now how a method 'getDefinition()' to return the
        TagDecl*/RecordDecl* that refers to the TagDecl* that defines a particular
        enum/struct/class/union. This is useful from going from a RecordDecl* that
        defines a forward declaration to the RecordDecl* that provides the actual
        definition. Note that this also works for EnumDecls, except that in this case
        there is no distinction between forward declarations and definitions (yet).
      
      - Clients should no longer assume that 'isDefinition()' returns true from a
        RecordDecl if the corresponding struct/union/class has been defined.
        isDefinition() only returns true if a particular RecordDecl is the defining
        Decl. Use 'getDefinition()' instead to determine if a struct has been defined.
      
      - The main changes to Sema happen in ActOnTag. To make the changes more
        incremental, I split off the processing of enums and structs et al into two
        code paths. Enums use the original code path (which is in ActOnTag) and
        structs use the ActOnTagStruct. Eventually the two code paths will be merged,
        but the idea was to preserve the original logic both for comparison and not to
        change the logic for both enums and structs all at once.
      
      - There is NO CHAINING of RecordDecls for the same RecordType. All RecordDecls
        that correspond to the same type simply have a pointer to that type. If we
        need to figure out what are all the RecordDecls for a given type we can build
        a backmap.
      
      - The diff in CXXRecordDecl.[cpp,h] is actually very small; it just mimics the
        changes to RecordDecl. For some reason 'svn' marks the entire file as changed.
      
      Why is CodeGen broken:
      - Codegen assumes that there is an equivalence between RecordDecl* and
        RecordType*. This was true before because we only created one RecordDecl* for
        a given RecordType*, but it is no longer true. I believe this shouldn't be too
        hard to change, but the patch was big enough as it is.
        
      I have tested this patch on both the clang test suite, and by running the static analyzer over Postgresql and a large Apple-internal project (mix of Objective-C and C).  
      
      llvm-svn: 55839
      21475702
    • Argyrios Kyrtzidis's avatar
      Support "typeof unary-expression" (GNU C++ extension). · 2545aeb7
      Argyrios Kyrtzidis authored
      llvm-svn: 55833
      2545aeb7
    • Argyrios Kyrtzidis's avatar
      Set different header search paths for the Windows platform. · 971dd236
      Argyrios Kyrtzidis authored
      llvm-svn: 55832
      971dd236
    • Argyrios Kyrtzidis's avatar
      Add header search paths for Mingw32 (GCC version 4). · 624cab87
      Argyrios Kyrtzidis authored
      llvm-svn: 55830
      624cab87
    • Argyrios Kyrtzidis's avatar
      Line endings: CRLF -> LF · 91c3f526
      Argyrios Kyrtzidis authored
      llvm-svn: 55829
      91c3f526
    • Ted Kremenek's avatar
      Remove stale comments. · cb363253
      Ted Kremenek authored
      llvm-svn: 55822
      cb363253
    • Ted Kremenek's avatar
      Remove "NextDecl" from RecordDecl. This change touches many files that where... · 47923c7e
      Ted Kremenek authored
      Remove "NextDecl" from RecordDecl.  This change touches many files that where RecordDecl or CXXRecordDecl was constructed, always with an argument of 'NULL' for the previous declaration.
      
      The motivation behind this change is that chaining the RecordDecls is simply unnecessary.  Once we create multiple RecordDecls for the same struct/union/class, clients that care about all the declarations of the same struct can build a back map by seeing which Decls refer to the same RecordType.
      
      llvm-svn: 55821
      47923c7e
    • Daniel Dunbar's avatar
      Set sext/zext on function result. · 2ffee610
      Daniel Dunbar authored
       - <rdar://problem/6156739>
      
      llvm-svn: 55815
      2ffee610
    • Daniel Dunbar's avatar
      Set function attributes (sext, zext, etc.) on Objective-C methods. · 449a339f
      Daniel Dunbar authored
      llvm-svn: 55812
      449a339f
  5. Sep 04, 2008
  6. Sep 03, 2008
    • Daniel Dunbar's avatar
      Set register storage class correctly for function parameters. · 0ff4192f
      Daniel Dunbar authored
       - PR2730
      
      llvm-svn: 55739
      0ff4192f
    • Daniel Dunbar's avatar
      Add __builtin_object_size support. · b0d34c8e
      Daniel Dunbar authored
       - Currently CodeGen always returns a conservative value for this (-1
         or 0 depending on the context).
      
      llvm-svn: 55735
      b0d34c8e
    • Steve Naroff's avatar
      Add semantic analysis for "blocks". · c540d669
      Steve Naroff authored
      Highlights...
      
      - 4 new AST nodes, BlockExpr, BlockStmtExpr, BlockExprExpr, BlockDeclRefExpr.
      - Sema::ActOnBlockStart(), ActOnBlockError(), ActOnBlockStmtExpr(), ActOnBlockExprExpr(), ActOnBlockReturnStmt().
      
      Next steps...
      
      - hack Sema::ActOnIdentifierExpr() to deal with block decl refs.
      - add attribute handler for byref decls.
      - add test cases.
      
      llvm-svn: 55710
      c540d669
    • Ted Kremenek's avatar
      Fix 80 col violations. · 3060d98a
      Ted Kremenek authored
      llvm-svn: 55707
      3060d98a
    • Daniel Dunbar's avatar
      Improve type-checking of ?: for Objective-C types. · de1ec9cd
      Daniel Dunbar authored
       - Allow any Objective-C object types to devolve to type id in a ?:
         expression. This matches gcc behavior more closely.
      
      llvm-svn: 55705
      de1ec9cd
    • Ted Kremenek's avatar
      Store: (static analyzer) · 1b9e1039
      Ted Kremenek authored
      - Change definition of store::Region and store::Binding (once again) to make
        them real classes that just wrap pointers. This makes them more strictly
        typed, and allows specific implementations of Regions/Bindings to just
        subclass them.
      - minor renamings to RegionExtent and its subclasses
      - added a bunch of doxygen comments
      
      StoreManager: (static analyzer)
      - added 'iterBindings', an iteration method for iterating over the bindings of a
        store. It that takes a callback object (acting like a poor man's closure).
      - added 'getRVal' version for store::Binding. Will potentially phase the other
        versions of GetRVal in StoreManager out.
      - reimplemented 'getBindings' to be non-virtual and to use 'iterBindings'
      
      BasicStoreManager: (static analyzer)
      - implemented 'iterBindings' for BasicStoreManager
      
      llvm-svn: 55688
      1b9e1039
    • Daniel Dunbar's avatar
      Restore Objective-C dot-syntax access of methods. · ef89086c
      Daniel Dunbar authored
       - Now also searches for correct setter method.
       - There are still some issues regarding validation of the setter
         method and access of read-only properties.
      
      llvm-svn: 55686
      ef89086c
    • Daniel Dunbar's avatar
      Fix ObjCPropertRefExpr to be able to encode all the information for · c5d33040
      Daniel Dunbar authored
      uses which refer to methods not properties.
       - Not yet wired in Sema.
      
      llvm-svn: 55681
      c5d33040
  7. Sep 02, 2008
    • Ted Kremenek's avatar
      When creating CXXRecordDecls and RecordDecls within ActOnTag, hook up the new... · ceb3ca94
      Ted Kremenek authored
      When creating CXXRecordDecls and RecordDecls within ActOnTag, hook up the new [CXX]RecordDecl with the RecordDecl chain.
      
      llvm-svn: 55652
      ceb3ca94
    • Ted Kremenek's avatar
      RecordDecl: · 52baf50f
      Ted Kremenek authored
      - Remove method 'isForwardDecl'; this functionality is already provided by
        'isDefinition()'
      - Move method definitions to be co-located with other RecordDecl methods.
      
      llvm-svn: 55649
      52baf50f
    • Ted Kremenek's avatar
      RecordDecl serialization: · 478f6baf
      Ted Kremenek authored
      - Don't serialize out the NextDeclarator field.  It is unused and deprecated.
      - Serialize out the NextDecl pointer.
      
      llvm-svn: 55644
      478f6baf
    • Ted Kremenek's avatar
      RecordDecl: · 318d78f5
      Ted Kremenek authored
      - Added method 'isForwardDeclaration', a predicate method that returns true
        if a RecordDecl represents a forward declaration.
      - Added method 'getDefinitionDecl', a query method that returns a pointer to
        the RecordDecl that provides the actual definition of a struct/union.
      
      llvm-svn: 55642
      318d78f5
    • Ted Kremenek's avatar
      CXXRecordDecl and RecordDecl: · 123f025b
      Ted Kremenek authored
      - Change constructor and create methods to accept a CXXRecordDecl* (RecordDecl*)
        instead of a ScopedDecl* for PrevDecl.  This causes the type checking
        to be more tight and doesn't break any code.
        
      RecordDecl:
      
      - Don't use the NextDeclarator field in ScopedDecl to represent the previous
        declaration. This is a conflated use of the NextDeclarator field, which will
        be removed anyway when DeclGroups are fully implemented.
      
      - Instead, represent (a soon to be implemented) chain of RecordDecls using a
        NextDecl field.  The last RecordDecl in the chain is always the 'defining'
        RecordDecl that owns the FieldDecls.  The other RecordDecls in the chain
        are forward declarations.
      
      llvm-svn: 55640
      123f025b
Loading