From a23043cb9c1ef021a9cf05cd62cce76cd03c0ba2 Mon Sep 17 00:00:00 2001 From: Richard Trieu Date: Mon, 9 Jun 2014 22:53:16 +0000 Subject: Removing an "if (!this)" check from two print methods. The condition will never be true in a well-defined context. The checking for null pointers has been moved into the caller logic so it does not rely on undefined behavior. llvm-svn: 210497 --- llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp') diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index 9d822d3cb1a..67b57fa2b4c 100644 --- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -1867,6 +1867,7 @@ static void emitGlobalConstantFP(const ConstantFP *CFP, AsmPrinter &AP) { SmallString<8> StrVal; CFP->getValueAPF().toString(StrVal); + assert(CFP->getType() != nullptr && "Expecting non-null Type"); CFP->getType()->print(AP.OutStreamer.GetCommentOS()); AP.OutStreamer.GetCommentOS() << ' ' << StrVal << '\n'; } -- cgit v1.2.3