forked from OSchip/llvm-project
emit ELF .type directives through MCStreamer instead of doing it textually.
llvm-svn: 94436
This commit is contained in:
parent
bc8f638531
commit
bc696445e1
|
@ -156,13 +156,8 @@ void AsmPrinter::EmitGlobalVariable(const GlobalVariable *GV) {
|
||||||
MCSymbol *GVSym = GetGlobalValueSymbol(GV);
|
MCSymbol *GVSym = GetGlobalValueSymbol(GV);
|
||||||
printVisibility(GVSym, GV->getVisibility());
|
printVisibility(GVSym, GV->getVisibility());
|
||||||
|
|
||||||
if (MAI->hasDotTypeDotSizeDirective()) {
|
if (MAI->hasDotTypeDotSizeDirective())
|
||||||
O << "\t.type\t" << *GVSym;
|
OutStreamer.EmitSymbolAttribute(GVSym, MCSA_ELF_TypeObject);
|
||||||
if (MAI->getCommentString()[0] != '@')
|
|
||||||
O << ",@object\n";
|
|
||||||
else
|
|
||||||
O << ",%object\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
SectionKind GVKind = TargetLoweringObjectFile::getKindForGlobal(GV, TM);
|
SectionKind GVKind = TargetLoweringObjectFile::getKindForGlobal(GV, TM);
|
||||||
|
|
||||||
|
|
|
@ -234,7 +234,7 @@ void MCAsmStreamer::EmitSymbolAttribute(MCSymbol *Symbol,
|
||||||
case MCSA_ELF_TypeCommon: /// .type _foo, STT_COMMON # aka @common
|
case MCSA_ELF_TypeCommon: /// .type _foo, STT_COMMON # aka @common
|
||||||
case MCSA_ELF_TypeNoType: /// .type _foo, STT_NOTYPE # aka @notype
|
case MCSA_ELF_TypeNoType: /// .type _foo, STT_NOTYPE # aka @notype
|
||||||
assert(MAI.hasDotTypeDotSizeDirective() && "Symbol Attr not supported");
|
assert(MAI.hasDotTypeDotSizeDirective() && "Symbol Attr not supported");
|
||||||
OS << ".type " << *Symbol << ','
|
OS << "\t.type " << *Symbol << ','
|
||||||
<< ((MAI.getCommentString()[0] != '@') ? '@' : '%');
|
<< ((MAI.getCommentString()[0] != '@') ? '@' : '%');
|
||||||
switch (Attribute) {
|
switch (Attribute) {
|
||||||
default: assert(0 && "Unknown ELF .type");
|
default: assert(0 && "Unknown ELF .type");
|
||||||
|
|
|
@ -106,7 +106,7 @@ void X86AsmPrinter::emitFunctionHeader(const MachineFunction &MF) {
|
||||||
printVisibility(CurrentFnSym, F->getVisibility());
|
printVisibility(CurrentFnSym, F->getVisibility());
|
||||||
|
|
||||||
if (Subtarget->isTargetELF()) {
|
if (Subtarget->isTargetELF()) {
|
||||||
O << "\t.type\t" << *CurrentFnSym << ",@function\n";
|
OutStreamer.EmitSymbolAttribute(CurrentFnSym, MCSA_ELF_TypeFunction);
|
||||||
} else if (Subtarget->isTargetCygMing()) {
|
} else if (Subtarget->isTargetCygMing()) {
|
||||||
O << "\t.def\t " << *CurrentFnSym;
|
O << "\t.def\t " << *CurrentFnSym;
|
||||||
O << ";\t.scl\t" <<
|
O << ";\t.scl\t" <<
|
||||||
|
|
Loading…
Reference in New Issue