Quantcast

__builtin_sin() and friends not compiling?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

__builtin_sin() and friends not compiling?

Charles Davis-3
Hi,

I noticed this comment in lib/CodeGen/CGBuiltin.cpp:

  // If this is an alias for a libm function (e.g. __builtin_sin) turn
it into
  // that function.
  if (getContext().BuiltinInfo.isLibFunction(BuiltinID) ||
      getContext().BuiltinInfo.isPredefinedLibFunction(BuiltinID))
    return EmitCall(CGM.getBuiltinLibFunction(FD, BuiltinID),
                    E->getCallee()->getType(), E->arg_begin(),
                    E->arg_end());

But this is what I find in include/clang/Basic/Builtins.def:

// Standard unary libc/libm functions with double/float/long double
variants:
BUILTIN(__builtin_acos , "dd"  , "nc")
...
BUILTIN(__builtin_tanl, "LdLd", "nc")

So none of these builtins that should be marked as LibFunctions or
PredefinedLibFunctions are marked as such. Is there a good reason for
this? Because when I try to use one of them, I get an error:

$ cat t.c
int main(void)
{
        __builtin_sin(0.0);
        return 0;
}

$ clang t.c
t.c:3:2: error: cannot compile this builtin function yet
        __builtin_sin(0.0);
        ^~~~~~~~~~~~~~~~~~
1 diagnostic generated.

Should I file a PR?

Chip
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: __builtin_sin() and friends not compiling?

Chris Lattner

On Dec 5, 2009, at 2:15 PM, Charles Davis wrote:

> Hi,
>
> I noticed this comment in lib/CodeGen/CGBuiltin.cpp:

Looks like a simple oversight, I fixed this in r90736, thanks!

-Chris

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Loading...