Changes in src/CodeGen/FixNames.cc [8d7bef2:6d611fb]
- File:
-
- 1 edited
-
src/CodeGen/FixNames.cc (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/CodeGen/FixNames.cc
r8d7bef2 r6d611fb 16 16 #include "FixNames.h" 17 17 18 #include <memory> // for unique_ptr 18 19 #include <string> // for string, operator!=, operator== 19 20 … … 46 47 std::string mangle_main() { 47 48 FunctionType* main_type; 48 FunctionDecl* mainDecl = new FunctionDecl{49 "main", Type::StorageClasses(), LinkageSpec::Cforall,50 main_type = new FunctionType{ Type::Qualifiers(), true }, nullptr};49 std::unique_ptr<FunctionDecl> mainDecl { new FunctionDecl( "main", Type::StorageClasses(), LinkageSpec::Cforall, 50 main_type = new FunctionType( Type::Qualifiers(), true ), nullptr ) 51 }; 51 52 main_type->get_returnVals().push_back( 52 53 new ObjectDecl( "", Type::StorageClasses(), LinkageSpec::Cforall, 0, new BasicType( Type::Qualifiers(), BasicType::SignedInt ), nullptr ) 53 54 ); 54 55 55 auto && name = SymTab::Mangler::mangle( mainDecl );56 auto && name = SymTab::Mangler::mangle( mainDecl.get() ); 56 57 // std::cerr << name << std::endl; 57 return name;58 return std::move(name); 58 59 } 59 60 std::string mangle_main_args() { 60 61 FunctionType* main_type; 61 FunctionDecl* mainDecl = new FunctionDecl{62 "main", Type::StorageClasses(), LinkageSpec::Cforall,63 main_type = new FunctionType{ Type::Qualifiers(), false }, nullptr};62 std::unique_ptr<FunctionDecl> mainDecl { new FunctionDecl( "main", Type::StorageClasses(), LinkageSpec::Cforall, 63 main_type = new FunctionType( Type::Qualifiers(), false ), nullptr ) 64 }; 64 65 main_type->get_returnVals().push_back( 65 66 new ObjectDecl( "", Type::StorageClasses(), LinkageSpec::Cforall, 0, new BasicType( Type::Qualifiers(), BasicType::SignedInt ), nullptr ) … … 76 77 ); 77 78 78 auto&& name = SymTab::Mangler::mangle( mainDecl );79 auto&& name = SymTab::Mangler::mangle( mainDecl.get() ); 79 80 // std::cerr << name << std::endl; 80 return name;81 return std::move(name); 81 82 } 82 83
Note:
See TracChangeset
for help on using the changeset viewer.