diff options
Diffstat (limited to 'tools/llc')
-rw-r--r-- | tools/llc/CMakeLists.txt | 2 | ||||
-rw-r--r-- | tools/llc/LLVMBuild.txt | 2 | ||||
-rw-r--r-- | tools/llc/Makefile | 2 | ||||
-rw-r--r-- | tools/llc/llc.cpp | 8 |
4 files changed, 11 insertions, 3 deletions
diff --git a/tools/llc/CMakeLists.txt b/tools/llc/CMakeLists.txt index dcbcf9da6128b..ff5a89e1da44f 100644 --- a/tools/llc/CMakeLists.txt +++ b/tools/llc/CMakeLists.txt @@ -6,9 +6,11 @@ set(LLVM_LINK_COMPONENTS Core IRReader MC + MIRParser ScalarOpts SelectionDAG Support + Target ) # Support plugins. diff --git a/tools/llc/LLVMBuild.txt b/tools/llc/LLVMBuild.txt index 45cdc6498f86b..38660cf27a463 100644 --- a/tools/llc/LLVMBuild.txt +++ b/tools/llc/LLVMBuild.txt @@ -19,4 +19,4 @@ type = Tool name = llc parent = Tools -required_libraries = AsmParser BitReader IRReader all-targets +required_libraries = AsmParser BitReader IRReader MIRParser all-targets diff --git a/tools/llc/Makefile b/tools/llc/Makefile index 71bce4dc1adf9..ae64c9a5b57c6 100644 --- a/tools/llc/Makefile +++ b/tools/llc/Makefile @@ -9,7 +9,7 @@ LEVEL := ../.. TOOLNAME := llc -LINK_COMPONENTS := all-targets bitreader asmparser irreader +LINK_COMPONENTS := all-targets bitreader asmparser irreader mirparser # Support plugins. NO_DEAD_STRIP := 1 diff --git a/tools/llc/llc.cpp b/tools/llc/llc.cpp index 0977418e02318..fadcfa90235c3 100644 --- a/tools/llc/llc.cpp +++ b/tools/llc/llc.cpp @@ -20,6 +20,7 @@ #include "llvm/CodeGen/CommandFlags.h" #include "llvm/CodeGen/LinkAllAsmWriterComponents.h" #include "llvm/CodeGen/LinkAllCodegenComponents.h" +#include "llvm/CodeGen/MIRParser/MIRParser.h" #include "llvm/IR/DataLayout.h" #include "llvm/IR/IRPrintingPasses.h" #include "llvm/IR/LLVMContext.h" @@ -109,6 +110,8 @@ GetOutputStream(const char *TargetName, Triple::OSType OS, StringRef IFN = InputFilename; if (IFN.endswith(".bc") || IFN.endswith(".ll")) OutputFilename = IFN.drop_back(3); + else if (IFN.endswith(".mir")) + OutputFilename = IFN.drop_back(4); else OutputFilename = IFN; @@ -214,7 +217,10 @@ static int compileModule(char **argv, LLVMContext &Context) { // If user just wants to list available options, skip module loading if (!SkipModule) { - M = parseIRFile(InputFilename, Err, Context); + if (StringRef(InputFilename).endswith_lower(".mir")) + M = parseMIRFile(InputFilename, Err, Context); + else + M = parseIRFile(InputFilename, Err, Context); if (!M) { Err.print(argv[0], errs()); return 1; |