Skip to content
Snippets Groups Projects
  1. Jun 22, 2015
  2. Jun 20, 2015
  3. Jun 19, 2015
    • Douglas Gregor's avatar
      Check for consistent use of nullability type specifiers in a header. · d442f4a2
      Douglas Gregor authored
      Adds a new warning (under -Wnullability-completeness) that complains
      about pointer, block pointer, or member pointer declarations that have
      not been annotated with nullability information (directly or inferred)
      within a header that contains some nullability annotations. This is
      intended to be used to help maintain the completeness of nullability
      information within a header that has already been audited.
      
      Note that, for performance reasons, this warning will underrepresent
      the number of non-annotated pointers in the case where more than one
      pointer is seen before the first nullability type specifier, because
      we're only tracking one piece of information per header. Part of
      rdar://problem/18868820.
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240158 91177308-0d34-0410-b5e6-96231b3b80d8
      d442f4a2
    • Douglas Gregor's avatar
      Introduced pragmas for audited nullability regions. · 109dad2d
      Douglas Gregor authored
      Introduce the clang pragmas "assume_nonnull begin" and "assume_nonnull
      end" in which we make default assumptions about the nullability of many
      unannotated pointers:
      
        - Single-level pointers are inferred to __nonnull
        - NSError** in a (function or method) parameter list is inferred to
          NSError * __nullable * __nullable.
        - CFErrorRef * in a (function or method) parameter list is inferred
          to CFErrorRef __nullable * __nullable.
        - Other multi-level pointers are never inferred to anything.
      
      Implements rdar://problem/19191042.
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240156 91177308-0d34-0410-b5e6-96231b3b80d8
      109dad2d
    • Douglas Gregor's avatar
      Implement the 'null_resettable' attribute for Objective-C properties. · a9b97e51
      Douglas Gregor authored
      'null_resettable' properties are those whose getters return nonnull
      but whose setters take nil, to "reset" the property to some
      default. Implements rdar://problem/19051334.
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240155 91177308-0d34-0410-b5e6-96231b3b80d8
      a9b97e51
    • Douglas Gregor's avatar
      Extend type nullability qualifiers for Objective-C. · e3a96006
      Douglas Gregor authored
      Introduce context-sensitive, non-underscored nullability specifiers
      (nonnull, nullable, null_unspecified) for Objective-C method return
      types, method parameter types, and properties.
      
      Introduce Objective-C-specific semantics, including computation of the
      nullability of the result of a message send, merging of nullability
      information from the @interface of a class into its @implementation,
      etc .
      
      This is the Objective-C part of rdar://problem/18868820.
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240154 91177308-0d34-0410-b5e6-96231b3b80d8
      e3a96006
    • Douglas Gregor's avatar
      Introduce type nullability specifiers for C/C++. · a46fb43c
      Douglas Gregor authored
      Introduces the type specifiers __nonnull, __nullable, and
      __null_unspecified that describe the nullability of the pointer type
      to which the specifier appertains. Nullability type specifiers improve
      on the existing nonnull attributes in a few ways:
        - They apply to types, so one can represent a pointer to a non-null
          pointer, use them in function pointer types, etc.
        - As type specifiers, they are syntactically more lightweight than
          __attribute__s or [[attribute]]s.
        - They can express both the notion of 'should never be null' and
        also 'it makes sense for this to be null', and therefore can more
        easily catch errors of omission where one forgot to annotate the
        nullability of a particular pointer (this will come in a subsequent
        patch).
      
      Nullability type specifiers are maintained as type sugar, and
      therefore have no effect on mangling, encoding, overloading,
      etc. Nonetheless, they will be used for warnings about, e.g., passing
      'null' to a method that does not accept it.
      
      This is the C/C++ part of rdar://problem/18868820.
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240146 91177308-0d34-0410-b5e6-96231b3b80d8
      a46fb43c
  4. Jun 18, 2015
  5. Jun 16, 2015
  6. Jun 15, 2015
  7. Jun 12, 2015
  8. Jun 09, 2015
  9. May 26, 2015
  10. May 20, 2015
  11. May 18, 2015
  12. May 17, 2015
    • Nico Weber's avatar
      Don't leak TemplateIds when a plugin parses late-parsed templates at TU end. · acb8cdf0
      Nico Weber authored
      In -fdelayed-template-parsing mode, templates that aren't used are not parsed
      at all.  For some diagnostic plugins, this is a problem since they want to
      analyse the contents of the template function body.  What has been suggested
      on cfe-dev [1] is to explicitly parse interesting templates in
      HandleTranslationUnit(); IWYU does this for example [2].
      
      This is workable, but since the delayed parsing doesn't run below a call to
      ParseTopLevelDecl(), no DestroyTemplateIdAnnotationsRAIIObj object is on the
      stack to clean up TemplateIds that are created during parsing.  To fix this,
      let ~Parser() clean them up in delayed template parsing mode instead of
      leaking (or asserting in +Assert builds).
      
      (r219810, relanded in r220400, fixed the same problem in incremental processing
      mode; the review thread of r219810 has a good discussion of the problem.)
      
      To test this, give the PrintFunctionNames plugin a flag to force parsing
      of a template and add a test that uses it in -fdelayed-template-parsing mode.
      Without the Parser.cpp change, that test asserts.
      
      1: http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-August/038415.html
      2: https://code.google.com/p/include-what-you-use/source/detail?r=566 
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@237531 91177308-0d34-0410-b5e6-96231b3b80d8
      acb8cdf0
  13. May 15, 2015
    • Richard Smith's avatar
      [modules] Add local submodule visibility support for declarations. · 049e702b
      Richard Smith authored
      With this change, enabling -fmodules-local-submodule-visibility results in name
      visibility rules being applied to submodules of the current module in addition
      to imported modules (that is, names no longer "leak" between submodules of the
      same top-level module). This also makes it much safer to textually include a
      non-modular library into a module: each submodule that textually includes that
      library will get its own "copy" of that library, and so the library becomes
      visible no matter which including submodule you import.
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@237473 91177308-0d34-0410-b5e6-96231b3b80d8
      049e702b
  14. May 12, 2015
  15. May 11, 2015
    • Steven Wu's avatar
      Allow AsmLabel with -fno-gnu-inline-asm · 99689c20
      Steven Wu authored
      Summary:
      AsmLabel is heavily used in system level and firmware to redirect
      function and access platform specific labels. They are also extensively
      used in system headers which makes this option unusable for many
      users. Since AsmLabel doesn't introduce any assembly code into the
      output binary, it shouldn't be considered as inline-asm.
      
      Reviewers: bob.wilson, rnk
      
      Reviewed By: rnk
      
      Subscribers: cfe-commits
      
      Differential Revision: http://reviews.llvm.org/D9679
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@237048 91177308-0d34-0410-b5e6-96231b3b80d8
      99689c20
  16. May 08, 2015
  17. May 07, 2015
  18. May 05, 2015
  19. May 02, 2015
  20. May 01, 2015
  21. Apr 30, 2015
  22. Apr 29, 2015
  23. Apr 28, 2015
  24. Apr 20, 2015
  25. Apr 19, 2015
Loading