FabioRS added inline comments.

================
Comment at: clang-tools-extra/clangd/refactor/tweaks/ExtractFunction.cpp:765
+
+  ExtractedFunc.ForwardDeclarationSyntacticDC = ExtractedFunc.SemanticDC =
+      ExtractedFunc.SyntacticDC = ExtZone.EnclosingFunction->getDeclContext();
----------------
sammccall wrote:
> You're setting/resetting these in lots of different places, but no need for 
> that:
> 
> SyntacticDC = EnclosingFunction->getLexicalDeclContext()
> SemanticDC = getDeclContext();
> 
> and set ForwardDeclarationSyntacticDC in captureMethodInfo(), leave it null 
> if this isn't a method.
Thanks!
The out-of-line ns:f() needs the ForwardDeclarationSyntacticDC too, I think 
inside the branch if (ExtZone.EnclosingFunction->isOutOfLine()) is the place to 
put it, I will submit a diff.



CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D122698/new/

https://reviews.llvm.org/D122698

STAMPS
actor(@FabioRS) application(Differential) author(@FabioRS) herald(H243) 
herald(H311) herald(H365) herald(H378) herald(H391) herald(H502) herald(H576) 
herald(H744) herald(H864) monogram(D122698) object-type(DREV) 
phid(PHID-DREV-cfxk4igkfserwacndt5w) reviewer(@sammccall) 
revision-status(accepted) subscriber(@arphaman) subscriber(@cfe-commits) 
subscriber(@ilya-biryukov) subscriber(@kadircet) subscriber(@MaskRay) 
subscriber(@nridge) subscriber(@usaxena95) tag(#all) tag(#clang-tools-extra) 
via(web)

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to