Add MCSymbolMachO which will be used to hide the MCSymbolMachO flags.
authorPete Cooper <peter_cooper@apple.com>
Mon, 8 Jun 2015 17:17:23 +0000 (17:17 +0000)
committerPete Cooper <peter_cooper@apple.com>
Mon, 8 Jun 2015 17:17:23 +0000 (17:17 +0000)
Reviewed by Rafael EspĂ­ndola.

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

include/llvm/MC/MCSymbolMachO.h [new file with mode: 0644]
lib/MC/MCContext.cpp

diff --git a/include/llvm/MC/MCSymbolMachO.h b/include/llvm/MC/MCSymbolMachO.h
new file mode 100644 (file)
index 0000000..b7f8541
--- /dev/null
@@ -0,0 +1,25 @@
+//===- MCSymbolMachO.h -  ---------------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+#ifndef LLVM_MC_MCSYMBOLMACHO_H
+#define setIsWeakExternal
+
+#include "llvm/MC/MCSymbol.h"
+
+namespace llvm {
+class MCSymbolMachO : public MCSymbol {
+
+public:
+  MCSymbolMachO(const StringMapEntry<bool> *Name, bool isTemporary)
+      : MCSymbol(SymbolKindMachO, Name, isTemporary) {}
+
+  static bool classof(const MCSymbol *S) { return S->isMachO(); }
+};
+}
+
+#endif
index 6e67e69dc2f6923af3ad92d6fa3190ce6466b7dc..1e52eedaf188dde34e12ee7bf5ffaa66e712dbc6 100644 (file)
@@ -22,6 +22,7 @@
 #include "llvm/MC/MCStreamer.h"
 #include "llvm/MC/MCSymbolCOFF.h"
 #include "llvm/MC/MCSymbolELF.h"
+#include "llvm/MC/MCSymbolMachO.h"
 #include "llvm/Support/ELF.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/FileSystem.h"
@@ -167,7 +168,7 @@ MCSymbol *MCContext::createSymbolImpl(const StringMapEntry<bool> *Name,
     case MCObjectFileInfo::IsELF:
       return new (*this) MCSymbolELF(Name, IsTemporary);
     case MCObjectFileInfo::IsMachO:
-      return new (*this) MCSymbol(MCSymbol::SymbolKindUnset, Name, IsTemporary);
+      return new (*this) MCSymbolMachO(Name, IsTemporary);
     }
   }
   return new (*this) MCSymbol(MCSymbol::SymbolKindUnset, Name, IsTemporary);