---
title: "Chenyuan Zhao (@lukaluka) | Hashnode"
description: "a greenhand in compiler. Read the latest articles by Chenyuan Zhao on Hashnode."
url: "https://hashnode.com/@lukaluka"
---

@lukaluka

# Chenyuan Zhao

@lukaluka · Shanghai, China · Joined May 2022

a greenhand in compiler

### [编译器前端介绍](https://behindthewall.hashnode.dev/57yw6kr5zmo5ymn56uv5lul57un?utm_source=hashnode&utm_medium=feed)

前言 编译指的是将源程序翻译为等价的目标代码的过程。编译往往有五个阶段，即词法分析，语法分析，语义分析，中间代码优化与目标代码生成。编译器前端通常指生成中间代码之前的步骤。高级语言的源程序在计算机的角度来看仅仅是一串字符串，并不能直接在计算机上执行。需要靠编译器去分析这些字符串，理解程序员的意图，并将其转化为机器能够执行的语言。 词法分析的任务是识别源码中的词素（Token），将源码分隔为不能再拆分的基本组成单元。这些单元往往是： 语言定义的关键字或保留字，e.g. 数据类型int, 流程...

2 min read · [behindthewall.hashnode.dev](https://behindthewall.hashnode.dev/57yw6kr5zmo5ymn56uv5lul57un?utm_source=hashnode&utm_medium=feed)

[Jun 22, 2022](https://hashnode.com/posts/57yw6kr5zmo5ymn56uv5lul57un/62b3325686d22092a75466bd)

### [\[llvm\] 函数插桩的两种方式](https://behindthewall.hashnode.dev/llvm?utm_source=hashnode&utm_medium=feed)

函数插桩指利用编译器，在程序中特定的位置插入函数调用。比如当我们希望统计某个函数运行所花的时间时，可以使用如下的Routine void some\_function(int arg1, int arg2) { unsigned long long tik,tok; tik = gettimeofday(); /\*\*\* do\_something \*\*\*/ tok = gettimeofday(); printf("elipsed %lld seconds\\n", tok-t...

3 min read · [behindthewall.hashnode.dev](https://behindthewall.hashnode.dev/llvm?utm_source=hashnode&utm_medium=feed)

[Jun 22, 2022](https://hashnode.com/posts/llvm/62b31bb286d22092a754634e)

### [Git的基础使用](https://behindthewall.hashnode.dev/git?utm_source=hashnode&utm_medium=feed)

Git基础使用 1. 创建 在本地创建一个git仓库：git init克隆一个远程仓库：git clone <网址> 2. 文件跟踪、修改与提交 仅在本地使用时，git可分为三个区域：工作区、暂存区(stage)与本地仓库(repository)。工作区就是当前目录，使用git add命令可将已修改(modified)文件中希望提交的文件存储到暂存区，暂存区中记录了预期的下一次提交，使用git commit命令将暂存区中的文件提交到本地仓库，生成一条记录，相关文件回到未修改(unmodified...

1 min read · [behindthewall.hashnode.dev](https://behindthewall.hashnode.dev/git?utm_source=hashnode&utm_medium=feed)

[Jun 2, 2022](https://hashnode.com/posts/git/62986f212e2e010d098e73fc)

### [TableGen语法简介](https://behindthewall.hashnode.dev/tablegen?utm_source=hashnode&utm_medium=feed)

TableGen是LLVM后端用于保存机器平台信息的一种工具语言。与架构相关的各类优化常需要知道指令的某些“特性”，比如指令调度器需要知道指令是否存在读、写延迟；寄存器分配器需要知道指令是否绑定某个物理寄存器…… 而在LLVM中，不同的优化在流程上是分开的，那么实现这些优化的源文件自然也是分开存放的。如果编译开发过程中需要在这些分散的源文件中各自书写一遍架构相关指令特性，就势必造成信息冗杂，难以维护。TableGen于是应运而生，它是为LLVM编译开发的轻量化语言，专门用来书写架构相关的信息供L...

5 min read · [behindthewall.hashnode.dev](https://behindthewall.hashnode.dev/tablegen?utm_source=hashnode&utm_medium=feed)

[Jun 1, 2022](https://hashnode.com/posts/tablegen/62972623750734fd35a7a416)

### [CMake学习笔记](https://behindthewall.hashnode.dev/cmake?utm_source=hashnode&utm_medium=feed)

CMake是非常流行的构建系统（更准确地讲，是构建系统的“生成器”）。尤其是在C++项目中，现代CMake（3.10+版本）几乎已经成为事实上的标准（standard de facto）。在现代CMake中，使用目标（target）代替传统的目录层次作为构建的最小单位，避免将路径硬编码，构建命令再也不用与源码目录结构绑定；CMake只用一套语法，就可以在不同的平台上生成对应的构建命令（在linux上生成make、ninja, 在windows上生成vs),实现了跨平台编译；CMake在其顶层维护...

3 min read · [behindthewall.hashnode.dev](https://behindthewall.hashnode.dev/cmake?utm_source=hashnode&utm_medium=feed)

[May 29, 2022](https://hashnode.com/posts/cmake/62936ca0d97f80b5091db1d5)
