【问题标题】:first argument from module (opcode llvm)模块的第一个参数(操作码 llvm)
【发布时间】:2021-07-21 12:25:37
【问题描述】:

https://github.com/llvm/llvm-project/tree/main/llvm/examples/ModuleMaker 中是静态变量。 如何读取参数模块并放入添加指令?

Instruction *Add = BinaryOperator::Create(Instruction::Add, x, y, "tmp");

如何分配给 x = 参数块 1

【问题讨论】:

    标签: llvm opcode


    【解决方案1】:
    Function::arg_iterator argument = F->arg_begin();
    Argument *Pierwszy = argument++;
    Pierwszy->setName("c");
    Value *Drugi = argument++;
    Drugi->setName("d");
        
    /* tworzymy instrukcję */
    Instruction *Dodaj = BinaryOperator::Create(Instruction::Add,
    Pierwszy, Drugi, "wynik");
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-11-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多