diff options
Diffstat (limited to 'tools/llvm-extract')
-rw-r--r-- | tools/llvm-extract/LLVMBuild.txt | 22 | ||||
-rw-r--r-- | tools/llvm-extract/Makefile | 7 | ||||
-rw-r--r-- | tools/llvm-extract/llvm-extract.cpp | 12 |
3 files changed, 31 insertions, 10 deletions
diff --git a/tools/llvm-extract/LLVMBuild.txt b/tools/llvm-extract/LLVMBuild.txt new file mode 100644 index 0000000..1b1a4c3 --- /dev/null +++ b/tools/llvm-extract/LLVMBuild.txt @@ -0,0 +1,22 @@ +;===- ./tools/llvm-extract/LLVMBuild.txt -----------------------*- Conf -*--===; +; +; The LLVM Compiler Infrastructure +; +; This file is distributed under the University of Illinois Open Source +; License. See LICENSE.TXT for details. +; +;===------------------------------------------------------------------------===; +; +; This is an LLVMBuild description file for the components in this subdirectory. +; +; For more information on the LLVMBuild system, please see: +; +; http://llvm.org/docs/LLVMBuild.html +; +;===------------------------------------------------------------------------===; + +[component_0] +type = Tool +name = llvm-extract +parent = Tools +required_libraries = AsmParser BitReader BitWriter IPO diff --git a/tools/llvm-extract/Makefile b/tools/llvm-extract/Makefile index 5672aa3..a1e93f5 100644 --- a/tools/llvm-extract/Makefile +++ b/tools/llvm-extract/Makefile @@ -7,12 +7,11 @@ # ##===----------------------------------------------------------------------===## -LEVEL = ../.. - -TOOLNAME = llvm-extract +LEVEL := ../.. +TOOLNAME := llvm-extract LINK_COMPONENTS := ipo bitreader bitwriter asmparser # This tool has no plugins, optimize startup time. -TOOL_NO_EXPORTS = 1 +TOOL_NO_EXPORTS := 1 include $(LEVEL)/Makefile.common diff --git a/tools/llvm-extract/llvm-extract.cpp b/tools/llvm-extract/llvm-extract.cpp index f6227ee..2ed11c5 100644 --- a/tools/llvm-extract/llvm-extract.cpp +++ b/tools/llvm-extract/llvm-extract.cpp @@ -90,7 +90,7 @@ int main(int argc, char **argv) { M.reset(getLazyIRFileModule(InputFilename, Err, Context)); if (M.get() == 0) { - Err.Print(argv[0], errs()); + Err.print(argv[0], errs()); return 1; } @@ -99,7 +99,7 @@ int main(int argc, char **argv) { // Figure out which globals we should extract. for (size_t i = 0, e = ExtractGlobals.size(); i != e; ++i) { - GlobalValue *GV = M.get()->getNamedGlobal(ExtractGlobals[i]); + GlobalValue *GV = M->getNamedGlobal(ExtractGlobals[i]); if (!GV) { errs() << argv[0] << ": program doesn't contain global named '" << ExtractGlobals[i] << "'!\n"; @@ -117,8 +117,8 @@ int main(int argc, char **argv) { "invalid regex: " << Error; } bool match = false; - for (Module::global_iterator GV = M.get()->global_begin(), - E = M.get()->global_end(); GV != E; GV++) { + for (Module::global_iterator GV = M->global_begin(), + E = M->global_end(); GV != E; GV++) { if (RegEx.match(GV->getName())) { GVs.insert(&*GV); match = true; @@ -133,7 +133,7 @@ int main(int argc, char **argv) { // Figure out which functions we should extract. for (size_t i = 0, e = ExtractFuncs.size(); i != e; ++i) { - GlobalValue *GV = M.get()->getFunction(ExtractFuncs[i]); + GlobalValue *GV = M->getFunction(ExtractFuncs[i]); if (!GV) { errs() << argv[0] << ": program doesn't contain function named '" << ExtractFuncs[i] << "'!\n"; @@ -151,7 +151,7 @@ int main(int argc, char **argv) { "invalid regex: " << Error; } bool match = false; - for (Module::iterator F = M.get()->begin(), E = M.get()->end(); F != E; + for (Module::iterator F = M->begin(), E = M->end(); F != E; F++) { if (RegEx.match(F->getName())) { GVs.insert(&*F); |