summaryrefslogtreecommitdiff
path: root/lib/Target/ARM/AsmParser
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2014-01-07 02:29:00 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2014-01-07 02:29:00 +0000
commit6a4207d26301f167f7f0c77cf5bd787b1edad3c5 (patch)
tree23e84319d27690e710121e8fa96ca4d55607d2d9 /lib/Target/ARM/AsmParser
parenta83f45be971544e6831b1748ca55dbcb4420b613 (diff)
downloadllvm-6a4207d26301f167f7f0c77cf5bd787b1edad3c5.tar.gz
llvm-6a4207d26301f167f7f0c77cf5bd787b1edad3c5.tar.bz2
llvm-6a4207d26301f167f7f0c77cf5bd787b1edad3c5.tar.xz
ARM IAS: allow more depth in contextual diagnostics
Switch the context to be SmallVectors. This allows for saving additional context when providing previous emission sites. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198665 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/AsmParser')
-rw-r--r--lib/Target/ARM/AsmParser/ARMAsmParser.cpp50
1 files changed, 30 insertions, 20 deletions
diff --git a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
index f864af70e2..0076939b4a 100644
--- a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
+++ b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
@@ -116,46 +116,56 @@ typedef MapVector<const MCSection *, ConstantPool> ConstantPoolMapTy;
class UnwindContext {
MCAsmParser &Parser;
- SMLoc FnStartLoc;
- SMLoc CantUnwindLoc;
- SMLoc PersonalityLoc;
- SMLoc HandlerDataLoc;
+ typedef SmallVector<SMLoc, 4> Locs;
+
+ Locs FnStartLocs;
+ Locs CantUnwindLocs;
+ Locs PersonalityLocs;
+ Locs HandlerDataLocs;
int FPReg;
public:
UnwindContext(MCAsmParser &P) : Parser(P), FPReg(-1) {}
- bool hasFnStart() const { return FnStartLoc.isValid(); }
- bool cantUnwind() const { return CantUnwindLoc.isValid(); }
- bool hasHandlerData() const { return HandlerDataLoc.isValid(); }
- bool hasPersonality() const { return PersonalityLoc.isValid(); }
+ bool hasFnStart() const { return !FnStartLocs.empty(); }
+ bool cantUnwind() const { return !CantUnwindLocs.empty(); }
+ bool hasHandlerData() const { return !HandlerDataLocs.empty(); }
+ bool hasPersonality() const { return !PersonalityLocs.empty(); }
- void recordFnStart(SMLoc L) { FnStartLoc = L; }
- void recordCantUnwind(SMLoc L) { CantUnwindLoc = L; }
- void recordPersonality(SMLoc L) { PersonalityLoc = L; }
- void recordHandlerData(SMLoc L) { HandlerDataLoc = L; }
+ void recordFnStart(SMLoc L) { FnStartLocs.push_back(L); }
+ void recordCantUnwind(SMLoc L) { CantUnwindLocs.push_back(L); }
+ void recordPersonality(SMLoc L) { PersonalityLocs.push_back(L); }
+ void recordHandlerData(SMLoc L) { HandlerDataLocs.push_back(L); }
void saveFPReg(int Reg) { FPReg = Reg; }
int getFPReg() const { return FPReg; }
void emitFnStartLocNotes() const {
- Parser.Note(FnStartLoc, ".fnstart was specified here");
+ for (Locs::const_iterator FI = FnStartLocs.begin(), FE = FnStartLocs.end();
+ FI != FE; ++FI)
+ Parser.Note(*FI, ".fnstart was specified here");
}
void emitCantUnwindLocNotes() const {
- Parser.Note(CantUnwindLoc, ".cantunwind was specified here");
+ for (Locs::const_iterator UI = CantUnwindLocs.begin(),
+ UE = CantUnwindLocs.end(); UI != UE; ++UI)
+ Parser.Note(*UI, ".cantunwind was specified here");
}
void emitHandlerDataLocNotes() const {
- Parser.Note(HandlerDataLoc, ".handlerdata was specified here");
+ for (Locs::const_iterator HI = HandlerDataLocs.begin(),
+ HE = HandlerDataLocs.end(); HI != HE; ++HI)
+ Parser.Note(*HI, ".handlerdata was specified here");
}
void emitPersonalityLocNotes() const {
- Parser.Note(PersonalityLoc, ".personality was specified here");
+ for (Locs::const_iterator PI = PersonalityLocs.begin(),
+ PE = PersonalityLocs.end(); PI != PE; ++PI)
+ Parser.Note(*PI, ".personality was specified here");
}
void reset() {
- FnStartLoc = SMLoc();
- CantUnwindLoc = SMLoc();
- PersonalityLoc = SMLoc();
- HandlerDataLoc = SMLoc();
+ FnStartLocs = Locs();
+ CantUnwindLocs = Locs();
+ PersonalityLocs = Locs();
+ HandlerDataLocs = Locs();
FPReg = -1;
}
};