Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1693)

Unified Diff: lib/Target/X86/X86AsmBackend.cpp

Issue 1624043: Win32 COFF Support + lit fixes Base URL: http://llvm.org/svn/llvm-project/llvm/trunk/
Patch Set: Created 13 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/MC/WinCOFFStreamer.cpp ('k') | lib/Target/X86/X86TargetMachine.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « lib/MC/WinCOFFStreamer.cpp ('k') | lib/Target/X86/X86TargetMachine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b