Fix the Win32 VS2008 build:
authorSebastian Redl <sebastian.redl@getdesigned.at>
Thu, 19 Mar 2009 23:26:52 +0000 (23:26 +0000)
committerSebastian Redl <sebastian.redl@getdesigned.at>
Thu, 19 Mar 2009 23:26:52 +0000 (23:26 +0000)
 - Make type declarations match the struct/class keyword of the definition.
 - Move AddSignalHandler into the namespace where it belongs.
 - Correctly call functions from template base.
 - Some other small changes.
With this patch, LLVM and Clang should build properly and with far less noise under VS2008.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67347 91177308-0d34-0410-b5e6-96231b3b80d8

CMakeLists.txt
include/llvm/CodeGen/ScheduleDAG.h
include/llvm/Support/CommandLine.h
include/llvm/User.h
lib/Analysis/CMakeLists.txt
lib/CodeGen/LiveIntervalAnalysis.cpp
lib/System/Win32/Alarm.inc
lib/System/Win32/Signals.inc
utils/TableGen/TGParser.h

index 4ee8d204007464003038419c351b6bd3f6da6e02..1edea945c4b07f48f59ef6ad67afd70b3e6f2572 100644 (file)
@@ -145,7 +145,7 @@ if( MSVC )
   add_definitions( -D_SCL_SECURE_NO_WARNINGS -DCRT_NONSTDC_NO_WARNINGS )
   add_definitions( -D_SCL_SECURE_NO_DEPRECATE )
   add_definitions( -wd4146 -wd4503 -wd4996 -wd4800 -wd4244 -wd4624 )
-  add_definitions( -wd4355 -wd4715 )
+  add_definitions( -wd4355 -wd4715 -wd4180 -wd4345 -wd4224 )
 endif( MSVC )
 
 include_directories( ${LLVM_BINARY_DIR}/include ${LLVM_MAIN_INCLUDE_DIR})
index 685dc76d124013412f1ce9c9324ced268ed84498..f258f6f0ccee337721ab5d9a0b30b8fd936dc88c 100644 (file)
@@ -23,7 +23,7 @@
 #include "llvm/ADT/PointerIntPair.h"
 
 namespace llvm {
-  struct SUnit;
+  class SUnit;
   class MachineConstantPool;
   class MachineFunction;
   class MachineModuleInfo;
index def5ce750140931b2fab777b771dc9f3cc5c3f70..1c6b3337dfdad8c34b0342ca34b9ab705ad0e973 100644 (file)
@@ -833,8 +833,8 @@ class opt : public Option,
        typename ParserClass::parser_data_type();
     if (Parser.parse(*this, ArgName, Arg, Val))
       return true;                            // Parse error!
-    setValue(Val);
-    setPosition(pos);
+    this->setValue(Val);
+    this->setPosition(pos);
     return false;
   }
 
index 69826c0d8cff554bb90fb33d8d0b12800b2a3a8a..8a244068b24a0599fe2f8b40485c43a65217ef66 100644 (file)
@@ -84,6 +84,10 @@ public:
   void operator delete(void*, unsigned) {
     assert(0 && "Constructor throws?");
   }
+  /// placement delete - required by std, but never called.
+  void operator delete(void*, unsigned, bool) {
+    assert(0 && "Constructor throws?");
+  }
 protected:
   template <int Idx, typename U> static Use &OpFrom(const U *that) {
     return Idx < 0
index f63054b60ed0c80817bbc7320d3c53e524a15c52..07a918b5aac8150a2e4f54c474647b32b8178bad 100644 (file)
@@ -16,6 +16,7 @@ add_llvm_library(LLVMAnalysis
   IntervalPartition.cpp
   LibCallAliasAnalysis.cpp
   LibCallSemantics.cpp
+  LiveValues.cpp
   LoopInfo.cpp
   LoopPass.cpp
   LoopVR.cpp
index 3a8f40faec588d6f07af9caf71e3bf178e853031..29be67bf6053eeacef8fb0a70d8bb6e15f7a3f9e 100644 (file)
@@ -2042,7 +2042,7 @@ addIntervalsForSpills(const LiveInterval &li,
         if (CanFold && !Ops.empty()) {
           if (tryFoldMemoryOperand(MI, vrm, NULL, index, Ops, true, Slot,VReg)){
             Folded = true;
-            if (FoundUse > 0) {
+            if (FoundUse) {
               // Also folded uses, do not issue a load.
               eraseRestoreInfo(Id, index, VReg, RestoreMBBs, RestoreIdxes);
               nI.removeRange(getLoadIndex(index), getUseIndex(index)+1);
index c413b096e7e14cd78f26479f757b012dd534340f..e0d00a0142bfac4a4bce0d13109db85b4eae801b 100644 (file)
@@ -39,5 +39,5 @@ int sys::AlarmStatus() {
 extern "C"  void __stdcall Sleep(unsigned long);
 
 void sys::Sleep(unsigned n) {
-  Sleep(n*1000);
+  ::Sleep(n*1000);
 }
index 9276ef41a0ba63b061746eed543728e78984b9bc..560ac3879e2fcec8f160b6c637e342714358f338 100644 (file)
@@ -14,6 +14,7 @@
 #include "Win32.h"
 #include <stdio.h>
 #include <vector>
+#include <algorithm>
 
 #ifdef __MINGW32__
  #include <imagehlp.h>
@@ -111,6 +112,17 @@ void sys::SetInterruptFunction(void (*IF)()) {
   InterruptFunction = IF;
   LeaveCriticalSection(&CriticalSection);
 }
+
+
+/// AddSignalHandler - Add a function to be called when a signal is delivered
+/// to the process.  The handler can have a cookie passed to it to identify
+/// what instance of the handler it is.
+void sys::AddSignalHandler(void (*FnPtr)(void *), void *Cookie) {
+  if (CallBacksToRun == 0)
+    CallBacksToRun = new std::vector<std::pair<void(*)(void*), void*> >();
+  CallBacksToRun->push_back(std::make_pair(FnPtr, Cookie));
+  RegisterHandler();
+}
 }
 
 static void Cleanup() {
@@ -256,13 +268,3 @@ static BOOL WINAPI LLVMConsoleCtrlHandler(DWORD dwCtrlType) {
   return FALSE;
 }
 
-/// AddSignalHandler - Add a function to be called when a signal is delivered
-/// to the process.  The handler can have a cookie passed to it to identify
-/// what instance of the handler it is.
-void llvm::sys::AddSignalHandler(void (*FnPtr)(void *), void *Cookie) {
-  if (CallBacksToRun == 0)
-    CallBacksToRun = new std::vector<std::pair<void(*)(void*), void*> >();
-  CallBacksToRun->push_back(std::make_pair(FnPtr, Cookie));
-  RegisterHandler();
-}
-
index 5d5330de51718570c84d22909fb9b71e66a552f1..b04139f80a5eb552a2d5cbf8230ec567fd11cf26 100644 (file)
@@ -24,7 +24,7 @@ namespace llvm {
   struct RecTy;
   struct Init;
   struct MultiClass;
-  class SubClassReference;
+  struct SubClassReference;
   
   struct LetRecord {
     std::string Name;