[ThinLTO] Support cloning of temporary DILocation metadata
[oota-llvm.git] / include / llvm / IR / DebugInfoMetadata.h
index 68a497745ae746acefeacc623bc28a02ad9ad68e..0b3fe06f357679bfd04cdb025f2460c242ab3e3e 100644 (file)
@@ -1118,8 +1118,10 @@ class DILocation : public MDNode {
   }
 
   TempDILocation cloneImpl() const {
-    return getTemporary(getContext(), getLine(), getColumn(), getScope(),
-                        getInlinedAt());
+    // Get the raw scope/inlinedAt since it is possible to invoke this on
+    // a DILocation containing temporary metadata.
+    return getTemporary(getContext(), getLine(), getColumn(), getRawScope(),
+                        getRawInlinedAt());
   }
 
   // Disallow replacing operands.