]> granicus.if.org Git - clang/commit
Driver: parse -mcmodel earlier
authorSaleem Abdulrasool <compnerd@compnerd.org>
Thu, 8 May 2014 02:28:32 +0000 (02:28 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Thu, 8 May 2014 02:28:32 +0000 (02:28 +0000)
commite81307a78e7395d512cdea0a59ff7937ac8ebe63
tree4ffece61187668a9219d6e390f7759ac5e4cfe34
parentb9da57db34b53258ac428471523b25040f2c237c
Driver: parse -mcmodel earlier

This addresses an existing FIXME item in the driver.  The code model flag was
parsed in the actual tool rather than in the driver.  This was problematic since
the value may be invalid.  In that case, we would silently treat it as a default
value in non-assert builds, and abort in assert builds.  Add a check in the
driver to validate that the value being passed is valid, and if not provide a
proper error message.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208275 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/BackendUtil.cpp
lib/Frontend/CompilerInvocation.cpp
test/Driver/code-model.c [new file with mode: 0644]