<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Version info shows "DEBUG build" for optimized builds with Visual Studio"
   href="http://llvm.org/bugs/show_bug.cgi?id=17752">17752</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Version info shows "DEBUG build" for optimized builds with Visual Studio
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>3.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows XP
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Support Libraries
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>fredrik.littmarck@propellerheads.se
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>This seems to be a purely cosmetical bug, but the optimized builds of llvm
tools prints the wrong version info when built with Visual Studio.

Expected:
  llvm-ld.exe --version
  Low Level Virtual Machine (<a href="http://llvm.org/">http://llvm.org/</a>):
    llvm version 3.0
    Optimized build.
    Built Apr 17 2012 (13:21:32).
    Host: i686-pc-win32
    Host CPU: corei7

Result:
  llvm-ld.exe --version
  Low Level Virtual Machine (<a href="http://llvm.org/">http://llvm.org/</a>):
    llvm version 3.0
    DEBUG build.
    Built Apr 17 2012 (13:21:32).
    Host: i686-pc-win32
    Host CPU: corei7

Probable cause:
The use of the __OPTIMIZED__ preprocessor definition in
lib/Support/CommandLine.cpp:

void print() {
    raw_ostream &OS = outs();
    OS << "Low Level Virtual Machine (<a href="http://llvm.org/):\n">http://llvm.org/):\n</a>"
      << "  " << PACKAGE_NAME << " version " << PACKAGE_VERSION;
#ifdef LLVM_VERSION_INFO
    OS << LLVM_VERSION_INFO;
#endif
    OS << "\n  ";
#ifndef __OPTIMIZE__
    OS << "DEBUG build";
#else
    OS << "Optimized build";
#endif
#ifndef NDEBUG
    OS << " with assertions";
#endif

--- snip ---
}

__OPTIMIZE__ is never defined by MSVCC (or the CMake build scripts). This is
the only place in the llvm codebase where this macro is used from what I can
see.

It does not seem to be fixed in the trunk.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>