MCPcopy Create free account
hub / github.com/FEX-Emu/FEX / GetTypeAnnotations

Function GetTypeAnnotations

ThunkLibs/Generator/analysis.cpp:163–185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

161};
162
163static TypeAnnotations GetTypeAnnotations(clang::ASTContext& context, clang::CXXRecordDecl* decl) {
164 if (!decl->hasDefinition()) {
165 return {};
166 }
167
168 ErrorReporter report_error {context};
169 TypeAnnotations ret;
170
171 for (const clang::CXXBaseSpecifier& base : decl->bases()) {
172 auto annotation = base.getType().getAsString();
173 if (annotation == "fexgen::opaque_type") {
174 ret.is_opaque = true;
175 } else if (annotation == "fexgen::assume_compatible_data_layout") {
176 ret.assumed_compatible = true;
177 } else if (annotation == "fexgen::emit_layout_wrappers") {
178 ret.emit_layout_wrappers = true;
179 } else {
180 throw report_error(base.getSourceRange().getBegin(), "Unknown type annotation");
181 }
182 }
183
184 return ret;
185}
186
187static ParameterAnnotations GetParameterAnnotations(clang::ASTContext& context, clang::CXXRecordDecl* decl) {
188 if (!decl->hasDefinition()) {

Callers 1

ParseInterfaceMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected