Eliminate use of sed in Visual Studio builds.
authorJeff Cohen <jeffc@jolt-lang.org>
Wed, 26 Oct 2005 14:48:53 +0000 (14:48 +0000)
committerJeff Cohen <jeffc@jolt-lang.org>
Wed, 26 Oct 2005 14:48:53 +0000 (14:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24003 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/hash_map.in
include/llvm/ADT/hash_set.in
include/llvm/ADT/iterator.in
include/llvm/Support/DataTypes.h.in
win32/Configure/Configure.vcproj

index 0b27ed3f17a07cc6efb5f2db49516919ca04aa67..fe5c3939f52b0c98000bd384cdadb887de53d201 100644 (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
 #  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
index 533b7574060c275ab3310ad3be606773c07b8010..509314b52750dc570b850c2e15773b4ce6113454 100644 (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
 #  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.
index f74aca28a634ae6722f8e0ae3bcfb463733a35d6..47f70d12fdbcaeb3a41111c11c764b8d20e4e9e9 100644 (file)
 #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
index cfec5f3862fcd70d6f57365ec027dfe6315b507f..f16a2cd9a29edd292db4f37b01e62c8d3c6adc64 100644 (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;
index 847d0d1b5a312cbd7bff34651c9803e143e6b23d..9aca7bd6ab246e01e70f2a017493963ba273537c 100644 (file)
                                        <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>
                                        <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>
                                        <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>
                                        <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>
                                        <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>