当前位置:网站首页>MC Layer Target
MC Layer Target
2022-07-03 04:33:00 【Hu's Sutra Pavilion】
Target
Every type of backends stay MC Chengdu will have a corresponding Target class , position On llvm\include\llvm\MC\TargetRegistry.h file .
- Target Contains the corresponding backends Some basic information about
- Every backend There will be a single instance Target
- Target In addition to containing some basic information , Another important use : Create for MC The classes in the layer provide createXXX Interface , Therefore use MC You need to call Target in createXX Interface Create the appropriate MC Components
- For example, when disassembling, you need to call createMCDisassembler, establish MCDisassembler Disassembly .
Target member
Target Members are mainly divided into two parts : Basic information members and various callback functions
- Basic information members , for example const char *Name、const char *BackendName Wait and so on .
- Various callback functions Fn, for example MCAsmInfoCtorFn etc. ,XXXXFn With Fn Mainly createXXXX Interface to create the corresponding MC Components used in ,
XXXXFn You need to call the corresponding... At startup registerXXX Function to register ,TargetRegistry.h Various register function Provide XXXFn Registration function .
TargetRegistry.h Various creareXXXX function , Used to create MC Various components in .
FirstTarget
All registered backend Target It will eventually be connected in series in the form of a one-way linked list :
FirstTarget Register for the first Target, Look for a Target One way linked list cyclic access is required , At present due to backend Not many , Therefore, one-way linked list can meet the demand .
<Target>TargetInfo.cpp
When you add a back-end, it usually creates a corresponding <Target>TargetInfo.cpp file , Used to provide corresponding Target Class single instance and registration function
AMDGPU MC Target The registration function is located at llvm\lib\Target\AMDGPU\TargetInfo\AMDGPUTargetInfo.cpp In file :
Provide R600 and GCN Two Target Single instance registration function .
TargetRegistry::RegisterTarget
TargetRegistry::RegisterTarget Finally, the single instance Target Sign up to RegisterTarget In a one-way list :
边栏推荐
猜你喜欢
After job hopping at the end of the year, I interviewed more than 30 companies in two weeks and finally landed
Asp access teaching management system design finished product
4 years of experience to interview test development, 10 minutes to end, ask too
[PCL self study: filtering] introduction and use of various filters in PCL (continuously updated)
2022 Shandong Province safety officer C certificate examination content and Shandong Province safety officer C certificate examination questions and analysis
redis 持久化原理
Function introduction of member points mall system
Jincang KFS data bidirectional synchronization scenario deployment
[Thesis Writing] how to write the overall design of JSP tourism network
2022 registration of G2 utility boiler stoker examination and G2 utility boiler stoker reexamination examination
随机推荐
AWS VPC
IPhone x forgot the boot password
Which Bluetooth headset is good about 400? Four Bluetooth headsets with strong noise reduction are recommended
[software testing-6] & Test Management
[BMZCTF-pwn] 18-RCTF-2017-Recho
RSRS指标择时及大小盘轮动
Hj35 serpentine matrix
逆袭大学生的职业规划
Basic types of data in TS
[literature reading] sparse in deep learning: practicing and growth for effective information and training in NN
有道云笔记
Leetcode simple question: check whether two string arrays are equal
Dive Into Deep Learning——2.1数据操作&&练习
Preliminary cognition of C language pointer
[set theory] inclusion exclusion principle (including examples of exclusion principle)
2022-02-12 (338. Bit count)
Redis persistence principle
Php+mysql registration landing page development complete code
How to retrieve the password for opening word files
Priv-app permission异常