Skip to content
  1. Feb 16, 2009
    • Daniel Dunbar's avatar
      Support IRgen of sqrt -> llvm.sqrt, pow -> llvm.pow. · 8eb018ab
      Daniel Dunbar authored
       - Define pow[lf]?, sqrt[lf]? as builtins.
      
       - Add -fmath-errno option which binds to LangOptions.MathErrno
      
       - Add new builtin flag Builtin::Context::isConstWithoutErrno for
         functions which can be marked as const if errno isn't respected for
         math functions. Sema automatically marks these functions as const
         when they are defined, if MathErrno=0.
      
       - IRgen uses const attribute on sqrt and pow library functions to
         decide if it can use the llvm intrinsic.
      
      llvm-svn: 64689
      8eb018ab
    • Daniel Dunbar's avatar
      Fix IRgen of __builtin_memset. · e28b3598
      Daniel Dunbar authored
       - Fix test case to not only have negative tests.
      
      llvm-svn: 64674
      e28b3598
  2. Feb 14, 2009
    • 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
  3. Feb 11, 2009
  4. Feb 05, 2009
  5. Feb 04, 2009
  6. Jan 25, 2009
    • Eli Friedman's avatar
      Make the constant folder aware of · c69d454d
      Eli Friedman authored
      __builtin___CFStringMakeConstantString.  (We get into trouble in 
      GenerateStaticBlockVarDecl if the constant folder isn't accurate.)
      
      llvm-svn: 62949
      c69d454d
  7. Jan 20, 2009
  8. Jan 18, 2009
  9. Dec 22, 2008
  10. Dec 01, 2008
  11. Nov 16, 2008
  12. Nov 04, 2008
  13. Oct 29, 2008
    • Eli Friedman's avatar
      Fix for PR2966: va_start/va_end use the *address* of the · 5adca5f0
      Eli Friedman authored
      va_list, not the value.  Patch fixes an assert on 
      x86-64 and a wrong-code bug on x86.  I'm not completely sure, 
      but I think it's a regression from r58306.
      
      Does anyone run regression tests regularly on x86-64? The crash should 
      have been picked up there.
      
      llvm-svn: 58366
      5adca5f0
  14. Oct 15, 2008
  15. Oct 10, 2008
  16. Oct 06, 2008
  17. Sep 30, 2008
  18. Sep 03, 2008
  19. Aug 30, 2008
  20. Aug 16, 2008
  21. Aug 11, 2008
    • Daniel Dunbar's avatar
      More #include cleaning · 56fdb6ae
      Daniel Dunbar authored
       - Kill unnecessary #includes in .cpp files. This is an automatic
         sweep so some things removed are actually used, but happen to be
         included by a previous header. I tried to get rid of the obvious
         examples and this was the easiest way to trim the #includes in one
         fell swoop.
       - We now return to regularly scheduled development.
      
      llvm-svn: 54632
      56fdb6ae
    • Daniel Dunbar's avatar
      More #include cleaning · 6e8aa537
      Daniel Dunbar authored
       - Drop {Decl.h,DeclObjC.h,IdentifierTable.h} from Expr.h
       - Moved Sema::getCurMethodDecl() out of line (dependent on
         ObjCMethodDecl via dyn_cast).
      
      llvm-svn: 54629
      6e8aa537
  22. Jul 31, 2008
  23. Jul 25, 2008
  24. Jul 23, 2008
  25. Jul 22, 2008
  26. Jul 21, 2008
  27. Jul 18, 2008
  28. Jul 09, 2008
  29. Jun 30, 2008
    • Chris Lattner's avatar
      Make a few related changes: · 9a8d1d9e
      Chris Lattner authored
      1) add a new ASTContext::getFloatTypeSemantics method.
      2) Use it from SemaExpr.cpp, CodeGenTypes.cpp and other places.
      3) Change the TargetInfo.h get*Format methods to return their 
         fltSemantics byref instead of by pointer.
      4) Change CodeGenFunction::EmitBuiltinExpr to allow builtins which
         sometimes expand specially and othertimes fall back to libm.
      5) Add support for __builtin_nan("") to codegen, cases that don't pass
         in an empty string are currently lowered to libm calls.
      6) Fix codegen of __builtin_infl.
      
      llvm-svn: 52914
      9a8d1d9e
Loading