[PATCH] PR5326, Clang needs support for _Complex_I and _Imaginary_I as intrinsics.

http://llvm.org/bugs/show_bug.cgi?id=5326

G'Day,

In regards to PR 5326,

Would someone to be willing to give me some feedback and what else may
need to be done on my current patch please?
See: http://llvm.org/bugs/attachment.cgi?id=3715

Cheers,
Edward.

The patch looks correct as far as it goes.

Instead of making _Complex_I a keyword, you could just #define it to
the GNU equivalent in the predefines; it's not precisely correct, but
it's a lot less work to get it working. If you want to get it working
cleanly, I guess the next step would be making
Parser::ParseCastExpression actually handle _Complex_I, then adding an
AST node, then adding Sema and CodeGen handling.

-Eli

Thanks for the pointer Eli !

Please see attached update, I can't seem to get it work work as expected.

-bash-3.2$ ../../llvm/Debug/bin/clang-cc -fsun-extensions divdc3_test.c
clang-cc: Unknown command line argument '-fsun-extensions'. Try:
'../../llvm/Debug/bin/clang-cc --help'

I must be missing something somewhere, can you please review my patch carefully?

Thanks for your time,
Edward.

PR5326.patch (9.59 KB)

Hmm, strange... the tools/clang-cc/Options.cpp bit ought to be enough
to prevent that error. I haven't been keeping track of recent changes
that closely, though.

-Eli