[LLVMdev] Win32 COFF Support patch 5 (the final patch in the saga!)

Michael Spencer
Tue, 27 Jul 2010 02:25:29 -0000

Daniel somehow replied to one of my previous commits on llvm-commits
instead of this thread.

On Mon, Jul 26, 2010 at 12:41 AM, Daniel Dunbar <daniel at zuster.org>
wrote:
> Hi Michael,
>
> Two minor notes:
> --
>> diff --git a/lib/Target/X86/X86AsmBackend.cpp
b/lib/Target/X86/X86AsmBackend.cpp
>> index 2cf65c1..02ac2be 100644
>> --- a/lib/Target/X86/X86AsmBackend.cpp
>> +++ b/lib/Target/X86/X86AsmBackend.cpp
>> @@ -14,6 +14,7 @@
>>  #include "llvm/MC/MCAssembler.h"
>>  #include "llvm/MC/MCExpr.h"
>>  #include "llvm/MC/MCObjectWriter.h"
>> +#include "llvm/MC/MCSectionCOFF.h"
>>  #include "llvm/MC/MCSectionELF.h"
>>  #include "llvm/MC/MCSectionMachO.h"
>>  #include "llvm/MC/MachObjectWriter.h"
>> @@ -212,6 +213,24 @@ public:
>>      : ELFX86AsmBackend(T) {}
>>  };
>>
>> +class WindowsX86AsmBackend : public X86AsmBackend {
>> +public:
>> +  WindowsX86AsmBackend(const Target &T)
>> +    : X86AsmBackend(T) {
>> +    HasAbsolutizedSet = true;
>> +    HasScatteredSymbols = true;
>
> These probably should be false for Win32.

What do they do?

>> diff --git a/test/MC/COFF/dg.exp b/test/MC/COFF/dg.exp
>> new file mode 100644
>> index 0000000..7b7bd4e
>> --- /dev/null
>> +++ b/test/MC/COFF/dg.exp
>> @@ -0,0 +1,5 @@
>> +load_lib llvm.exp
>> +
>> +if { [llvm_supports_target X86] } {
>> +  RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll}]]
>> +}
>
> This should be *.{s}.

This has to be *.{ll} for now because llvm-mc cannot parse COFF .s files.

> --
>
> Otherwise looks good to me!
>
>  - Daniel

- Michael Spencer