source: translator/CodeGen/Generate.cc @ c11e31c

ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsctordeferred_resndemanglerenumforall-pointer-decaygc_noraiijacob/cs343-translationjenkins-sandboxmemorynew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newstringwith_gc
Last change on this file since c11e31c was 17cd4eb, checked in by Peter A. Buhr <pabuhr@…>, 10 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.