Make Microsoft assembler and linker happy.
authorJeff Cohen <jeffc@jolt-lang.org>
Fri, 20 Apr 2007 00:33:54 +0000 (00:33 +0000)
committerJeff Cohen <jeffc@jolt-lang.org>
Fri, 20 Apr 2007 00:33:54 +0000 (00:33 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36265 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86IntelAsmPrinter.cpp

index 39b65eeee40e9dfe822e7abaea7857613260e461..c0c1b5a9b8c4897a4329be082dd6fa758a5660c6 100755 (executable)
@@ -355,6 +355,10 @@ bool X86IntelAsmPrinter::doInitialization(Module &M) {
       if (I->hasDLLImportLinkage()) {
         O << "__imp_";
       }      
+      // Microsoft sticks an extra _ in front of "_write" (whether LLVM should
+      // hard-code usage of a Unix API is another question).
+      if (Name == "_write")
+        Name = "__write";
       O << Name << ":near\n";
     }