Hi, I need a help, #define OPT #define MAN struct A { int i; char* c; }; struct B { OPT A a; MAN int i; }; After parsing the above .h file, how to get the attributes of B members specifically for member A which is prefixed with OPT... So far am able to get type of a as A but unable to OPT...as it might be preprocessed and as it is empty it may discarded or... regards ragha
Hi ragha, as this is a clang question I suggest you ask on the clang mailing list. Best wishes, Duncan. On 10/07/13 16:50, Raghavendra K wrote:> > Hi, > > I need a help, > > #define OPT > #define MAN > > struct A > { > int i; > char* c; > }; > > > struct B > { > OPT A a; > MAN int i; > }; > > After parsing the above .h file, how to get the attributes of B members specifically > for member A which is prefixed with OPT... > > So far am able to get type of a as A but unable to OPT...as it might be preprocessed and as it is empty > it may discarded or... > > > > regards > ragha > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >
Hi, I need a help, #define OPT #define MAN struct A { int i; char* c; }; struct B { OPT A a; MAN int i; }; After parsing the above .h file, how to get the attributes of B members specifically for member A which is prefixed with OPT... So far am able to get type of a as A but unable to OPT...as it might be preprocessed and as it is empty it may discarded or... regards ragha _______________________________________________ LLVM Developers mailing list LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
On 2013-07-11 10:40, Raghavendra K wrote:> #define OPT > #define MAN > > struct A > { > int i; > char* c; > }; > > > struct B > { > OPT A a; > MAN int i; > }; > > After parsing the above .h file, how to get the attributes of B members specifically > for member A which is prefixed with OPT... > > So far am able to get type of a as A but unable to OPT...as it might be preprocessed and as it is empty > it may discarded or... >Are you talking about Clang's AST (in which case you should ask your question on cfe-dev, not here) or IR? In either case, empty preprocessor defines are gone. There's no way to recover them. Instead, define OPT and MAN to be something like __attribute__((annotate("opt"))), which will be preserved. Sebastian
Maybe Matching Threads
- [LLVMdev] Getting strcut member attributes
- [LLVMdev] Linking Debug+Asserts Shared Library libclang.so: final link failed: Bad value
- can't load just saved R object "ReadItem: unknown type 65"
- can't load just saved R object "ReadItem: unknown type 65"
- [LLVMdev] Linking Debug+Asserts Shared Library libclang.so: final link failed: Bad value