summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MIRParser/MIParser.cpp
diff options
context:
space:
mode:
authorAlex Lorenz <arphaman@gmail.com>2015-08-18 22:18:52 +0000
committerAlex Lorenz <arphaman@gmail.com>2015-08-18 22:18:52 +0000
commitdc9dadf68388a7277c9d729bb77222149c282302 (patch)
tree8fa1648637a2b86331fb70395b703429676c8127 /llvm/lib/CodeGen/MIRParser/MIParser.cpp
parent8e335ca278ab03f8f33f6c2eed0bf7b4521bfa5a (diff)
downloadbcm5719-llvm-dc9dadf68388a7277c9d729bb77222149c282302.tar.gz
bcm5719-llvm-dc9dadf68388a7277c9d729bb77222149c282302.zip
MIR Parser: Extract the code that parses stack object references into a new
method. This commit extracts the code that parses the stack object references into a new method named 'parseStackFrameIndex', so that it can be reused when parsing standalone stack object references. llvm-svn: 245370
Diffstat (limited to 'llvm/lib/CodeGen/MIRParser/MIParser.cpp')
-rw-r--r--llvm/lib/CodeGen/MIRParser/MIParser.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/MIRParser/MIParser.cpp b/llvm/lib/CodeGen/MIRParser/MIParser.cpp
index c6c0e4516f1..e040672a465 100644
--- a/llvm/lib/CodeGen/MIRParser/MIParser.cpp
+++ b/llvm/lib/CodeGen/MIRParser/MIParser.cpp
@@ -114,6 +114,7 @@ public:
bool parseFPImmediateOperand(MachineOperand &Dest);
bool parseMBBReference(MachineBasicBlock *&MBB);
bool parseMBBOperand(MachineOperand &Dest);
+ bool parseStackFrameIndex(int &FI);
bool parseStackObjectOperand(MachineOperand &Dest);
bool parseFixedStackFrameIndex(int &FI);
bool parseFixedStackObjectOperand(MachineOperand &Dest);
@@ -929,7 +930,7 @@ bool MIParser::parseMBBOperand(MachineOperand &Dest) {
return false;
}
-bool MIParser::parseStackObjectOperand(MachineOperand &Dest) {
+bool MIParser::parseStackFrameIndex(int &FI) {
assert(Token.is(MIToken::StackObject));
unsigned ID;
if (getUnsigned(ID))
@@ -946,7 +947,15 @@ bool MIParser::parseStackObjectOperand(MachineOperand &Dest) {
return error(Twine("the name of the stack object '%stack.") + Twine(ID) +
"' isn't '" + Token.stringValue() + "'");
lex();
- Dest = MachineOperand::CreateFI(ObjectInfo->second);
+ FI = ObjectInfo->second;
+ return false;
+}
+
+bool MIParser::parseStackObjectOperand(MachineOperand &Dest) {
+ int FI;
+ if (parseStackFrameIndex(FI))
+ return true;
+ Dest = MachineOperand::CreateFI(FI);
return false;
}
OpenPOWER on IntegriCloud