Mercurial > hg > CbC > CbC_gcc
diff gcc/d/dmd/objc.h @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gcc/d/dmd/objc.h Thu Feb 13 11:34:05 2020 +0900 @@ -0,0 +1,53 @@ + +/* Compiler implementation of the D programming language + * Copyright (C) 2015-2019 by The D Language Foundation, All Rights Reserved + * written by Michel Fortin + * http://www.digitalmars.com + * Distributed under the Boost Software License, Version 1.0. + * http://www.boost.org/LICENSE_1_0.txt + * https://github.com/dlang/dmd/blob/master/src/dmd/objc.h + */ + +#pragma once + +#include "root/root.h" +#include "root/stringtable.h" + +class Identifier; +class FuncDeclaration; +class ClassDeclaration; +class InterfaceDeclaration; +struct Scope; +class StructDeclaration; + +struct ObjcSelector +{ + static StringTable stringtable; + static StringTable vTableDispatchSelectors; + static int incnum; + + const char *stringvalue; + size_t stringlen; + size_t paramCount; + + static void _init(); + + ObjcSelector(const char *sv, size_t len, size_t pcount); + + static ObjcSelector *lookup(const char *s); + static ObjcSelector *lookup(const char *s, size_t len, size_t pcount); + + static ObjcSelector *create(FuncDeclaration *fdecl); +}; + +class Objc +{ +public: + static void _init(); + + virtual void setObjc(ClassDeclaration* cd) = 0; + virtual void setObjc(InterfaceDeclaration*) = 0; + virtual void setSelector(FuncDeclaration*, Scope* sc) = 0; + virtual void validateSelector(FuncDeclaration* fd) = 0; + virtual void checkLinkage(FuncDeclaration* fd) = 0; +};