Difference between revisions of "C"

From mmmv_kos
Jump to: navigation, search
(Created page with " C++ = Transleerimine = == C++ -> C == [https://stackoverflow.com/questions/1833484/c-frontend-only-compiler-convert-c-to-c Väidetavalt saab] LLVM abil C++ korrali...")
 
m
Line 11: Line 11:
  
 
[https://stackoverflow.com/questions/1833484/c-frontend-only-compiler-convert-c-to-c Väidetavalt saab] LLVM abil C++ korralikult C'ks transleerida l
 
[https://stackoverflow.com/questions/1833484/c-frontend-only-compiler-convert-c-to-c Väidetavalt saab] LLVM abil C++ korralikult C'ks transleerida l
 +
 +
<syntaxhighlight lang="bash">
 +
llvm-g++ -emit-llvm -c foo.cpp -o foo.o
 +
llc -march=c <foo.o >foo.c
 +
</syntaxhighlight

Revision as of 10:18, 16 January 2020

C++



Transleerimine

C++ -> C

Väidetavalt saab LLVM abil C++ korralikult C'ks transleerida l

<syntaxhighlight lang="bash"> llvm-g++ -emit-llvm -c foo.cpp -o foo.o llc -march=c <foo.o >foo.c </syntaxhighlight