mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-22 13:29:44 +00:00
Make AsmPrinter::EmitTTypeReference() more robust - put
the zero GV check inside, so we won't forget it at the caller side. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168328 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
2386fc8daa
commit
239938ff77
@ -113,11 +113,7 @@ void ARMException::EmitTypeInfos(unsigned TTypeEncoding) {
|
||||
const GlobalVariable *GV = *I;
|
||||
if (VerboseAsm)
|
||||
Asm->OutStreamer.AddComment("TypeInfo " + Twine(Entry--));
|
||||
if (GV)
|
||||
Asm->EmitTTypeReference(GV, TTypeEncoding);
|
||||
else
|
||||
Asm->OutStreamer.EmitIntValue(0,Asm->GetSizeOfEncodedValue(TTypeEncoding),
|
||||
0);
|
||||
Asm->EmitTTypeReference(GV, TTypeEncoding);
|
||||
}
|
||||
|
||||
// Emit the Exception Specifications.
|
||||
@ -135,10 +131,7 @@ void ARMException::EmitTypeInfos(unsigned TTypeEncoding) {
|
||||
Asm->OutStreamer.AddComment("FilterInfo " + Twine(Entry));
|
||||
}
|
||||
|
||||
if (TypeID == 0)
|
||||
Asm->OutStreamer.EmitIntValue(0,Asm->GetSizeOfEncodedValue(TTypeEncoding),
|
||||
0);
|
||||
else
|
||||
Asm->EmitTTypeReference(TypeInfos[TypeID - 1], TTypeEncoding);
|
||||
Asm->EmitTTypeReference((TypeID == 0 ? 0 : TypeInfos[TypeID - 1]),
|
||||
TTypeEncoding);
|
||||
}
|
||||
}
|
||||
|
@ -120,11 +120,14 @@ unsigned AsmPrinter::GetSizeOfEncodedValue(unsigned Encoding) const {
|
||||
}
|
||||
|
||||
void AsmPrinter::EmitTTypeReference(const GlobalValue *GV, unsigned Encoding)const{
|
||||
const TargetLoweringObjectFile &TLOF = getObjFileLowering();
|
||||
if (GV) {
|
||||
const TargetLoweringObjectFile &TLOF = getObjFileLowering();
|
||||
|
||||
const MCExpr *Exp =
|
||||
TLOF.getTTypeGlobalReference(GV, Mang, MMI, Encoding, OutStreamer);
|
||||
OutStreamer.EmitValue(Exp, GetSizeOfEncodedValue(Encoding), /*addrspace*/0);
|
||||
const MCExpr *Exp =
|
||||
TLOF.getTTypeGlobalReference(GV, Mang, MMI, Encoding, OutStreamer);
|
||||
OutStreamer.EmitValue(Exp, GetSizeOfEncodedValue(Encoding), /*addrspace*/0);
|
||||
} else
|
||||
OutStreamer.EmitIntValue(0, GetSizeOfEncodedValue(Encoding), 0);
|
||||
}
|
||||
|
||||
/// EmitSectionOffset - Emit the 4-byte offset of Label from the start of its
|
||||
|
@ -696,11 +696,7 @@ void DwarfException::EmitTypeInfos(unsigned TTypeEncoding) {
|
||||
const GlobalVariable *GV = *I;
|
||||
if (VerboseAsm)
|
||||
Asm->OutStreamer.AddComment("TypeInfo " + Twine(Entry--));
|
||||
if (GV)
|
||||
Asm->EmitTTypeReference(GV, TTypeEncoding);
|
||||
else
|
||||
Asm->OutStreamer.EmitIntValue(0,Asm->GetSizeOfEncodedValue(TTypeEncoding),
|
||||
0);
|
||||
Asm->EmitTTypeReference(GV, TTypeEncoding);
|
||||
}
|
||||
|
||||
// Emit the Exception Specifications.
|
||||
|
Loading…
x
Reference in New Issue
Block a user