[llvm] r225826 - IR: Fix GCC error from MDLocation::getInlinedAt()

Duncan P. N. Exon Smith dexonsmith at apple.com
Tue Jan 13 12:50:21 PST 2015


Author: dexonsmith
Date: Tue Jan 13 14:50:21 2015
New Revision: 225826

URL: http://llvm.org/viewvc/llvm-project?rev=225826&view=rev
Log:
IR: Fix GCC error from MDLocation::getInlinedAt()

Apparently GCC didn't like my ternary operator from r225824.  Use an
`if`.

Modified:
    llvm/trunk/include/llvm/IR/Metadata.h

Modified: llvm/trunk/include/llvm/IR/Metadata.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/Metadata.h?rev=225826&r1=225825&r2=225826&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/Metadata.h (original)
+++ llvm/trunk/include/llvm/IR/Metadata.h Tue Jan 13 14:50:21 2015
@@ -857,7 +857,9 @@ public:
   unsigned getColumn() const { return SubclassData16; }
   Metadata *getScope() const { return getOperand(0); }
   Metadata *getInlinedAt() const {
-    return getNumOperands() == 2 ? getOperand(1) : nullptr;
+    if (getNumOperands() == 2)
+      return getOperand(1);
+    return nullptr;
   }
 
   static bool classof(const Metadata *MD) {





More information about the llvm-commits mailing list