Example #1
0
StructTypeDecl* C2Sema::ActOnStructType(const char* name, SourceLocation loc,
            bool isStruct, bool is_public, bool is_global) {
#ifdef SEMA_DEBUG
    std::cerr << COL_SEMA << "SEMA: Struct/Union Type '" << (name ? name : "<anonymous>");
    std::cerr << ANSI_NORMAL << '\n';
#endif
    QualType qt = typeContext.getStructType();
    StructTypeDecl* S = new StructTypeDecl(name, loc, qt, isStruct, is_global, is_public); 
    StructType* ST = cast<StructType>(qt.getTypePtr());
    ST->setDecl(S);
    if (is_global) {
        ast.addType(S);
        addSymbol(S);
    }
    return S;
}