[PATCH] Separate file parsing from File's constructors.

Rui Ueyama ruiu at google.com
Thu Dec 11 19:20:58 PST 2014


================
Comment at: lib/ReaderWriter/ELF/DynamicFile.h:58-61
@@ -57,1 +57,6 @@
 
+  std::error_code parse() override {
+    if (_parsed)
+      return std::error_code();
+    _parsed = true;
+    std::error_code ec;
----------------
Bigcheese wrote:
> The error semantics here are a bit weird. All calls to parse() will not error after the first, even if the first errors out.
Good point. I wanted to make this function idempotent, so returning a different result on second call is wrong. I'll fix this.

http://reviews.llvm.org/D6633

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list