Change the way to manage the variables and operations:
[scilab.git] / scilab / modules / jit / src / cpp / llvm-wrapper-generated.cpp
index 7668c95..f4d76e4 100644 (file)
@@ -7,384 +7,18 @@ Module* makeLLVMModuleContents(Module *mod)
     mod->setModuleIdentifier("<stdin>");
 
     // Type Definitions
-    StructType *StructTy_class_std__ios_base__Init = mod->getTypeByName("class.std::ios_base::Init");
-    if (!StructTy_class_std__ios_base__Init)
-    {
-        StructTy_class_std__ios_base__Init = StructType::create(mod->getContext(), "class.std::ios_base::Init");
-    }
-    std::vector<Type*>StructTy_class_std__ios_base__Init_fields;
-    StructTy_class_std__ios_base__Init_fields.push_back(IntegerType::get(mod->getContext(), 8));
-    if (StructTy_class_std__ios_base__Init->isOpaque())
-    {
-        StructTy_class_std__ios_base__Init->setBody(StructTy_class_std__ios_base__Init_fields, /*isPacked=*/false);
-    }
-
-    PointerType* PointerTy_0 = PointerType::get(StructTy_class_std__ios_base__Init, 0);
-
-    PointerType* PointerTy_1 = PointerType::get(IntegerType::get(mod->getContext(), 8), 0);
-
-    std::vector<Type*>StructTy_3_fields;
-    StructTy_3_fields.push_back(IntegerType::get(mod->getContext(), 32));
-    std::vector<Type*>FuncTy_5_args;
-    FunctionType* FuncTy_5 = FunctionType::get(
-                                 /*Result=*/Type::getVoidTy(mod->getContext()),
-                                 /*Params=*/FuncTy_5_args,
-                                 /*isVarArg=*/false);
-
-    PointerType* PointerTy_4 = PointerType::get(FuncTy_5, 0);
-
-    StructTy_3_fields.push_back(PointerTy_4);
-    StructType *StructTy_3 = StructType::get(mod->getContext(), StructTy_3_fields, /*isPacked=*/false);
-
-    ArrayType* ArrayTy_2 = ArrayType::get(StructTy_3, 1);
-
-    PointerType* PointerTy_6 = PointerType::get(ArrayTy_2, 0);
-
-    std::vector<Type*>FuncTy_8_args;
-    FuncTy_8_args.push_back(PointerTy_0);
-    FunctionType* FuncTy_8 = FunctionType::get(
-                                 /*Result=*/Type::getVoidTy(mod->getContext()),
-                                 /*Params=*/FuncTy_8_args,
-                                 /*isVarArg=*/false);
-
-    PointerType* PointerTy_7 = PointerType::get(FuncTy_8, 0);
-
-    std::vector<Type*>FuncTy_10_args;
-    FuncTy_10_args.push_back(PointerTy_1);
-    FunctionType* FuncTy_10 = FunctionType::get(
-                                  /*Result=*/Type::getVoidTy(mod->getContext()),
-                                  /*Params=*/FuncTy_10_args,
-                                  /*isVarArg=*/false);
-
-    PointerType* PointerTy_9 = PointerType::get(FuncTy_10, 0);
-
-    std::vector<Type*>FuncTy_12_args;
-    FuncTy_12_args.push_back(PointerTy_9);
-    FuncTy_12_args.push_back(PointerTy_1);
-    FuncTy_12_args.push_back(PointerTy_1);
-    FunctionType* FuncTy_12 = FunctionType::get(
-                                  /*Result=*/IntegerType::get(mod->getContext(), 32),
-                                  /*Params=*/FuncTy_12_args,
-                                  /*isVarArg=*/false);
-
-    PointerType* PointerTy_11 = PointerType::get(FuncTy_12, 0);
-
-    std::vector<Type*>FuncTy_13_args;
-    FunctionType* FuncTy_13 = FunctionType::get(
-                                  /*Result=*/IntegerType::get(mod->getContext(), 32),
-                                  /*Params=*/FuncTy_13_args,
-                                  /*isVarArg=*/false);
-
-    StructType *StructTy_class_types__Double = mod->getTypeByName("class.types::Double");
-    if (!StructTy_class_types__Double)
-    {
-        StructTy_class_types__Double = StructType::create(mod->getContext(), "class.types::Double");
-    }
-    std::vector<Type*>StructTy_class_types__Double_fields;
-    StructType *StructTy_class_types__ArrayOf = mod->getTypeByName("class.types::ArrayOf");
-    if (!StructTy_class_types__ArrayOf)
-    {
-        StructTy_class_types__ArrayOf = StructType::create(mod->getContext(), "class.types::ArrayOf");
-    }
-    std::vector<Type*>StructTy_class_types__ArrayOf_fields;
-    StructType *StructTy_class_types__GenericType = mod->getTypeByName("class.types::GenericType");
-    if (!StructTy_class_types__GenericType)
-    {
-        StructTy_class_types__GenericType = StructType::create(mod->getContext(), "class.types::GenericType");
-    }
-    std::vector<Type*>StructTy_class_types__GenericType_fields;
-    ArrayType* ArrayTy_16 = ArrayType::get(IntegerType::get(mod->getContext(), 8), 36);
-
-    StructTy_class_types__GenericType_fields.push_back(ArrayTy_16);
-    StructTy_class_types__GenericType_fields.push_back(IntegerType::get(mod->getContext(), 32));
-    StructTy_class_types__GenericType_fields.push_back(IntegerType::get(mod->getContext(), 32));
-    StructTy_class_types__GenericType_fields.push_back(IntegerType::get(mod->getContext(), 32));
-    StructTy_class_types__GenericType_fields.push_back(IntegerType::get(mod->getContext(), 32));
-    ArrayType* ArrayTy_17 = ArrayType::get(IntegerType::get(mod->getContext(), 32), 50);
-
-    StructTy_class_types__GenericType_fields.push_back(ArrayTy_17);
-    StructTy_class_types__GenericType_fields.push_back(IntegerType::get(mod->getContext(), 32));
-    if (StructTy_class_types__GenericType->isOpaque())
-    {
-        StructTy_class_types__GenericType->setBody(StructTy_class_types__GenericType_fields, /*isPacked=*/false);
-    }
-
-    StructTy_class_types__ArrayOf_fields.push_back(StructTy_class_types__GenericType);
-    StructTy_class_types__ArrayOf_fields.push_back(IntegerType::get(mod->getContext(), 8));
-    PointerType* PointerTy_18 = PointerType::get(Type::getDoubleTy(mod->getContext()), 0);
-
-    StructTy_class_types__ArrayOf_fields.push_back(PointerTy_18);
-    StructTy_class_types__ArrayOf_fields.push_back(PointerTy_18);
-    if (StructTy_class_types__ArrayOf->isOpaque())
-    {
-        StructTy_class_types__ArrayOf->setBody(StructTy_class_types__ArrayOf_fields, /*isPacked=*/false);
-    }
-
-    StructTy_class_types__Double_fields.push_back(StructTy_class_types__ArrayOf);
-    StructTy_class_types__Double_fields.push_back(IntegerType::get(mod->getContext(), 8));
-    StructTy_class_types__Double_fields.push_back(IntegerType::get(mod->getContext(), 8));
-    if (StructTy_class_types__Double->isOpaque())
-    {
-        StructTy_class_types__Double->setBody(StructTy_class_types__Double_fields, /*isPacked=*/false);
-    }
-
-    PointerType* PointerTy_15 = PointerType::get(StructTy_class_types__Double, 0);
-
-    PointerType* PointerTy_14 = PointerType::get(PointerTy_15, 0);
-
-    PointerType* PointerTy_19 = PointerType::get(IntegerType::get(mod->getContext(), 32), 0);
-
-    std::vector<Type*>FuncTy_21_args;
-    FunctionType* FuncTy_21 = FunctionType::get(
-                                  /*Result=*/PointerTy_15,
-                                  /*Params=*/FuncTy_21_args,
-                                  /*isVarArg=*/false);
-
-    PointerType* PointerTy_20 = PointerType::get(FuncTy_21, 0);
-
-    std::vector<Type*>FuncTy_23_args;
-    FuncTy_23_args.push_back(PointerTy_15);
-    FuncTy_23_args.push_back(PointerTy_15);
-    FuncTy_23_args.push_back(PointerTy_14);
-    FunctionType* FuncTy_23 = FunctionType::get(
-                                  /*Result=*/IntegerType::get(mod->getContext(), 32),
-                                  /*Params=*/FuncTy_23_args,
-                                  /*isVarArg=*/false);
-
-    PointerType* PointerTy_22 = PointerType::get(FuncTy_23, 0);
-
 
     // Function Declarations
 
-    Function* func___cxx_global_var_init = mod->getFunction("__cxx_global_var_init");
-    if (!func___cxx_global_var_init)
-    {
-        func___cxx_global_var_init = Function::Create(
-                                         /*Type=*/FuncTy_5,
-                                         /*Linkage=*/GlobalValue::InternalLinkage,
-                                         /*Name=*/"__cxx_global_var_init", mod);
-        func___cxx_global_var_init->setCallingConv(CallingConv::C);
-        func___cxx_global_var_init->setSection(".text.startup");
-    }
-    AttrListPtr func___cxx_global_var_init_PAL;
-    func___cxx_global_var_init->setAttributes(func___cxx_global_var_init_PAL);
-
-    Function* func__ZNSt8ios_base4InitC1Ev = mod->getFunction("_ZNSt8ios_base4InitC1Ev");
-    if (!func__ZNSt8ios_base4InitC1Ev)
-    {
-        func__ZNSt8ios_base4InitC1Ev = Function::Create(
-                                           /*Type=*/FuncTy_8,
-                                           /*Linkage=*/GlobalValue::ExternalLinkage,
-                                           /*Name=*/"_ZNSt8ios_base4InitC1Ev", mod); // (external, no body)
-        func__ZNSt8ios_base4InitC1Ev->setCallingConv(CallingConv::C);
-    }
-    AttrListPtr func__ZNSt8ios_base4InitC1Ev_PAL;
-    func__ZNSt8ios_base4InitC1Ev->setAttributes(func__ZNSt8ios_base4InitC1Ev_PAL);
-
-    Function* func__ZNSt8ios_base4InitD1Ev = mod->getFunction("_ZNSt8ios_base4InitD1Ev");
-    if (!func__ZNSt8ios_base4InitD1Ev)
-    {
-        func__ZNSt8ios_base4InitD1Ev = Function::Create(
-                                           /*Type=*/FuncTy_8,
-                                           /*Linkage=*/GlobalValue::ExternalLinkage,
-                                           /*Name=*/"_ZNSt8ios_base4InitD1Ev", mod); // (external, no body)
-        func__ZNSt8ios_base4InitD1Ev->setCallingConv(CallingConv::C);
-    }
-    AttrListPtr func__ZNSt8ios_base4InitD1Ev_PAL;
-    func__ZNSt8ios_base4InitD1Ev->setAttributes(func__ZNSt8ios_base4InitD1Ev_PAL);
-
-    Function* func___cxa_atexit = mod->getFunction("__cxa_atexit");
-    if (!func___cxa_atexit)
-    {
-        func___cxa_atexit = Function::Create(
-                                /*Type=*/FuncTy_12,
-                                /*Linkage=*/GlobalValue::ExternalLinkage,
-                                /*Name=*/"__cxa_atexit", mod); // (external, no body)
-        func___cxa_atexit->setCallingConv(CallingConv::C);
-    }
-    AttrListPtr func___cxa_atexit_PAL;
-    func___cxa_atexit->setAttributes(func___cxa_atexit_PAL);
-
-    Function* func__Z3foov = mod->getFunction("_Z3foov");
-    if (!func__Z3foov)
-    {
-        func__Z3foov = Function::Create(
-                           /*Type=*/FuncTy_13,
-                           /*Linkage=*/GlobalValue::ExternalLinkage,
-                           /*Name=*/"_Z3foov", mod);
-        func__Z3foov->setCallingConv(CallingConv::C);
-    }
-    AttrListPtr func__Z3foov_PAL;
-    func__Z3foov->setAttributes(func__Z3foov_PAL);
-
-    Function* func__ZN5types6Double5EmptyEv = mod->getFunction("_ZN5types6Double5EmptyEv");
-    if (!func__ZN5types6Double5EmptyEv)
-    {
-        func__ZN5types6Double5EmptyEv = Function::Create(
-                                            /*Type=*/FuncTy_21,
-                                            /*Linkage=*/GlobalValue::ExternalLinkage,
-                                            /*Name=*/"_ZN5types6Double5EmptyEv", mod); // (external, no body)
-        func__ZN5types6Double5EmptyEv->setCallingConv(CallingConv::C);
-    }
-    AttrListPtr func__ZN5types6Double5EmptyEv_PAL;
-    func__ZN5types6Double5EmptyEv->setAttributes(func__ZN5types6Double5EmptyEv_PAL);
-
-    Function* func__Z17AddDoubleToDoublePN5types6DoubleES1_PS1_ = mod->getFunction("_Z17AddDoubleToDoublePN5types6DoubleES1_PS1_");
-    if (!func__Z17AddDoubleToDoublePN5types6DoubleES1_PS1_)
-    {
-        func__Z17AddDoubleToDoublePN5types6DoubleES1_PS1_ = Function::Create(
-                    /*Type=*/FuncTy_23,
-                    /*Linkage=*/GlobalValue::ExternalLinkage,
-                    /*Name=*/"_Z17AddDoubleToDoublePN5types6DoubleES1_PS1_", mod); // (external, no body)
-        func__Z17AddDoubleToDoublePN5types6DoubleES1_PS1_->setCallingConv(CallingConv::C);
-    }
-    AttrListPtr func__Z17AddDoubleToDoublePN5types6DoubleES1_PS1__PAL;
-    func__Z17AddDoubleToDoublePN5types6DoubleES1_PS1_->setAttributes(func__Z17AddDoubleToDoublePN5types6DoubleES1_PS1__PAL);
-
-    Function* func__GLOBAL__I_a = mod->getFunction("_GLOBAL__I_a");
-    if (!func__GLOBAL__I_a)
-    {
-        func__GLOBAL__I_a = Function::Create(
-                                /*Type=*/FuncTy_5,
-                                /*Linkage=*/GlobalValue::InternalLinkage,
-                                /*Name=*/"_GLOBAL__I_a", mod);
-        func__GLOBAL__I_a->setCallingConv(CallingConv::C);
-        func__GLOBAL__I_a->setSection(".text.startup");
-    }
-    AttrListPtr func__GLOBAL__I_a_PAL;
-    func__GLOBAL__I_a->setAttributes(func__GLOBAL__I_a_PAL);
-
     // Global Variable Declarations
 
 
-    GlobalVariable* gvar_struct__ZStL8__ioinit = new GlobalVariable(/*Module=*/*mod,
-            /*Type=*/StructTy_class_std__ios_base__Init,
-            /*isConstant=*/false,
-            /*Linkage=*/GlobalValue::InternalLinkage,
-            /*Initializer=*/0, // has initializer, specified below
-            /*Name=*/"_ZStL8__ioinit");
-    gvar_struct__ZStL8__ioinit->setAlignment(1);
-
-    GlobalVariable* gvar_int8___dso_handle = new GlobalVariable(/*Module=*/*mod,
-            /*Type=*/IntegerType::get(mod->getContext(), 8),
-            /*isConstant=*/false,
-            /*Linkage=*/GlobalValue::ExternalLinkage,
-            /*Initializer=*/0,
-            /*Name=*/"__dso_handle");
-
-    GlobalVariable* gvar_array_llvm_global_ctors = new GlobalVariable(/*Module=*/*mod,
-            /*Type=*/ArrayTy_2,
-            /*isConstant=*/false,
-            /*Linkage=*/GlobalValue::AppendingLinkage,
-            /*Initializer=*/0, // has initializer, specified below
-            /*Name=*/"llvm.global_ctors");
-
     // Constant Definitions
-    ConstantAggregateZero* const_struct_24 = ConstantAggregateZero::get(StructTy_class_std__ios_base__Init);
-    std::vector<Constant*> const_array_25_elems;
-    std::vector<Constant*> const_struct_26_fields;
-    ConstantInt* const_int32_27 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("65535"), 10));
-    const_struct_26_fields.push_back(const_int32_27);
-    const_struct_26_fields.push_back(func__GLOBAL__I_a);
-    Constant* const_struct_26 = ConstantStruct::get(StructTy_3, const_struct_26_fields);
-    const_array_25_elems.push_back(const_struct_26);
-    Constant* const_array_25 = ConstantArray::get(ArrayTy_2, const_array_25_elems);
-    Constant* const_ptr_28 = ConstantExpr::getCast(Instruction::BitCast, func__ZNSt8ios_base4InitD1Ev, PointerTy_9);
-    std::vector<Constant*> const_ptr_29_indices;
-    ConstantInt* const_int32_30 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("0"), 10));
-    const_ptr_29_indices.push_back(const_int32_30);
-    const_ptr_29_indices.push_back(const_int32_30);
-    Constant* const_ptr_29 = ConstantExpr::getGetElementPtr(gvar_struct__ZStL8__ioinit, const_ptr_29_indices);
-    ConstantInt* const_int32_31 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("1"), 10));
 
     // Global Variable Definitions
-    gvar_struct__ZStL8__ioinit->setInitializer(const_struct_24);
-    gvar_array_llvm_global_ctors->setInitializer(const_array_25);
 
     // Function Definitions
 
-    // Function: __cxx_global_var_init (func___cxx_global_var_init)
-    {
-
-        BasicBlock* label_32 = BasicBlock::Create(mod->getContext(), "", func___cxx_global_var_init, 0);
-
-        // Block  (label_32)
-        CallInst* void_33 = CallInst::Create(func__ZNSt8ios_base4InitC1Ev, gvar_struct__ZStL8__ioinit, "", label_32);
-        void_33->setCallingConv(CallingConv::C);
-        void_33->setTailCall(false);
-        AttrListPtr void_33_PAL;
-        void_33->setAttributes(void_33_PAL);
-
-        std::vector<Value*> int32_34_params;
-        int32_34_params.push_back(const_ptr_28);
-        int32_34_params.push_back(const_ptr_29);
-        int32_34_params.push_back(gvar_int8___dso_handle);
-        CallInst* int32_34 = CallInst::Create(func___cxa_atexit, int32_34_params, "", label_32);
-        int32_34->setCallingConv(CallingConv::C);
-        int32_34->setTailCall(false);
-        AttrListPtr int32_34_PAL;
-        int32_34->setAttributes(int32_34_PAL);
-
-        ReturnInst::Create(mod->getContext(), label_32);
-
-    }
-
-    // Function: _Z3foov (func__Z3foov)
-    {
-
-        BasicBlock* label_36 = BasicBlock::Create(mod->getContext(), "", func__Z3foov, 0);
-
-        // Block  (label_36)
-        AllocaInst* ptr_pdbl1 = new AllocaInst(PointerTy_15, "pdbl1", label_36);
-        ptr_pdbl1->setAlignment(8);
-        AllocaInst* ptr_res = new AllocaInst(IntegerType::get(mod->getContext(), 32), "res", label_36);
-        ptr_res->setAlignment(4);
-        CallInst* ptr_37 = CallInst::Create(func__ZN5types6Double5EmptyEv, "", label_36);
-        ptr_37->setCallingConv(CallingConv::C);
-        ptr_37->setTailCall(false);
-        AttrListPtr ptr_37_PAL;
-        ptr_37->setAttributes(ptr_37_PAL);
-
-        StoreInst* void_38 = new StoreInst(ptr_37, ptr_pdbl1, false, label_36);
-        void_38->setAlignment(8);
-        LoadInst* ptr_39 = new LoadInst(ptr_pdbl1, "", false, label_36);
-        ptr_39->setAlignment(8);
-        LoadInst* ptr_40 = new LoadInst(ptr_pdbl1, "", false, label_36);
-        ptr_40->setAlignment(8);
-        std::vector<Value*> int32_41_params;
-        int32_41_params.push_back(ptr_39);
-        int32_41_params.push_back(ptr_40);
-        int32_41_params.push_back(ptr_pdbl1);
-        CallInst* int32_41 = CallInst::Create(func__Z17AddDoubleToDoublePN5types6DoubleES1_PS1_, int32_41_params, "", label_36);
-        int32_41->setCallingConv(CallingConv::C);
-        int32_41->setTailCall(false);
-        AttrListPtr int32_41_PAL;
-        int32_41->setAttributes(int32_41_PAL);
-
-        StoreInst* void_42 = new StoreInst(int32_41, ptr_res, false, label_36);
-        void_42->setAlignment(4);
-        LoadInst* int32_43 = new LoadInst(ptr_res, "", false, label_36);
-        int32_43->setAlignment(4);
-        ReturnInst::Create(mod->getContext(), int32_43, label_36);
-
-    }
-
-    // Function: _GLOBAL__I_a (func__GLOBAL__I_a)
-    {
-
-        BasicBlock* label_45 = BasicBlock::Create(mod->getContext(), "", func__GLOBAL__I_a, 0);
-
-        // Block  (label_45)
-        CallInst* void_46 = CallInst::Create(func___cxx_global_var_init, "", label_45);
-        void_46->setCallingConv(CallingConv::C);
-        void_46->setTailCall(false);
-        AttrListPtr void_46_PAL;
-        void_46->setAttributes(void_46_PAL);
-
-        ReturnInst::Create(mod->getContext(), label_45);
-
-    }
-
     return mod;
 
 }