- Timestamp:
- Jun 26, 2022, 10:29:22 PM (3 years ago)
- Branches:
- ADT, ast-experimental, master, pthread-emulation, qualifiedEnum
- Children:
- 9b817e15
- Parents:
- 8446c18 (diff), 91715ce1 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- src
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/module.mk
r8446c18 r6e21aaf 37 37 AST/Init.cpp \ 38 38 AST/Init.hpp \ 39 AST/Inspect.cpp \ 40 AST/Inspect.hpp \ 39 41 AST/Label.hpp \ 40 42 AST/LinkageSpec.cpp \ -
src/CodeGen/CodeGenerator.cc
r8446c18 r6e21aaf 294 294 } else { 295 295 if ( obj->get_init() ) { 296 obj->get_init()->accept( *visitor ); 296 obj->get_init()->accept( *visitor ); 297 297 } else { 298 298 // Should not reach here! … … 683 683 extension( variableExpr ); 684 684 const OperatorInfo * opInfo; 685 if ( variableExpr->get_var()->get_linkage() == LinkageSpec::Intrinsic && (opInfo = operatorLookup( variableExpr->get_var()->get_name() )) && opInfo->type == OT_CONSTANT ) { 685 if( dynamic_cast<ZeroType*>( variableExpr->get_var()->get_type() ) ) { 686 output << "0"; 687 } else if ( variableExpr->get_var()->get_linkage() == LinkageSpec::Intrinsic && (opInfo = operatorLookup( variableExpr->get_var()->get_name() )) && opInfo->type == OT_CONSTANT ) { 686 688 output << opInfo->symbol; 687 689 } else { 688 // if (dynamic_cast<EnumInstType *>(variableExpr->get_var()->get_type()) 690 // if (dynamic_cast<EnumInstType *>(variableExpr->get_var()->get_type()) 689 691 // && dynamic_cast<EnumInstType *>(variableExpr->get_var()->get_type())->baseEnum->base) { 690 692 // output << '(' <<genType(dynamic_cast<EnumInstType *>(variableExpr->get_var()->get_type())->baseEnum->base, "", options) << ')'; -
src/GenPoly/Box.cc
r8446c18 r6e21aaf 1277 1277 FunctionType * ftype = functionDecl->type; 1278 1278 if ( ! ftype->returnVals.empty() && functionDecl->statements ) { 1279 if ( ! isPrefix( functionDecl->name, "_thunk" ) && ! isPrefix( functionDecl->name, "_adapter" ) ) { // xxx - remove check for prefix once thunks properly use ctor/dtors 1279 // intrinsic functions won't be using the _retval so no need to generate it. 1280 if ( functionDecl->linkage != LinkageSpec::Intrinsic && !isPrefix( functionDecl->name, "_thunk" ) && ! isPrefix( functionDecl->name, "_adapter" ) ) { // xxx - remove check for prefix once thunks properly use ctor/dtors 1280 1281 assert( ftype->returnVals.size() == 1 ); 1281 1282 DeclarationWithType * retval = ftype->returnVals.front(); -
src/Validate/Autogen.cpp
r8446c18 r6e21aaf 28 28 #include "AST/DeclReplacer.hpp" 29 29 #include "AST/Expr.hpp" 30 #include "AST/Inspect.hpp" 30 31 #include "AST/Pass.hpp" 31 32 #include "AST/Stmt.hpp" … … 121 122 122 123 // Built-ins do not use autogeneration. 123 bool shouldAutogen() const final { return !decl->linkage.is_builtin ; }124 bool shouldAutogen() const final { return !decl->linkage.is_builtin && !structHasFlexibleArray(decl); } 124 125 private: 125 126 void genFuncBody( ast::FunctionDecl * decl ) final; … … 183 184 { 184 185 // TODO: These functions are somewhere between instrinsic and autogen, 185 // could possibly use a new linkage type. For now we just make them 186 // intrinsic to code-gen them as C assignments. 187 proto_linkage = ast::Linkage::Intrinsic; 186 // could possibly use a new linkage type. For now we just make the 187 // basic ones intrinsic to code-gen them as C assignments. 188 const auto & real_type = decl->base; 189 const auto & basic = real_type.as<ast::BasicType>(); 190 if(!real_type || (basic && basic->isInteger())) proto_linkage = ast::Linkage::Intrinsic; 188 191 } 189 192 … … 402 405 auto retval = srcParam(); 403 406 retval->name = "_ret"; 404 // xxx - Adding this unused attribute can slience unused variable warning405 // However, some code might not be compiled as expected406 // Temporarily disabled407 // retval->attributes.push_back(new ast::Attribute("unused"));408 407 return genProto( "?=?", { dstParam(), srcParam() }, { retval } ); 409 408 }
Note:
See TracChangeset
for help on using the changeset viewer.