mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-29 06:10:48 +00:00
Fix for bug 34002 - label generated before it block is finalized. Differential Revision: https://reviews.llvm.org/D52258
llvm-svn: 342615
This commit is contained in:
parent
50da2c69d9
commit
ac015cd2c1
@ -476,6 +476,9 @@ public:
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// For actions that have to be performed before a label is emitted
|
||||
virtual void doBeforeLabelEmit(MCSymbol *Symbol) {}
|
||||
|
||||
virtual void onLabelParsed(MCSymbol *Symbol) {}
|
||||
|
||||
/// Ensure that all previously parsed instructions have been emitted to the
|
||||
|
@ -1808,6 +1808,8 @@ bool AsmParser::parseStatement(ParseStatementInfo &Info,
|
||||
Lex();
|
||||
}
|
||||
|
||||
getTargetParser().doBeforeLabelEmit(Sym);
|
||||
|
||||
// Emit the label.
|
||||
if (!getTargetParser().isParsingInlineAsm())
|
||||
Out.EmitLabel(Sym, IDLoc);
|
||||
|
@ -631,6 +631,8 @@ public:
|
||||
void ReportNearMisses(SmallVectorImpl<NearMissInfo> &NearMisses, SMLoc IDLoc,
|
||||
OperandVector &Operands);
|
||||
|
||||
void doBeforeLabelEmit(MCSymbol *Symbol) override;
|
||||
|
||||
void onLabelParsed(MCSymbol *Symbol) override;
|
||||
};
|
||||
|
||||
@ -9443,10 +9445,13 @@ bool ARMAsmParser::parseDirectiveARM(SMLoc L) {
|
||||
return false;
|
||||
}
|
||||
|
||||
void ARMAsmParser::onLabelParsed(MCSymbol *Symbol) {
|
||||
void ARMAsmParser::doBeforeLabelEmit(MCSymbol *Symbol) {
|
||||
// We need to flush the current implicit IT block on a label, because it is
|
||||
// not legal to branch into an IT block.
|
||||
flushPendingInstructions(getStreamer());
|
||||
}
|
||||
|
||||
void ARMAsmParser::onLabelParsed(MCSymbol *Symbol) {
|
||||
if (NextSymbolIsThumb) {
|
||||
getParser().getStreamer().EmitThumbFunc(Symbol);
|
||||
NextSymbolIsThumb = false;
|
||||
|
@ -73,12 +73,14 @@
|
||||
addeq r0, #1
|
||||
label:
|
||||
addeq r0, #1
|
||||
5:
|
||||
five:
|
||||
addeq r0, #1
|
||||
@ CHECK: it eq
|
||||
@ CHECK: addeq
|
||||
@ CHECK: label
|
||||
@ CHECK: it eq
|
||||
@ CHECK: addeq
|
||||
@ CHECK: five
|
||||
@ CHECK: it eq
|
||||
@ CHECK: addeq
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user