• 2023-11-30查看一个 '函数' 到底是【函数】还是【方法】
    需要用到FunctionType和MethodTypefromtypesimportFunctionType,MethodType 准备测试用代码写一个函数:defadd():pass写一个类:classPerson:defrun(self):pass@classmethoddefxx(cls):pass@staticmethod
  • 2023-08-0203_llvm_IR测试创建变量
    主要分全局变量、函数参数、局部变量(常量)与返回值测试全局变量介绍说明、代码、编译与结果如下:#include"llvm/IR/Module.h"#include"llvm/IR/LLVMContext.h"#include"llvm/Support/raw_ostream.h"#include"llvm/IR/Function.h"#include"llvm/IR/Verifier.h&qu
  • 2023-07-3102_llvm的IR测试创建函数和代码块
    如果要使用LLVM的能力,则需熟悉如何根据自己的代码生成出llvm的IR,以便提供给llvm使用。测试创建function测试代码如下02_test_function.cpp#include"llvm/IR/Module.h"#include"llvm/IR/LLVMContext.h"#include"llvm/Support/raw_ostream.h"#include"llvm/IR/Function.h&qu