[PATCH] D55519: Reuse code from CGDebugInfo::getOrCreateFile() when creating the file for the DICompileUnit

Mikael Holmén via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 10 22:48:03 PST 2018


uabelho added a comment.

If I change what I think is two typos, then the patch compiles for me and solves the issue I had.

The remaining calls to DIBuilder::createFile, should they be changed to createFile too or should they be left as is for some reason?
If they should be left, perhaps it would be good to add some comments explaining why we should use DIBuilder::createFile directly in some place and not in others?

Thanks!



================
Comment at: lib/CodeGen/CGDebugInfo.cpp:432
     CSInfo.emplace(*CSKind, Checksum);
+  return getOrCreateFile(FileName, CSInfo, getSource(SM, SM.getFileID(Loc)));
+}
----------------
I suppose you mean to use the new
createFile
method here?


================
Comment at: lib/CodeGen/CGDebugInfo.cpp:613
       LangTag,
-      DBuilder.createFile(remapDIPath(MainFileName),
-                          remapDIPath(getCurrentDirname()), CSInfo,
-                          getSource(SM, SM.getMainFileID())),
+      getOrCreateFile(MainFileName, CSInfo, getSource(SM, SM.getMainFileID())),
       CGOpts.EmitVersionIdentMetadata ? Producer : "",
----------------
I suppose you mean to use the new 
 createFile
method here?


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

https://reviews.llvm.org/D55519





More information about the llvm-commits mailing list