]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/d/dmd/objc.h
d: Merge upstream dmd 7132b3537
[thirdparty/gcc.git] / gcc / d / dmd / objc.h
CommitLineData
b4c522fa
IB
1
2/* Compiler implementation of the D programming language
a3b38b77 3 * Copyright (C) 2015-2021 by The D Language Foundation, All Rights Reserved
b4c522fa
IB
4 * written by Michel Fortin
5 * http://www.digitalmars.com
6 * Distributed under the Boost Software License, Version 1.0.
7 * http://www.boost.org/LICENSE_1_0.txt
8 * https://github.com/dlang/dmd/blob/master/src/dmd/objc.h
9 */
10
11#pragma once
12
13#include "root/root.h"
14#include "root/stringtable.h"
15
16class Identifier;
17class FuncDeclaration;
18class ClassDeclaration;
19class InterfaceDeclaration;
20struct Scope;
21class StructDeclaration;
22
23struct ObjcSelector
24{
25 static StringTable stringtable;
26 static StringTable vTableDispatchSelectors;
27 static int incnum;
28
29 const char *stringvalue;
30 size_t stringlen;
31 size_t paramCount;
32
33 static void _init();
34
35 ObjcSelector(const char *sv, size_t len, size_t pcount);
36
37 static ObjcSelector *lookup(const char *s);
38 static ObjcSelector *lookup(const char *s, size_t len, size_t pcount);
39
40 static ObjcSelector *create(FuncDeclaration *fdecl);
41};
42
43class Objc
44{
45public:
46 static void _init();
47
48 virtual void setObjc(ClassDeclaration* cd) = 0;
49 virtual void setObjc(InterfaceDeclaration*) = 0;
50 virtual void setSelector(FuncDeclaration*, Scope* sc) = 0;
51 virtual void validateSelector(FuncDeclaration* fd) = 0;
52 virtual void checkLinkage(FuncDeclaration* fd) = 0;
53};