[cfe-dev] Adding a new type qualifier

kalyan ponnala ponnala.kalyan at gmail.com
Mon May 10 11:50:45 PDT 2010


Hello,

I am trying to add a new qualifier to the existing clang architecture. So
far I was looking into replacing one of the existing qualifiers "volatile or
restrict" from the "fast qualifiers". Now I think its a bad idea to do that.
Can someone tell me

>> whats the best way to add a new type quailfier?
>> Why are there only 3 fast qualifiers added to the qualtype?
>> How can I increase the size of the fast qualifiers, I mean how to add new
qualifier to qualtype without actually disturbing the existing fast quals :
const, volatile, restrict.

I was looking into :

enum TQ { // NOTE: These flags must be kept in sync with DeclSpec::TQ.
    Const    = 0x1,
    Restrict = 0x2,
    Volatile = 0x4,

+    new_qualifier  = 0x8,

+    CVRMask = Const | Volatile | Restrict | new_qualifier

  };

enum {
    /// The maximum supported address space number.
    /// 24 bits should be enough for anyone.
    MaxAddressSpace = 0xffffffu,

    /// The width of the "fast" qualifier mask.
 -   FastWidth = 2,
+   FastWidth = 3,

    /// The fast qualifier mask.
    FastMask = (1 << FastWidth) - 1
};

and working on changing the APIs of the Type.h file inside Clang/AST.
am I looking in a right direction here? can an expert give a reply.

Thanks.
-- 
Kalyan Ponnala
phone: 8163772059
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20100510/adc68ad3/attachment.html>


More information about the cfe-dev mailing list