Eliminate use of sed in Visual Studio builds.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24003 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jeff Cohen 2005-10-26 14:48:53 +00:00
parent 4ed1de843d
commit 8030c25882
5 changed files with 50 additions and 17 deletions

View File

@ -24,7 +24,7 @@
// 3.0.4 std ext/hash_map
// 3.1 __gnu_cxx ext/hash_map
// HP aCC6 std stdex/rw/hashm*ap.h
//
// MS VC++ stdext hash_map
#undef HAVE_GNU_EXT_HASH_MAP
#undef HAVE_STD_EXT_HASH_MAP
@ -63,6 +63,14 @@
# define HASH_NAMESPACE std
# endif
// Support Microsoft VC++.
#elif defined(_MSC_VER)
# include <hash_map>
# ifndef HASH_NAMESPACE
# define HASH_NAMESPACE stdext
using std::_Distance;
# endif
// Give a warning if we couldn't find it, instead of (or in addition to)
// randomly doing something dumb.
#else
@ -100,10 +108,6 @@ class hash_multimap : public rw_hashmultimap<KeyType, ValueType, class _HashFcn,
} // end HASH_NAMESPACE;
#endif
using HASH_NAMESPACE::hash_map;
using HASH_NAMESPACE::hash_multimap;
using HASH_NAMESPACE::hash;
// Include vector because ext/hash_map includes stl_vector.h and leaves
// out specializations like stl_bvector.h, causing link conflicts.
#include <vector>
@ -137,6 +141,10 @@ namespace stdext {
#endif
using HASH_NAMESPACE::hash_map;
using HASH_NAMESPACE::hash_multimap;
using HASH_NAMESPACE::hash;
#include "llvm/ADT/HashExtras.h"
#endif

View File

@ -25,7 +25,7 @@
// 3.0.4 std ext/hash_set
// 3.1 __gnu_cxx ext/hash_set
// HP aCC6 std stdex/rw/hashset.h
//
// MS VC++ stdext hash_map
#undef HAVE_GNU_EXT_HASH_SET
#undef HAVE_STD_EXT_HASH_SET
@ -64,6 +64,13 @@
# define HASH_NAMESPACE std
# endif
// Support Microsoft VC++.
#elif defined(_MSC_VER)
# include <hash_set>
# ifndef HASH_NAMESPACE
# define HASH_NAMESPACE stdext
# endif
// Give a warning if we couldn't find it, instead of (or in addition to)
// randomly doing something dumb.
#else
@ -94,7 +101,6 @@ class hash_set :
#endif
using HASH_NAMESPACE::hash_set;
using HASH_NAMESPACE::hash;
// Include vector because ext/hash_set includes stl_vector.h and leaves
// out specializations like stl_bvector.h, causing link conflicts.

View File

@ -34,6 +34,12 @@
#undef HAVE_STD_ITERATOR
#undef HAVE_FWD_ITERATOR
#ifdef _MSC_VER
# define HAVE_BI_ITERATOR 0
# define HAVE_STD_ITERATOR 1
# define HAVE_FWD_ITERATOR 0
#endif
#if !HAVE_BI_ITERATOR
# if HAVE_STD_ITERATOR
/// If the bidirectional iterator is not defined, we attempt to define it in

View File

@ -67,6 +67,7 @@ typedef u_int64_t uint64_t;
// Visual C++ doesn't provide standard integer headers, but it does provide
// built-in data types.
#include <stddef.h>
#include <sys/types.h>
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
typedef signed int int32_t;

View File

@ -74,8 +74,24 @@
<Tool
Name="VCCustomBuildTool"
Description="Generating $(SolutionDir)llvm\Config\config.h"
CommandLine="..\tools\sed &lt;$(InputPath) &gt;$(ProjectDir)..\llvm\Config\config.h &quot;s/#undef PACKAGE_NAME/#define PACKAGE_NAME \&quot;LLVM (win32 vc7.1)\&quot;/;s/#undef PACKAGE_VERSION/#define PACKAGE_VERSION 1.4/;s/#undef HAVE_WINDOWS_H/#define HAVE_WINDOWS_H 1/;s/#undef HAVE_LIMITS_H/#define HAVE_LIMITS_H 1/;s/#undef HAVE_SYS_STAT_H/#define HAVE_SYS_STAT_H 1/;s/#undef HAVE_STDLIB_H/#define HAVE_STDLIB_H 1/;s/#undef HAVE_STDIO_H/#define HAVE_STDIO_H 1/;s/#undef HAVE_STRING_H/#define HAVE_STRING_H 1/;s/#undef SHLIBEXT/#define SHLIBEXT \&quot;.lib\&quot;/;s/#undef error_t/#define error_t int/;s/#undef HAVE_ERRNO_H/#define HAVE_ERRNO_H 1/;s/#undef LTDL_DLOPEN_DEPLIBS/#define LTDL_DLOPEN_DEPLIBS 1/;s/#undef LTDL_OBJDIR/#define LTDL_OBJDIR \&quot;_libs\&quot;/;s/#undef LTDL_SHLIBPATH_VAR/#define LTDL_SHLIBPATH_VAR \&quot;PATH\&quot;/;s/#undef LTDL_SHLIB_EXT/#define LTDL_SHLIB_EXT \&quot;.dll\&quot;/;s/#undef LTDL_SYSSEARCHPATH/#define LTDL_SYSSEARCHPATH \&quot;\&quot;/;s/#undef LLVM_ON_WIN32/#define LLVM_ON_WIN32 1/;&quot;
"
CommandLine="copy $(InputPath) $(ProjectDir)..\llvm\Config\config.h
echo #define PACKAGE_NAME &quot;LLVM (win32 vc7.1)&quot; &gt;&gt;$(ProjectDir)..\llvm\Config\config.h
echo #define PACKAGE_VERSION 1.4 &gt;&gt;$(ProjectDir)..\llvm\Config\config.h
echo #define HAVE_WINDOWS_H 1 &gt;&gt;$(ProjectDir)..\llvm\Config\config.h
echo #define HAVE_LIMITS_H 1 &gt;&gt;$(ProjectDir)..\llvm\Config\config.h
echo #define HAVE_SYS_STAT_H 1 &gt;&gt;$(ProjectDir)..\llvm\Config\config.h
echo #define HAVE_STDLIB_H 1 &gt;&gt;$(ProjectDir)..\llvm\Config\config.h
echo #define HAVE_STDIO_H 1 &gt;&gt;$(ProjectDir)..\llvm\Config\config.h
echo #define HAVE_STRING_H 1 &gt;&gt;$(ProjectDir)..\llvm\Config\config.h
echo #define SHLIBEXT &quot;.lib&quot; &gt;&gt;$(ProjectDir)..\llvm\Config\config.h
echo #define error_t int &gt;&gt;$(ProjectDir)..\llvm\Config\config.h
echo #define HAVE_ERRNO_H 1 &gt;&gt;$(ProjectDir)..\llvm\Config\config.h
echo #define LTDL_DLOPEN_DEPLIBS 1 &gt;&gt;$(ProjectDir)..\llvm\Config\config.h
echo #define LTDL_OBJDIR &quot;_libs&quot; &gt;&gt;$(ProjectDir)..\llvm\Config\config.h
echo #define LTDL_SHLIBPATH_VAR &quot;PATH&quot; &gt;&gt;$(ProjectDir)..\llvm\Config\config.h
echo #define LTDL_SHLIB_EXT &quot;.dll&quot; &gt;&gt;$(ProjectDir)..\llvm\Config\config.h
echo #define LTDL_SYSSEARCHPATH &quot;&quot; &gt;&gt;$(ProjectDir)..\llvm\Config\config.h
echo #define LLVM_ON_WIN32 1 &gt;&gt;$(ProjectDir)..\llvm\Config\config.h"
Outputs="$(ProjectDir)..\llvm\Config\config.h"/>
</FileConfiguration>
</File>
@ -86,8 +102,7 @@
<Tool
Name="VCCustomBuildTool"
Description="Generating $(SolutionDir)llvm\Support\DataTypes.h"
CommandLine="..\tools\sed &lt;$(InputPath) &gt;$(ProjectDir)..\llvm\Support\DataTypes.h &quot;s/#undef HAVE_SYS_TYPES_H/#define HAVE_SYS_TYPES_H 1/;s/#undef HAVE_INTTYPES_H/#define HAVE_INTTYPES_H 1/;s/#undef HAVE_STDINT_H/#define HAVE_STD_INT_H 1/&quot;
"
CommandLine="copy $(InputPath) $(ProjectDir)..\llvm\Support\DataTypes.h"
Outputs="$(ProjectDir)..\llvm\Support\DataTypes.h"/>
</FileConfiguration>
</File>
@ -98,8 +113,7 @@
<Tool
Name="VCCustomBuildTool"
Description="Generating $(SolutionDir)llvm\ADT\hash_map"
CommandLine="..\tools\sed &lt;$(InputPath) &gt;$(ProjectDir)..\llvm\ADT\hash_map &quot;s/#undef HAVE_GLOBAL_HASH_MAP/#define HAVE_GLOBAL_HASH_MAP 1/;/using HASH_NAMESPACE\:\:hash;.*$/{D};s/define HASH_NAMESPACE std/define HASH_NAMESPACE stdext\nusing std::_Distance;/&quot;
"
CommandLine="copy $(InputPath) $(ProjectDir)..\llvm\ADT\hash_map"
Outputs="$(ProjectDir)..\llvm\ADT\hash_map"/>
</FileConfiguration>
</File>
@ -110,8 +124,7 @@
<Tool
Name="VCCustomBuildTool"
Description="Generating $(SolutionDir)llvm\ADT\hash_set"
CommandLine="..\tools\sed &lt;$(InputPath) &gt;$(ProjectDir)..\llvm\ADT\hash_set &quot;s/#undef HAVE_GLOBAL_HASH_SET/#define HAVE_GLOBAL_HASH_SET 1/;/using HASH_NAMESPACE\:\:hash;.*$/{D};/#include.*HashExtras.*$/{D};s/define HASH_NAMESPACE std/define HASH_NAMESPACE stdext/&quot;
"
CommandLine="copy $(InputPath) $(ProjectDir)..\llvm\ADT\hash_set"
Outputs="$(ProjectDir)..\llvm\ADT\hash_set"/>
</FileConfiguration>
</File>
@ -122,8 +135,7 @@
<Tool
Name="VCCustomBuildTool"
Description="Generating $(SolutionDir)llvm\ADT\iterator"
CommandLine="..\tools\sed &lt;$(InputPath) &gt;$(ProjectDir)..\llvm\ADT\iterator &quot;s/#undef HAVE_BI_ITERATOR/#define HAVE_BI_ITERATOR 0/;s/#undef HAVE_STD_ITERATOR/#define HAVE_STD_ITERATOR 1/;s/#undef HAVE_FWD_ITERATOR/#define HAVE_FWD_ITERATOR 0/&quot;
"
CommandLine="copy $(InputPath) $(ProjectDir)..\llvm\ADT\iterator"
Outputs="$(ProjectDir)..\llvm\ADT\iterator"/>
</FileConfiguration>
</File>