summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiloš Stojanović <Milos.Stojanovic@rt-rk.com>2019-12-16 17:03:18 +0100
committerMiloš Stojanović <Milos.Stojanovic@rt-rk.com>2019-12-16 17:04:55 +0100
commitd7efa6b1985ff14d0c50ade771d4b01ee1b5075e (patch)
treee3e33a94dbef844b1c121aa5395b9496d1aef972
parentd518f1da6d206cb909d5a1cd1f65d48e5d2c924f (diff)
downloadbcm5719-llvm-d7efa6b1985ff14d0c50ade771d4b01ee1b5075e.tar.gz
bcm5719-llvm-d7efa6b1985ff14d0c50ade771d4b01ee1b5075e.zip
[mips] Add an assert in getTargetStreamer()
Check if the TargetStreamer can be accessed. Differential Revision: https://reviews.llvm.org/D71477
-rw-r--r--llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp b/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
index 639ee2df96a..34862bdadb9 100644
--- a/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
+++ b/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
@@ -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);
}
OpenPOWER on IntegriCloud