source: translator/CodeGen/Generate.cc@ c8ffe20b

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 c8ffe20b was 51b73452, checked in by Peter A. Buhr <pabuhr@…>, 11 years ago

initial commit

  • Property mode set to 100644
File size: 784 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
15 void generate( std::list< Declaration* > translationUnit, std::ostream &os, bool doIntrinsics ) {
16
17 CodeGen::CodeGenerator2 cgv( os );
18
19 for(std::list<Declaration *>::iterator i = translationUnit.begin(); i != translationUnit.end(); i++)
20 {
21 if( LinkageSpec::isGeneratable( (*i)->get_linkage() ) && (doIntrinsics || !LinkageSpec::isBuiltin( (*i)->get_linkage() ) ) ) {
22 (*i)->accept(cgv);
23 cgv.shift_left();
24 if( doSemicolon( *i ) ) {
25 os << ";";
26 }
27 os << std::endl;
28 }
29 }
30
31 }
32
33} // namespace CodeGen
34
35
Note: See TracBrowser for help on using the repository browser.