mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
Implement protected visibility. This partly implements PR1363. Linker
should be taught to deal with protected symbols. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36565 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -125,9 +125,13 @@ bool X86ATTAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (F->hasHiddenVisibility())
|
||||
if (F->hasHiddenVisibility()) {
|
||||
if (const char *Directive = TAI->getHiddenDirective())
|
||||
O << Directive << CurrentFnName << "\n";
|
||||
} else if (F->hasProtectedVisibility()) {
|
||||
if (const char *Directive = TAI->getProtectedDirective())
|
||||
O << Directive << CurrentFnName << "\n";
|
||||
}
|
||||
|
||||
if (Subtarget->isTargetELF())
|
||||
O << "\t.type " << CurrentFnName << ",@function\n";
|
||||
@@ -322,7 +326,8 @@ void X86ATTAsmPrinter::printOperand(const MachineInstr *MI, unsigned OpNo,
|
||||
if (isCallOp && isa<Function>(GV)) {
|
||||
if (printGOT(TM, Subtarget)) {
|
||||
// Assemble call via PLT for non-local symbols
|
||||
if (!GV->hasHiddenVisibility() || GV->isDeclaration())
|
||||
if (!(GV->hasHiddenVisibility() || GV->hasProtectedVisibility()) ||
|
||||
GV->isDeclaration())
|
||||
O << "@PLT";
|
||||
}
|
||||
if (Subtarget->isTargetCygMing() && GV->isDeclaration())
|
||||
|
@@ -155,9 +155,14 @@ bool X86SharedAsmPrinter::doFinalization(Module &M) {
|
||||
unsigned Size = TD->getTypeSize(Type);
|
||||
unsigned Align = TD->getPreferredAlignmentLog(I);
|
||||
|
||||
if (I->hasHiddenVisibility())
|
||||
if (I->hasHiddenVisibility()) {
|
||||
if (const char *Directive = TAI->getHiddenDirective())
|
||||
O << Directive << name << "\n";
|
||||
} else if (I->hasProtectedVisibility()) {
|
||||
if (const char *Directive = TAI->getProtectedDirective())
|
||||
O << Directive << name << "\n";
|
||||
}
|
||||
|
||||
if (Subtarget->isTargetELF())
|
||||
O << "\t.type " << name << ",@object\n";
|
||||
|
||||
|
Reference in New Issue
Block a user