<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    Your cl::opt definition seems correct but the definition from
    llc.cpp is not visible in X86ISelLowring.cpp. The general practice
    is to define the cl::opt variable in the file you want to use it in.
    So you could try moving the definition to X86ISelLowering.cpp.<br>
    <br>
    <div class="moz-cite-prefix">On 7/21/2017 10:17 AM, hameeza ahmed
      via llvm-dev wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAFMPKeaKG9UFvoYydbGNW4c=BM-umtVgqiDjXeqcseDHoE9kSQ@mail.gmail.com">
      <div dir="ltr">Thank you.
        <div>I want to define a flag -optt-enabled in llc so i wrote
          following line in llc.cpp:</div>
        <div><br>
        </div>
        <div>
          <div>static cl::opt<bool></div>
          <div>OPPT("oppt-enabled", cl::desc("Enables Optimization"),
            cl::init(false));</div>
        </div>
        <div><br>
        </div>
        <div>Now i want to check its value in x86isellwering.cpp</div>
        <div>there i wrote:</div>
        <div><br>
        </div>
        <div>
          <div> if (OPPT)</div>
          <div>    {addRegisterClass(.............)</div>
        </div>
        <div>}</div>
        <div>but getting the error</div>
        <div><br>
        </div>
        <div> use of undeclared identifier 'OPPT'<br>
        </div>
        <div><br>
        </div>
        <div>Could someone tell me where i am mistaken? what else do i
          need to define.</div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Fri, Jul 21, 2017 at 2:33 PM, Diana
          Picus <span dir="ltr"><<a
              href="mailto:diana.picus@linaro.org" target="_blank"
              moz-do-not-send="true">diana.picus@linaro.org</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
            <br>
            You can find plenty of examples (including in the
            vectorizer) if you<br>
            grep for cl::opt.<br>
            The docs are here:<br>
            <a href="https://llvm.org/docs/CommandLine.html"
              rel="noreferrer" target="_blank" moz-do-not-send="true">https://llvm.org/docs/<wbr>CommandLine.html</a><br>
            <br>
            Hope that helps,<br>
            Diana<br>
            <br>
            On 21 July 2017 at 10:47, hameeza ahmed via llvm-dev<br>
            <div>
              <div class="h5"><<a
                  href="mailto:llvm-dev@lists.llvm.org"
                  moz-do-not-send="true">llvm-dev@lists.llvm.org</a>>
                wrote:<br>
                > Hello.<br>
                ><br>
                > I need to introduce a new flag in llc command like
                llc -mV to control the<br>
                > vectorization. How can I achieve this??<br>
                ><br>
                ><br>
                > Please help.<br>
                ><br>
                > Thank You<br>
                ><br>
              </div>
            </div>
            > ______________________________<wbr>_________________<br>
            > LLVM Developers mailing list<br>
            > <a href="mailto:llvm-dev@lists.llvm.org"
              moz-do-not-send="true">llvm-dev@lists.llvm.org</a><br>
            > <a
              href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev"
              rel="noreferrer" target="_blank" moz-do-not-send="true">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
            ><br>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>