[cfe-dev] Clang: get list of defined macro

GabrieleCocco cocco at di.unipi.it
Mon Oct 29 11:28:53 PDT 2012


I think I found out something for my purpose. The macro should be CLVM_DEBUG.

        IdentifierInfo& info = Context.Idents.get("CLVM_DEBUG");
        if(info.hasMacroDefinition()) {
            ...
        }
        else {
             // Find SourceLocation of the first/last #define and add
CLVM_DEBUG definition
        }
        
Is it safe to do this?
I'm still wondering how to implement the else branch.



--
View this message in context: http://clang-developers.42468.n3.nabble.com/Clang-get-list-of-defined-macro-tp4027815p4027816.html
Sent from the Clang Developers mailing list archive at Nabble.com.



More information about the cfe-dev mailing list