Index: lib/Target/X86/X86AsmBackend.cpp |
=================================================================== |
--- lib/Target/X86/X86AsmBackend.cpp (revision 105819) |
+++ lib/Target/X86/X86AsmBackend.cpp (working copy) |
@@ -23,6 +23,8 @@ |
#include "llvm/Target/TargetAsmBackend.h" |
using namespace llvm; |
+namespace llvm { MCObjectWriter * createWinCOFFObjectWriter (raw_ostream & OS); } |
+ |
namespace { |
static unsigned getFixupKindLog2Size(unsigned Kind) { |
@@ -210,6 +212,26 @@ public: |
: ELFX86AsmBackend(T) {} |
}; |
+class Win32X86AsmBackend : public X86AsmBackend { |
+public: |
+ Win32X86AsmBackend(const Target &T) |
+ : X86AsmBackend(T) { |
+ HasAbsolutizedSet = true; |
+ HasScatteredSymbols = true; |
+ } |
+ |
+ MCObjectWriter *createObjectWriter(raw_ostream &OS) const { |
+ return createWinCOFFObjectWriter (OS); |
+ } |
+ |
+ bool isVirtualSection(const MCSection &Section) const { |
+// const MCSectionCOFF &SE = static_cast<const MCSectionCOFF&>(Section); |
+// return SE.getType() == MCSectionCOFF::SHT_NOBITS; |
+ |
+ return false; // not sure how to interpret this right now |
+ } |
+}; |
+ |
class DarwinX86AsmBackend : public X86AsmBackend { |
public: |
DarwinX86AsmBackend(const Target &T) |
@@ -288,6 +310,10 @@ TargetAsmBackend *llvm::createX86_32AsmBackend(const Target &T, |
switch (Triple(TT).getOS()) { |
case Triple::Darwin: |
return new DarwinX86_32AsmBackend(T); |
+ case Triple::Win32: |
+ case Triple::MinGW32: |
+ case Triple::Cygwin: |
+ return new Win32X86AsmBackend (T); |
default: |
return new ELFX86_32AsmBackend(T); |
} |