LLVM 2.1 with VC++

I've come across a couple errors when building LLVM 2.1 in VC++ 2005.

1) CodeGen/RegisterCoalescer.cpp is not included in the project
2) System/Win32/DynamicLibrary.inc - ELM_Callback is declared with a
PSTR ModuleName argument. This causes a compile error - the callback
typedef specifies PCSTR.

Also, I'd like to suggest adding the following to config.h, to
eliminate the spurious deprecation warnings:

#define _CRT_SECURE_NO_WARNINGS
#define _SCL_SECURE_NO_WARNINGS
#define _CRT_NONSTDC_NO_WARNINGS

And moving #include "llvm/Config/config.h" in all the files above any
other includes, so those will have the proper effect.

Finally, is the JIT considered stable under Windows?

I've come across a couple errors when building LLVM 2.1 in VC++ 2005.

You might want to try LLVM SVN. I believe Hartmut has made several improvements.

Also, I'd like to suggest adding the following to config.h, to
eliminate the spurious deprecation warnings:

#define _CRT_SECURE_NO_WARNINGS
#define _SCL_SECURE_NO_WARNINGS
#define _CRT_NONSTDC_NO_WARNINGS

And moving #include "llvm/Config/config.h" in all the files above any
other includes, so those will have the proper effect.

If LLVM SVN doesn't have these improvements, please consider sending in a patch, thanks!

Finally, is the JIT considered stable under Windows?

Yes, several groups are using it.

-Chris

Cory,

I've come across a couple errors when building LLVM 2.1 in VC++ 2005.

1) CodeGen/RegisterCoalescer.cpp is not included in the project

I didn't update the build system for a week or so. I'll try to squeeze it in
asap.

2) System/Win32/DynamicLibrary.inc - ELM_Callback is declared
with a PSTR ModuleName argument. This causes a compile error
- the callback typedef specifies PCSTR.

I never ran into this problem. How can I reproduce this?

Also, I'd like to suggest adding the following to config.h,
to eliminate the spurious deprecation warnings:

#define _CRT_SECURE_NO_WARNINGS
#define _SCL_SECURE_NO_WARNINGS
#define _CRT_NONSTDC_NO_WARNINGS

I thought to have added it to the project files. If there are place where
it's missing, please provide a patch.

And moving #include "llvm/Config/config.h" in all the files
above any other includes, so those will have the proper effect.

You lost me here, could you elaorate, please?

Regards Hartmut

Also, I'd like to suggest adding the following to config.h, to
eliminate the spurious deprecation warnings:

#define _CRT_SECURE_NO_WARNINGS
#define _SCL_SECURE_NO_WARNINGS
#define _CRT_NONSTDC_NO_WARNINGS

> And moving #include "llvm/Config/config.h" in all the files above any
> other includes, so those will have the proper effect.

Can we guard those defines like so?

#if defined _MSC_VER && _MSC_VER >= 1300
    #if !defined _CRT_SECURE_NO_WARNINGS
        #define _CRT_SECURE_NO_WARNINGS
    #endif
    #if !defined _SCL_SECURE_NO_WARNINGS
        #define _SCL_SECURE_NO_WARNINGS
    #endif
    #if !defined _CRT_NONSTDC_NO_WARNINGS
        #define _CRT_NONSTDC_NO_WARNINGS
    #endif
#endif

That way I don't get a warning when I include an LLVM header in a file that
already happens to define these.

Thanks,

Jaap Suter

Jaap,

> Also, I'd like to suggest adding the following to config.h, to
> eliminate the spurious deprecation warnings:
>
> #define _CRT_SECURE_NO_WARNINGS
> #define _SCL_SECURE_NO_WARNINGS
> #define _CRT_NONSTDC_NO_WARNINGS
>
> > And moving #include "llvm/Config/config.h" in all the files above
> > any other includes, so those will have the proper effect.

Can we guard those defines like so?

#if defined _MSC_VER && _MSC_VER >= 1300
    #if !defined _CRT_SECURE_NO_WARNINGS
        #define _CRT_SECURE_NO_WARNINGS
    #endif
    #if !defined _SCL_SECURE_NO_WARNINGS
        #define _SCL_SECURE_NO_WARNINGS
    #endif
    #if !defined _CRT_NONSTDC_NO_WARNINGS
        #define _CRT_NONSTDC_NO_WARNINGS
    #endif
#endif

That way I don't get a warning when I include an LLVM header
in a file that already happens to define these.

Currently these defines are done inside the VC8 project files, so no harm
should be done for you.

Regards Hartmut

I've come across a couple errors when building LLVM 2.1 in VC++ 2005.

1) CodeGen/RegisterCoalescer.cpp is not included in the project
2) System/Win32/DynamicLibrary.inc - ELM_Callback is declared
with a PSTR ModuleName argument. This causes a compile error
- the callback typedef specifies PCSTR.

Also, I'd like to suggest adding the following to config.h,
to eliminate the spurious deprecation warnings:

#define _CRT_SECURE_NO_WARNINGS
#define _SCL_SECURE_NO_WARNINGS
#define _CRT_NONSTDC_NO_WARNINGS

Everything should be fine now.

Regards Hartmut