mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 20:23:11 +01:00
[AsmPrinter] De-capitalize all AsmPrinter::Emit* but EmitInstruction
Similar to rL328848.
This commit is contained in:
parent
1603414595
commit
e81ba0b0a3
@ -958,7 +958,7 @@ a realistic example:
|
|||||||
// } __gcmap_<FUNCTIONNAME>;
|
// } __gcmap_<FUNCTIONNAME>;
|
||||||
|
|
||||||
// Align to address width.
|
// Align to address width.
|
||||||
AP.EmitAlignment(IntPtrSize == 4 ? 2 : 3);
|
AP.emitAlignment(IntPtrSize == 4 ? 2 : 3);
|
||||||
|
|
||||||
// Emit PointCount.
|
// Emit PointCount.
|
||||||
OS.AddComment("safe point count");
|
OS.AddComment("safe point count");
|
||||||
|
@ -354,30 +354,30 @@ public:
|
|||||||
/// Print to the current output stream assembly representations of the
|
/// Print to the current output stream assembly representations of the
|
||||||
/// constants in the constant pool MCP. This is used to print out constants
|
/// constants in the constant pool MCP. This is used to print out constants
|
||||||
/// which have been "spilled to memory" by the code generator.
|
/// which have been "spilled to memory" by the code generator.
|
||||||
virtual void EmitConstantPool();
|
virtual void emitConstantPool();
|
||||||
|
|
||||||
/// Print assembly representations of the jump tables used by the current
|
/// Print assembly representations of the jump tables used by the current
|
||||||
/// function to the current output stream.
|
/// function to the current output stream.
|
||||||
virtual void EmitJumpTableInfo();
|
virtual void emitJumpTableInfo();
|
||||||
|
|
||||||
/// Emit the specified global variable to the .s file.
|
/// Emit the specified global variable to the .s file.
|
||||||
virtual void EmitGlobalVariable(const GlobalVariable *GV);
|
virtual void emitGlobalVariable(const GlobalVariable *GV);
|
||||||
|
|
||||||
/// Check to see if the specified global is a special global used by LLVM. If
|
/// Check to see if the specified global is a special global used by LLVM. If
|
||||||
/// so, emit it and return true, otherwise do nothing and return false.
|
/// so, emit it and return true, otherwise do nothing and return false.
|
||||||
bool EmitSpecialLLVMGlobal(const GlobalVariable *GV);
|
bool emitSpecialLLVMGlobal(const GlobalVariable *GV);
|
||||||
|
|
||||||
/// Emit an alignment directive to the specified power of two boundary. If a
|
/// Emit an alignment directive to the specified power of two boundary. If a
|
||||||
/// global value is specified, and if that global has an explicit alignment
|
/// global value is specified, and if that global has an explicit alignment
|
||||||
/// requested, it will override the alignment request if required for
|
/// requested, it will override the alignment request if required for
|
||||||
/// correctness.
|
/// correctness.
|
||||||
void EmitAlignment(Align Alignment, const GlobalObject *GV = nullptr) const;
|
void emitAlignment(Align Alignment, const GlobalObject *GV = nullptr) const;
|
||||||
|
|
||||||
/// Lower the specified LLVM Constant to an MCExpr.
|
/// Lower the specified LLVM Constant to an MCExpr.
|
||||||
virtual const MCExpr *lowerConstant(const Constant *CV);
|
virtual const MCExpr *lowerConstant(const Constant *CV);
|
||||||
|
|
||||||
/// Print a general LLVM constant to the .s file.
|
/// Print a general LLVM constant to the .s file.
|
||||||
void EmitGlobalConstant(const DataLayout &DL, const Constant *CV);
|
void emitGlobalConstant(const DataLayout &DL, const Constant *CV);
|
||||||
|
|
||||||
/// Unnamed constant global variables solely contaning a pointer to
|
/// Unnamed constant global variables solely contaning a pointer to
|
||||||
/// another globals variable act like a global variable "proxy", or GOT
|
/// another globals variable act like a global variable "proxy", or GOT
|
||||||
@ -443,12 +443,12 @@ public:
|
|||||||
llvm_unreachable("Function descriptor is target-specific.");
|
llvm_unreachable("Function descriptor is target-specific.");
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void EmitMachineConstantPoolValue(MachineConstantPoolValue *MCPV);
|
virtual void emitMachineConstantPoolValue(MachineConstantPoolValue *MCPV);
|
||||||
|
|
||||||
/// Targets can override this to change how global constants that are part of
|
/// Targets can override this to change how global constants that are part of
|
||||||
/// a C++ static/global constructor list are emitted.
|
/// a C++ static/global constructor list are emitted.
|
||||||
virtual void EmitXXStructor(const DataLayout &DL, const Constant *CV) {
|
virtual void emitXXStructor(const DataLayout &DL, const Constant *CV) {
|
||||||
EmitGlobalConstant(DL, CV);
|
emitGlobalConstant(DL, CV);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Return true if the basic block has exactly one predecessor and the control
|
/// Return true if the basic block has exactly one predecessor and the control
|
||||||
@ -549,13 +549,13 @@ public:
|
|||||||
/// Emit a .byte 42 directive that corresponds to an encoding. If verbose
|
/// Emit a .byte 42 directive that corresponds to an encoding. If verbose
|
||||||
/// assembly output is enabled, we output comments describing the encoding.
|
/// assembly output is enabled, we output comments describing the encoding.
|
||||||
/// Desc is a string saying what the encoding is specifying (e.g. "LSDA").
|
/// Desc is a string saying what the encoding is specifying (e.g. "LSDA").
|
||||||
void EmitEncodingByte(unsigned Val, const char *Desc = nullptr) const;
|
void emitEncodingByte(unsigned Val, const char *Desc = nullptr) const;
|
||||||
|
|
||||||
/// Return the size of the encoding in bytes.
|
/// Return the size of the encoding in bytes.
|
||||||
unsigned GetSizeOfEncodedValue(unsigned Encoding) const;
|
unsigned GetSizeOfEncodedValue(unsigned Encoding) const;
|
||||||
|
|
||||||
/// Emit reference to a ttype global with a specified encoding.
|
/// Emit reference to a ttype global with a specified encoding.
|
||||||
void EmitTTypeReference(const GlobalValue *GV, unsigned Encoding) const;
|
void emitTTypeReference(const GlobalValue *GV, unsigned Encoding) const;
|
||||||
|
|
||||||
/// Emit a reference to a symbol for use in dwarf. Different object formats
|
/// Emit a reference to a symbol for use in dwarf. Different object formats
|
||||||
/// represent this in different ways. Some use a relocation others encode
|
/// represent this in different ways. Some use a relocation others encode
|
||||||
@ -683,14 +683,14 @@ private:
|
|||||||
|
|
||||||
/// Emit a blob of inline asm to the output streamer.
|
/// Emit a blob of inline asm to the output streamer.
|
||||||
void
|
void
|
||||||
EmitInlineAsm(StringRef Str, const MCSubtargetInfo &STI,
|
emitInlineAsm(StringRef Str, const MCSubtargetInfo &STI,
|
||||||
const MCTargetOptions &MCOptions,
|
const MCTargetOptions &MCOptions,
|
||||||
const MDNode *LocMDNode = nullptr,
|
const MDNode *LocMDNode = nullptr,
|
||||||
InlineAsm::AsmDialect AsmDialect = InlineAsm::AD_ATT) const;
|
InlineAsm::AsmDialect AsmDialect = InlineAsm::AD_ATT) const;
|
||||||
|
|
||||||
/// This method formats and emits the specified machine instruction that is an
|
/// This method formats and emits the specified machine instruction that is an
|
||||||
/// inline asm.
|
/// inline asm.
|
||||||
void EmitInlineAsm(const MachineInstr *MI) const;
|
void emitInlineAsm(const MachineInstr *MI) const;
|
||||||
|
|
||||||
/// Add inline assembly info to the diagnostics machinery, so we can
|
/// Add inline assembly info to the diagnostics machinery, so we can
|
||||||
/// emit file and position info. Returns SrcMgr memory buffer position.
|
/// emit file and position info. Returns SrcMgr memory buffer position.
|
||||||
@ -701,14 +701,14 @@ private:
|
|||||||
// Internal Implementation Details
|
// Internal Implementation Details
|
||||||
//===------------------------------------------------------------------===//
|
//===------------------------------------------------------------------===//
|
||||||
|
|
||||||
void EmitJumpTableEntry(const MachineJumpTableInfo *MJTI,
|
void emitJumpTableEntry(const MachineJumpTableInfo *MJTI,
|
||||||
const MachineBasicBlock *MBB, unsigned uid) const;
|
const MachineBasicBlock *MBB, unsigned uid) const;
|
||||||
void EmitLLVMUsedList(const ConstantArray *InitList);
|
void emitLLVMUsedList(const ConstantArray *InitList);
|
||||||
/// Emit llvm.ident metadata in an '.ident' directive.
|
/// Emit llvm.ident metadata in an '.ident' directive.
|
||||||
void EmitModuleIdents(Module &M);
|
void emitModuleIdents(Module &M);
|
||||||
/// Emit bytes for llvm.commandline metadata.
|
/// Emit bytes for llvm.commandline metadata.
|
||||||
void EmitModuleCommandLines(Module &M);
|
void emitModuleCommandLines(Module &M);
|
||||||
void EmitXXStructorList(const DataLayout &DL, const Constant *List,
|
void emitXXStructorList(const DataLayout &DL, const Constant *List,
|
||||||
bool isCtor);
|
bool isCtor);
|
||||||
|
|
||||||
GCMetadataPrinter *GetOrCreateGCPrinter(GCStrategy &S);
|
GCMetadataPrinter *GetOrCreateGCPrinter(GCStrategy &S);
|
||||||
|
@ -499,7 +499,7 @@ protected:
|
|||||||
|
|
||||||
void emitGlobals();
|
void emitGlobals();
|
||||||
|
|
||||||
void EmitGlobalVariable(const GlobalVariable *GV);
|
void emitGlobalVariable(const GlobalVariable *GV);
|
||||||
|
|
||||||
GenericValue getConstantValue(const Constant *C);
|
GenericValue getConstantValue(const Constant *C);
|
||||||
void LoadValueFromMemory(GenericValue &Result, GenericValue *Ptr,
|
void LoadValueFromMemory(GenericValue &Result, GenericValue *Ptr,
|
||||||
|
@ -109,7 +109,7 @@ void ARMException::emitTypeInfos(unsigned TTypeEncoding,
|
|||||||
for (const GlobalValue *GV : reverse(TypeInfos)) {
|
for (const GlobalValue *GV : reverse(TypeInfos)) {
|
||||||
if (VerboseAsm)
|
if (VerboseAsm)
|
||||||
Asm->OutStreamer->AddComment("TypeInfo " + Twine(Entry--));
|
Asm->OutStreamer->AddComment("TypeInfo " + Twine(Entry--));
|
||||||
Asm->EmitTTypeReference(GV, TTypeEncoding);
|
Asm->emitTTypeReference(GV, TTypeEncoding);
|
||||||
}
|
}
|
||||||
|
|
||||||
Asm->OutStreamer->EmitLabel(TTBaseLabel);
|
Asm->OutStreamer->EmitLabel(TTBaseLabel);
|
||||||
@ -129,7 +129,7 @@ void ARMException::emitTypeInfos(unsigned TTypeEncoding,
|
|||||||
Asm->OutStreamer->AddComment("FilterInfo " + Twine(Entry));
|
Asm->OutStreamer->AddComment("FilterInfo " + Twine(Entry));
|
||||||
}
|
}
|
||||||
|
|
||||||
Asm->EmitTTypeReference((TypeID == 0 ? nullptr : TypeInfos[TypeID - 1]),
|
Asm->emitTTypeReference((TypeID == 0 ? nullptr : TypeInfos[TypeID - 1]),
|
||||||
TTypeEncoding);
|
TTypeEncoding);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -305,7 +305,7 @@ bool AsmPrinter::doInitialization(Module &M) {
|
|||||||
TM.getTargetFeatureString()));
|
TM.getTargetFeatureString()));
|
||||||
OutStreamer->AddComment("Start of file scope inline assembly");
|
OutStreamer->AddComment("Start of file scope inline assembly");
|
||||||
OutStreamer->AddBlankLine();
|
OutStreamer->AddBlankLine();
|
||||||
EmitInlineAsm(M.getModuleInlineAsm()+"\n",
|
emitInlineAsm(M.getModuleInlineAsm() + "\n",
|
||||||
OutContext.getSubtargetCopy(*STI), TM.Options.MCOptions);
|
OutContext.getSubtargetCopy(*STI), TM.Options.MCOptions);
|
||||||
OutStreamer->AddComment("End of file scope inline assembly");
|
OutStreamer->AddComment("End of file scope inline assembly");
|
||||||
OutStreamer->AddBlankLine();
|
OutStreamer->AddBlankLine();
|
||||||
@ -466,7 +466,7 @@ MCSymbol *AsmPrinter::getSymbolPreferLocal(const GlobalValue &GV) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// EmitGlobalVariable - Emit the specified global variable to the .s file.
|
/// EmitGlobalVariable - Emit the specified global variable to the .s file.
|
||||||
void AsmPrinter::EmitGlobalVariable(const GlobalVariable *GV) {
|
void AsmPrinter::emitGlobalVariable(const GlobalVariable *GV) {
|
||||||
bool IsEmuTLSVar = TM.useEmulatedTLS() && GV->isThreadLocal();
|
bool IsEmuTLSVar = TM.useEmulatedTLS() && GV->isThreadLocal();
|
||||||
assert(!(IsEmuTLSVar && GV->hasCommonLinkage()) &&
|
assert(!(IsEmuTLSVar && GV->hasCommonLinkage()) &&
|
||||||
"No emulated TLS variables in the common section");
|
"No emulated TLS variables in the common section");
|
||||||
@ -478,7 +478,7 @@ void AsmPrinter::EmitGlobalVariable(const GlobalVariable *GV) {
|
|||||||
|
|
||||||
if (GV->hasInitializer()) {
|
if (GV->hasInitializer()) {
|
||||||
// Check to see if this is a special global used by LLVM, if so, emit it.
|
// Check to see if this is a special global used by LLVM, if so, emit it.
|
||||||
if (EmitSpecialLLVMGlobal(GV))
|
if (emitSpecialLLVMGlobal(GV))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Skip the emission of global equivalents. The symbol can be emitted later
|
// Skip the emission of global equivalents. The symbol can be emitted later
|
||||||
@ -607,10 +607,10 @@ void AsmPrinter::EmitGlobalVariable(const GlobalVariable *GV) {
|
|||||||
} else if (GVKind.isThreadData()) {
|
} else if (GVKind.isThreadData()) {
|
||||||
OutStreamer->SwitchSection(TheSection);
|
OutStreamer->SwitchSection(TheSection);
|
||||||
|
|
||||||
EmitAlignment(Alignment, GV);
|
emitAlignment(Alignment, GV);
|
||||||
OutStreamer->EmitLabel(MangSym);
|
OutStreamer->EmitLabel(MangSym);
|
||||||
|
|
||||||
EmitGlobalConstant(GV->getParent()->getDataLayout(),
|
emitGlobalConstant(GV->getParent()->getDataLayout(),
|
||||||
GV->getInitializer());
|
GV->getInitializer());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -643,14 +643,14 @@ void AsmPrinter::EmitGlobalVariable(const GlobalVariable *GV) {
|
|||||||
OutStreamer->SwitchSection(TheSection);
|
OutStreamer->SwitchSection(TheSection);
|
||||||
|
|
||||||
emitLinkage(GV, EmittedInitSym);
|
emitLinkage(GV, EmittedInitSym);
|
||||||
EmitAlignment(Alignment, GV);
|
emitAlignment(Alignment, GV);
|
||||||
|
|
||||||
OutStreamer->EmitLabel(EmittedInitSym);
|
OutStreamer->EmitLabel(EmittedInitSym);
|
||||||
MCSymbol *LocalAlias = getSymbolPreferLocal(*GV);
|
MCSymbol *LocalAlias = getSymbolPreferLocal(*GV);
|
||||||
if (LocalAlias != EmittedInitSym)
|
if (LocalAlias != EmittedInitSym)
|
||||||
OutStreamer->EmitLabel(LocalAlias);
|
OutStreamer->EmitLabel(LocalAlias);
|
||||||
|
|
||||||
EmitGlobalConstant(GV->getParent()->getDataLayout(), GV->getInitializer());
|
emitGlobalConstant(GV->getParent()->getDataLayout(), GV->getInitializer());
|
||||||
|
|
||||||
if (MAI->hasDotTypeDotSizeDirective())
|
if (MAI->hasDotTypeDotSizeDirective())
|
||||||
// .size foo, 42
|
// .size foo, 42
|
||||||
@ -679,7 +679,7 @@ void AsmPrinter::emitFunctionHeader() {
|
|||||||
<< GlobalValue::dropLLVMManglingEscape(F.getName()) << '\n';
|
<< GlobalValue::dropLLVMManglingEscape(F.getName()) << '\n';
|
||||||
|
|
||||||
// Print out constants referenced by the function
|
// Print out constants referenced by the function
|
||||||
EmitConstantPool();
|
emitConstantPool();
|
||||||
|
|
||||||
// Print the 'header' of function.
|
// Print the 'header' of function.
|
||||||
OutStreamer->SwitchSection(getObjFileLowering().SectionForGlobal(&F, TM));
|
OutStreamer->SwitchSection(getObjFileLowering().SectionForGlobal(&F, TM));
|
||||||
@ -691,7 +691,7 @@ void AsmPrinter::emitFunctionHeader() {
|
|||||||
|
|
||||||
emitLinkage(&F, CurrentFnSym);
|
emitLinkage(&F, CurrentFnSym);
|
||||||
if (MAI->hasFunctionAlignment())
|
if (MAI->hasFunctionAlignment())
|
||||||
EmitAlignment(MF->getAlignment(), &F);
|
emitAlignment(MF->getAlignment(), &F);
|
||||||
|
|
||||||
if (MAI->hasDotTypeDotSizeDirective())
|
if (MAI->hasDotTypeDotSizeDirective())
|
||||||
OutStreamer->EmitSymbolAttribute(CurrentFnSym, MCSA_ELF_TypeFunction);
|
OutStreamer->EmitSymbolAttribute(CurrentFnSym, MCSA_ELF_TypeFunction);
|
||||||
@ -715,12 +715,12 @@ void AsmPrinter::emitFunctionHeader() {
|
|||||||
MCSymbol *PrefixSym = OutContext.createLinkerPrivateTempSymbol();
|
MCSymbol *PrefixSym = OutContext.createLinkerPrivateTempSymbol();
|
||||||
OutStreamer->EmitLabel(PrefixSym);
|
OutStreamer->EmitLabel(PrefixSym);
|
||||||
|
|
||||||
EmitGlobalConstant(F.getParent()->getDataLayout(), F.getPrefixData());
|
emitGlobalConstant(F.getParent()->getDataLayout(), F.getPrefixData());
|
||||||
|
|
||||||
// Emit an .alt_entry directive for the actual function symbol.
|
// Emit an .alt_entry directive for the actual function symbol.
|
||||||
OutStreamer->EmitSymbolAttribute(CurrentFnSym, MCSA_AltEntry);
|
OutStreamer->EmitSymbolAttribute(CurrentFnSym, MCSA_AltEntry);
|
||||||
} else {
|
} else {
|
||||||
EmitGlobalConstant(F.getParent()->getDataLayout(), F.getPrefixData());
|
emitGlobalConstant(F.getParent()->getDataLayout(), F.getPrefixData());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -776,7 +776,7 @@ void AsmPrinter::emitFunctionHeader() {
|
|||||||
|
|
||||||
// Emit the prologue data.
|
// Emit the prologue data.
|
||||||
if (F.hasPrologueData())
|
if (F.hasPrologueData())
|
||||||
EmitGlobalConstant(F.getParent()->getDataLayout(), F.getPrologueData());
|
emitGlobalConstant(F.getParent()->getDataLayout(), F.getPrologueData());
|
||||||
}
|
}
|
||||||
|
|
||||||
/// EmitFunctionEntryLabel - Emit the label that is the entrypoint for the
|
/// EmitFunctionEntryLabel - Emit the label that is the entrypoint for the
|
||||||
@ -1136,7 +1136,7 @@ void AsmPrinter::emitFunctionBody() {
|
|||||||
break;
|
break;
|
||||||
case TargetOpcode::INLINEASM:
|
case TargetOpcode::INLINEASM:
|
||||||
case TargetOpcode::INLINEASM_BR:
|
case TargetOpcode::INLINEASM_BR:
|
||||||
EmitInlineAsm(&MI);
|
emitInlineAsm(&MI);
|
||||||
break;
|
break;
|
||||||
case TargetOpcode::DBG_VALUE:
|
case TargetOpcode::DBG_VALUE:
|
||||||
if (isVerbose()) {
|
if (isVerbose()) {
|
||||||
@ -1247,7 +1247,7 @@ void AsmPrinter::emitFunctionBody() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Print out jump tables referenced by the function.
|
// Print out jump tables referenced by the function.
|
||||||
EmitJumpTableInfo();
|
emitJumpTableInfo();
|
||||||
|
|
||||||
// Emit post-function debug and/or EH information.
|
// Emit post-function debug and/or EH information.
|
||||||
for (const HandlerInfo &HI : Handlers) {
|
for (const HandlerInfo &HI : Handlers) {
|
||||||
@ -1343,7 +1343,7 @@ void AsmPrinter::emitGlobalGOTEquivs() {
|
|||||||
GlobalGOTEquivs.clear();
|
GlobalGOTEquivs.clear();
|
||||||
|
|
||||||
for (auto *GV : FailedCandidates)
|
for (auto *GV : FailedCandidates)
|
||||||
EmitGlobalVariable(GV);
|
emitGlobalVariable(GV);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AsmPrinter::emitGlobalIndirectSymbol(Module &M,
|
void AsmPrinter::emitGlobalIndirectSymbol(Module &M,
|
||||||
@ -1445,7 +1445,7 @@ bool AsmPrinter::doFinalization(Module &M) {
|
|||||||
|
|
||||||
// Emit global variables.
|
// Emit global variables.
|
||||||
for (const auto &G : M.globals())
|
for (const auto &G : M.globals())
|
||||||
EmitGlobalVariable(&G);
|
emitGlobalVariable(&G);
|
||||||
|
|
||||||
// Emit remaining GOT equivalent globals.
|
// Emit remaining GOT equivalent globals.
|
||||||
emitGlobalGOTEquivs();
|
emitGlobalGOTEquivs();
|
||||||
@ -1481,7 +1481,7 @@ bool AsmPrinter::doFinalization(Module &M) {
|
|||||||
OutStreamer->SwitchSection(TLOF.getDataSection());
|
OutStreamer->SwitchSection(TLOF.getDataSection());
|
||||||
const DataLayout &DL = M.getDataLayout();
|
const DataLayout &DL = M.getDataLayout();
|
||||||
|
|
||||||
EmitAlignment(Align(DL.getPointerSize()));
|
emitAlignment(Align(DL.getPointerSize()));
|
||||||
for (const auto &Stub : Stubs) {
|
for (const auto &Stub : Stubs) {
|
||||||
OutStreamer->EmitLabel(Stub.first);
|
OutStreamer->EmitLabel(Stub.first);
|
||||||
OutStreamer->EmitSymbolValue(Stub.second.getPointer(),
|
OutStreamer->EmitSymbolValue(Stub.second.getPointer(),
|
||||||
@ -1508,7 +1508,7 @@ bool AsmPrinter::doFinalization(Module &M) {
|
|||||||
COFF::IMAGE_SCN_LNK_COMDAT,
|
COFF::IMAGE_SCN_LNK_COMDAT,
|
||||||
SectionKind::getReadOnly(), Stub.first->getName(),
|
SectionKind::getReadOnly(), Stub.first->getName(),
|
||||||
COFF::IMAGE_COMDAT_SELECT_ANY));
|
COFF::IMAGE_COMDAT_SELECT_ANY));
|
||||||
EmitAlignment(Align(DL.getPointerSize()));
|
emitAlignment(Align(DL.getPointerSize()));
|
||||||
OutStreamer->EmitSymbolAttribute(Stub.first, MCSA_Global);
|
OutStreamer->EmitSymbolAttribute(Stub.first, MCSA_Global);
|
||||||
OutStreamer->EmitLabel(Stub.first);
|
OutStreamer->EmitLabel(Stub.first);
|
||||||
OutStreamer->EmitSymbolValue(Stub.second.getPointer(),
|
OutStreamer->EmitSymbolValue(Stub.second.getPointer(),
|
||||||
@ -1568,10 +1568,10 @@ bool AsmPrinter::doFinalization(Module &M) {
|
|||||||
MP->finishAssembly(M, *MI, *this);
|
MP->finishAssembly(M, *MI, *this);
|
||||||
|
|
||||||
// Emit llvm.ident metadata in an '.ident' directive.
|
// Emit llvm.ident metadata in an '.ident' directive.
|
||||||
EmitModuleIdents(M);
|
emitModuleIdents(M);
|
||||||
|
|
||||||
// Emit bytes for llvm.commandline metadata.
|
// Emit bytes for llvm.commandline metadata.
|
||||||
EmitModuleCommandLines(M);
|
emitModuleCommandLines(M);
|
||||||
|
|
||||||
// Emit __morestack address if needed for indirect calls.
|
// Emit __morestack address if needed for indirect calls.
|
||||||
if (MMI->usesMorestackAddr()) {
|
if (MMI->usesMorestackAddr()) {
|
||||||
@ -1764,7 +1764,7 @@ namespace {
|
|||||||
/// representations of the constants in the constant pool MCP. This is
|
/// representations of the constants in the constant pool MCP. This is
|
||||||
/// used to print out constants which have been "spilled to memory" by
|
/// used to print out constants which have been "spilled to memory" by
|
||||||
/// the code generator.
|
/// the code generator.
|
||||||
void AsmPrinter::EmitConstantPool() {
|
void AsmPrinter::emitConstantPool() {
|
||||||
const MachineConstantPool *MCP = MF->getConstantPool();
|
const MachineConstantPool *MCP = MF->getConstantPool();
|
||||||
const std::vector<MachineConstantPoolEntry> &CP = MCP->getConstants();
|
const std::vector<MachineConstantPoolEntry> &CP = MCP->getConstants();
|
||||||
if (CP.empty()) return;
|
if (CP.empty()) return;
|
||||||
@ -1822,7 +1822,7 @@ void AsmPrinter::EmitConstantPool() {
|
|||||||
|
|
||||||
if (CurSection != CPSections[i].S) {
|
if (CurSection != CPSections[i].S) {
|
||||||
OutStreamer->SwitchSection(CPSections[i].S);
|
OutStreamer->SwitchSection(CPSections[i].S);
|
||||||
EmitAlignment(Align(CPSections[i].Alignment));
|
emitAlignment(Align(CPSections[i].Alignment));
|
||||||
CurSection = CPSections[i].S;
|
CurSection = CPSections[i].S;
|
||||||
Offset = 0;
|
Offset = 0;
|
||||||
}
|
}
|
||||||
@ -1839,16 +1839,16 @@ void AsmPrinter::EmitConstantPool() {
|
|||||||
|
|
||||||
OutStreamer->EmitLabel(Sym);
|
OutStreamer->EmitLabel(Sym);
|
||||||
if (CPE.isMachineConstantPoolEntry())
|
if (CPE.isMachineConstantPoolEntry())
|
||||||
EmitMachineConstantPoolValue(CPE.Val.MachineCPVal);
|
emitMachineConstantPoolValue(CPE.Val.MachineCPVal);
|
||||||
else
|
else
|
||||||
EmitGlobalConstant(getDataLayout(), CPE.Val.ConstVal);
|
emitGlobalConstant(getDataLayout(), CPE.Val.ConstVal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// EmitJumpTableInfo - Print assembly representations of the jump tables used
|
// Print assembly representations of the jump tables used by the current
|
||||||
/// by the current function to the current output stream.
|
// function.
|
||||||
void AsmPrinter::EmitJumpTableInfo() {
|
void AsmPrinter::emitJumpTableInfo() {
|
||||||
const DataLayout &DL = MF->getDataLayout();
|
const DataLayout &DL = MF->getDataLayout();
|
||||||
const MachineJumpTableInfo *MJTI = MF->getJumpTableInfo();
|
const MachineJumpTableInfo *MJTI = MF->getJumpTableInfo();
|
||||||
if (!MJTI) return;
|
if (!MJTI) return;
|
||||||
@ -1869,7 +1869,7 @@ void AsmPrinter::EmitJumpTableInfo() {
|
|||||||
OutStreamer->SwitchSection(ReadOnlySection);
|
OutStreamer->SwitchSection(ReadOnlySection);
|
||||||
}
|
}
|
||||||
|
|
||||||
EmitAlignment(Align(MJTI->getEntryAlignment(DL)));
|
emitAlignment(Align(MJTI->getEntryAlignment(DL)));
|
||||||
|
|
||||||
// Jump tables in code sections are marked with a data_region directive
|
// Jump tables in code sections are marked with a data_region directive
|
||||||
// where that's supported.
|
// where that's supported.
|
||||||
@ -1921,7 +1921,7 @@ void AsmPrinter::EmitJumpTableInfo() {
|
|||||||
OutStreamer->EmitLabel(JTISymbol);
|
OutStreamer->EmitLabel(JTISymbol);
|
||||||
|
|
||||||
for (unsigned ii = 0, ee = JTBBs.size(); ii != ee; ++ii)
|
for (unsigned ii = 0, ee = JTBBs.size(); ii != ee; ++ii)
|
||||||
EmitJumpTableEntry(MJTI, JTBBs[ii], JTI);
|
emitJumpTableEntry(MJTI, JTBBs[ii], JTI);
|
||||||
}
|
}
|
||||||
if (!JTInDiffSection)
|
if (!JTInDiffSection)
|
||||||
OutStreamer->EmitDataRegion(MCDR_DataRegionEnd);
|
OutStreamer->EmitDataRegion(MCDR_DataRegionEnd);
|
||||||
@ -1929,7 +1929,7 @@ void AsmPrinter::EmitJumpTableInfo() {
|
|||||||
|
|
||||||
/// EmitJumpTableEntry - Emit a jump table entry for the specified MBB to the
|
/// EmitJumpTableEntry - Emit a jump table entry for the specified MBB to the
|
||||||
/// current stream.
|
/// current stream.
|
||||||
void AsmPrinter::EmitJumpTableEntry(const MachineJumpTableInfo *MJTI,
|
void AsmPrinter::emitJumpTableEntry(const MachineJumpTableInfo *MJTI,
|
||||||
const MachineBasicBlock *MBB,
|
const MachineBasicBlock *MBB,
|
||||||
unsigned UID) const {
|
unsigned UID) const {
|
||||||
assert(MBB && MBB->getNumber() >= 0 && "Invalid basic block");
|
assert(MBB && MBB->getNumber() >= 0 && "Invalid basic block");
|
||||||
@ -1994,10 +1994,10 @@ void AsmPrinter::EmitJumpTableEntry(const MachineJumpTableInfo *MJTI,
|
|||||||
/// EmitSpecialLLVMGlobal - Check to see if the specified global is a
|
/// EmitSpecialLLVMGlobal - Check to see if the specified global is a
|
||||||
/// special global used by LLVM. If so, emit it and return true, otherwise
|
/// special global used by LLVM. If so, emit it and return true, otherwise
|
||||||
/// do nothing and return false.
|
/// do nothing and return false.
|
||||||
bool AsmPrinter::EmitSpecialLLVMGlobal(const GlobalVariable *GV) {
|
bool AsmPrinter::emitSpecialLLVMGlobal(const GlobalVariable *GV) {
|
||||||
if (GV->getName() == "llvm.used") {
|
if (GV->getName() == "llvm.used") {
|
||||||
if (MAI->hasNoDeadStrip()) // No need to emit this at all.
|
if (MAI->hasNoDeadStrip()) // No need to emit this at all.
|
||||||
EmitLLVMUsedList(cast<ConstantArray>(GV->getInitializer()));
|
emitLLVMUsedList(cast<ConstantArray>(GV->getInitializer()));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2011,14 +2011,14 @@ bool AsmPrinter::EmitSpecialLLVMGlobal(const GlobalVariable *GV) {
|
|||||||
assert(GV->hasInitializer() && "Not a special LLVM global!");
|
assert(GV->hasInitializer() && "Not a special LLVM global!");
|
||||||
|
|
||||||
if (GV->getName() == "llvm.global_ctors") {
|
if (GV->getName() == "llvm.global_ctors") {
|
||||||
EmitXXStructorList(GV->getParent()->getDataLayout(), GV->getInitializer(),
|
emitXXStructorList(GV->getParent()->getDataLayout(), GV->getInitializer(),
|
||||||
/* isCtor */ true);
|
/* isCtor */ true);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GV->getName() == "llvm.global_dtors") {
|
if (GV->getName() == "llvm.global_dtors") {
|
||||||
EmitXXStructorList(GV->getParent()->getDataLayout(), GV->getInitializer(),
|
emitXXStructorList(GV->getParent()->getDataLayout(), GV->getInitializer(),
|
||||||
/* isCtor */ false);
|
/* isCtor */ false);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -2029,7 +2029,7 @@ bool AsmPrinter::EmitSpecialLLVMGlobal(const GlobalVariable *GV) {
|
|||||||
|
|
||||||
/// EmitLLVMUsedList - For targets that define a MAI::UsedDirective, mark each
|
/// EmitLLVMUsedList - For targets that define a MAI::UsedDirective, mark each
|
||||||
/// global in the specified llvm.used list.
|
/// global in the specified llvm.used list.
|
||||||
void AsmPrinter::EmitLLVMUsedList(const ConstantArray *InitList) {
|
void AsmPrinter::emitLLVMUsedList(const ConstantArray *InitList) {
|
||||||
// Should be an array of 'i8*'.
|
// Should be an array of 'i8*'.
|
||||||
for (unsigned i = 0, e = InitList->getNumOperands(); i != e; ++i) {
|
for (unsigned i = 0, e = InitList->getNumOperands(); i != e; ++i) {
|
||||||
const GlobalValue *GV =
|
const GlobalValue *GV =
|
||||||
@ -2053,7 +2053,7 @@ struct Structor {
|
|||||||
|
|
||||||
/// EmitXXStructorList - Emit the ctor or dtor list taking into account the init
|
/// EmitXXStructorList - Emit the ctor or dtor list taking into account the init
|
||||||
/// priority.
|
/// priority.
|
||||||
void AsmPrinter::EmitXXStructorList(const DataLayout &DL, const Constant *List,
|
void AsmPrinter::emitXXStructorList(const DataLayout &DL, const Constant *List,
|
||||||
bool isCtor) {
|
bool isCtor) {
|
||||||
// Should be an array of '{ i32, void ()*, i8* }' structs. The first value is the
|
// Should be an array of '{ i32, void ()*, i8* }' structs. The first value is the
|
||||||
// init priority.
|
// init priority.
|
||||||
@ -2111,12 +2111,12 @@ void AsmPrinter::EmitXXStructorList(const DataLayout &DL, const Constant *List,
|
|||||||
: Obj.getStaticDtorSection(S.Priority, KeySym));
|
: Obj.getStaticDtorSection(S.Priority, KeySym));
|
||||||
OutStreamer->SwitchSection(OutputSection);
|
OutStreamer->SwitchSection(OutputSection);
|
||||||
if (OutStreamer->getCurrentSection() != OutStreamer->getPreviousSection())
|
if (OutStreamer->getCurrentSection() != OutStreamer->getPreviousSection())
|
||||||
EmitAlignment(Align);
|
emitAlignment(Align);
|
||||||
EmitXXStructor(DL, S.Func);
|
emitXXStructor(DL, S.Func);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AsmPrinter::EmitModuleIdents(Module &M) {
|
void AsmPrinter::emitModuleIdents(Module &M) {
|
||||||
if (!MAI->hasIdentDirective())
|
if (!MAI->hasIdentDirective())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -2131,7 +2131,7 @@ void AsmPrinter::EmitModuleIdents(Module &M) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AsmPrinter::EmitModuleCommandLines(Module &M) {
|
void AsmPrinter::emitModuleCommandLines(Module &M) {
|
||||||
MCSection *CommandLine = getObjFileLowering().getSectionForCommandLines();
|
MCSection *CommandLine = getObjFileLowering().getSectionForCommandLines();
|
||||||
if (!CommandLine)
|
if (!CommandLine)
|
||||||
return;
|
return;
|
||||||
@ -2215,7 +2215,7 @@ void AsmPrinter::emitLabelPlusOffset(const MCSymbol *Label, uint64_t Offset,
|
|||||||
// two boundary. If a global value is specified, and if that global has
|
// two boundary. If a global value is specified, and if that global has
|
||||||
// an explicit alignment requested, it will override the alignment request
|
// an explicit alignment requested, it will override the alignment request
|
||||||
// if required for correctness.
|
// if required for correctness.
|
||||||
void AsmPrinter::EmitAlignment(Align Alignment, const GlobalObject *GV) const {
|
void AsmPrinter::emitAlignment(Align Alignment, const GlobalObject *GV) const {
|
||||||
if (GV)
|
if (GV)
|
||||||
Alignment = getGVAlignment(GV, GV->getParent()->getDataLayout(), Alignment);
|
Alignment = getGVAlignment(GV, GV->getParent()->getDataLayout(), Alignment);
|
||||||
|
|
||||||
@ -2816,7 +2816,7 @@ static void emitGlobalConstantImpl(const DataLayout &DL, const Constant *CV,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// EmitGlobalConstant - Print a general LLVM constant to the .s file.
|
/// EmitGlobalConstant - Print a general LLVM constant to the .s file.
|
||||||
void AsmPrinter::EmitGlobalConstant(const DataLayout &DL, const Constant *CV) {
|
void AsmPrinter::emitGlobalConstant(const DataLayout &DL, const Constant *CV) {
|
||||||
uint64_t Size = DL.getTypeAllocSize(CV->getType());
|
uint64_t Size = DL.getTypeAllocSize(CV->getType());
|
||||||
if (Size)
|
if (Size)
|
||||||
emitGlobalConstantImpl(DL, CV, *this);
|
emitGlobalConstantImpl(DL, CV, *this);
|
||||||
@ -2827,7 +2827,7 @@ void AsmPrinter::EmitGlobalConstant(const DataLayout &DL, const Constant *CV) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AsmPrinter::EmitMachineConstantPoolValue(MachineConstantPoolValue *MCPV) {
|
void AsmPrinter::emitMachineConstantPoolValue(MachineConstantPoolValue *MCPV) {
|
||||||
// Target doesn't support this yet!
|
// Target doesn't support this yet!
|
||||||
llvm_unreachable("Target does not support EmitMachineConstantPoolValue");
|
llvm_unreachable("Target does not support EmitMachineConstantPoolValue");
|
||||||
}
|
}
|
||||||
@ -2993,7 +2993,7 @@ void AsmPrinter::emitBasicBlockStart(const MachineBasicBlock &MBB) {
|
|||||||
// Emit an alignment directive for this block, if needed.
|
// Emit an alignment directive for this block, if needed.
|
||||||
const Align Alignment = MBB.getAlignment();
|
const Align Alignment = MBB.getAlignment();
|
||||||
if (Alignment != Align(1))
|
if (Alignment != Align(1))
|
||||||
EmitAlignment(Alignment);
|
emitAlignment(Alignment);
|
||||||
|
|
||||||
// If the block has its address taken, emit any labels that were used to
|
// If the block has its address taken, emit any labels that were used to
|
||||||
// reference the block. It is possible that there is more than one label
|
// reference the block. It is possible that there is more than one label
|
||||||
@ -3283,7 +3283,7 @@ void AsmPrinter::emitPatchableFunctionEntries() {
|
|||||||
OutStreamer->SwitchSection(OutContext.getELFSection(
|
OutStreamer->SwitchSection(OutContext.getELFSection(
|
||||||
"__patchable_function_entries", ELF::SHT_PROGBITS, Flags));
|
"__patchable_function_entries", ELF::SHT_PROGBITS, Flags));
|
||||||
}
|
}
|
||||||
EmitAlignment(Align(PointerSize));
|
emitAlignment(Align(PointerSize));
|
||||||
OutStreamer->EmitSymbolValue(CurrentPatchableFunctionEntrySym, PointerSize);
|
OutStreamer->EmitSymbolValue(CurrentPatchableFunctionEntrySym, PointerSize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -106,7 +106,7 @@ static const char *DecodeDWARFEncoding(unsigned Encoding) {
|
|||||||
/// encoding. If verbose assembly output is enabled, we output comments
|
/// encoding. If verbose assembly output is enabled, we output comments
|
||||||
/// describing the encoding. Desc is an optional string saying what the
|
/// describing the encoding. Desc is an optional string saying what the
|
||||||
/// encoding is specifying (e.g. "LSDA").
|
/// encoding is specifying (e.g. "LSDA").
|
||||||
void AsmPrinter::EmitEncodingByte(unsigned Val, const char *Desc) const {
|
void AsmPrinter::emitEncodingByte(unsigned Val, const char *Desc) const {
|
||||||
if (isVerbose()) {
|
if (isVerbose()) {
|
||||||
if (Desc)
|
if (Desc)
|
||||||
OutStreamer->AddComment(Twine(Desc) + " Encoding = " +
|
OutStreamer->AddComment(Twine(Desc) + " Encoding = " +
|
||||||
@ -137,7 +137,7 @@ unsigned AsmPrinter::GetSizeOfEncodedValue(unsigned Encoding) const {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AsmPrinter::EmitTTypeReference(const GlobalValue *GV,
|
void AsmPrinter::emitTTypeReference(const GlobalValue *GV,
|
||||||
unsigned Encoding) const {
|
unsigned Encoding) const {
|
||||||
if (GV) {
|
if (GV) {
|
||||||
const TargetLoweringObjectFile &TLOF = getObjFileLowering();
|
const TargetLoweringObjectFile &TLOF = getObjFileLowering();
|
||||||
|
@ -106,7 +106,7 @@ unsigned AsmPrinter::addInlineAsmDiagBuffer(StringRef AsmStr,
|
|||||||
|
|
||||||
|
|
||||||
/// EmitInlineAsm - Emit a blob of inline asm to the output streamer.
|
/// EmitInlineAsm - Emit a blob of inline asm to the output streamer.
|
||||||
void AsmPrinter::EmitInlineAsm(StringRef Str, const MCSubtargetInfo &STI,
|
void AsmPrinter::emitInlineAsm(StringRef Str, const MCSubtargetInfo &STI,
|
||||||
const MCTargetOptions &MCOptions,
|
const MCTargetOptions &MCOptions,
|
||||||
const MDNode *LocMDNode,
|
const MDNode *LocMDNode,
|
||||||
InlineAsm::AsmDialect Dialect) const {
|
InlineAsm::AsmDialect Dialect) const {
|
||||||
@ -489,9 +489,9 @@ static void EmitGCCInlineAsmStr(const char *AsmStr, const MachineInstr *MI,
|
|||||||
OS << '\n' << (char)0; // null terminate string.
|
OS << '\n' << (char)0; // null terminate string.
|
||||||
}
|
}
|
||||||
|
|
||||||
/// EmitInlineAsm - This method formats and emits the specified machine
|
/// This method formats and emits the specified machine instruction that is an
|
||||||
/// instruction that is an inline asm.
|
/// inline asm.
|
||||||
void AsmPrinter::EmitInlineAsm(const MachineInstr *MI) const {
|
void AsmPrinter::emitInlineAsm(const MachineInstr *MI) const {
|
||||||
assert(MI->isInlineAsm() && "printInlineAsm only works on inline asms");
|
assert(MI->isInlineAsm() && "printInlineAsm only works on inline asms");
|
||||||
|
|
||||||
// Count the number of register definitions to find the asm string.
|
// Count the number of register definitions to find the asm string.
|
||||||
@ -584,7 +584,7 @@ void AsmPrinter::EmitInlineAsm(const MachineInstr *MI) const {
|
|||||||
SrcMgr.PrintMessage(Loc, SourceMgr::DK_Note, Note);
|
SrcMgr.PrintMessage(Loc, SourceMgr::DK_Note, Note);
|
||||||
}
|
}
|
||||||
|
|
||||||
EmitInlineAsm(OS.str(), getSubtargetInfo(), TM.Options.MCOptions, LocMD,
|
emitInlineAsm(OS.str(), getSubtargetInfo(), TM.Options.MCOptions, LocMD,
|
||||||
MI->getInlineAsmDialect());
|
MI->getInlineAsmDialect());
|
||||||
|
|
||||||
// Emit the #NOAPP end marker. This has to happen even if verbose-asm isn't
|
// Emit the #NOAPP end marker. This has to happen even if verbose-asm isn't
|
||||||
@ -592,7 +592,6 @@ void AsmPrinter::EmitInlineAsm(const MachineInstr *MI) const {
|
|||||||
OutStreamer->emitRawComment(MAI->getInlineAsmEnd());
|
OutStreamer->emitRawComment(MAI->getInlineAsmEnd());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// PrintSpecial - Print information related to the specified machine instr
|
/// PrintSpecial - Print information related to the specified machine instr
|
||||||
/// that is independent of the operand, and may be independent of the instr
|
/// that is independent of the operand, and may be independent of the instr
|
||||||
/// itself. This can be useful for portably encoding the comment character
|
/// itself. This can be useful for portably encoding the comment character
|
||||||
|
@ -426,7 +426,7 @@ MCSymbol *EHStreamer::emitExceptionTable() {
|
|||||||
// EHABI). In this case LSDASection will be NULL.
|
// EHABI). In this case LSDASection will be NULL.
|
||||||
if (LSDASection)
|
if (LSDASection)
|
||||||
Asm->OutStreamer->SwitchSection(LSDASection);
|
Asm->OutStreamer->SwitchSection(LSDASection);
|
||||||
Asm->EmitAlignment(Align(4));
|
Asm->emitAlignment(Align(4));
|
||||||
|
|
||||||
// Emit the LSDA.
|
// Emit the LSDA.
|
||||||
MCSymbol *GCCETSym =
|
MCSymbol *GCCETSym =
|
||||||
@ -436,8 +436,8 @@ MCSymbol *EHStreamer::emitExceptionTable() {
|
|||||||
Asm->OutStreamer->EmitLabel(Asm->getCurExceptionSym());
|
Asm->OutStreamer->EmitLabel(Asm->getCurExceptionSym());
|
||||||
|
|
||||||
// Emit the LSDA header.
|
// Emit the LSDA header.
|
||||||
Asm->EmitEncodingByte(dwarf::DW_EH_PE_omit, "@LPStart");
|
Asm->emitEncodingByte(dwarf::DW_EH_PE_omit, "@LPStart");
|
||||||
Asm->EmitEncodingByte(TTypeEncoding, "@TType");
|
Asm->emitEncodingByte(TTypeEncoding, "@TType");
|
||||||
|
|
||||||
MCSymbol *TTBaseLabel = nullptr;
|
MCSymbol *TTBaseLabel = nullptr;
|
||||||
if (HaveTTData) {
|
if (HaveTTData) {
|
||||||
@ -456,7 +456,7 @@ MCSymbol *EHStreamer::emitExceptionTable() {
|
|||||||
// Emit the landing pad call site table.
|
// Emit the landing pad call site table.
|
||||||
MCSymbol *CstBeginLabel = Asm->createTempSymbol("cst_begin");
|
MCSymbol *CstBeginLabel = Asm->createTempSymbol("cst_begin");
|
||||||
MCSymbol *CstEndLabel = Asm->createTempSymbol("cst_end");
|
MCSymbol *CstEndLabel = Asm->createTempSymbol("cst_end");
|
||||||
Asm->EmitEncodingByte(CallSiteEncoding, "Call site");
|
Asm->emitEncodingByte(CallSiteEncoding, "Call site");
|
||||||
Asm->emitLabelDifferenceAsULEB128(CstEndLabel, CstBeginLabel);
|
Asm->emitLabelDifferenceAsULEB128(CstEndLabel, CstBeginLabel);
|
||||||
Asm->OutStreamer->EmitLabel(CstBeginLabel);
|
Asm->OutStreamer->EmitLabel(CstBeginLabel);
|
||||||
|
|
||||||
@ -602,11 +602,11 @@ MCSymbol *EHStreamer::emitExceptionTable() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (HaveTTData) {
|
if (HaveTTData) {
|
||||||
Asm->EmitAlignment(Align(4));
|
Asm->emitAlignment(Align(4));
|
||||||
emitTypeInfos(TTypeEncoding, TTBaseLabel);
|
emitTypeInfos(TTypeEncoding, TTBaseLabel);
|
||||||
}
|
}
|
||||||
|
|
||||||
Asm->EmitAlignment(Align(4));
|
Asm->emitAlignment(Align(4));
|
||||||
return GCCETSym;
|
return GCCETSym;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -629,7 +629,7 @@ void EHStreamer::emitTypeInfos(unsigned TTypeEncoding, MCSymbol *TTBaseLabel) {
|
|||||||
TypeInfos.rend())) {
|
TypeInfos.rend())) {
|
||||||
if (VerboseAsm)
|
if (VerboseAsm)
|
||||||
Asm->OutStreamer->AddComment("TypeInfo " + Twine(Entry--));
|
Asm->OutStreamer->AddComment("TypeInfo " + Twine(Entry--));
|
||||||
Asm->EmitTTypeReference(GV, TTypeEncoding);
|
Asm->emitTTypeReference(GV, TTypeEncoding);
|
||||||
}
|
}
|
||||||
|
|
||||||
Asm->OutStreamer->EmitLabel(TTBaseLabel);
|
Asm->OutStreamer->EmitLabel(TTBaseLabel);
|
||||||
|
@ -72,7 +72,7 @@ void ErlangGCPrinter::finishAssembly(Module &M, GCModuleInfo &Info,
|
|||||||
**/
|
**/
|
||||||
|
|
||||||
// Align to address width.
|
// Align to address width.
|
||||||
AP.EmitAlignment(IntPtrSize == 4 ? Align(4) : Align(8));
|
AP.emitAlignment(IntPtrSize == 4 ? Align(4) : Align(8));
|
||||||
|
|
||||||
// Emit PointCount.
|
// Emit PointCount.
|
||||||
OS.AddComment("safe point count");
|
OS.AddComment("safe point count");
|
||||||
|
@ -129,7 +129,7 @@ void OcamlGCMetadataPrinter::finishAssembly(Module &M, GCModuleInfo &Info,
|
|||||||
report_fatal_error(" Too much descriptor for ocaml GC");
|
report_fatal_error(" Too much descriptor for ocaml GC");
|
||||||
}
|
}
|
||||||
AP.emitInt16(NumDescriptors);
|
AP.emitInt16(NumDescriptors);
|
||||||
AP.EmitAlignment(IntPtrSize == 4 ? Align(4) : Align(8));
|
AP.emitAlignment(IntPtrSize == 4 ? Align(4) : Align(8));
|
||||||
|
|
||||||
for (GCModuleInfo::FuncInfoVec::iterator I = Info.funcinfo_begin(),
|
for (GCModuleInfo::FuncInfoVec::iterator I = Info.funcinfo_begin(),
|
||||||
IE = Info.funcinfo_end();
|
IE = Info.funcinfo_end();
|
||||||
@ -180,7 +180,7 @@ void OcamlGCMetadataPrinter::finishAssembly(Module &M, GCModuleInfo &Info,
|
|||||||
AP.emitInt16(K->StackOffset);
|
AP.emitInt16(K->StackOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
AP.EmitAlignment(IntPtrSize == 4 ? Align(4) : Align(8));
|
AP.emitAlignment(IntPtrSize == 4 ? Align(4) : Align(8));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -203,7 +203,7 @@ void WinException::beginFunclet(const MachineBasicBlock &MBB,
|
|||||||
|
|
||||||
// We want our funclet's entry point to be aligned such that no nops will be
|
// We want our funclet's entry point to be aligned such that no nops will be
|
||||||
// present after the label.
|
// present after the label.
|
||||||
Asm->EmitAlignment(std::max(Asm->MF->getAlignment(), MBB.getAlignment()),
|
Asm->emitAlignment(std::max(Asm->MF->getAlignment(), MBB.getAlignment()),
|
||||||
&F);
|
&F);
|
||||||
|
|
||||||
// Now that we've emitted the alignment directive, point at our funclet.
|
// Now that we've emitted the alignment directive, point at our funclet.
|
||||||
|
@ -582,7 +582,7 @@ void *ExecutionEngine::getPointerToGlobal(const GlobalValue *GV) {
|
|||||||
// Global variable might have been added since interpreter started.
|
// Global variable might have been added since interpreter started.
|
||||||
if (GlobalVariable *GVar =
|
if (GlobalVariable *GVar =
|
||||||
const_cast<GlobalVariable *>(dyn_cast<GlobalVariable>(GV)))
|
const_cast<GlobalVariable *>(dyn_cast<GlobalVariable>(GV)))
|
||||||
EmitGlobalVariable(GVar);
|
emitGlobalVariable(GVar);
|
||||||
else
|
else
|
||||||
llvm_unreachable("Global hasn't had an address allocated yet!");
|
llvm_unreachable("Global hasn't had an address allocated yet!");
|
||||||
|
|
||||||
@ -1276,7 +1276,7 @@ void ExecutionEngine::emitGlobals() {
|
|||||||
if (GVEntry != &GV) // Not the canonical variable.
|
if (GVEntry != &GV) // Not the canonical variable.
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
EmitGlobalVariable(&GV);
|
emitGlobalVariable(&GV);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1285,7 +1285,7 @@ void ExecutionEngine::emitGlobals() {
|
|||||||
// EmitGlobalVariable - This method emits the specified global variable to the
|
// EmitGlobalVariable - This method emits the specified global variable to the
|
||||||
// address specified in GlobalAddresses, or allocates new memory if it's not
|
// address specified in GlobalAddresses, or allocates new memory if it's not
|
||||||
// already in the map.
|
// already in the map.
|
||||||
void ExecutionEngine::EmitGlobalVariable(const GlobalVariable *GV) {
|
void ExecutionEngine::emitGlobalVariable(const GlobalVariable *GV) {
|
||||||
void *GA = getPointerToGlobalIfAvailable(GV);
|
void *GA = getPointerToGlobalIfAvailable(GV);
|
||||||
|
|
||||||
if (!GA) {
|
if (!GA) {
|
||||||
|
@ -85,7 +85,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void emitStartOfAsmFile(Module &M) override;
|
void emitStartOfAsmFile(Module &M) override;
|
||||||
void EmitJumpTableInfo() override;
|
void emitJumpTableInfo() override;
|
||||||
void emitJumpTableEntry(const MachineJumpTableInfo *MJTI,
|
void emitJumpTableEntry(const MachineJumpTableInfo *MJTI,
|
||||||
const MachineBasicBlock *MBB, unsigned JTI);
|
const MachineBasicBlock *MBB, unsigned JTI);
|
||||||
|
|
||||||
@ -225,7 +225,7 @@ void AArch64AsmPrinter::emitStartOfAsmFile(Module &M) {
|
|||||||
OutStreamer->SwitchSection(Nt);
|
OutStreamer->SwitchSection(Nt);
|
||||||
|
|
||||||
// Emit the note header.
|
// Emit the note header.
|
||||||
EmitAlignment(Align(8));
|
emitAlignment(Align(8));
|
||||||
OutStreamer->EmitIntValue(4, 4); // data size for "GNU\0"
|
OutStreamer->EmitIntValue(4, 4); // data size for "GNU\0"
|
||||||
OutStreamer->EmitIntValue(4 * 4, 4); // Elf_Prop size
|
OutStreamer->EmitIntValue(4 * 4, 4); // Elf_Prop size
|
||||||
OutStreamer->EmitIntValue(ELF::NT_GNU_PROPERTY_TYPE_0, 4);
|
OutStreamer->EmitIntValue(ELF::NT_GNU_PROPERTY_TYPE_0, 4);
|
||||||
@ -754,7 +754,7 @@ void AArch64AsmPrinter::PrintDebugValueComment(const MachineInstr *MI,
|
|||||||
printOperand(MI, NOps - 2, OS);
|
printOperand(MI, NOps - 2, OS);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AArch64AsmPrinter::EmitJumpTableInfo() {
|
void AArch64AsmPrinter::emitJumpTableInfo() {
|
||||||
const MachineJumpTableInfo *MJTI = MF->getJumpTableInfo();
|
const MachineJumpTableInfo *MJTI = MF->getJumpTableInfo();
|
||||||
if (!MJTI) return;
|
if (!MJTI) return;
|
||||||
|
|
||||||
@ -782,7 +782,7 @@ void AArch64AsmPrinter::EmitJumpTableInfo() {
|
|||||||
if (JTBBs.empty()) continue;
|
if (JTBBs.empty()) continue;
|
||||||
|
|
||||||
unsigned Size = AFI->getJumpTableEntrySize(JTI);
|
unsigned Size = AFI->getJumpTableEntrySize(JTI);
|
||||||
EmitAlignment(Align(Size));
|
emitAlignment(Align(Size));
|
||||||
OutStreamer->EmitLabel(GetJTISymbol(JTI));
|
OutStreamer->EmitLabel(GetJTISymbol(JTI));
|
||||||
|
|
||||||
for (auto *JTBB : JTBBs)
|
for (auto *JTBB : JTBBs)
|
||||||
|
@ -276,7 +276,7 @@ void AMDGPUAsmPrinter::emitBasicBlockStart(const MachineBasicBlock &MBB) {
|
|||||||
AsmPrinter::emitBasicBlockStart(MBB);
|
AsmPrinter::emitBasicBlockStart(MBB);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AMDGPUAsmPrinter::EmitGlobalVariable(const GlobalVariable *GV) {
|
void AMDGPUAsmPrinter::emitGlobalVariable(const GlobalVariable *GV) {
|
||||||
if (GV->getAddressSpace() == AMDGPUAS::LOCAL_ADDRESS) {
|
if (GV->getAddressSpace() == AMDGPUAS::LOCAL_ADDRESS) {
|
||||||
if (GV->hasInitializer() && !isa<UndefValue>(GV->getInitializer())) {
|
if (GV->hasInitializer() && !isa<UndefValue>(GV->getInitializer())) {
|
||||||
OutContext.reportError({},
|
OutContext.reportError({},
|
||||||
@ -310,7 +310,7 @@ void AMDGPUAsmPrinter::EmitGlobalVariable(const GlobalVariable *GV) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
AsmPrinter::EmitGlobalVariable(GV);
|
AsmPrinter::emitGlobalVariable(GV);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AMDGPUAsmPrinter::doFinalization(Module &M) {
|
bool AMDGPUAsmPrinter::doFinalization(Module &M) {
|
||||||
|
@ -131,7 +131,7 @@ public:
|
|||||||
|
|
||||||
void emitBasicBlockStart(const MachineBasicBlock &MBB) override;
|
void emitBasicBlockStart(const MachineBasicBlock &MBB) override;
|
||||||
|
|
||||||
void EmitGlobalVariable(const GlobalVariable *GV) override;
|
void emitGlobalVariable(const GlobalVariable *GV) override;
|
||||||
|
|
||||||
void emitStartOfAsmFile(Module &M) override;
|
void emitStartOfAsmFile(Module &M) override;
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ void ARMAsmPrinter::emitFunctionEntryLabel() {
|
|||||||
OutStreamer->EmitLabel(CurrentFnSym);
|
OutStreamer->EmitLabel(CurrentFnSym);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ARMAsmPrinter::EmitXXStructor(const DataLayout &DL, const Constant *CV) {
|
void ARMAsmPrinter::emitXXStructor(const DataLayout &DL, const Constant *CV) {
|
||||||
uint64_t Size = getDataLayout().getTypeAllocSize(CV->getType());
|
uint64_t Size = getDataLayout().getTypeAllocSize(CV->getType());
|
||||||
assert(Size && "C++ constructor pointer had zero size!");
|
assert(Size && "C++ constructor pointer had zero size!");
|
||||||
|
|
||||||
@ -93,11 +93,11 @@ void ARMAsmPrinter::EmitXXStructor(const DataLayout &DL, const Constant *CV) {
|
|||||||
OutStreamer->EmitValue(E, Size);
|
OutStreamer->EmitValue(E, Size);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ARMAsmPrinter::EmitGlobalVariable(const GlobalVariable *GV) {
|
void ARMAsmPrinter::emitGlobalVariable(const GlobalVariable *GV) {
|
||||||
if (PromotedGlobals.count(GV))
|
if (PromotedGlobals.count(GV))
|
||||||
// The global was promoted into a constant pool. It should not be emitted.
|
// The global was promoted into a constant pool. It should not be emitted.
|
||||||
return;
|
return;
|
||||||
AsmPrinter::EmitGlobalVariable(GV);
|
AsmPrinter::emitGlobalVariable(GV);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// runOnMachineFunction - This uses the EmitInstruction()
|
/// runOnMachineFunction - This uses the EmitInstruction()
|
||||||
@ -168,7 +168,7 @@ bool ARMAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
|
|||||||
// relatively easy to exceed the thumb branch range within a TU.
|
// relatively easy to exceed the thumb branch range within a TU.
|
||||||
if (! ThumbIndirectPads.empty()) {
|
if (! ThumbIndirectPads.empty()) {
|
||||||
OutStreamer->EmitAssemblerFlag(MCAF_Code16);
|
OutStreamer->EmitAssemblerFlag(MCAF_Code16);
|
||||||
EmitAlignment(Align(2));
|
emitAlignment(Align(2));
|
||||||
for (std::pair<unsigned, MCSymbol *> &TIP : ThumbIndirectPads) {
|
for (std::pair<unsigned, MCSymbol *> &TIP : ThumbIndirectPads) {
|
||||||
OutStreamer->EmitLabel(TIP.second);
|
OutStreamer->EmitLabel(TIP.second);
|
||||||
EmitToStreamer(*OutStreamer, MCInstBuilder(ARM::tBX)
|
EmitToStreamer(*OutStreamer, MCInstBuilder(ARM::tBX)
|
||||||
@ -526,7 +526,7 @@ void ARMAsmPrinter::emitEndOfAsmFile(Module &M) {
|
|||||||
if (!Stubs.empty()) {
|
if (!Stubs.empty()) {
|
||||||
// Switch with ".non_lazy_symbol_pointer" directive.
|
// Switch with ".non_lazy_symbol_pointer" directive.
|
||||||
OutStreamer->SwitchSection(TLOFMacho.getNonLazySymbolPointerSection());
|
OutStreamer->SwitchSection(TLOFMacho.getNonLazySymbolPointerSection());
|
||||||
EmitAlignment(Align(4));
|
emitAlignment(Align(4));
|
||||||
|
|
||||||
for (auto &Stub : Stubs)
|
for (auto &Stub : Stubs)
|
||||||
emitNonLazySymbolPointer(*OutStreamer, Stub.first, Stub.second);
|
emitNonLazySymbolPointer(*OutStreamer, Stub.first, Stub.second);
|
||||||
@ -539,7 +539,7 @@ void ARMAsmPrinter::emitEndOfAsmFile(Module &M) {
|
|||||||
if (!Stubs.empty()) {
|
if (!Stubs.empty()) {
|
||||||
// Switch with ".non_lazy_symbol_pointer" directive.
|
// Switch with ".non_lazy_symbol_pointer" directive.
|
||||||
OutStreamer->SwitchSection(TLOFMacho.getThreadLocalPointerSection());
|
OutStreamer->SwitchSection(TLOFMacho.getThreadLocalPointerSection());
|
||||||
EmitAlignment(Align(4));
|
emitAlignment(Align(4));
|
||||||
|
|
||||||
for (auto &Stub : Stubs)
|
for (auto &Stub : Stubs)
|
||||||
emitNonLazySymbolPointer(*OutStreamer, Stub.first, Stub.second);
|
emitNonLazySymbolPointer(*OutStreamer, Stub.first, Stub.second);
|
||||||
@ -856,8 +856,8 @@ MCSymbol *ARMAsmPrinter::GetARMGVSymbol(const GlobalValue *GV,
|
|||||||
llvm_unreachable("unexpected target");
|
llvm_unreachable("unexpected target");
|
||||||
}
|
}
|
||||||
|
|
||||||
void ARMAsmPrinter::
|
void ARMAsmPrinter::emitMachineConstantPoolValue(
|
||||||
EmitMachineConstantPoolValue(MachineConstantPoolValue *MCPV) {
|
MachineConstantPoolValue *MCPV) {
|
||||||
const DataLayout &DL = getDataLayout();
|
const DataLayout &DL = getDataLayout();
|
||||||
int Size = DL.getTypeAllocSize(MCPV->getType());
|
int Size = DL.getTypeAllocSize(MCPV->getType());
|
||||||
|
|
||||||
@ -881,7 +881,7 @@ EmitMachineConstantPoolValue(MachineConstantPoolValue *MCPV) {
|
|||||||
EmittedPromotedGlobalLabels.insert(GV);
|
EmittedPromotedGlobalLabels.insert(GV);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return EmitGlobalConstant(DL, ACPC->getPromotedGlobalInit());
|
return emitGlobalConstant(DL, ACPC->getPromotedGlobalInit());
|
||||||
}
|
}
|
||||||
|
|
||||||
MCSymbol *MCSym;
|
MCSymbol *MCSym;
|
||||||
@ -935,13 +935,13 @@ EmitMachineConstantPoolValue(MachineConstantPoolValue *MCPV) {
|
|||||||
OutStreamer->EmitValue(Expr, Size);
|
OutStreamer->EmitValue(Expr, Size);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ARMAsmPrinter::EmitJumpTableAddrs(const MachineInstr *MI) {
|
void ARMAsmPrinter::emitJumpTableAddrs(const MachineInstr *MI) {
|
||||||
const MachineOperand &MO1 = MI->getOperand(1);
|
const MachineOperand &MO1 = MI->getOperand(1);
|
||||||
unsigned JTI = MO1.getIndex();
|
unsigned JTI = MO1.getIndex();
|
||||||
|
|
||||||
// Make sure the Thumb jump table is 4-byte aligned. This will be a nop for
|
// Make sure the Thumb jump table is 4-byte aligned. This will be a nop for
|
||||||
// ARM mode tables.
|
// ARM mode tables.
|
||||||
EmitAlignment(Align(4));
|
emitAlignment(Align(4));
|
||||||
|
|
||||||
// Emit a label for the jump table.
|
// Emit a label for the jump table.
|
||||||
MCSymbol *JTISymbol = GetARMJTIPICJumpTableLabel(JTI);
|
MCSymbol *JTISymbol = GetARMJTIPICJumpTableLabel(JTI);
|
||||||
@ -981,13 +981,13 @@ void ARMAsmPrinter::EmitJumpTableAddrs(const MachineInstr *MI) {
|
|||||||
OutStreamer->EmitDataRegion(MCDR_DataRegionEnd);
|
OutStreamer->EmitDataRegion(MCDR_DataRegionEnd);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ARMAsmPrinter::EmitJumpTableInsts(const MachineInstr *MI) {
|
void ARMAsmPrinter::emitJumpTableInsts(const MachineInstr *MI) {
|
||||||
const MachineOperand &MO1 = MI->getOperand(1);
|
const MachineOperand &MO1 = MI->getOperand(1);
|
||||||
unsigned JTI = MO1.getIndex();
|
unsigned JTI = MO1.getIndex();
|
||||||
|
|
||||||
// Make sure the Thumb jump table is 4-byte aligned. This will be a nop for
|
// Make sure the Thumb jump table is 4-byte aligned. This will be a nop for
|
||||||
// ARM mode tables.
|
// ARM mode tables.
|
||||||
EmitAlignment(Align(4));
|
emitAlignment(Align(4));
|
||||||
|
|
||||||
// Emit a label for the jump table.
|
// Emit a label for the jump table.
|
||||||
MCSymbol *JTISymbol = GetARMJTIPICJumpTableLabel(JTI);
|
MCSymbol *JTISymbol = GetARMJTIPICJumpTableLabel(JTI);
|
||||||
@ -1009,14 +1009,14 @@ void ARMAsmPrinter::EmitJumpTableInsts(const MachineInstr *MI) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ARMAsmPrinter::EmitJumpTableTBInst(const MachineInstr *MI,
|
void ARMAsmPrinter::emitJumpTableTBInst(const MachineInstr *MI,
|
||||||
unsigned OffsetWidth) {
|
unsigned OffsetWidth) {
|
||||||
assert((OffsetWidth == 1 || OffsetWidth == 2) && "invalid tbb/tbh width");
|
assert((OffsetWidth == 1 || OffsetWidth == 2) && "invalid tbb/tbh width");
|
||||||
const MachineOperand &MO1 = MI->getOperand(1);
|
const MachineOperand &MO1 = MI->getOperand(1);
|
||||||
unsigned JTI = MO1.getIndex();
|
unsigned JTI = MO1.getIndex();
|
||||||
|
|
||||||
if (Subtarget->isThumb1Only())
|
if (Subtarget->isThumb1Only())
|
||||||
EmitAlignment(Align(4));
|
emitAlignment(Align(4));
|
||||||
|
|
||||||
MCSymbol *JTISymbol = GetARMJTIPICJumpTableLabel(JTI);
|
MCSymbol *JTISymbol = GetARMJTIPICJumpTableLabel(JTI);
|
||||||
OutStreamer->EmitLabel(JTISymbol);
|
OutStreamer->EmitLabel(JTISymbol);
|
||||||
@ -1059,7 +1059,7 @@ void ARMAsmPrinter::EmitJumpTableTBInst(const MachineInstr *MI,
|
|||||||
OutStreamer->EmitDataRegion(MCDR_DataRegionEnd);
|
OutStreamer->EmitDataRegion(MCDR_DataRegionEnd);
|
||||||
|
|
||||||
// Make sure the next instruction is 2-byte aligned.
|
// Make sure the next instruction is 2-byte aligned.
|
||||||
EmitAlignment(Align(2));
|
emitAlignment(Align(2));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ARMAsmPrinter::EmitUnwindingInstruction(const MachineInstr *MI) {
|
void ARMAsmPrinter::EmitUnwindingInstruction(const MachineInstr *MI) {
|
||||||
@ -1629,20 +1629,20 @@ void ARMAsmPrinter::EmitInstruction(const MachineInstr *MI) {
|
|||||||
|
|
||||||
const MachineConstantPoolEntry &MCPE = MCP->getConstants()[CPIdx];
|
const MachineConstantPoolEntry &MCPE = MCP->getConstants()[CPIdx];
|
||||||
if (MCPE.isMachineConstantPoolEntry())
|
if (MCPE.isMachineConstantPoolEntry())
|
||||||
EmitMachineConstantPoolValue(MCPE.Val.MachineCPVal);
|
emitMachineConstantPoolValue(MCPE.Val.MachineCPVal);
|
||||||
else
|
else
|
||||||
EmitGlobalConstant(DL, MCPE.Val.ConstVal);
|
emitGlobalConstant(DL, MCPE.Val.ConstVal);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
case ARM::JUMPTABLE_ADDRS:
|
case ARM::JUMPTABLE_ADDRS:
|
||||||
EmitJumpTableAddrs(MI);
|
emitJumpTableAddrs(MI);
|
||||||
return;
|
return;
|
||||||
case ARM::JUMPTABLE_INSTS:
|
case ARM::JUMPTABLE_INSTS:
|
||||||
EmitJumpTableInsts(MI);
|
emitJumpTableInsts(MI);
|
||||||
return;
|
return;
|
||||||
case ARM::JUMPTABLE_TBB:
|
case ARM::JUMPTABLE_TBB:
|
||||||
case ARM::JUMPTABLE_TBH:
|
case ARM::JUMPTABLE_TBH:
|
||||||
EmitJumpTableTBInst(MI, MI->getOpcode() == ARM::JUMPTABLE_TBB ? 1 : 2);
|
emitJumpTableTBInst(MI, MI->getOpcode() == ARM::JUMPTABLE_TBB ? 1 : 2);
|
||||||
return;
|
return;
|
||||||
case ARM::t2BR_JT: {
|
case ARM::t2BR_JT: {
|
||||||
EmitToStreamer(*OutStreamer, MCInstBuilder(ARM::tMOVr)
|
EmitToStreamer(*OutStreamer, MCInstBuilder(ARM::tMOVr)
|
||||||
|
@ -84,21 +84,21 @@ public:
|
|||||||
void emitInlineAsmEnd(const MCSubtargetInfo &StartInfo,
|
void emitInlineAsmEnd(const MCSubtargetInfo &StartInfo,
|
||||||
const MCSubtargetInfo *EndInfo) const override;
|
const MCSubtargetInfo *EndInfo) const override;
|
||||||
|
|
||||||
void EmitJumpTableAddrs(const MachineInstr *MI);
|
void emitJumpTableAddrs(const MachineInstr *MI);
|
||||||
void EmitJumpTableInsts(const MachineInstr *MI);
|
void emitJumpTableInsts(const MachineInstr *MI);
|
||||||
void EmitJumpTableTBInst(const MachineInstr *MI, unsigned OffsetWidth);
|
void emitJumpTableTBInst(const MachineInstr *MI, unsigned OffsetWidth);
|
||||||
void EmitInstruction(const MachineInstr *MI) override;
|
void EmitInstruction(const MachineInstr *MI) override;
|
||||||
bool runOnMachineFunction(MachineFunction &F) override;
|
bool runOnMachineFunction(MachineFunction &F) override;
|
||||||
|
|
||||||
void EmitConstantPool() override {
|
void emitConstantPool() override {
|
||||||
// we emit constant pools customly!
|
// we emit constant pools customly!
|
||||||
}
|
}
|
||||||
void emitFunctionBodyEnd() override;
|
void emitFunctionBodyEnd() override;
|
||||||
void emitFunctionEntryLabel() override;
|
void emitFunctionEntryLabel() override;
|
||||||
void emitStartOfAsmFile(Module &M) override;
|
void emitStartOfAsmFile(Module &M) override;
|
||||||
void emitEndOfAsmFile(Module &M) override;
|
void emitEndOfAsmFile(Module &M) override;
|
||||||
void EmitXXStructor(const DataLayout &DL, const Constant *CV) override;
|
void emitXXStructor(const DataLayout &DL, const Constant *CV) override;
|
||||||
void EmitGlobalVariable(const GlobalVariable *GV) override;
|
void emitGlobalVariable(const GlobalVariable *GV) override;
|
||||||
|
|
||||||
MCSymbol *GetCPISymbol(unsigned CPID) const override;
|
MCSymbol *GetCPISymbol(unsigned CPID) const override;
|
||||||
|
|
||||||
@ -150,7 +150,7 @@ private:
|
|||||||
public:
|
public:
|
||||||
/// EmitMachineConstantPoolValue - Print a machine constantpool value to
|
/// EmitMachineConstantPoolValue - Print a machine constantpool value to
|
||||||
/// the .s file.
|
/// the .s file.
|
||||||
void EmitMachineConstantPoolValue(MachineConstantPoolValue *MCPV) override;
|
void emitMachineConstantPoolValue(MachineConstantPoolValue *MCPV) override;
|
||||||
};
|
};
|
||||||
} // end namespace llvm
|
} // end namespace llvm
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ namespace {
|
|||||||
|
|
||||||
} // end anonymous namespace
|
} // end anonymous namespace
|
||||||
|
|
||||||
static void EmitInlineAsm(LLVMContext &C, BasicBlock *BB, StringRef AsmText) {
|
static void emitInlineAsm(LLVMContext &C, BasicBlock *BB, StringRef AsmText) {
|
||||||
std::vector<Type *> AsmArgTypes;
|
std::vector<Type *> AsmArgTypes;
|
||||||
std::vector<Value *> AsmArgs;
|
std::vector<Value *> AsmArgs;
|
||||||
|
|
||||||
@ -339,7 +339,7 @@ static void assureFPCallStub(Function &F, Module *M,
|
|||||||
AsmText += "jr $$18\n";
|
AsmText += "jr $$18\n";
|
||||||
else
|
else
|
||||||
AsmText += "jr $$25\n";
|
AsmText += "jr $$25\n";
|
||||||
EmitInlineAsm(Context, BB, AsmText);
|
emitInlineAsm(Context, BB, AsmText);
|
||||||
|
|
||||||
new UnreachableInst(Context, BB);
|
new UnreachableInst(Context, BB);
|
||||||
}
|
}
|
||||||
@ -475,7 +475,7 @@ static void createFPFnStub(Function *F, Module *M, FPParamVariant PV,
|
|||||||
AsmText += swapFPIntParams(PV, M, LE, false);
|
AsmText += swapFPIntParams(PV, M, LE, false);
|
||||||
AsmText += "jr $$25\n";
|
AsmText += "jr $$25\n";
|
||||||
AsmText += LocalName + " = " + Name + "\n";
|
AsmText += LocalName + " = " + Name + "\n";
|
||||||
EmitInlineAsm(Context, BB, AsmText);
|
emitInlineAsm(Context, BB, AsmText);
|
||||||
|
|
||||||
new UnreachableInst(FStub->getContext(), BB);
|
new UnreachableInst(FStub->getContext(), BB);
|
||||||
}
|
}
|
||||||
|
@ -226,9 +226,9 @@ void MipsAsmPrinter::EmitInstruction(const MachineInstr *MI) {
|
|||||||
|
|
||||||
const MachineConstantPoolEntry &MCPE = MCP->getConstants()[CPIdx];
|
const MachineConstantPoolEntry &MCPE = MCP->getConstants()[CPIdx];
|
||||||
if (MCPE.isMachineConstantPoolEntry())
|
if (MCPE.isMachineConstantPoolEntry())
|
||||||
EmitMachineConstantPoolValue(MCPE.Val.MachineCPVal);
|
emitMachineConstantPoolValue(MCPE.Val.MachineCPVal);
|
||||||
else
|
else
|
||||||
EmitGlobalConstant(MF->getDataLayout(), MCPE.Val.ConstVal);
|
emitGlobalConstant(MF->getDataLayout(), MCPE.Val.ConstVal);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -404,7 +404,7 @@ void MipsAsmPrinter::emitFunctionEntryLabel() {
|
|||||||
// NaCl sandboxing requires that indirect call instructions are masked.
|
// NaCl sandboxing requires that indirect call instructions are masked.
|
||||||
// This means that function entry points should be bundle-aligned.
|
// This means that function entry points should be bundle-aligned.
|
||||||
if (Subtarget->isTargetNaCl())
|
if (Subtarget->isTargetNaCl())
|
||||||
EmitAlignment(std::max(MF->getAlignment(), MIPS_NACL_BUNDLE_ALIGN));
|
emitAlignment(std::max(MF->getAlignment(), MIPS_NACL_BUNDLE_ALIGN));
|
||||||
|
|
||||||
if (Subtarget->inMicroMipsMode()) {
|
if (Subtarget->inMicroMipsMode()) {
|
||||||
TS.emitDirectiveSetMicroMips();
|
TS.emitDirectiveSetMicroMips();
|
||||||
|
@ -126,11 +126,11 @@ public:
|
|||||||
|
|
||||||
bool runOnMachineFunction(MachineFunction &MF) override;
|
bool runOnMachineFunction(MachineFunction &MF) override;
|
||||||
|
|
||||||
void EmitConstantPool() override {
|
void emitConstantPool() override {
|
||||||
bool UsingConstantPools =
|
bool UsingConstantPools =
|
||||||
(Subtarget->inMips16Mode() && Subtarget->useConstantIslands());
|
(Subtarget->inMips16Mode() && Subtarget->useConstantIslands());
|
||||||
if (!UsingConstantPools)
|
if (!UsingConstantPools)
|
||||||
AsmPrinter::EmitConstantPool();
|
AsmPrinter::emitConstantPool();
|
||||||
// we emit constant pools customly!
|
// we emit constant pools customly!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -163,7 +163,7 @@ public:
|
|||||||
|
|
||||||
const MCExpr *lowerConstant(const Constant *CV) override;
|
const MCExpr *lowerConstant(const Constant *CV) override;
|
||||||
|
|
||||||
void EmitGlobalVariable(const GlobalVariable *GV) override;
|
void emitGlobalVariable(const GlobalVariable *GV) override;
|
||||||
|
|
||||||
void emitFunctionDescriptor() override;
|
void emitFunctionDescriptor() override;
|
||||||
|
|
||||||
@ -1583,7 +1583,7 @@ const MCExpr *PPCAIXAsmPrinter::lowerConstant(const Constant *CV) {
|
|||||||
return PPCAsmPrinter::lowerConstant(CV);
|
return PPCAsmPrinter::lowerConstant(CV);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PPCAIXAsmPrinter::EmitGlobalVariable(const GlobalVariable *GV) {
|
void PPCAIXAsmPrinter::emitGlobalVariable(const GlobalVariable *GV) {
|
||||||
ValidateGV(GV);
|
ValidateGV(GV);
|
||||||
|
|
||||||
// Create the symbol, set its storage class.
|
// Create the symbol, set its storage class.
|
||||||
@ -1632,9 +1632,9 @@ void PPCAIXAsmPrinter::EmitGlobalVariable(const GlobalVariable *GV) {
|
|||||||
|
|
||||||
MCSymbol *EmittedInitSym = GVSym;
|
MCSymbol *EmittedInitSym = GVSym;
|
||||||
emitLinkage(GV, EmittedInitSym);
|
emitLinkage(GV, EmittedInitSym);
|
||||||
EmitAlignment(getGVAlignment(GV, DL), GV);
|
emitAlignment(getGVAlignment(GV, DL), GV);
|
||||||
OutStreamer->EmitLabel(EmittedInitSym);
|
OutStreamer->EmitLabel(EmittedInitSym);
|
||||||
EmitGlobalConstant(GV->getParent()->getDataLayout(), GV->getInitializer());
|
emitGlobalConstant(GV->getParent()->getDataLayout(), GV->getInitializer());
|
||||||
}
|
}
|
||||||
|
|
||||||
void PPCAIXAsmPrinter::emitFunctionDescriptor() {
|
void PPCAIXAsmPrinter::emitFunctionDescriptor() {
|
||||||
|
@ -685,8 +685,8 @@ getModifierVariantKind(SystemZCP::SystemZCPModifier Modifier) {
|
|||||||
llvm_unreachable("Invalid SystemCPModifier!");
|
llvm_unreachable("Invalid SystemCPModifier!");
|
||||||
}
|
}
|
||||||
|
|
||||||
void SystemZAsmPrinter::
|
void SystemZAsmPrinter::emitMachineConstantPoolValue(
|
||||||
EmitMachineConstantPoolValue(MachineConstantPoolValue *MCPV) {
|
MachineConstantPoolValue *MCPV) {
|
||||||
auto *ZCPV = static_cast<SystemZConstantPoolValue*>(MCPV);
|
auto *ZCPV = static_cast<SystemZConstantPoolValue*>(MCPV);
|
||||||
|
|
||||||
const MCExpr *Expr =
|
const MCExpr *Expr =
|
||||||
|
@ -33,7 +33,7 @@ public:
|
|||||||
// Override AsmPrinter.
|
// Override AsmPrinter.
|
||||||
StringRef getPassName() const override { return "SystemZ Assembly Printer"; }
|
StringRef getPassName() const override { return "SystemZ Assembly Printer"; }
|
||||||
void EmitInstruction(const MachineInstr *MI) override;
|
void EmitInstruction(const MachineInstr *MI) override;
|
||||||
void EmitMachineConstantPoolValue(MachineConstantPoolValue *MCPV) override;
|
void emitMachineConstantPoolValue(MachineConstantPoolValue *MCPV) override;
|
||||||
void emitEndOfAsmFile(Module &M) override;
|
void emitEndOfAsmFile(Module &M) override;
|
||||||
bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
|
bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
|
||||||
const char *ExtraCode, raw_ostream &OS) override;
|
const char *ExtraCode, raw_ostream &OS) override;
|
||||||
|
@ -277,12 +277,12 @@ void WebAssemblyAsmPrinter::EmitTargetFeatures(Module &M) {
|
|||||||
OutStreamer->PopSection();
|
OutStreamer->PopSection();
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebAssemblyAsmPrinter::EmitConstantPool() {
|
void WebAssemblyAsmPrinter::emitConstantPool() {
|
||||||
assert(MF->getConstantPool()->getConstants().empty() &&
|
assert(MF->getConstantPool()->getConstants().empty() &&
|
||||||
"WebAssembly disables constant pools");
|
"WebAssembly disables constant pools");
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebAssemblyAsmPrinter::EmitJumpTableInfo() {
|
void WebAssemblyAsmPrinter::emitJumpTableInfo() {
|
||||||
// Nothing to do; jump tables are incorporated into the instruction stream.
|
// Nothing to do; jump tables are incorporated into the instruction stream.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,8 +60,8 @@ public:
|
|||||||
void emitEndOfAsmFile(Module &M) override;
|
void emitEndOfAsmFile(Module &M) override;
|
||||||
void EmitProducerInfo(Module &M);
|
void EmitProducerInfo(Module &M);
|
||||||
void EmitTargetFeatures(Module &M);
|
void EmitTargetFeatures(Module &M);
|
||||||
void EmitJumpTableInfo() override;
|
void emitJumpTableInfo() override;
|
||||||
void EmitConstantPool() override;
|
void emitConstantPool() override;
|
||||||
void emitFunctionBodyStart() override;
|
void emitFunctionBodyStart() override;
|
||||||
void EmitInstruction(const MachineInstr *MI) override;
|
void EmitInstruction(const MachineInstr *MI) override;
|
||||||
bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
|
bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
|
||||||
|
@ -597,7 +597,7 @@ void X86AsmPrinter::emitStartOfAsmFile(Module &M) {
|
|||||||
|
|
||||||
// Emitting note header.
|
// Emitting note header.
|
||||||
int WordSize = TT.isArch64Bit() ? 8 : 4;
|
int WordSize = TT.isArch64Bit() ? 8 : 4;
|
||||||
EmitAlignment(WordSize == 4 ? Align(4) : Align(8));
|
emitAlignment(WordSize == 4 ? Align(4) : Align(8));
|
||||||
OutStreamer->EmitIntValue(4, 4 /*size*/); // data size for "GNU\0"
|
OutStreamer->EmitIntValue(4, 4 /*size*/); // data size for "GNU\0"
|
||||||
OutStreamer->EmitIntValue(8 + WordSize, 4 /*size*/); // Elf_Prop size
|
OutStreamer->EmitIntValue(8 + WordSize, 4 /*size*/); // Elf_Prop size
|
||||||
OutStreamer->EmitIntValue(ELF::NT_GNU_PROPERTY_TYPE_0, 4 /*size*/);
|
OutStreamer->EmitIntValue(ELF::NT_GNU_PROPERTY_TYPE_0, 4 /*size*/);
|
||||||
@ -607,7 +607,7 @@ void X86AsmPrinter::emitStartOfAsmFile(Module &M) {
|
|||||||
OutStreamer->EmitIntValue(ELF::GNU_PROPERTY_X86_FEATURE_1_AND, 4);
|
OutStreamer->EmitIntValue(ELF::GNU_PROPERTY_X86_FEATURE_1_AND, 4);
|
||||||
OutStreamer->EmitIntValue(4, 4); // data size
|
OutStreamer->EmitIntValue(4, 4); // data size
|
||||||
OutStreamer->EmitIntValue(FeatureFlagsAnd, 4); // data
|
OutStreamer->EmitIntValue(FeatureFlagsAnd, 4); // data
|
||||||
EmitAlignment(WordSize == 4 ? Align(4) : Align(8)); // padding
|
emitAlignment(WordSize == 4 ? Align(4) : Align(8)); // padding
|
||||||
|
|
||||||
OutStreamer->endSection(Nt);
|
OutStreamer->endSection(Nt);
|
||||||
OutStreamer->SwitchSection(Cur);
|
OutStreamer->SwitchSection(Cur);
|
||||||
|
@ -72,7 +72,7 @@ namespace {
|
|||||||
const char *ExtraCode, raw_ostream &O) override;
|
const char *ExtraCode, raw_ostream &O) override;
|
||||||
|
|
||||||
void emitArrayBound(MCSymbol *Sym, const GlobalVariable *GV);
|
void emitArrayBound(MCSymbol *Sym, const GlobalVariable *GV);
|
||||||
void EmitGlobalVariable(const GlobalVariable *GV) override;
|
void emitGlobalVariable(const GlobalVariable *GV) override;
|
||||||
|
|
||||||
void emitFunctionEntryLabel() override;
|
void emitFunctionEntryLabel() override;
|
||||||
void EmitInstruction(const MachineInstr *MI) override;
|
void EmitInstruction(const MachineInstr *MI) override;
|
||||||
@ -104,10 +104,9 @@ void XCoreAsmPrinter::emitArrayBound(MCSymbol *Sym, const GlobalVariable *GV) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void XCoreAsmPrinter::EmitGlobalVariable(const GlobalVariable *GV) {
|
void XCoreAsmPrinter::emitGlobalVariable(const GlobalVariable *GV) {
|
||||||
// Check to see if this is a special global used by LLVM, if so, emit it.
|
// Check to see if this is a special global used by LLVM, if so, emit it.
|
||||||
if (!GV->hasInitializer() ||
|
if (!GV->hasInitializer() || emitSpecialLLVMGlobal(GV))
|
||||||
EmitSpecialLLVMGlobal(GV))
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const DataLayout &DL = getDataLayout();
|
const DataLayout &DL = getDataLayout();
|
||||||
@ -143,7 +142,7 @@ void XCoreAsmPrinter::EmitGlobalVariable(const GlobalVariable *GV) {
|
|||||||
llvm_unreachable("Unknown linkage type!");
|
llvm_unreachable("Unknown linkage type!");
|
||||||
}
|
}
|
||||||
|
|
||||||
EmitAlignment(std::max(Alignment, Align(4)), GV);
|
emitAlignment(std::max(Alignment, Align(4)), GV);
|
||||||
|
|
||||||
if (GV->isThreadLocal()) {
|
if (GV->isThreadLocal()) {
|
||||||
report_fatal_error("TLS is not supported by this target!");
|
report_fatal_error("TLS is not supported by this target!");
|
||||||
@ -155,7 +154,7 @@ void XCoreAsmPrinter::EmitGlobalVariable(const GlobalVariable *GV) {
|
|||||||
}
|
}
|
||||||
OutStreamer->EmitLabel(GVSym);
|
OutStreamer->EmitLabel(GVSym);
|
||||||
|
|
||||||
EmitGlobalConstant(DL, C);
|
emitGlobalConstant(DL, C);
|
||||||
// The ABI requires that unsigned scalar types smaller than 32 bits
|
// The ABI requires that unsigned scalar types smaller than 32 bits
|
||||||
// are padded to 32 bits.
|
// are padded to 32 bits.
|
||||||
if (Size < 4)
|
if (Size < 4)
|
||||||
|
Loading…
Reference in New Issue
Block a user