@@ -2123,10 +2123,6 @@ void IRGenDebugInfoImpl::emitVariableDeclaration(
2123
2123
IRBuilder &Builder, ArrayRef<llvm::Value *> Storage, DebugTypeInfo DbgTy,
2124
2124
const SILDebugScope *DS, ValueDecl *VarDecl, StringRef Name, unsigned ArgNo,
2125
2125
IndirectionKind Indirection, ArtificialKind Artificial) {
2126
- // Self is always an artificial argument.
2127
- if (ArgNo > 0 && Name == IGM.Context .Id_self .str ())
2128
- Artificial = ArtificialValue;
2129
-
2130
2126
// FIXME: Make this an assertion.
2131
2127
// assert(DS && "variable has no scope");
2132
2128
if (!DS)
@@ -2158,10 +2154,15 @@ void IRGenDebugInfoImpl::emitVariableDeclaration(
2158
2154
assert (DITy && " could not determine debug type of variable" );
2159
2155
2160
2156
unsigned Line = Loc.Line ;
2157
+
2158
+ // Self is always an artificial argument, so are variables without location.
2159
+ if (!Line || (ArgNo > 0 && Name == IGM.Context .Id_self .str ()))
2160
+ Artificial = ArtificialValue;
2161
+
2161
2162
llvm::DINode::DIFlags Flags = llvm::DINode::FlagZero;
2162
2163
if (Artificial || DITy->isArtificial () || DITy == InternalType)
2163
2164
Flags |= llvm::DINode::FlagArtificial;
2164
-
2165
+
2165
2166
// This could be Opts.Optimize if we would also unique DIVariables here.
2166
2167
bool Optimized = false ;
2167
2168
// Create the descriptor for the variable.
0 commit comments