1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00

[mips] Add an assert in getTargetStreamer()

Check if the TargetStreamer can be accessed.

Differential Revision: https://reviews.llvm.org/D71477
This commit is contained in:
Miloš Stojanović 2019-12-16 17:03:18 +01:00
parent e38a8576b2
commit 6ffd0a9d14

View File

@ -134,6 +134,8 @@ namespace {
class MipsAsmParser : public MCTargetAsmParser {
MipsTargetStreamer &getTargetStreamer() {
assert(getParser().getStreamer().getTargetStreamer() &&
"do not have a target streamer");
MCTargetStreamer &TS = *getParser().getStreamer().getTargetStreamer();
return static_cast<MipsTargetStreamer &>(TS);
}