Changes in src/Validate/Autogen.cpp [fc134a48:91715ce]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Validate/Autogen.cpp
rfc134a48 r91715ce 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.