source: translator/CodeGen/Generate.cc@ 643a2e1

ADT aaron-thesis arm-eh ast-experimental cleanup-dtors ctor deferred_resn demangler enum forall-pointer-decay gc_noraii jacob/cs343-translation jenkins-sandbox memory new-ast new-ast-unique-expr new-env no_list persistent-indexer pthread-emulation qualifiedEnum resolv-new string with_gc
Last change on this file since 643a2e1 was 17cd4eb, checked in by Peter A. Buhr <pabuhr@…>, 11 years ago

fixed restrict, fixed parameter copy, introduced name table for types, changed variable after to string

  • Property mode set to 100644
File size: 753 bytes
Line 
1#include <algorithm>
2#include <iostream>
3#include <cassert>
4#include <list>
5
6#include "Generate.h"
7#include "SynTree/Declaration.h"
8
9#include "CodeGenerator2.h"
10
11using namespace std;
12
13namespace CodeGen {
14 void generate( std::list< Declaration* > translationUnit, std::ostream &os, bool doIntrinsics ) {
15 CodeGen::CodeGenerator2 cgv( os );
16
17 for ( std::list<Declaration *>::iterator i = translationUnit.begin(); i != translationUnit.end(); i++ ) {
18 if ( LinkageSpec::isGeneratable( (*i)->get_linkage() ) && (doIntrinsics || ! LinkageSpec::isBuiltin( (*i)->get_linkage() ) ) ) {
19 (*i)->accept(cgv);
20 cgv.shift_left();
21 if ( doSemicolon( *i ) ) {
22 os << ";";
23 } // if
24 os << std::endl;
25 } // if
26 } // for
27 }
28} // namespace CodeGen
Note: See TracBrowser for help on using the repository browser.