Index: lib/Target/Mips/MipsTargetStreamer.h =================================================================== --- lib/Target/Mips/MipsTargetStreamer.h +++ lib/Target/Mips/MipsTargetStreamer.h @@ -12,6 +12,7 @@ #include "MCTargetDesc/MipsABIFlagsSection.h" #include "MCTargetDesc/MipsABIInfo.h" +#include "llvm/ADT/Optional.h" #include "llvm/MC/MCELFStreamer.h" #include "llvm/MC/MCRegisterInfo.h" #include "llvm/MC/MCStreamer.h" @@ -97,18 +98,18 @@ // structure values. template void updateABIInfo(const PredicateLibrary &P) { - ABI = &P.getABI(); + ABI = P.getABI(); ABIFlagsSection.setAllFromPredicates(P); } MipsABIFlagsSection &getABIFlagsSection() { return ABIFlagsSection; } const MipsABIInfo &getABI() const { - assert(ABI && "ABI hasn't been set!"); + assert(ABI.hasValue() && "ABI hasn't been set!"); return *ABI; } protected: - const MipsABIInfo *ABI; + llvm::Optional ABI; MipsABIFlagsSection ABIFlagsSection; bool GPRInfoSet;