上一页 1 2 3 4 5 6 7 8 ··· 41 下一页
摘要: words demo lexer.l: %option noyywrap noline %{ #include <iostream> #include "parser.h" #define YY_DECL yy::parser::symbol_type yylex() #define yytermi 阅读全文
posted @ 2021-06-06 11:46 Ajanuw 阅读(58) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <format> int main(int argc, char* argv[]) { if (argc > 1) { char prefix; char* opt; int valIndex; char* val; for (size_t 阅读全文
posted @ 2021-06-06 00:44 Ajanuw 阅读(164) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <memory> using namespace std; class Base { public: virtual ~Base() = default; /* 使其多态 */ }; class A : public Base { publi 阅读全文
posted @ 2021-06-05 20:55 Ajanuw 阅读(813) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include "lexer.h" #define yylex aaslex #define yy_scan_string aas_scan_string #define yy_delete_buffer aas_delete_buffer extern c 阅读全文
posted @ 2021-06-04 11:05 Ajanuw 阅读(36) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include "lexer.h" #define yylex aaslex #define yy_scan_string aas_scan_string #define yy_delete_buffer aas_delete_buffer int main 阅读全文
posted @ 2021-06-04 08:20 Ajanuw 阅读(82) 评论(0) 推荐(0) 编辑
摘要: 想要什么: int fun(int p1) { int r = 0; for(int i = 0; i < p1; i++) { r = r + i + p1; } return r; } IR: define i32 @fun(i32 %p1) { entry: %r = alloca i32, 阅读全文
posted @ 2021-06-01 23:46 Ajanuw 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 想要什么: int fun(int p1) { if(p1 < 5) return 1; else return 2; } IR: define i32 @fun(i32 %p1) { entry: %cmp = icmp slt i32 %p1, 5 br i1 %cmp, label %then 阅读全文
posted @ 2021-06-01 22:08 Ajanuw 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 想要什么: int add1(int p1) { return 1 + p1; } IR: define i32 @add1(i32 %p1) { entry: %retVal = add i32 1, %p1 ret i32 %retVal } #include "llvm/ExecutionEn 阅读全文
posted @ 2021-06-01 20:50 Ajanuw 阅读(194) 评论(0) 推荐(0) 编辑
摘要: 在github上下载最新的Release版本的源码zip包 解压后进入"llvm-project-llvmorg-12.0.0"目录下 运行cmake > cmake -S .\llvm\ -B build -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_B 阅读全文
posted @ 2021-05-24 13:00 Ajanuw 阅读(628) 评论(0) 推荐(0) 编辑
摘要: tasks.json { // See https://go.microsoft.com/fwlink/?LinkId=733558 // for the documentation about the tasks.json format "version": "2.0.0", "tasks": [ 阅读全文
posted @ 2021-05-17 17:27 Ajanuw 阅读(223) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 41 下一页