<html>
  <head>
    
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <br>
    <div class="moz-cite-prefix">On 10/01/2015 08:27 PM, Rui Ueyama
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAJENXgtsHaLEwh1FnH75KzONBehiwYtCA9-DNh1UWCtruzG3LQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <pre class="">+static std::unique_ptr<InputFile> createTargetFile(MemoryBufferRef MB) {
+  std::unique_ptr<InputFile> File = createFile(MB);
+  ELFFileBase *ELFFile = dyn_cast<ELFFileBase>(File.get());
+  if (!ELFFile)
+    return File;
+
+  const ELFKind ElfKind = ELFFile->getELFKind();
+  const uint16_t EMachine = ELFFile->getEMachine();
+
+  // Grab target from the first input file if wasn't set by -m option.
+  if (Config->ElfKind == ELFNoneKind) {
+    Config->ElfKind = ElfKind;
+    Config->EMachine = EMachine;
+    return File;
+  }
+  if (ElfKind != Config->ElfKind || EMachine != Config->EMachine)
+    return nullptr;</pre>
        <pre class="">Why don't you call error() here?</pre>
      </div>
    </blockquote>
    I removed Config->FirstObjName in favor of
    Symtab.getFirstELF()->getName() as was requested.<br>
    I don't want to pass Symtab to this method as a parameter, so I
    return nullptr as an indicator and check it outside.<br>
    <blockquote
cite="mid:CAJENXgtsHaLEwh1FnH75KzONBehiwYtCA9-DNh1UWCtruzG3LQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <pre class=""><pre class="">+  bool HasEmulation = false;
+  if (auto *Arg = Args.getLastArg(OPT_emulation)) {
+    applyEmulation(Arg->getValue());</pre><pre class="">I prefer setELFType or something over applyEmulation.</pre></pre>
      </div>
    </blockquote>
    Good.<br>
    <blockquote
cite="mid:CAJENXgtsHaLEwh1FnH75KzONBehiwYtCA9-DNh1UWCtruzG3LQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <pre class=""><pre class=""><pre class="">+def emulation : Separate<["-"], "m">,
+  HelpText<"Set target emulation">;</pre><pre class="">Stick with "def m" instead of "def emulation" how silly the option is named.</pre></pre></pre>
      </div>
    </blockquote>
    Good.<br>
    <blockquote
cite="mid:CAJENXgtsHaLEwh1FnH75KzONBehiwYtCA9-DNh1UWCtruzG3LQ@mail.gmail.com"
      type="cite">
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Thu, Oct 1, 2015 at 10:20 AM, Rafael
          Espíndola <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">This patch
            makes isCompatibleWith redundant and should remove it (See<br>
            attached patch).<br>
            <br>
            I think this OK once rebased on top of trunk.<br>
            Rui, is this OK with you too?<br>
            <br>
            <br>
            On 1 October 2015 at 05:09, Denis Protivensky<br>
            <div class="HOEnZb">
              <div class="h5"><<a moz-do-not-send="true"
                  href="mailto:dprotivensky@accesssoftek.com">dprotivensky@accesssoftek.com</a>>
                wrote:<br>
                > denis-protivensky updated this revision to Diff
                36201.<br>
                > denis-protivensky marked 2 inline comments as done.<br>
                > denis-protivensky added a comment.<br>
                ><br>
                > Updated:<br>
                ><br>
                > - Remove FirstOjbName Config variable, use
                Symtab.getFirstELF()->getName() instead<br>
                > - clang-format sources<br>
                ><br>
                ><br>
                > <a moz-do-not-send="true"
                  href="http://reviews.llvm.org/D13055" rel="noreferrer"
                  target="_blank">http://reviews.llvm.org/D13055</a><br>
                ><br>
                > Files:<br>
                >   ELF/Config.h<br>
                >   ELF/Driver.cpp<br>
                >   ELF/InputFiles.cpp<br>
                >   ELF/InputFiles.h<br>
                >   ELF/Options.td<br>
                >   ELF/SymbolTable.cpp<br>
                >   test/elf2/basic.s<br>
                >   test/elf2/emulation.s<br>
                >   test/elf2/incompatible.s<br>
                ><br>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
  </body>
</html>