If compile unit's language is not set then don't crash while dump'ing compile unit.
[oota-llvm.git] / lib / CodeGen / MachineFunction.cpp
index fc9aa843e7889413d2e0c22f0a6b366ae64dac7b..cf7f39140b8663e25daf837a8973b3001d2b7384 100644 (file)
@@ -397,8 +397,8 @@ unsigned MachineFunction::getOrCreateDebugLocID(unsigned Src, unsigned Line,
 }
 
 /// getDebugLocTuple - Get the DebugLocTuple for a given DebugLoc object.
-const DebugLocTuple &MachineFunction::getDebugLocTuple(DebugLoc DL) {
-  unsigned Idx;
+DebugLocTuple MachineFunction::getDebugLocTuple(DebugLoc DL) const {
+  unsigned Idx = DL.getIndex();
   assert(Idx < DebugLocInfo.DebugLocations.size() &&
          "Invalid index into debug locations!");
   return DebugLocInfo.DebugLocations[Idx];