[PATCH] D26214: [llvm] Implement support for -defsym assembler option

Jim Grosbach via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 1 11:09:10 PST 2016


grosbach reopened this revision.
grosbach added inline comments.
This revision is now accepted and ready to land.


================
Comment at: llvm/trunk/lib/MC/MCContext.cpp:263
 
+int MCContext::setSymbolValue(MCStreamer &Streamer, std::string &I) {
+    auto Pair = StringRef(I).split('=');
----------------
The error checking shouldn't be in the setter function, but rather in the caller.


================
Comment at: llvm/trunk/lib/MC/MCContext.cpp:266
+    if (Pair.second.empty()) {
+      errs() << "error: defsym must be of the form: sym=value: " << I << "\n";
+      return 1;
----------------
The MC layer should not be writing directly to errs(), but rather going through the diagnostics handlers.


Repository:
  rL LLVM

https://reviews.llvm.org/D26214





More information about the llvm-commits mailing list