forked from OSchip/llvm-project
add a version of AsmPrinter::printVisibility that takes an MCSymbol.
llvm-svn: 93587
This commit is contained in:
parent
10dd6e9ca5
commit
7fec180909
|
@ -418,6 +418,9 @@ namespace llvm {
|
||||||
|
|
||||||
/// printVisibility - This prints visibility information about symbol, if
|
/// printVisibility - This prints visibility information about symbol, if
|
||||||
/// this is suported by the target.
|
/// this is suported by the target.
|
||||||
|
void printVisibility(const MCSymbol *Sym, unsigned Visibility) const;
|
||||||
|
|
||||||
|
// FIXME: This is deprecated and should be removed.
|
||||||
void printVisibility(const std::string& Name, unsigned Visibility) const;
|
void printVisibility(const std::string& Name, unsigned Visibility) const;
|
||||||
|
|
||||||
/// printOffset - This is just convenient handler for printing offsets.
|
/// printOffset - This is just convenient handler for printing offsets.
|
||||||
|
|
|
@ -1856,6 +1856,23 @@ void AsmPrinter::printVisibility(const std::string& Name,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AsmPrinter::printVisibility(const MCSymbol *Sym,
|
||||||
|
unsigned Visibility) const {
|
||||||
|
if (Visibility == GlobalValue::HiddenVisibility) {
|
||||||
|
if (const char *Directive = MAI->getHiddenDirective()) {
|
||||||
|
O << Directive;
|
||||||
|
Sym->print(O, MAI);
|
||||||
|
O << '\n';
|
||||||
|
}
|
||||||
|
} else if (Visibility == GlobalValue::ProtectedVisibility) {
|
||||||
|
if (const char *Directive = MAI->getProtectedDirective()) {
|
||||||
|
O << Directive;
|
||||||
|
Sym->print(O, MAI);
|
||||||
|
O << '\n';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void AsmPrinter::printOffset(int64_t Offset) const {
|
void AsmPrinter::printOffset(int64_t Offset) const {
|
||||||
if (Offset > 0)
|
if (Offset > 0)
|
||||||
O << '+' << Offset;
|
O << '+' << Offset;
|
||||||
|
|
|
@ -49,7 +49,6 @@
|
||||||
#include "llvm/Support/CommandLine.h"
|
#include "llvm/Support/CommandLine.h"
|
||||||
#include "llvm/Support/ErrorHandling.h"
|
#include "llvm/Support/ErrorHandling.h"
|
||||||
#include "llvm/Support/FormattedStream.h"
|
#include "llvm/Support/FormattedStream.h"
|
||||||
#include "llvm/Support/Mangler.h"
|
|
||||||
#include "llvm/Support/MathExtras.h"
|
#include "llvm/Support/MathExtras.h"
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
@ -1186,9 +1185,7 @@ void ARMAsmPrinter::PrintGlobalVariable(const GlobalVariable* GVar) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Name = Mang->getMangledName(GVar);
|
|
||||||
MCSymbol *GVarSym = GetGlobalValueSymbol(GVar);
|
MCSymbol *GVarSym = GetGlobalValueSymbol(GVar);
|
||||||
|
|
||||||
|
|
||||||
Constant *C = GVar->getInitializer();
|
Constant *C = GVar->getInitializer();
|
||||||
const Type *Type = C->getType();
|
const Type *Type = C->getType();
|
||||||
|
@ -1196,7 +1193,7 @@ void ARMAsmPrinter::PrintGlobalVariable(const GlobalVariable* GVar) {
|
||||||
unsigned Align = TD->getPreferredAlignmentLog(GVar);
|
unsigned Align = TD->getPreferredAlignmentLog(GVar);
|
||||||
bool isDarwin = Subtarget->isTargetDarwin();
|
bool isDarwin = Subtarget->isTargetDarwin();
|
||||||
|
|
||||||
printVisibility(Name, GVar->getVisibility());
|
printVisibility(GVarSym, GVar->getVisibility());
|
||||||
|
|
||||||
if (Subtarget->isTargetELF()) {
|
if (Subtarget->isTargetELF()) {
|
||||||
O << "\t.type ";
|
O << "\t.type ";
|
||||||
|
|
Loading…
Reference in New Issue