Refactor TargetOptions initialization into a single place.
authorEli Bendersky <eliben@google.com>
Wed, 19 Feb 2014 17:09:35 +0000 (17:09 +0000)
committerEli Bendersky <eliben@google.com>
Wed, 19 Feb 2014 17:09:35 +0000 (17:09 +0000)
commitcf42174647af5265e35f0e15fbffa17445ae0e80
tree70f756244b660fb0330b77a87251b188ffb1a82a
parenteb5fe7002aa9276b86581da2220c895a85202a9a
Refactor TargetOptions initialization into a single place.

The same code (~20 lines) for initializing a TargetOptions object from CodeGen
cmdline flags is duplicated 4 times in 4 different tools. This patch moves it
into a utility function.

Since the CodeGen/CommandFlags.h file defines cl::opt flags in a header, it's
a bit of a touchy situation because we should only link them into tools. So this
patch puts the init function in the header.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201699 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/CommandFlags.h
tools/llc/llc.cpp
tools/llvm-lto/llvm-lto.cpp
tools/lto/lto.cpp
tools/opt/opt.cpp