Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
2
2025ustc-jianmu-compiler
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
74
Issues
74
List
Boards
Labels
Service Desk
Milestones
Merge Requests
52
Merge Requests
52
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
compiler_staff
2025ustc-jianmu-compiler
Commits
c54e751d
Commit
c54e751d
authored
Nov 11, 2025
by
王宇航
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lab3 publish
parent
03dc00fe
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
include/lightir/BasicBlock.hpp
include/lightir/BasicBlock.hpp
+4
-1
src/lightir/Instruction.cpp
src/lightir/Instruction.cpp
+4
-1
No files found.
include/lightir/BasicBlock.hpp
View file @
c54e751d
...
...
@@ -40,6 +40,9 @@ class BasicBlock : public Value, public llvm::ilist_node<BasicBlock> {
/****************api about Instruction****************/
void
add_instruction
(
Instruction
*
instr
);
void
add_instr_begin
(
Instruction
*
instr
)
{
instr_list_
.
push_front
(
instr
);
}
void
add_instr_before_end
(
Instruction
*
instr
)
{
instr_list_
.
insert
(
std
::
prev
(
instr_list_
.
end
()),
instr
);
}
void
erase_instr
(
Instruction
*
instr
)
{
instr_list_
.
erase
(
instr
);
}
void
remove_instr
(
Instruction
*
instr
)
{
instr_list_
.
remove
(
instr
);
}
...
...
src/lightir/Instruction.cpp
View file @
c54e751d
...
...
@@ -303,7 +303,10 @@ AllocaInst *AllocaInst::create_alloca_begin(Type *ty, BasicBlock *bb) {
if
(
bb
!=
nullptr
)
{
ret
->
set_parent
(
bb
);
bb
->
add_instr_begin
(
ret
);
if
(
bb
->
is_terminated
())
bb
->
add_instr_before_end
(
ret
);
else
bb
->
add_instruction
(
ret
);
}
return
ret
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment