Skip to content
  1. Feb 20, 2009
  2. Feb 19, 2009
  3. Feb 18, 2009
  4. Feb 17, 2009
  5. Feb 16, 2009
  6. Feb 14, 2009
    • Douglas Gregor's avatar
      Add hook to add attributes to function declarations that we know · e711f705
      Douglas Gregor authored
      about, whether they are builtins or not. Use this to add the
      appropriate "format" attribute to NSLog, NSLogv, asprintf, and
      vasprintf, and to translate builtin attributes (from Builtins.def)
      into actual attributes on the function declaration.
      
      Use the "printf" format attribute on function declarations to
      determine whether we should do format string checking, rather than
      looking at an ad hoc list of builtins and "known" function names.
      
      Be a bit more careful about when we consider a function a "builtin" in
      C++.
      
      llvm-svn: 64561
      e711f705
    • Douglas Gregor's avatar
      Implicitly declare certain C library functions (malloc, strcpy, memmove, · b9063fc1
      Douglas Gregor authored
      etc.) when we perform name lookup on them. This ensures that we
      produce the correct signature for these functions, which has two
      practical impacts:
      
        1) When we're supporting the "implicit function declaration" feature
        of C99, these functions will be implicitly declared with the right
        signature rather than as a function returning "int" with no
        prototype. See PR3541 for the reason why this is important (hint:
        GCC always predeclares these functions).
       
        2) If users attempt to redeclare one of these library functions with
        an incompatible signature, we produce a hard error.
      
      This patch does a little bit of work to give reasonable error
      messages. For example, when we hit case #1 we complain that we're
      implicitly declaring this function with a specific signature, and then
      we give a note that asks the user to include the appropriate header
      (e.g., "please include <stdlib.h> or explicitly declare 'malloc'"). In
      case #2, we show the type of the implicit builtin that was incorrectly
      declared, so the user can see the problem. We could do better here:
      for example, when displaying this latter error message we say
      something like:
      
        'strcpy' was implicitly declared here with type 'char *(char *, char
        const *)'
      
      but we should really print out a fake code line showing the
      declaration, like this:
      
        'strcpy' was implicitly declared here as:
      
          char *strcpy(char *, char const *)
      
      This would also be good for printing built-in candidates with C++
      operator overloading.
      
      The set of C library functions supported by this patch includes all
      functions from the C99 specification's <stdlib.h> and <string.h> that
      (a) are predefined by GCC and (b) have signatures that could cause
      codegen issues if they are treated as functions with no prototype
      returning and int. Future work could extend this set of functions to
      other C library functions that we know about.
      
      llvm-svn: 64504
      b9063fc1
  7. Feb 13, 2009
    • Douglas Gregor's avatar
      Add basic support for C++ name mangling according to the Itanium C++ · 5fec5b04
      Douglas Gregor authored
      ABI to the CodeGen library. Since C++ code-generation is so
      incomplete, we can't exercise much of this mangling code. However, a
      few smoke tests show that it's doing the same thing as GCC. When C++
      codegen matures, we'll extend the ABI tester to verify name-mangling
      as well, and complete the implementation here.
      
      At this point, the major client of name mangling is in the uses of the
      new "overloadable" attribute in C, which allows overloading. Any
      "overloadable" function in C (or in an extern "C" block in C++) will
      be mangled the same way that the corresponding C++ function would be
      mangled.
      
      llvm-svn: 64413
      5fec5b04
  8. Feb 12, 2009
  9. Feb 11, 2009
  10. Feb 10, 2009
  11. Feb 05, 2009
  12. Feb 03, 2009
  13. Feb 02, 2009
  14. Jan 18, 2009
  15. Jan 13, 2009
  16. Jan 09, 2009
  17. Jan 06, 2009
    • Douglas Gregor's avatar
      Add QualifiedDeclRefExpr, which retains additional source-location · c7acfdfe
      Douglas Gregor authored
      information for declarations that were referenced via a qualified-id,
      e.g., N::C::value. We keep track of the location of the start of the
      nested-name-specifier. Note that the difference between
      QualifiedDeclRefExpr and DeclRefExpr does have an effect on the
      semantics of function calls in two ways:
        1) The use of a qualified-id instead of an unqualified-id suppresses
           argument-dependent lookup
        2) If the name refers to a virtual function, the qualified-id
        version will call the function determined statically while the
        unqualified-id version will call the function determined dynamically
        (by looking up the appropriate function in the vtable).
      
      Neither of these features is implemented yet, but we do print out
      qualified names for QualifiedDeclRefExprs as part of the AST printing.
      
      llvm-svn: 61789
      c7acfdfe
  18. Dec 21, 2008
  19. Dec 18, 2008
  20. Dec 15, 2008
  21. Dec 12, 2008
  22. Nov 24, 2008
    • Chris Lattner's avatar
      Rename NamedDecl::getName() to getNameAsString(). Replace a bunch of · f3d3faec
      Chris Lattner authored
      uses of getName() with uses of getDeclName().  This upgrades a bunch of
      diags to take DeclNames instead of std::strings.
      
      This also tweaks a couple of diagnostics to be cleaner and changes
      CheckInitializerTypes/PerformInitializationByConstructor to pass
      around DeclarationNames instead of std::strings.
      
      llvm-svn: 59947
      f3d3faec
  23. Nov 22, 2008
Loading