Beispiel #1
0
 public CodeGenerator(LanguageLevel level, TargetMachine machine)
 {
     Context            = new Context( );
     TargetMachine      = machine;
     InstructionBuilder = new InstructionBuilder(Context);
     NamedValues        = new Dictionary <string, Alloca>( );
     FunctionPrototypes = new PrototypeCollection( );
     ParserStack        = new ReplParserStack(level);
 }
Beispiel #2
0
 public CodeGenerator(LanguageLevel level)
 {
     Context = new Context( );
     InitializeModuleAndPassManager( );
     InstructionBuilder = new InstructionBuilder(Context);
     JIT                = new KaleidoscopeJIT( );
     NamedValues        = new Dictionary <string, Alloca>( );
     FunctionPrototypes = new PrototypeCollection( );
     ParserStack        = new ReplParserStack(level);
 }
Beispiel #3
0
 public CodeGenerator(LanguageLevel level, TargetMachine machine)
 {
     LexicalBlocks      = new Stack <DIScope>( );
     Context            = new Context( );
     TargetMachine      = machine;
     InstructionBuilder = new InstructionBuilder(Context);
     NamedValues        = new Dictionary <string, Alloca>( );
     FunctionPrototypes = new PrototypeCollection( );
     ParserStack        = new ReplParserStack(level);
     Module             = new BitcodeModule(Context, "Kaleidoscope", SourceLanguage.C, "fib.ks", "Kaleidoscope Compiler")
     {
         TargetTriple = machine.Triple,
         Layout       = machine.TargetData
     };
     DoubleType = new DebugBasicType(Context.DoubleType, Module, "double", DiTypeKind.Float);
 }