| author | |
| committer | |
| log | 356cfa08f49a9e92dfa4135cbcf2ddc079ddf228 |
| tree | 8592bcef5bf98fd8fe340854acdd3f5db9a97007 |
| parent | bd52d81dc316df601877a17a9c70caf3a49f936d |
| signature |
See #19644 files changed, 446 insertions(+), 8 deletions(-)
CMakeLists.txt+1| ... | ... | @@ -429,6 +429,7 @@ set(BLAKE_SOURCES |
| 429 | 429 | ) |
| 430 | 430 | set(ZIG_CPP_SOURCES |
| 431 | 431 | "${CMAKE_SOURCE_DIR}/src/zig_llvm.cpp" |
| 432 | "${CMAKE_SOURCE_DIR}/src/zig_clang.cpp" | |
| 432 | 433 | "${CMAKE_SOURCE_DIR}/src/windows_sdk.cpp" |
| 433 | 434 | ) |
| 434 | 435 |
src/translate_c.cpp+14-8| ... | ... | @@ -14,7 +14,6 @@ |
| 14 | 14 | #include "translate_c.hpp" |
| 15 | 15 | #include "parser.hpp" |
| 16 | 16 | |
| 17 | ||
| 18 | 17 | #if __GNUC__ >= 8 |
| 19 | 18 | #pragma GCC diagnostic push |
| 20 | 19 | #pragma GCC diagnostic ignored "-Wclass-memaccess" |
| ... | ... | @@ -28,6 +27,13 @@ |
| 28 | 27 | #pragma GCC diagnostic pop |
| 29 | 28 | #endif |
| 30 | 29 | |
| 30 | ||
| 31 | // Before the #include of zig_clang.h | |
| 32 | // Temporary transitional thing: override ZigClangSourceLocation with clang::SourceLocation | |
| 33 | #define ZigClangSourceLocation clang::SourceLocation | |
| 34 | #define ZIG_CLANG_SOURCE_LOCATION ZigClangABISourceLocation | |
| 35 | #include "zig_clang.h" | |
| 36 | ||
| 31 | 37 | #include <string.h> |
| 32 | 38 | |
| 33 | 39 | struct Alias { |
| ... | ... | @@ -85,7 +91,7 @@ struct Context { |
| 85 | 91 | HashMap<const void *, AstNode *, ptr_hash, ptr_eq> decl_table; |
| 86 | 92 | HashMap<Buf *, AstNode *, buf_hash, buf_eql_buf> macro_table; |
| 87 | 93 | HashMap<Buf *, AstNode *, buf_hash, buf_eql_buf> global_table; |
| 88 | clang::SourceManager *source_manager; | |
| 94 | ZigClangSourceManager *source_manager; | |
| 89 | 95 | ZigList<Alias> aliases; |
| 90 | 96 | AstNode *source_node; |
| 91 | 97 | bool warnings_on; |
| ... | ... | @@ -139,16 +145,16 @@ static void emit_warning(Context *c, const clang::SourceLocation &sl, const char |
| 139 | 145 | Buf *msg = buf_vprintf(format, ap); |
| 140 | 146 | va_end(ap); |
| 141 | 147 | |
| 142 | StringRef filename = c->source_manager->getFilename(c->source_manager->getSpellingLoc(sl)); | |
| 143 | const char *filename_bytes = (const char *)filename.bytes_begin(); | |
| 148 | const char *filename_bytes = ZigClangSourceManager_getFilename(c->source_manager, | |
| 149 | ZigClangSourceManager_getSpellingLoc(c->source_manager, sl)); | |
| 144 | 150 | Buf *path; |
| 145 | 151 | if (filename_bytes) { |
| 146 | 152 | path = buf_create_from_str(filename_bytes); |
| 147 | 153 | } else { |
| 148 | 154 | path = buf_sprintf("(no file)"); |
| 149 | 155 | } |
| 150 | unsigned line = c->source_manager->getSpellingLineNumber(sl); | |
| 151 | unsigned column = c->source_manager->getSpellingColumnNumber(sl); | |
| 156 | unsigned line = ZigClangSourceManager_getSpellingLineNumber(c->source_manager, sl); | |
| 157 | unsigned column = ZigClangSourceManager_getSpellingColumnNumber(c->source_manager, sl); | |
| 152 | 158 | fprintf(stderr, "%s:%u:%u: warning: %s\n", buf_ptr(path), line, column, buf_ptr(msg)); |
| 153 | 159 | } |
| 154 | 160 | |
| ... | ... | @@ -4701,7 +4707,7 @@ static void process_preprocessor_entities(Context *c, clang::ASTUnit &unit) { |
| 4701 | 4707 | continue; |
| 4702 | 4708 | } |
| 4703 | 4709 | |
| 4704 | const char *begin_c = c->source_manager->getCharacterData(begin_loc); | |
| 4710 | const char *begin_c = ZigClangSourceManager_getCharacterData(c->source_manager, begin_loc); | |
| 4705 | 4711 | process_macro(c, &ctok, name, begin_c); |
| 4706 | 4712 | } |
| 4707 | 4713 | } |
| ... | ... | @@ -4889,7 +4895,7 @@ Error parse_h_file(ImportTableEntry *import, ZigList<ErrorMsg *> *errors, const |
| 4889 | 4895 | } |
| 4890 | 4896 | |
| 4891 | 4897 | c->ctx = &ast_unit->getASTContext(); |
| 4892 | c->source_manager = &ast_unit->getSourceManager(); | |
| 4898 | c->source_manager = reinterpret_cast<ZigClangSourceManager *>(&ast_unit->getSourceManager()); | |
| 4893 | 4899 | c->root = trans_create_node(c, NodeTypeContainerDecl); |
| 4894 | 4900 | c->root->data.container_decl.is_root = true; |
| 4895 | 4901 |
src/zig_clang.cpp created+178| ... | ... | @@ -0,0 +1,178 @@ |
| 1 | /* | |
| 2 | * Copyright (c) 2019 Andrew Kelley | |
| 3 | * | |
| 4 | * This file is part of zig, which is MIT licensed. | |
| 5 | * See http://opensource.org/licenses/MIT | |
| 6 | */ | |
| 7 | ||
| 8 | ||
| 9 | /* | |
| 10 | * The point of this file is to contain all the Clang C++ API interaction so that: | |
| 11 | * 1. The compile time of other files is kept under control. | |
| 12 | * 2. Provide a C interface to the Clang functions we need for self-hosting purposes. | |
| 13 | * 3. Prevent C++ from infecting the rest of the project. | |
| 14 | */ | |
| 15 | ||
| 16 | #if __GNUC__ >= 8 | |
| 17 | #pragma GCC diagnostic push | |
| 18 | #pragma GCC diagnostic ignored "-Wclass-memaccess" | |
| 19 | #endif | |
| 20 | ||
| 21 | #include <clang/Frontend/ASTUnit.h> | |
| 22 | #include <clang/Frontend/CompilerInstance.h> | |
| 23 | #include <clang/AST/Expr.h> | |
| 24 | ||
| 25 | #if __GNUC__ >= 8 | |
| 26 | #pragma GCC diagnostic pop | |
| 27 | #endif | |
| 28 | ||
| 29 | // Before the #include of zig_clang.h | |
| 30 | // We'll check that the types are compatible but just use | |
| 31 | // the clang type. | |
| 32 | #define ZigClangSourceLocation clang::SourceLocation | |
| 33 | #define ZIG_CLANG_SOURCE_LOCATION ZigClangABISourceLocation | |
| 34 | ||
| 35 | #include "zig_clang.h" | |
| 36 | ||
| 37 | // Detect additions to the enum | |
| 38 | void zig2clang_BO(ZigClangBO op) { | |
| 39 | switch (op) { | |
| 40 | case ZigClangBO_PtrMemD: | |
| 41 | case ZigClangBO_PtrMemI: | |
| 42 | case ZigClangBO_Cmp: | |
| 43 | case ZigClangBO_Mul: | |
| 44 | case ZigClangBO_Div: | |
| 45 | case ZigClangBO_Rem: | |
| 46 | case ZigClangBO_Add: | |
| 47 | case ZigClangBO_Sub: | |
| 48 | case ZigClangBO_Shl: | |
| 49 | case ZigClangBO_Shr: | |
| 50 | case ZigClangBO_LT: | |
| 51 | case ZigClangBO_GT: | |
| 52 | case ZigClangBO_LE: | |
| 53 | case ZigClangBO_GE: | |
| 54 | case ZigClangBO_EQ: | |
| 55 | case ZigClangBO_NE: | |
| 56 | case ZigClangBO_And: | |
| 57 | case ZigClangBO_Xor: | |
| 58 | case ZigClangBO_Or: | |
| 59 | case ZigClangBO_LAnd: | |
| 60 | case ZigClangBO_LOr: | |
| 61 | case ZigClangBO_Assign: | |
| 62 | case ZigClangBO_Comma: | |
| 63 | case ZigClangBO_MulAssign: | |
| 64 | case ZigClangBO_DivAssign: | |
| 65 | case ZigClangBO_RemAssign: | |
| 66 | case ZigClangBO_AddAssign: | |
| 67 | case ZigClangBO_SubAssign: | |
| 68 | case ZigClangBO_ShlAssign: | |
| 69 | case ZigClangBO_ShrAssign: | |
| 70 | case ZigClangBO_AndAssign: | |
| 71 | case ZigClangBO_XorAssign: | |
| 72 | case ZigClangBO_OrAssign: | |
| 73 | break; | |
| 74 | } | |
| 75 | } | |
| 76 | ||
| 77 | static_assert((clang::BinaryOperatorKind)ZigClangBO_Add == clang::BO_Add, ""); | |
| 78 | static_assert((clang::BinaryOperatorKind)ZigClangBO_AddAssign == clang::BO_AddAssign, ""); | |
| 79 | static_assert((clang::BinaryOperatorKind)ZigClangBO_And == clang::BO_And, ""); | |
| 80 | static_assert((clang::BinaryOperatorKind)ZigClangBO_AndAssign == clang::BO_AndAssign, ""); | |
| 81 | static_assert((clang::BinaryOperatorKind)ZigClangBO_Assign == clang::BO_Assign, ""); | |
| 82 | static_assert((clang::BinaryOperatorKind)ZigClangBO_Cmp == clang::BO_Cmp, ""); | |
| 83 | static_assert((clang::BinaryOperatorKind)ZigClangBO_Comma == clang::BO_Comma, ""); | |
| 84 | static_assert((clang::BinaryOperatorKind)ZigClangBO_Div == clang::BO_Div, ""); | |
| 85 | static_assert((clang::BinaryOperatorKind)ZigClangBO_DivAssign == clang::BO_DivAssign, ""); | |
| 86 | static_assert((clang::BinaryOperatorKind)ZigClangBO_EQ == clang::BO_EQ, ""); | |
| 87 | static_assert((clang::BinaryOperatorKind)ZigClangBO_GE == clang::BO_GE, ""); | |
| 88 | static_assert((clang::BinaryOperatorKind)ZigClangBO_GT == clang::BO_GT, ""); | |
| 89 | static_assert((clang::BinaryOperatorKind)ZigClangBO_LAnd == clang::BO_LAnd, ""); | |
| 90 | static_assert((clang::BinaryOperatorKind)ZigClangBO_LE == clang::BO_LE, ""); | |
| 91 | static_assert((clang::BinaryOperatorKind)ZigClangBO_LOr == clang::BO_LOr, ""); | |
| 92 | static_assert((clang::BinaryOperatorKind)ZigClangBO_LT == clang::BO_LT, ""); | |
| 93 | static_assert((clang::BinaryOperatorKind)ZigClangBO_Mul == clang::BO_Mul, ""); | |
| 94 | static_assert((clang::BinaryOperatorKind)ZigClangBO_MulAssign == clang::BO_MulAssign, ""); | |
| 95 | static_assert((clang::BinaryOperatorKind)ZigClangBO_NE == clang::BO_NE, ""); | |
| 96 | static_assert((clang::BinaryOperatorKind)ZigClangBO_Or == clang::BO_Or, ""); | |
| 97 | static_assert((clang::BinaryOperatorKind)ZigClangBO_OrAssign == clang::BO_OrAssign, ""); | |
| 98 | static_assert((clang::BinaryOperatorKind)ZigClangBO_PtrMemD == clang::BO_PtrMemD, ""); | |
| 99 | static_assert((clang::BinaryOperatorKind)ZigClangBO_PtrMemI == clang::BO_PtrMemI, ""); | |
| 100 | static_assert((clang::BinaryOperatorKind)ZigClangBO_Rem == clang::BO_Rem, ""); | |
| 101 | static_assert((clang::BinaryOperatorKind)ZigClangBO_RemAssign == clang::BO_RemAssign, ""); | |
| 102 | static_assert((clang::BinaryOperatorKind)ZigClangBO_Shl == clang::BO_Shl, ""); | |
| 103 | static_assert((clang::BinaryOperatorKind)ZigClangBO_ShlAssign == clang::BO_ShlAssign, ""); | |
| 104 | static_assert((clang::BinaryOperatorKind)ZigClangBO_Shr == clang::BO_Shr, ""); | |
| 105 | static_assert((clang::BinaryOperatorKind)ZigClangBO_ShrAssign == clang::BO_ShrAssign, ""); | |
| 106 | static_assert((clang::BinaryOperatorKind)ZigClangBO_Sub == clang::BO_Sub, ""); | |
| 107 | static_assert((clang::BinaryOperatorKind)ZigClangBO_SubAssign == clang::BO_SubAssign, ""); | |
| 108 | static_assert((clang::BinaryOperatorKind)ZigClangBO_Xor == clang::BO_Xor, ""); | |
| 109 | static_assert((clang::BinaryOperatorKind)ZigClangBO_XorAssign == clang::BO_XorAssign, ""); | |
| 110 | ||
| 111 | // This function detects additions to the enum | |
| 112 | void zig2clang_UO(ZigClangUO op) { | |
| 113 | switch (op) { | |
| 114 | case ZigClangUO_AddrOf: | |
| 115 | case ZigClangUO_Coawait: | |
| 116 | case ZigClangUO_Deref: | |
| 117 | case ZigClangUO_Extension: | |
| 118 | case ZigClangUO_Imag: | |
| 119 | case ZigClangUO_LNot: | |
| 120 | case ZigClangUO_Minus: | |
| 121 | case ZigClangUO_Not: | |
| 122 | case ZigClangUO_Plus: | |
| 123 | case ZigClangUO_PostDec: | |
| 124 | case ZigClangUO_PostInc: | |
| 125 | case ZigClangUO_PreDec: | |
| 126 | case ZigClangUO_PreInc: | |
| 127 | case ZigClangUO_Real: | |
| 128 | break; | |
| 129 | } | |
| 130 | } | |
| 131 | ||
| 132 | static_assert((clang::UnaryOperatorKind)ZigClangUO_AddrOf == clang::UO_AddrOf, ""); | |
| 133 | static_assert((clang::UnaryOperatorKind)ZigClangUO_Coawait == clang::UO_Coawait, ""); | |
| 134 | static_assert((clang::UnaryOperatorKind)ZigClangUO_Deref == clang::UO_Deref, ""); | |
| 135 | static_assert((clang::UnaryOperatorKind)ZigClangUO_Extension == clang::UO_Extension, ""); | |
| 136 | static_assert((clang::UnaryOperatorKind)ZigClangUO_Imag == clang::UO_Imag, ""); | |
| 137 | static_assert((clang::UnaryOperatorKind)ZigClangUO_LNot == clang::UO_LNot, ""); | |
| 138 | static_assert((clang::UnaryOperatorKind)ZigClangUO_Minus == clang::UO_Minus, ""); | |
| 139 | static_assert((clang::UnaryOperatorKind)ZigClangUO_Not == clang::UO_Not, ""); | |
| 140 | static_assert((clang::UnaryOperatorKind)ZigClangUO_Plus == clang::UO_Plus, ""); | |
| 141 | static_assert((clang::UnaryOperatorKind)ZigClangUO_PostDec == clang::UO_PostDec, ""); | |
| 142 | static_assert((clang::UnaryOperatorKind)ZigClangUO_PostInc == clang::UO_PostInc, ""); | |
| 143 | static_assert((clang::UnaryOperatorKind)ZigClangUO_PreDec == clang::UO_PreDec, ""); | |
| 144 | static_assert((clang::UnaryOperatorKind)ZigClangUO_PreInc == clang::UO_PreInc, ""); | |
| 145 | static_assert((clang::UnaryOperatorKind)ZigClangUO_Real == clang::UO_Real, ""); | |
| 146 | ||
| 147 | static_assert(sizeof(ZigClangABISourceLocation) == sizeof(clang::SourceLocation)); | |
| 148 | ||
| 149 | clang::SourceLocation ZigClangSourceManager_getSpellingLoc(const ZigClangSourceManager *self, | |
| 150 | clang::SourceLocation Loc) | |
| 151 | { | |
| 152 | return reinterpret_cast<const clang::SourceManager *>(self)->getSpellingLoc(Loc); | |
| 153 | } | |
| 154 | ||
| 155 | const char *ZigClangSourceManager_getFilename(const ZigClangSourceManager *self, | |
| 156 | clang::SourceLocation SpellingLoc) | |
| 157 | { | |
| 158 | StringRef s = reinterpret_cast<const clang::SourceManager *>(self)->getFilename(SpellingLoc); | |
| 159 | return (const char *)s.bytes_begin(); | |
| 160 | } | |
| 161 | ||
| 162 | unsigned ZigClangSourceManager_getSpellingLineNumber(const ZigClangSourceManager *self, | |
| 163 | ZigClangSourceLocation Loc) | |
| 164 | { | |
| 165 | return reinterpret_cast<const clang::SourceManager *>(self)->getSpellingLineNumber(Loc); | |
| 166 | } | |
| 167 | ||
| 168 | unsigned ZigClangSourceManager_getSpellingColumnNumber(const ZigClangSourceManager *self, | |
| 169 | ZigClangSourceLocation Loc) | |
| 170 | { | |
| 171 | return reinterpret_cast<const clang::SourceManager *>(self)->getSpellingColumnNumber(Loc); | |
| 172 | } | |
| 173 | ||
| 174 | const char* ZigClangSourceManager_getCharacterData(const ZigClangSourceManager *self, | |
| 175 | ZigClangSourceLocation SL) | |
| 176 | { | |
| 177 | return reinterpret_cast<const clang::SourceManager *>(self)->getCharacterData(SL); | |
| 178 | } |
src/zig_clang.h created+253| ... | ... | @@ -0,0 +1,253 @@ |
| 1 | /* | |
| 2 | * Copyright (c) 2019 Andrew Kelley | |
| 3 | * | |
| 4 | * This file is part of zig, which is MIT licensed. | |
| 5 | * See http://opensource.org/licenses/MIT | |
| 6 | */ | |
| 7 | ||
| 8 | #ifndef ZIG_ZIG_CLANG_H | |
| 9 | #define ZIG_ZIG_CLANG_H | |
| 10 | ||
| 11 | #ifdef __cplusplus | |
| 12 | #define ZIG_EXTERN_C extern "C" | |
| 13 | #else | |
| 14 | #define ZIG_EXTERN_C | |
| 15 | #endif | |
| 16 | ||
| 17 | // ATTENTION: If you modify this file, be sure to update the corresponding | |
| 18 | // extern function declarations in the self-hosted compiler. | |
| 19 | ||
| 20 | #ifndef ZIG_CLANG_SOURCE_LOCATION | |
| 21 | #define ZIG_CLANG_SOURCE_LOCATION ZigClangSourceLocation | |
| 22 | #endif | |
| 23 | ||
| 24 | struct ZIG_CLANG_SOURCE_LOCATION { | |
| 25 | unsigned ID; | |
| 26 | }; | |
| 27 | ||
| 28 | struct ZigClangAPValue; | |
| 29 | struct ZigClangASTContext; | |
| 30 | struct ZigClangASTUnit; | |
| 31 | struct ZigClangArraySubscriptExpr; | |
| 32 | struct ZigClangArrayType; | |
| 33 | struct ZigClangAttributedType; | |
| 34 | struct ZigClangBinaryOperator; | |
| 35 | struct ZigClangBreakStmt; | |
| 36 | struct ZigClangBuiltinType; | |
| 37 | struct ZigClangCStyleCastExpr; | |
| 38 | struct ZigClangCallExpr; | |
| 39 | struct ZigClangCaseStmt; | |
| 40 | struct ZigClangCompoundAssignOperator; | |
| 41 | struct ZigClangCompoundStmt; | |
| 42 | struct ZigClangConditionalOperator; | |
| 43 | struct ZigClangConstantArrayType; | |
| 44 | struct ZigClangContinueStmt; | |
| 45 | struct ZigClangDecayedType; | |
| 46 | struct ZigClangDecl; | |
| 47 | struct ZigClangDeclRefExpr; | |
| 48 | struct ZigClangDeclStmt; | |
| 49 | struct ZigClangDefaultStmt; | |
| 50 | struct ZigClangDiagnosticOptions; | |
| 51 | struct ZigClangDiagnosticsEngine; | |
| 52 | struct ZigClangDoStmt; | |
| 53 | struct ZigClangElaboratedType; | |
| 54 | struct ZigClangEnumConstantDecl; | |
| 55 | struct ZigClangEnumDecl; | |
| 56 | struct ZigClangEnumType; | |
| 57 | struct ZigClangExpr; | |
| 58 | struct ZigClangFieldDecl; | |
| 59 | struct ZigClangFileID; | |
| 60 | struct ZigClangForStmt; | |
| 61 | struct ZigClangFullSourceLoc; | |
| 62 | struct ZigClangFunctionDecl; | |
| 63 | struct ZigClangFunctionProtoType; | |
| 64 | struct ZigClangIfStmt; | |
| 65 | struct ZigClangImplicitCastExpr; | |
| 66 | struct ZigClangIncompleteArrayType; | |
| 67 | struct ZigClangIntegerLiteral; | |
| 68 | struct ZigClangMacroDefinitionRecord; | |
| 69 | struct ZigClangMemberExpr; | |
| 70 | struct ZigClangNamedDecl; | |
| 71 | struct ZigClangNone; | |
| 72 | struct ZigClangPCHContainerOperations; | |
| 73 | struct ZigClangParenExpr; | |
| 74 | struct ZigClangParenType; | |
| 75 | struct ZigClangParmVarDecl; | |
| 76 | struct ZigClangPointerType; | |
| 77 | struct ZigClangPreprocessedEntity; | |
| 78 | struct ZigClangQualType; | |
| 79 | struct ZigClangRecordDecl; | |
| 80 | struct ZigClangRecordType; | |
| 81 | struct ZigClangReturnStmt; | |
| 82 | struct ZigClangSkipFunctionBodiesScope; | |
| 83 | struct ZigClangSourceManager; | |
| 84 | struct ZigClangSourceRange; | |
| 85 | struct ZigClangStmt; | |
| 86 | struct ZigClangStorageClass; | |
| 87 | struct ZigClangStringLiteral; | |
| 88 | struct ZigClangStringRef; | |
| 89 | struct ZigClangSwitchStmt; | |
| 90 | struct ZigClangType; | |
| 91 | struct ZigClangTypedefNameDecl; | |
| 92 | struct ZigClangTypedefType; | |
| 93 | struct ZigClangUnaryExprOrTypeTraitExpr; | |
| 94 | struct ZigClangUnaryOperator; | |
| 95 | struct ZigClangValueDecl; | |
| 96 | struct ZigClangVarDecl; | |
| 97 | struct ZigClangWhileStmt; | |
| 98 | ||
| 99 | enum ZigClangBO { | |
| 100 | ZigClangBO_PtrMemD, | |
| 101 | ZigClangBO_PtrMemI, | |
| 102 | ZigClangBO_Mul, | |
| 103 | ZigClangBO_Div, | |
| 104 | ZigClangBO_Rem, | |
| 105 | ZigClangBO_Add, | |
| 106 | ZigClangBO_Sub, | |
| 107 | ZigClangBO_Shl, | |
| 108 | ZigClangBO_Shr, | |
| 109 | ZigClangBO_Cmp, | |
| 110 | ZigClangBO_LT, | |
| 111 | ZigClangBO_GT, | |
| 112 | ZigClangBO_LE, | |
| 113 | ZigClangBO_GE, | |
| 114 | ZigClangBO_EQ, | |
| 115 | ZigClangBO_NE, | |
| 116 | ZigClangBO_And, | |
| 117 | ZigClangBO_Xor, | |
| 118 | ZigClangBO_Or, | |
| 119 | ZigClangBO_LAnd, | |
| 120 | ZigClangBO_LOr, | |
| 121 | ZigClangBO_Assign, | |
| 122 | ZigClangBO_MulAssign, | |
| 123 | ZigClangBO_DivAssign, | |
| 124 | ZigClangBO_RemAssign, | |
| 125 | ZigClangBO_AddAssign, | |
| 126 | ZigClangBO_SubAssign, | |
| 127 | ZigClangBO_ShlAssign, | |
| 128 | ZigClangBO_ShrAssign, | |
| 129 | ZigClangBO_AndAssign, | |
| 130 | ZigClangBO_XorAssign, | |
| 131 | ZigClangBO_OrAssign, | |
| 132 | ZigClangBO_Comma, | |
| 133 | }; | |
| 134 | ||
| 135 | enum ZigClangUO { | |
| 136 | ZigClangUO_PostInc, | |
| 137 | ZigClangUO_PostDec, | |
| 138 | ZigClangUO_PreInc, | |
| 139 | ZigClangUO_PreDec, | |
| 140 | ZigClangUO_AddrOf, | |
| 141 | ZigClangUO_Deref, | |
| 142 | ZigClangUO_Plus, | |
| 143 | ZigClangUO_Minus, | |
| 144 | ZigClangUO_Not, | |
| 145 | ZigClangUO_LNot, | |
| 146 | ZigClangUO_Real, | |
| 147 | ZigClangUO_Imag, | |
| 148 | ZigClangUO_Extension, | |
| 149 | ZigClangUO_Coawait, | |
| 150 | }; | |
| 151 | ||
| 152 | //struct ZigClangCC_AAPCS; | |
| 153 | //struct ZigClangCC_AAPCS_VFP; | |
| 154 | //struct ZigClangCC_C; | |
| 155 | //struct ZigClangCC_IntelOclBicc; | |
| 156 | //struct ZigClangCC_OpenCLKernel; | |
| 157 | //struct ZigClangCC_PreserveAll; | |
| 158 | //struct ZigClangCC_PreserveMost; | |
| 159 | //struct ZigClangCC_SpirFunction; | |
| 160 | //struct ZigClangCC_Swift; | |
| 161 | //struct ZigClangCC_Win64; | |
| 162 | //struct ZigClangCC_X86FastCall; | |
| 163 | //struct ZigClangCC_X86Pascal; | |
| 164 | //struct ZigClangCC_X86RegCall; | |
| 165 | //struct ZigClangCC_X86StdCall; | |
| 166 | //struct ZigClangCC_X86ThisCall; | |
| 167 | //struct ZigClangCC_X86VectorCall; | |
| 168 | //struct ZigClangCC_X86_64SysV; | |
| 169 | ||
| 170 | //struct ZigClangCK_ARCConsumeObject; | |
| 171 | //struct ZigClangCK_ARCExtendBlockObject; | |
| 172 | //struct ZigClangCK_ARCProduceObject; | |
| 173 | //struct ZigClangCK_ARCReclaimReturnedObject; | |
| 174 | //struct ZigClangCK_AddressSpaceConversion; | |
| 175 | //struct ZigClangCK_AnyPointerToBlockPointerCast; | |
| 176 | //struct ZigClangCK_ArrayToPointerDecay; | |
| 177 | //struct ZigClangCK_AtomicToNonAtomic; | |
| 178 | //struct ZigClangCK_BaseToDerived; | |
| 179 | //struct ZigClangCK_BaseToDerivedMemberPointer; | |
| 180 | //struct ZigClangCK_BitCast; | |
| 181 | //struct ZigClangCK_BlockPointerToObjCPointerCast; | |
| 182 | //struct ZigClangCK_BooleanToSignedIntegral; | |
| 183 | //struct ZigClangCK_BuiltinFnToFnPtr; | |
| 184 | //struct ZigClangCK_CPointerToObjCPointerCast; | |
| 185 | //struct ZigClangCK_ConstructorConversion; | |
| 186 | //struct ZigClangCK_CopyAndAutoreleaseBlockObject; | |
| 187 | //struct ZigClangCK_Dependent; | |
| 188 | //struct ZigClangCK_DerivedToBase; | |
| 189 | //struct ZigClangCK_DerivedToBaseMemberPointer; | |
| 190 | //struct ZigClangCK_Dynamic; | |
| 191 | //struct ZigClangCK_FloatingCast; | |
| 192 | //struct ZigClangCK_FloatingComplexCast; | |
| 193 | //struct ZigClangCK_FloatingComplexToBoolean; | |
| 194 | //struct ZigClangCK_FloatingComplexToIntegralComplex; | |
| 195 | //struct ZigClangCK_FloatingComplexToReal; | |
| 196 | //struct ZigClangCK_FloatingRealToComplex; | |
| 197 | //struct ZigClangCK_FloatingToBoolean; | |
| 198 | //struct ZigClangCK_FloatingToIntegral; | |
| 199 | //struct ZigClangCK_FunctionToPointerDecay; | |
| 200 | //struct ZigClangCK_IntToOCLSampler; | |
| 201 | //struct ZigClangCK_IntegralCast; | |
| 202 | //struct ZigClangCK_IntegralComplexCast; | |
| 203 | //struct ZigClangCK_IntegralComplexToBoolean; | |
| 204 | //struct ZigClangCK_IntegralComplexToFloatingComplex; | |
| 205 | //struct ZigClangCK_IntegralComplexToReal; | |
| 206 | //struct ZigClangCK_IntegralRealToComplex; | |
| 207 | //struct ZigClangCK_IntegralToBoolean; | |
| 208 | //struct ZigClangCK_IntegralToFloating; | |
| 209 | //struct ZigClangCK_IntegralToPointer; | |
| 210 | //struct ZigClangCK_LValueBitCast; | |
| 211 | //struct ZigClangCK_LValueToRValue; | |
| 212 | //struct ZigClangCK_MemberPointerToBoolean; | |
| 213 | //struct ZigClangCK_NoOp; | |
| 214 | //struct ZigClangCK_NonAtomicToAtomic; | |
| 215 | //struct ZigClangCK_NullToMemberPointer; | |
| 216 | //struct ZigClangCK_NullToPointer; | |
| 217 | //struct ZigClangCK_ObjCObjectLValueCast; | |
| 218 | //struct ZigClangCK_PointerToBoolean; | |
| 219 | //struct ZigClangCK_PointerToIntegral; | |
| 220 | //struct ZigClangCK_ReinterpretMemberPointer; | |
| 221 | //struct ZigClangCK_ToUnion; | |
| 222 | //struct ZigClangCK_ToVoid; | |
| 223 | //struct ZigClangCK_UncheckedDerivedToBase; | |
| 224 | //struct ZigClangCK_UserDefinedConversion; | |
| 225 | //struct ZigClangCK_VectorSplat; | |
| 226 | //struct ZigClangCK_ZeroToOCLEvent; | |
| 227 | //struct ZigClangCK_ZeroToOCLQueue; | |
| 228 | ||
| 229 | //struct ZigClangETK_Class; | |
| 230 | //struct ZigClangETK_Enum; | |
| 231 | //struct ZigClangETK_Interface; | |
| 232 | //struct ZigClangETK_None; | |
| 233 | //struct ZigClangETK_Struct; | |
| 234 | //struct ZigClangETK_Typename; | |
| 235 | //struct ZigClangETK_Union; | |
| 236 | ||
| 237 | //struct ZigClangSC_None; | |
| 238 | //struct ZigClangSC_PrivateExtern; | |
| 239 | //struct ZigClangSC_Static; | |
| 240 | ||
| 241 | //struct ZigClangTU_Complete; | |
| 242 | ||
| 243 | ZIG_EXTERN_C ZigClangSourceLocation ZigClangSourceManager_getSpellingLoc(const ZigClangSourceManager *, | |
| 244 | ZigClangSourceLocation Loc); | |
| 245 | ZIG_EXTERN_C const char *ZigClangSourceManager_getFilename(const ZigClangSourceManager *, | |
| 246 | ZigClangSourceLocation SpellingLoc); | |
| 247 | ZIG_EXTERN_C unsigned ZigClangSourceManager_getSpellingLineNumber(const ZigClangSourceManager *, | |
| 248 | ZigClangSourceLocation Loc); | |
| 249 | ZIG_EXTERN_C unsigned ZigClangSourceManager_getSpellingColumnNumber(const ZigClangSourceManager *, | |
| 250 | ZigClangSourceLocation Loc); | |
| 251 | ZIG_EXTERN_C const char* ZigClangSourceManager_getCharacterData(const ZigClangSourceManager *, | |
| 252 | ZigClangSourceLocation SL); | |
| 253 | #endif |