Skip to content

Commit

Permalink
Add "-mcpu=" option to llvm-rtdyld
Browse files Browse the repository at this point in the history
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

llvm-svn: 240477
  • Loading branch information
petar-jovanovic committed Jun 23, 2015
1 parent 51fe7bf commit 280e562
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
Expand Up @@ -82,6 +82,12 @@ Dylibs("dylib",
static cl::opt<std::string>
TripleName("triple", cl::desc("Target triple for disassembler"));

static cl::opt<std::string>
MCPU("mcpu",
cl::desc("Target a specific cpu type (-mcpu=help for details)"),
cl::value_desc("cpu-name"),
cl::init(""));

static cl::list<std::string>
CheckFiles("check",
cl::desc("File containing RuntimeDyld verifier checks."),
Expand Down Expand Up @@ -539,7 +545,7 @@ static int linkAndVerify() {
TripleName = TheTriple.getTriple();

std::unique_ptr<MCSubtargetInfo> STI(
TheTarget->createMCSubtargetInfo(TripleName, "", ""));
TheTarget->createMCSubtargetInfo(TripleName, MCPU, ""));
assert(STI && "Unable to create subtarget info!");

std::unique_ptr<MCRegisterInfo> MRI(TheTarget->createMCRegInfo(TripleName));
Expand Down

0 comments on commit 280e562

Please sign in to comment.