Displaying 7 results from an estimated 7 matches for "code_for_main".
2006 Nov 06
0
[LLVMdev] Convert C++ to C. What is 0x0p+0 ?
Hi Napi,
On Mon, 2006-11-06 at 10:44 +0800, Mohd-Hanafiah Abdullah wrote:
> Hi:
>
> I've been able to compile the attached "helloworld.c" file converted
> from "helloworld.cpp".
Great.
>
> My question is how does one usually use __main() and CODE_FOR_MAIN()
> in tying up with the rest of the code?
I'm not quite sure what you're asking. CODE_FOR_MAIN is defined in your
helloworld.c file as:
#define CODE_FOR_MAIN() /* Any target-specific code for main()*/
#if defined(__GNUC__) && !defined(__llvm__)
#if defined(i386) || defined(__i...
2006 Nov 06
2
[LLVMdev] Convert C++ to C. What is 0x0p+0 ?
Hi:
I've been able to compile the attached "helloworld.c" file converted
from "helloworld.cpp".
My question is how does one usually use __main() and CODE_FOR_MAIN()
in tying up with the rest of the code?
Attached here are the original "helloworld.cpp" and "helloworld.c"
files.
Thanks.
Napi
On Sun, 2006-11-05 at 09:14 -0800, Reid Spencer wrote:
> Hi Napi,
>
> On Sun, 2006-11-05 at 18:30 +0800, Mohd-Hanafiah Abdullah wrote:
&g...
2006 Nov 05
4
[LLVMdev] Convert C++ to C. What is 0x0p+0 ?
Hi:
I'm interested in using llvm to convert C++ code to C code.
I used the following command to do this:
% llvm-g++ -c foo.cpp -o - | llc -march=c -o foo.cbe.c
In the resulting file foo.cbe.c there are many occurences of '0x0p+0'.
What is it used for? Here's a code snippet from the file foo.cbe.c
if ((ltmp_126_2 > 0x0p+0)) {
goto ltmp_363_19;
} else {
goto
2006 Nov 17
4
[LLVMdev] C++ to C
...will convert the C
code to Java Bytecode. If the above function is in C++ then I need to
convert it to C first.
Here's the code segment that uses the function:
int main(void) {
struct
l_struct_2E_std_3A__3A_basic_ostream_3C_char_2C_std_3A__3A_char_traits_
3C_char_3E__20__3E_ *ltmp_2_2;
CODE_FOR_MAIN();
/*tail*/ __main();
ltmp_2_2 = /*tail*/
_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc((
&_ZSt4cout), (&(_2E_str_1[0])));
return 0;
}
Thanks for any tips.
Napi
2006 Nov 17
0
[LLVMdev] C++ to C
...e. If the above function is in C++ then I need to
>convert it to C first.
>
>Here's the code segment that uses the function:
>
>int main(void) {
> struct
>l_struct_2E_std_3A__3A_basic_ostream_3C_char_2C_std_3A__3A_char_traits_
>3C_char_3E__20__3E_ *ltmp_2_2;
>
> CODE_FOR_MAIN();
> /*tail*/ __main();
> ltmp_2_2 = /*tail*/
>_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc((
>&_ZSt4cout), (&(_2E_str_1[0])));
> return 0;
>}
>
>Thanks for any tips.
>
>Napi
>
>_______________________________________________
>LLVM Deve...
2006 Nov 05
0
[LLVMdev] Convert C++ to C. What is 0x0p+0 ?
On Nov 5, 2006, at 2:30 AM, Mohd-Hanafiah Abdullah wrote:
> On Sat, 2006-11-04 at 21:06 -0800, Reid Spencer wrote:
>>> In the resulting file foo.cbe.c there are many occurences of '0x0p
>>> +0'.
>>> What is it used for? Here's a code snippet from the file foo.cbe.c
>>>
>>> if ((ltmp_126_2 > 0x0p+0)) {
>>> goto
2006 Nov 05
4
[LLVMdev] Convert C++ to C. What is 0x0p+0 ?
On Sat, 2006-11-04 at 21:06 -0800, Reid Spencer wrote:
> Hi Napi,
>
> On Sun, 2006-11-05 at 12:40 +0800, Mohd-Hanafiah Abdullah wrote:
> > Hi:
> >
> > I'm interested in using llvm to convert C++ code to C code.
> > I used the following command to do this:
> >
> > % llvm-g++ -c foo.cpp -o - | llc -march=c -o foo.cbe.c
>
> Yup, that'll