Debug Info: In DIBuilder, the context field of a global variable is updated to
[oota-llvm.git] / lib / IR / DIBuilder.cpp
index 227de0a04c3c204cd35f641fe6733b24f907b646..33ee9e9bb8716252732ec3fd13d5912a3fe82239 100644 (file)
@@ -844,7 +844,7 @@ static DIGlobalVariable createGlobalVariableHelper(
                        .concat(isLocalToUnit)
                        .concat(isDefinition)
                        .get(VMContext),
-                   getNonCompileUnitScope(Context), F, Ty, Val,
+                   DIScope(getNonCompileUnitScope(Context)).getRef(), F, Ty, Val,
                    DIDescriptor(Decl)};
 
   return DIGlobalVariable(CreateFunc(Elts));