Changeset 1593


Ignore:
Timestamp:
07/09/10 11:22:40 (3 years ago)
Author:
perry
Message:

Update llvm.memset intrinsic to LLVM 2.8 calling convention

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/bpf-jit/bpf-jit.cc

    r1586 r1593  
    274274  FunctionType* memsetType = FunctionType::get( 
    275275    /*Result=*/Type::getVoidTy(getGlobalContext()), 
    276                 construct_vector<const Type*>(4, 
    277                         PointerType::get(IntegerType::get(getGlobalContext(), 8), 0), 
    278                         IntegerType::get(getGlobalContext(), 8), 
    279                         IntegerType::get(getGlobalContext(), 64), 
    280                         IntegerType::get(getGlobalContext(), 32)), 
     276                construct_vector<const Type*>(5, 
     277                        PointerType::get(IntegerType::get(getGlobalContext(), 8), 0), /*dest*/ 
     278                        IntegerType::get(getGlobalContext(), 8),  /* i8 val */ 
     279                        IntegerType::get(getGlobalContext(), 64), /* i64 len */ 
     280                        IntegerType::get(getGlobalContext(), 32), /* i32 align */ 
     281                        IntegerType::get(getGlobalContext(), 1)  /* i1 volatile */ 
     282                        ), 
    281283    /*isVarArg=*/false); 
    282284   
     
    330332  ConstantInt* const_int64_13 = ConstantInt::get(getGlobalContext(), APInt(64,  StringRef("1056"), 10)); 
    331333  ConstantInt* const_int32_14 = ConstantInt::get(getGlobalContext(), APInt(32,  StringRef("8"), 10)); 
     334  ConstantInt* const_int1_false = ConstantInt::get(getGlobalContext(), APInt(1,  StringRef("0"), 10)); 
    332335   
    333336  // Function: bpf_run (func_bpf_run) 
     
    357360                "state1", label_entry); 
    358361    std::vector<Value*> void_25_params; 
    359     void_25_params.push_back(ptr_state1); 
    360     void_25_params.push_back(const_int8_12); 
    361     void_25_params.push_back(const_int64_13); 
    362     void_25_params.push_back(const_int32_14); 
    363     CallInst* void_25 = CallInst::Create(func_llvm_memset_i64, void_25_params.begin(), void_25_params.end(), "", label_entry); 
     362    void_25_params.push_back(ptr_state1);       /* dest */ 
     363    void_25_params.push_back(const_int8_12);    /* value */ 
     364    void_25_params.push_back(const_int64_13);   /* length */ 
     365    void_25_params.push_back(const_int32_14);   /* alignment */ 
     366    void_25_params.push_back(const_int1_false); /* volatile */ 
     367    CallInst* void_25 = CallInst::Create(func_llvm_memset_i64,  
     368                void_25_params.begin(), void_25_params.end(),  
     369                "",  
     370                label_entry); 
    364371    void_25->setCallingConv(CallingConv::C); 
    365     void_25->setTailCall(false);AttrListPtr void_25_PAL; 
     372    void_25->setTailCall(false); 
     373    AttrListPtr void_25_PAL; 
    366374    void_25->setAttributes(void_25_PAL); 
    367375  
Note: See TracChangeset for help on using the changeset viewer.