[PATCH] [lld][PECOFF] Add WinLinkDriver and PECOFFTargetInfo.

Shankar Kalpathi Easwaran shankarke at gmail.com
Fri May 24 16:24:42 PDT 2013



================
Comment at: lib/Driver/WinLinkDriver.cpp:77-98
@@ +76,24 @@
+
+bool WinLinkDriver::parse(int argc, const char *argv[],
+                          PECOFFTargetInfo &info, raw_ostream &diagnostics) {
+  // Arguments after "--" are interpreted as filenames even if they start with
+  // a hyphen or a slash. This is not compatible with link.exe but useful for
+  // us to test lld on Unix for testing.
+  int doubleDashPosition = findDoubleDash(argv);
+  int argEnd = (doubleDashPosition > 0) ? doubleDashPosition : argc;
+
+  // Parse command line options using WinLinkOptions.td
+  std::unique_ptr<llvm::opt::InputArgList> parsedArgs;
+  WinLinkOptTable table;
+  unsigned missingIndex;
+  unsigned missingCount;
+  parsedArgs.reset(
+      table.ParseArgs(&argv[1], &argv[argEnd], missingIndex, missingCount));
+  if (missingCount) {
+    diagnostics << "error: missing arg value for '"
+                << parsedArgs->getArgString(missingIndex) << "' expected "
+                << missingCount << " argument(s).\n";
+    return nullptr;
+  }
+
+  // Copy mllvm
----------------
--help functionality is missing here.

================
Comment at: lib/ReaderWriter/PECOFF/PECOFFTargetInfo.cpp:35-43
@@ +34,11 @@
+
+ErrorOr<Reference::Kind>
+PECOFFTargetInfo::relocKindFromString(StringRef str) const {
+  return make_error_code(yaml_reader_error::illegal_value);
+}
+
+ErrorOr<std::string>
+PECOFFTargetInfo::stringFromRelocKind(Reference::Kind kind) const {
+  return make_error_code(yaml_reader_error::illegal_value);
+}
+
----------------
no relocations ?


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



More information about the llvm-commits mailing list