[PATCH] [lld] add calls to nativereader/nativewriter

Shankar Kalpathi Easwaran shankarke at gmail.com
Wed Oct 23 20:20:39 PDT 2013



================
Comment at: include/lld/Passes/RoundTripYAMLPass.h:33
@@ +32,3 @@
+  LinkingContext &_context;
+  std::vector<std::unique_ptr<File> > _yamlFile;
+};
----------------
kledzik at apple.com wrote:
> _yamlFile seems like it should be a local variable in perform().  But I bet it is an ivar to keep it alive after the pass is done, because it actally owns the atoms that will be used for the rest of the link.  At least add a comment explaining that.
you are right Nick, Will add comment here.

================
Comment at: lib/Passes/RoundTripNativePass.cpp:25
@@ +24,3 @@
+void RoundTripNativePass::perform(std::unique_ptr<MutableFile> &nativeFile) {
+  ScopedTask task(getDefaultDomain(), "RoundTripNativePass");
+  std::unique_ptr<Writer> _nativeWriter = createWriterNative(_context);
----------------
kledzik at apple.com wrote:
> other passes call the parameter "mergedFile". Calling it nativeFile is misleading.
Ok. Will call it mergedFile.

================
Comment at: lib/Passes/RoundTripNativePass.cpp:27
@@ +26,3 @@
+  std::unique_ptr<Writer> _nativeWriter = createWriterNative(_context);
+  SmallString<128> tmpNativeFile;
+  // Separate the directory from the filename
----------------
kledzik at apple.com wrote:
> _nativeWriter is a local variable, so should not have a leading underscore.
will remove leading underscore.

================
Comment at: lib/Passes/RoundTripYAMLPass.cpp:24
@@ +23,3 @@
+/// Perform the actual pass
+void RoundTripYAMLPass::perform(std::unique_ptr<MutableFile> &yamlFile) {
+  ScopedTask task(getDefaultDomain(), "RoundTripYAMLPass");
----------------
kledzik at apple.com wrote:
> other passes call the parameter "mergedFile".  Calling it yamlFile is misleading
will change it to mergedFile.

================
Comment at: lib/Passes/RoundTripYAMLPass.cpp:26
@@ +25,3 @@
+  ScopedTask task(getDefaultDomain(), "RoundTripYAMLPass");
+  std::unique_ptr<Writer> _yamlWriter = createWriterYAML(_context);
+  SmallString<128> tmpYAMLFile;
----------------
kledzik at apple.com wrote:
> _yamlWriter is a local variable, so should not have a leading underscore.
Will do.


http://llvm-reviews.chandlerc.com/D1955



More information about the llvm-commits mailing list