[PATCH] D43934: [ELF] - Report location for div/mod by zero.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 1 08:53:56 PST 2018


ruiu added inline comments.


================
Comment at: ELF/ScriptParser.cpp:815-823
     return [=] { return L().getValue() * R().getValue(); };
-  if (Op == "/")
-    return [=] { return div(L(), R()); };
-  if (Op == "%")
-    return [=] { return mod(L(), R()); };
+  if (Op == "/") {
+    std::string Loc = getCurrentLocation();
+    return [=] { return div(L(), R(), Loc); };
+  }
+  if (Op == "%") {
+    std::string Loc = getCurrentLocation();
----------------
You probably should inline these functions. They are called only once.


https://reviews.llvm.org/D43934





More information about the llvm-commits mailing list