[M68k] Mark public functions with the LLVM_EXTERNAL_VISIBILITY macro
authorJohn Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Mon, 5 Apr 2021 16:22:59 +0000 (09:22 -0700)
committerMin-Yih Hsu <minyihh@uci.edu>
Mon, 5 Apr 2021 16:24:30 +0000 (09:24 -0700)
In 0dbcb3639451, most most target symbols were made hidden by default
with the public ones marked with LLVM_EXTERNAL_VISIBILITY. When the
M68k target was added, this particular change was forgotten so that
external tools cannot make use of the public M68k target functions
in libLLVM.so. Thus, add the missing LLVM_EXTERNAL_VISIBILITY macro
to all public target functions in the M68k backend.

Differential Revision: https://reviews.llvm.org/D99869

llvm/lib/Target/M68k/M68kAsmPrinter.cpp
llvm/lib/Target/M68k/M68kTargetMachine.cpp
llvm/lib/Target/M68k/MCTargetDesc/M68kMCTargetDesc.cpp
llvm/lib/Target/M68k/TargetInfo/M68kTargetInfo.cpp

index 9bfcf60..d3f9a5e 100644 (file)
@@ -65,6 +65,6 @@ void M68kAsmPrinter::emitStartOfAsmFile(Module &M) {
 
 void M68kAsmPrinter::emitEndOfAsmFile(Module &M) {}
 
-extern "C" void LLVMInitializeM68kAsmPrinter() {
+extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeM68kAsmPrinter() {
   RegisterAsmPrinter<M68kAsmPrinter> X(getTheM68kTarget());
 }
index f484567..fe69d29 100644 (file)
@@ -28,7 +28,7 @@ using namespace llvm;
 
 #define DEBUG_TYPE "m68k"
 
-extern "C" void LLVMInitializeM68kTarget() {
+extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeM68kTarget() {
   RegisterTargetMachine<M68kTargetMachine> X(getTheM68kTarget());
 }
 
index 41bbc27..0a438ea 100644 (file)
@@ -106,7 +106,7 @@ static MCInstPrinter *createM68kMCInstPrinter(const Triple &T,
   return new M68kInstPrinter(MAI, MII, MRI);
 }
 
-extern "C" void LLVMInitializeM68kTargetMC() {
+extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeM68kTargetMC() {
   Target &T = getTheM68kTarget();
 
   // Register the MC asm info.
index 69c1164..5f08b90 100644 (file)
@@ -21,7 +21,7 @@ Target &getTheM68kTarget() {
 }
 } // namespace llvm
 
-extern "C" void LLVMInitializeM68kTargetInfo() {
+extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeM68kTargetInfo() {
   RegisterTarget<Triple::m68k, /*HasJIT=*/true> X(
       getTheM68kTarget(), "m68k", "Motorola 68000 family", "M68k");
 }