Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vis debug #30

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: CI

on:
push:
types:

jobs:
build:
runs-on: macOS-latest

steps:
- uses: actions/checkout@v1
- name: Create build directory
run: mkdir build
- name: Configure llvm
working-directory: build
run: cmake ../llvm -DCMAKE_BUILD_TYPE=Release -DLLVM_BUILD_LLVM_DYLIB=ON -DLLVM_LINK_LLVM_DYLIB=ON -DLLVM_ENABLE_BINDINGS=OFF
- name: Build and test llvm
run: make check-all -C build
6 changes: 6 additions & 0 deletions llvm/include/llvm/Support/Compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,17 @@
/// not accessible from outside it. Can also be used to mark variables and
/// functions, making them private to any shared library they are linked into.
/// On PE/COFF targets, library visibility is the default, so this isn't needed.
///
/// LLVM_EXTERNAL_VISIBILITY - classes, functions, and variables marked with this
/// attribute will be made public and visible outside of any shared library they
/// are linked in to.
#if (__has_attribute(visibility) || LLVM_GNUC_PREREQ(4, 0, 0)) && \
!defined(__MINGW32__) && !defined(__CYGWIN__) && !defined(_WIN32)
#define LLVM_LIBRARY_VISIBILITY __attribute__ ((visibility("hidden")))
#define LLVM_EXTERNAL_VISIBILITY __attribute__ ((visibility("default")))
#else
#define LLVM_LIBRARY_VISIBILITY
#define LLVM_EXTERNAL_VISIBILITY
#endif

#if defined(__GNUC__)
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1219,7 +1219,7 @@ void AArch64AsmPrinter::EmitInstruction(const MachineInstr *MI) {
}

// Force static initialization.
extern "C" void LLVMInitializeAArch64AsmPrinter() {
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAArch64AsmPrinter() {
RegisterAsmPrinter<AArch64AsmPrinter> X(getTheAArch64leTarget());
RegisterAsmPrinter<AArch64AsmPrinter> Y(getTheAArch64beTarget());
RegisterAsmPrinter<AArch64AsmPrinter> Z(getTheARM64Target());
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/AArch64/AArch64TargetMachine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ static cl::opt<bool>
cl::desc("Enable the AAcrh64 branch target pass"),
cl::init(true));

extern "C" void LLVMInitializeAArch64Target() {
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAArch64Target() {
// Register the target.
RegisterTargetMachine<AArch64leTargetMachine> X(getTheAArch64leTarget());
RegisterTargetMachine<AArch64beTargetMachine> Y(getTheAArch64beTarget());
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5509,7 +5509,7 @@ AArch64AsmParser::classifySymbolRef(const MCExpr *Expr,
}

/// Force static initialization.
extern "C" void LLVMInitializeAArch64AsmParser() {
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAArch64AsmParser() {
RegisterMCAsmParser<AArch64AsmParser> X(getTheAArch64leTarget());
RegisterMCAsmParser<AArch64AsmParser> Y(getTheAArch64beTarget());
RegisterMCAsmParser<AArch64AsmParser> Z(getTheARM64Target());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ createAArch64ExternalSymbolizer(const Triple &TT, LLVMOpInfoCallback GetOpInfo,
SymbolLookUp, DisInfo);
}

extern "C" void LLVMInitializeAArch64Disassembler() {
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAArch64Disassembler() {
TargetRegistry::RegisterMCDisassembler(getTheAArch64leTarget(),
createAArch64Disassembler);
TargetRegistry::RegisterMCDisassembler(getTheAArch64beTarget(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ static MCInstrAnalysis *createAArch64InstrAnalysis(const MCInstrInfo *Info) {
}

// Force static initialization.
extern "C" void LLVMInitializeAArch64TargetMC() {
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAArch64TargetMC() {
for (Target *T : {&getTheAArch64leTarget(), &getTheAArch64beTarget(),
&getTheAArch64_32Target(), &getTheARM64Target(),
&getTheARM64_32Target()}) {
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/AArch64/TargetInfo/AArch64TargetInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Target &llvm::getTheARM64_32Target() {
return TheARM64_32Target;
}

extern "C" void LLVMInitializeAArch64TargetInfo() {
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAArch64TargetInfo() {
// Now register the "arm64" name for use with "-march". We don't want it to
// take possession of the Triple::aarch64 tags though.
TargetRegistry::RegisterTarget(getTheARM64Target(), "arm64",
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ createAMDGPUAsmPrinterPass(TargetMachine &tm,
return new AMDGPUAsmPrinter(tm, std::move(Streamer));
}

extern "C" void LLVMInitializeAMDGPUAsmPrinter() {
extern "C" void LLVM_EXTERNAL_VISIBILITY LLVMInitializeAMDGPUAsmPrinter() {
TargetRegistry::RegisterAsmPrinter(getTheAMDGPUTarget(),
llvm::createR600AsmPrinterPass);
TargetRegistry::RegisterAsmPrinter(getTheGCNTarget(),
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ static cl::opt<bool> EnableScalarIRPasses(
cl::init(true),
cl::Hidden);

extern "C" void LLVMInitializeAMDGPUTarget() {
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAMDGPUTarget() {
// Register the target
RegisterTargetMachine<R600TargetMachine> X(getTheAMDGPUTarget());
RegisterTargetMachine<GCNTargetMachine> Y(getTheGCNTarget());
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6940,7 +6940,7 @@ AMDGPUOperand::Ptr AMDGPUAsmParser::defaultABID() const {
}

/// Force static initialization.
extern "C" void LLVMInitializeAMDGPUAsmParser() {
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAMDGPUAsmParser() {
RegisterMCAsmParser<AMDGPUAsmParser> A(getTheAMDGPUTarget());
RegisterMCAsmParser<AMDGPUAsmParser> B(getTheGCNTarget());
}
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1262,7 +1262,7 @@ static MCDisassembler *createAMDGPUDisassembler(const Target &T,
return new AMDGPUDisassembler(STI, Ctx, T.createMCInstrInfo());
}

extern "C" void LLVMInitializeAMDGPUDisassembler() {
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAMDGPUDisassembler() {
TargetRegistry::RegisterMCDisassembler(getTheGCNTarget(),
createAMDGPUDisassembler);
TargetRegistry::RegisterMCSymbolizer(getTheGCNTarget(),
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCTargetDesc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ static MCInstrAnalysis *createAMDGPUMCInstrAnalysis(const MCInstrInfo *Info) {
return new AMDGPUMCInstrAnalysis(Info);
}

extern "C" void LLVMInitializeAMDGPUTargetMC() {
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAMDGPUTargetMC() {

TargetRegistry::RegisterMCInstrInfo(getTheGCNTarget(), createAMDGPUMCInstrInfo);
TargetRegistry::RegisterMCInstrInfo(getTheAMDGPUTarget(), createR600MCInstrInfo);
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/AMDGPU/TargetInfo/AMDGPUTargetInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Target &llvm::getTheGCNTarget() {
}

/// Extern function to initialize the targets for the AMDGPU backend
extern "C" void LLVMInitializeAMDGPUTargetInfo() {
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAMDGPUTargetInfo() {
RegisterTarget<Triple::r600, false> R600(getTheAMDGPUTarget(), "r600",
"AMD GPUs HD2XXX-HD6XXX", "AMDGPU");
RegisterTarget<Triple::amdgcn, false> GCN(getTheGCNTarget(), "amdgcn",
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/ARC/ARCAsmPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,6 @@ void ARCAsmPrinter::EmitInstruction(const MachineInstr *MI) {
}

// Force static initialization.
extern "C" void LLVMInitializeARCAsmPrinter() {
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeARCAsmPrinter() {
RegisterAsmPrinter<ARCAsmPrinter> X(getTheARCTarget());
}
2 changes: 1 addition & 1 deletion llvm/lib/Target/ARC/ARCTargetMachine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void ARCPassConfig::addPreRegAlloc() {
}

// Force static initialization.
extern "C" void LLVMInitializeARCTarget() {
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeARCTarget() {
RegisterTargetMachine<ARCTargetMachine> X(getTheARCTarget());
}

Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/ARC/Disassembler/ARCDisassembler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ static MCDisassembler *createARCDisassembler(const Target &T,
return new ARCDisassembler(STI, Ctx, T.createMCInstrInfo());
}

extern "C" void LLVMInitializeARCDisassembler() {
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeARCDisassembler() {
// Register the disassembler.
TargetRegistry::RegisterMCDisassembler(getTheARCTarget(),
createARCDisassembler);
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/ARC/MCTargetDesc/ARCMCTargetDesc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ static MCTargetStreamer *createTargetAsmStreamer(MCStreamer &S,
}

// Force static initialization.
extern "C" void LLVMInitializeARCTargetMC() {
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeARCTargetMC() {
// Register the MC asm info.
Target &TheARCTarget = getTheARCTarget();
RegisterMCAsmInfoFn X(TheARCTarget, createARCMCAsmInfo);
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/ARC/TargetInfo/ARCTargetInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ Target &llvm::getTheARCTarget() {
return TheARCTarget;
}

extern "C" void LLVMInitializeARCTargetInfo() {
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeARCTargetInfo() {
RegisterTarget<Triple::arc> X(getTheARCTarget(), "arc", "ARC", "ARC");
}
2 changes: 1 addition & 1 deletion llvm/lib/Target/ARM/ARMAsmPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2142,7 +2142,7 @@ void ARMAsmPrinter::EmitInstruction(const MachineInstr *MI) {
//===----------------------------------------------------------------------===//

// Force static initialization.
extern "C" void LLVMInitializeARMAsmPrinter() {
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeARMAsmPrinter() {
RegisterAsmPrinter<ARMAsmPrinter> X(getTheARMLETarget());
RegisterAsmPrinter<ARMAsmPrinter> Y(getTheARMBETarget());
RegisterAsmPrinter<ARMAsmPrinter> A(getTheThumbLETarget());
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/ARM/ARMTargetMachine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ namespace llvm {
void initializeARMExecutionDomainFixPass(PassRegistry&);
}

extern "C" void LLVMInitializeARMTarget() {
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeARMTarget() {
// Register the target.
RegisterTargetMachine<ARMLETargetMachine> X(getTheARMLETarget());
RegisterTargetMachine<ARMLETargetMachine> A(getTheThumbLETarget());
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11495,7 +11495,7 @@ bool ARMAsmParser::parseDirectiveThumbSet(SMLoc L) {
}

/// Force static initialization.
extern "C" void LLVMInitializeARMAsmParser() {
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeARMAsmParser() {
RegisterMCAsmParser<ARMAsmParser> X(getTheARMLETarget());
RegisterMCAsmParser<ARMAsmParser> Y(getTheARMBETarget());
RegisterMCAsmParser<ARMAsmParser> A(getTheThumbLETarget());
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1099,7 +1099,7 @@ DecodeStatus ARMDisassembler::getThumbInstruction(MCInst &MI, uint64_t &Size,
return MCDisassembler::Fail;
}

extern "C" void LLVMInitializeARMDisassembler() {
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeARMDisassembler() {
TargetRegistry::RegisterMCDisassembler(getTheARMLETarget(),
createARMDisassembler);
TargetRegistry::RegisterMCDisassembler(getTheARMBETarget(),
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ static MCInstrAnalysis *createThumbMCInstrAnalysis(const MCInstrInfo *Info) {
}

// Force static initialization.
extern "C" void LLVMInitializeARMTargetMC() {
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeARMTargetMC() {
for (Target *T : {&getTheARMLETarget(), &getTheARMBETarget(),
&getTheThumbLETarget(), &getTheThumbBETarget()}) {
// Register the MC asm info.
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/ARM/TargetInfo/ARMTargetInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Target &llvm::getTheThumbBETarget() {
return TheThumbBETarget;
}

extern "C" void LLVMInitializeARMTargetInfo() {
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeARMTargetInfo() {
RegisterTarget<Triple::arm, /*HasJIT=*/true> X(getTheARMLETarget(), "arm",
"ARM", "ARM");
RegisterTarget<Triple::armeb, /*HasJIT=*/true> Y(getTheARMBETarget(), "armeb",
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/AVR/AVRAsmPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ void AVRAsmPrinter::EmitInstruction(const MachineInstr *MI) {

} // end of namespace llvm

extern "C" void LLVMInitializeAVRAsmPrinter() {
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAVRAsmPrinter() {
llvm::RegisterAsmPrinter<llvm::AVRAsmPrinter> X(llvm::getTheAVRTarget());
}

2 changes: 1 addition & 1 deletion llvm/lib/Target/AVR/AVRTargetMachine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ TargetPassConfig *AVRTargetMachine::createPassConfig(PassManagerBase &PM) {
return new AVRPassConfig(*this, PM);
}

extern "C" void LLVMInitializeAVRTarget() {
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAVRTarget() {
// Register the target.
RegisterTargetMachine<AVRTargetMachine> X(getTheAVRTarget());

Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/AVR/AsmParser/AVRAsmParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ bool AVRAsmParser::parseLiteralValues(unsigned SizeInBytes, SMLoc L) {
return (parseMany(parseOne));
}

extern "C" void LLVMInitializeAVRAsmParser() {
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAVRAsmParser() {
RegisterMCAsmParser<AVRAsmParser> X(getTheAVRTarget());
}

Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/AVR/Disassembler/AVRDisassembler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ static MCDisassembler *createAVRDisassembler(const Target &T,
}


extern "C" void LLVMInitializeAVRDisassembler() {
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAVRDisassembler() {
// Register the disassembler.
TargetRegistry::RegisterMCDisassembler(getTheAVRTarget(),
createAVRDisassembler);
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/AVR/MCTargetDesc/AVRMCTargetDesc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ static MCTargetStreamer *createMCAsmTargetStreamer(MCStreamer &S,
return new AVRTargetAsmStreamer(S);
}

extern "C" void LLVMInitializeAVRTargetMC() {
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAVRTargetMC() {
// Register the MC asm info.
RegisterMCAsmInfo<AVRMCAsmInfo> X(getTheAVRTarget());

Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/AVR/TargetInfo/AVRTargetInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Target &getTheAVRTarget() {
}
}

extern "C" void LLVMInitializeAVRTargetInfo() {
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAVRTargetInfo() {
llvm::RegisterTarget<llvm::Triple::avr> X(llvm::getTheAVRTarget(), "avr",
"Atmel AVR Microcontroller", "AVR");
}
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/BPF/AsmParser/BPFAsmParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ bool BPFAsmParser::ParseInstruction(ParseInstructionInfo &Info, StringRef Name,

bool BPFAsmParser::ParseDirective(AsmToken DirectiveID) { return true; }

extern "C" void LLVMInitializeBPFAsmParser() {
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeBPFAsmParser() {
RegisterMCAsmParser<BPFAsmParser> X(getTheBPFTarget());
RegisterMCAsmParser<BPFAsmParser> Y(getTheBPFleTarget());
RegisterMCAsmParser<BPFAsmParser> Z(getTheBPFbeTarget());
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/BPF/BPFAsmPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ void BPFAsmPrinter::EmitInstruction(const MachineInstr *MI) {
}

// Force static initialization.
extern "C" void LLVMInitializeBPFAsmPrinter() {
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeBPFAsmPrinter() {
RegisterAsmPrinter<BPFAsmPrinter> X(getTheBPFleTarget());
RegisterAsmPrinter<BPFAsmPrinter> Y(getTheBPFbeTarget());
RegisterAsmPrinter<BPFAsmPrinter> Z(getTheBPFTarget());
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/BPF/BPFTargetMachine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ static cl::
opt<bool> DisableMIPeephole("disable-bpf-peephole", cl::Hidden,
cl::desc("Disable machine peepholes for BPF"));

extern "C" void LLVMInitializeBPFTarget() {
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeBPFTarget() {
// Register the target.
RegisterTargetMachine<BPFTargetMachine> X(getTheBPFleTarget());
RegisterTargetMachine<BPFTargetMachine> Y(getTheBPFbeTarget());
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/BPF/Disassembler/BPFDisassembler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ static MCDisassembler *createBPFDisassembler(const Target &T,
}


extern "C" void LLVMInitializeBPFDisassembler() {
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeBPFDisassembler() {
// Register the disassembler.
TargetRegistry::RegisterMCDisassembler(getTheBPFTarget(),
createBPFDisassembler);
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/BPF/MCTargetDesc/BPFMCTargetDesc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ static MCInstrAnalysis *createBPFInstrAnalysis(const MCInstrInfo *Info) {
return new BPFMCInstrAnalysis(Info);
}

extern "C" void LLVMInitializeBPFTargetMC() {
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeBPFTargetMC() {
for (Target *T :
{&getTheBPFleTarget(), &getTheBPFbeTarget(), &getTheBPFTarget()}) {
// Register the MC asm info.
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/BPF/TargetInfo/BPFTargetInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Target &llvm::getTheBPFTarget() {
return TheBPFTarget;
}

extern "C" void LLVMInitializeBPFTargetInfo() {
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeBPFTargetInfo() {
TargetRegistry::RegisterTarget(getTheBPFTarget(), "bpf", "BPF (host endian)",
"BPF", [](Triple::ArchType) { return false; },
true);
Expand Down
8 changes: 8 additions & 0 deletions llvm/lib/Target/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ add_llvm_library(LLVMTarget
${LLVM_MAIN_INCLUDE_DIR}/llvm/Target
)

# When building shared objects for each target there are some internal APIs
# that are used across shared objects which we can't hide.
if (NOT BUILD_SHARED_LIBS)
# Set default visibility to hidden, so we don't export all the Target classes
# in libLLVM.so.
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
endif()

foreach(t ${LLVM_TARGETS_TO_BUILD})
message(STATUS "Targeting ${t}")
add_subdirectory(${t})
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -813,10 +813,10 @@ bool HexagonAsmParser::RegisterMatchesArch(unsigned MatchNum) const {
return true;
}

// extern "C" void LLVMInitializeHexagonAsmLexer();
// extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeHexagonAsmLexer();

/// Force static initialization.
extern "C" void LLVMInitializeHexagonAsmParser() {
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeHexagonAsmParser() {
RegisterMCAsmParser<HexagonAsmParser> X(getTheHexagonTarget());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ static MCDisassembler *createHexagonDisassembler(const Target &T,
return new HexagonDisassembler(STI, Ctx, T.createMCInstrInfo());
}

extern "C" void LLVMInitializeHexagonDisassembler() {
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeHexagonDisassembler() {
TargetRegistry::RegisterMCDisassembler(getTheHexagonTarget(),
createHexagonDisassembler);
}
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/Hexagon/HexagonAsmPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -771,6 +771,6 @@ void HexagonAsmPrinter::EmitInstruction(const MachineInstr *MI) {
OutStreamer->EmitInstruction(MCB, getSubtargetInfo());
}

extern "C" void LLVMInitializeHexagonAsmPrinter() {
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeHexagonAsmPrinter() {
RegisterAsmPrinter<HexagonAsmPrinter> X(getTheHexagonTarget());
}
Loading