[cfe-dev] LangOptions & CodeGenOptions over-ride

Robert Lytton robert at xmos.com
Mon Jul 29 10:14:35 PDT 2013


Hi,

I am working on a clang frontend for the XCore processor.


The XCore ABI requires that 'char' is unsigned.
I notice the C99 standard does not require it to be signed - contrary to the comment:
      /// isSignedIntegerType - Return true if this is an integer type that is
      /// signed, according to C99 6.2.5p4 [char, signed char, short, int, long..],
      /// or an enum decl which has a signed representation.

Thus I would like to over-ride the default setting in LangOptions.def:
        LANGOPT(CharIsSigned      , 1, 1, "signed char")

I had considered using setForcedLangOptions() - but assume this is the wrong way to use it!
      virtual void XCoreTargetInfo::setForcedLangOptions(LangOptions &Opts) {
        ...
       Opts.CharIsSigned = false;
      }



I would also like to make -fomit-frame-pointer" the default behaviour for the target:
    CODEGENOPT(DisableFPElim     , 1, 0) ///< Set when -fomit-frame-pointer is enabled.
And the same for -fno-common
    CODEGENOPT(NoCommon          , 1, 0) ///< Set when -fno-common or C++ is enabled.



What is the correct place (TargetInfo constructor?) and mechanism to specify alternative default options?
Is there a target-option.def over-rides mechanism?

Thank you

robert

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130729/cc751997/attachment.html>


More information about the cfe-dev mailing list