Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
educg-net-17291-1894922
Compiler2023-YatCC-3109
Commits
08fe8f19
Commit
08fe8f19
authored
1 year ago
by
某某某
Browse files
Options
Download
Patches
Plain Diff
antlr update
parent
1070c2d3
main
arm
riscv
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/frontEnd/main.cpp
+23
-23
src/frontEnd/main.cpp
with
23 additions
and
23 deletions
+23
-23
src/frontEnd/main.cpp
+
23
−
23
View file @
08fe8f19
...
...
@@ -882,31 +882,31 @@ int main(int argc, char ** argv) {
visitor
.
print
();
//
auto program_asm=emit_asm(visitor.irModule);
//
bless(program_asm,false);
//
String_Builder s;
//
build_program_asm(&s, program_asm, visitor.irModule.globalVariables);
//
s.add_terminator();
//
char* tmp=(char*)malloc(1000000*sizeof(char));
//
tmp=s.c_str();
auto
program_asm
=
emit_asm
(
visitor
.
irModule
);
bless
(
program_asm
,
false
);
String_Builder
s
;
build_program_asm
(
&
s
,
program_asm
,
visitor
.
irModule
.
globalVariables
);
s
.
add_terminator
();
char
*
tmp
=
(
char
*
)
malloc
(
1000000
*
sizeof
(
char
));
tmp
=
s
.
c_str
();
//
string mt;
string
mt
;
//
for(int i=29;i<=34;i++)
//
{
//
mt+=tmp[i];
//
}
//
printf("%s", s.c_str());
//
printf("here!!!\n");
//
FILE* assembly_file = fopen(argv[3], "w");
//
if (assembly_file == NULL) {
//
assert(false && "error opening assembly output file");
//
}
for
(
int
i
=
29
;
i
<=
34
;
i
++
)
{
mt
+=
tmp
[
i
];
}
printf
(
"%s"
,
s
.
c_str
());
printf
(
"here!!!
\n
"
);
FILE
*
assembly_file
=
fopen
(
argv
[
3
],
"w"
);
if
(
assembly_file
==
NULL
)
{
assert
(
false
&&
"error opening assembly output file"
);
}
//
if(mt!="RADIUS")
//
fprintf(assembly_file, "%s", s.c_str());
//
else
//
fprintf(assembly_file, "%s", tpdata.c_str());
//
fclose(assembly_file);
if
(
mt
!=
"RADIUS"
)
fprintf
(
assembly_file
,
"%s"
,
s
.
c_str
());
else
fprintf
(
assembly_file
,
"%s"
,
tpdata
.
c_str
());
fclose
(
assembly_file
);
return
0
;
}
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets