2018-01-17 01:48:22 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "serializer.h"
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
// TODO Rename query.h:SymbolKind to another name
|
|
|
|
// clang/Index/IndexSymbol.h clang::index::SymbolKind
|
|
|
|
enum class ClangSymbolKind : uint8_t {
|
|
|
|
Unknown,
|
|
|
|
|
|
|
|
Module = 1,
|
|
|
|
Namespace,
|
|
|
|
NamespaceAlias,
|
|
|
|
Macro,
|
|
|
|
|
|
|
|
Enum = 5,
|
|
|
|
Struct,
|
|
|
|
Class,
|
|
|
|
Protocol,
|
|
|
|
Extension,
|
|
|
|
Union,
|
|
|
|
TypeAlias,
|
|
|
|
|
|
|
|
Function = 12,
|
|
|
|
Variable,
|
|
|
|
Field,
|
|
|
|
EnumConstant,
|
|
|
|
|
|
|
|
InstanceMethod = 16,
|
|
|
|
ClassMethod,
|
|
|
|
StaticMethod,
|
|
|
|
InstanceProperty,
|
|
|
|
ClassProperty,
|
|
|
|
StaticProperty,
|
|
|
|
|
|
|
|
Constructor = 22,
|
|
|
|
Destructor,
|
|
|
|
ConversionFunction,
|
|
|
|
|
2018-02-02 04:07:11 +00:00
|
|
|
// Used for both function and template parameters.
|
|
|
|
// Clients can differentiate based on StorageClass.
|
2018-01-17 01:48:22 +00:00
|
|
|
Parameter = 25,
|
|
|
|
Using,
|
|
|
|
};
|
2018-01-30 00:35:01 +00:00
|
|
|
MAKE_REFLECT_TYPE_PROXY(ClangSymbolKind);
|
2018-01-17 01:48:22 +00:00
|
|
|
|
2018-01-26 17:28:29 +00:00
|
|
|
// clang/Basic/Specifiers.h clang::StorageClass
|
2018-01-28 04:25:14 +00:00
|
|
|
enum class StorageClass : uint8_t {
|
2018-01-26 17:28:29 +00:00
|
|
|
// In |CX_StorageClass| but not in |clang::StorageClass|
|
2018-01-28 04:25:14 +00:00
|
|
|
// e.g. non-type template parameters
|
|
|
|
Invalid,
|
2018-01-26 17:28:29 +00:00
|
|
|
|
|
|
|
// These are legal on both functions and variables.
|
2018-01-28 04:25:14 +00:00
|
|
|
// e.g. global functions/variables, local variables
|
|
|
|
None,
|
|
|
|
Extern,
|
|
|
|
Static,
|
|
|
|
// e.g. |__private_extern__ int a;|
|
|
|
|
PrivateExtern,
|
2018-01-26 17:28:29 +00:00
|
|
|
|
|
|
|
// These are only legal on variables.
|
2018-01-28 04:25:14 +00:00
|
|
|
// e.g. explicit |auto int a;|
|
|
|
|
Auto,
|
|
|
|
Register
|
2018-01-26 17:28:29 +00:00
|
|
|
};
|
2018-01-30 00:35:01 +00:00
|
|
|
MAKE_REFLECT_TYPE_PROXY(StorageClass);
|
2018-01-29 04:39:41 +00:00
|
|
|
|
2018-02-12 18:15:43 +00:00
|
|
|
enum class Role : uint16_t {
|
2018-02-08 02:29:34 +00:00
|
|
|
None = 0,
|
2018-01-29 04:39:41 +00:00
|
|
|
Declaration = 1 << 0,
|
|
|
|
Definition = 1 << 1,
|
|
|
|
Reference = 1 << 2,
|
2018-02-12 18:15:43 +00:00
|
|
|
Read = 1 << 3,
|
|
|
|
Write = 1 << 4,
|
|
|
|
Call = 1 << 5,
|
|
|
|
Dynamic = 1 << 6,
|
|
|
|
Address = 1 << 7,
|
|
|
|
Implicit = 1 << 8,
|
2018-01-29 04:39:41 +00:00
|
|
|
};
|
2018-02-11 04:01:10 +00:00
|
|
|
MAKE_REFLECT_TYPE_PROXY(Role);
|
|
|
|
MAKE_ENUM_HASHABLE(Role);
|
2018-01-29 04:39:41 +00:00
|
|
|
|
2018-02-12 18:15:43 +00:00
|
|
|
inline uint16_t operator&(Role lhs, Role rhs) {
|
|
|
|
return uint16_t(lhs) & uint16_t(rhs);
|
2018-01-29 04:39:41 +00:00
|
|
|
}
|
|
|
|
|
2018-02-11 04:01:10 +00:00
|
|
|
inline Role operator|(Role lhs, Role rhs) {
|
2018-02-12 18:15:43 +00:00
|
|
|
return Role(uint16_t(lhs) | uint16_t(rhs));
|
2018-01-29 04:39:41 +00:00
|
|
|
}
|