From: Petar Jovanovic Date: Tue, 23 Jun 2015 22:52:19 +0000 (+0000) Subject: Add "-mcpu=" option to llvm-rtdyld X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=8dad59bc3e5bea00c34a3a70be0d63a2906329d6;p=oota-llvm.git Add "-mcpu=" option to llvm-rtdyld This patch adds the -mcpu= option to llvm-rtdyld. With this option, one can test relocations for different types of CPUs (e.g. Mips64r6). Patch by Vladimir Radosavljevic. Differential Revision: http://reviews.llvm.org/D10503 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240477 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/llvm-rtdyld/llvm-rtdyld.cpp b/tools/llvm-rtdyld/llvm-rtdyld.cpp index 5bc18d3bfbe..addea588472 100644 --- a/tools/llvm-rtdyld/llvm-rtdyld.cpp +++ b/tools/llvm-rtdyld/llvm-rtdyld.cpp @@ -82,6 +82,12 @@ Dylibs("dylib", static cl::opt TripleName("triple", cl::desc("Target triple for disassembler")); +static cl::opt +MCPU("mcpu", + cl::desc("Target a specific cpu type (-mcpu=help for details)"), + cl::value_desc("cpu-name"), + cl::init("")); + static cl::list CheckFiles("check", cl::desc("File containing RuntimeDyld verifier checks."), @@ -539,7 +545,7 @@ static int linkAndVerify() { TripleName = TheTriple.getTriple(); std::unique_ptr STI( - TheTarget->createMCSubtargetInfo(TripleName, "", "")); + TheTarget->createMCSubtargetInfo(TripleName, MCPU, "")); assert(STI && "Unable to create subtarget info!"); std::unique_ptr MRI(TheTarget->createMCRegInfo(TripleName));