diff options
author | Miloš Stojanović <Milos.Stojanovic@rt-rk.com> | 2019-12-16 17:03:18 +0100 |
---|---|---|
committer | Miloš Stojanović <Milos.Stojanovic@rt-rk.com> | 2019-12-16 17:04:55 +0100 |
commit | d7efa6b1985ff14d0c50ade771d4b01ee1b5075e (patch) | |
tree | e3e33a94dbef844b1c121aa5395b9496d1aef972 | |
parent | d518f1da6d206cb909d5a1cd1f65d48e5d2c924f (diff) | |
download | bcm5719-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.cpp | 2 |
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); } |