Misha Brukman | e22594f | 2005-04-24 17:36:05 +0000 | [diff] [blame] | 1 | //===- llvm-extract.cpp - LLVM function extraction utility ----------------===// |
Misha Brukman | 650ba8e | 2005-04-22 00:00:37 +0000 | [diff] [blame] | 2 | // |
John Criswell | 09344dc | 2003-10-20 17:47:21 +0000 | [diff] [blame] | 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
Chris Lattner | 345353d | 2007-12-29 20:44:31 +0000 | [diff] [blame] | 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
Misha Brukman | 650ba8e | 2005-04-22 00:00:37 +0000 | [diff] [blame] | 7 | // |
John Criswell | 09344dc | 2003-10-20 17:47:21 +0000 | [diff] [blame] | 8 | //===----------------------------------------------------------------------===// |
Chris Lattner | 055de18 | 2002-05-22 20:27:00 +0000 | [diff] [blame] | 9 | // |
| 10 | // This utility changes the input module to only contain a single function, |
| 11 | // which is primarily used for debugging transformations. |
| 12 | // |
| 13 | //===----------------------------------------------------------------------===// |
| 14 | |
Chandler Carruth | 4d88a1c | 2012-12-04 10:44:52 +0000 | [diff] [blame] | 15 | #include "llvm/ADT/SetVector.h" |
| 16 | #include "llvm/ADT/SmallPtrSet.h" |
Chandler Carruth | b7bdfd6 | 2014-01-13 07:38:24 +0000 | [diff] [blame] | 17 | #include "llvm/Bitcode/BitcodeWriterPass.h" |
Chandler Carruth | 9fb823b | 2013-01-02 11:36:10 +0000 | [diff] [blame] | 18 | #include "llvm/IR/DataLayout.h" |
Chandler Carruth | b8ddc70 | 2014-01-12 11:10:32 +0000 | [diff] [blame] | 19 | #include "llvm/IR/IRPrintingPasses.h" |
| 20 | #include "llvm/IR/LLVMContext.h" |
Chandler Carruth | 9fb823b | 2013-01-02 11:36:10 +0000 | [diff] [blame] | 21 | #include "llvm/IR/Module.h" |
Chandler Carruth | e60e57b | 2013-03-26 02:25:37 +0000 | [diff] [blame] | 22 | #include "llvm/IRReader/IRReader.h" |
Chandler Carruth | 30d69c2 | 2015-02-13 10:01:29 +0000 | [diff] [blame] | 23 | #include "llvm/IR/LegacyPassManager.h" |
Reid Spencer | 7c16caa | 2004-09-01 22:55:40 +0000 | [diff] [blame] | 24 | #include "llvm/Support/CommandLine.h" |
Benjamin Kramer | d59664f | 2014-04-29 23:26:49 +0000 | [diff] [blame] | 25 | #include "llvm/Support/FileSystem.h" |
Chris Lattner | 76d4632 | 2006-12-06 01:18:01 +0000 | [diff] [blame] | 26 | #include "llvm/Support/ManagedStatic.h" |
Chris Lattner | e3fc2d1 | 2009-03-06 05:34:10 +0000 | [diff] [blame] | 27 | #include "llvm/Support/PrettyStackTrace.h" |
Chad Rosier | f0d3786 | 2011-09-16 21:09:17 +0000 | [diff] [blame] | 28 | #include "llvm/Support/Regex.h" |
Chandler Carruth | 4d88a1c | 2012-12-04 10:44:52 +0000 | [diff] [blame] | 29 | #include "llvm/Support/Signals.h" |
Chandler Carruth | e60e57b | 2013-03-26 02:25:37 +0000 | [diff] [blame] | 30 | #include "llvm/Support/SourceMgr.h" |
Chandler Carruth | 4d88a1c | 2012-12-04 10:44:52 +0000 | [diff] [blame] | 31 | #include "llvm/Support/SystemUtils.h" |
| 32 | #include "llvm/Support/ToolOutputFile.h" |
| 33 | #include "llvm/Transforms/IPO.h" |
Chris Lattner | 055de18 | 2002-05-22 20:27:00 +0000 | [diff] [blame] | 34 | #include <memory> |
Brian Gaeke | 960707c | 2003-11-11 22:41:34 +0000 | [diff] [blame] | 35 | using namespace llvm; |
| 36 | |
Chris Lattner | f5cad15 | 2002-07-22 02:10:13 +0000 | [diff] [blame] | 37 | // InputFilename - The filename to read from. |
Chris Lattner | 64a6727 | 2002-07-25 16:31:09 +0000 | [diff] [blame] | 38 | static cl::opt<std::string> |
Gabor Greif | e16561c | 2007-07-05 17:07:56 +0000 | [diff] [blame] | 39 | InputFilename(cl::Positional, cl::desc("<input bitcode file>"), |
Chris Lattner | f5cad15 | 2002-07-22 02:10:13 +0000 | [diff] [blame] | 40 | cl::init("-"), cl::value_desc("filename")); |
Misha Brukman | 650ba8e | 2005-04-22 00:00:37 +0000 | [diff] [blame] | 41 | |
Chris Lattner | 3b203f5 | 2004-02-18 16:53:59 +0000 | [diff] [blame] | 42 | static cl::opt<std::string> |
Misha Brukman | 650ba8e | 2005-04-22 00:00:37 +0000 | [diff] [blame] | 43 | OutputFilename("o", cl::desc("Specify output filename"), |
Chris Lattner | 3b203f5 | 2004-02-18 16:53:59 +0000 | [diff] [blame] | 44 | cl::value_desc("filename"), cl::init("-")); |
| 45 | |
| 46 | static cl::opt<bool> |
Dan Gohman | 61a8796 | 2009-08-25 15:34:52 +0000 | [diff] [blame] | 47 | Force("f", cl::desc("Enable binary output on terminals")); |
Chris Lattner | f5cad15 | 2002-07-22 02:10:13 +0000 | [diff] [blame] | 48 | |
Misha Brukman | 2ccac82 | 2004-04-22 23:07:39 +0000 | [diff] [blame] | 49 | static cl::opt<bool> |
Andrew Lenharth | 3f13b66 | 2008-03-07 19:51:57 +0000 | [diff] [blame] | 50 | DeleteFn("delete", cl::desc("Delete specified Globals from Module")); |
Misha Brukman | 2ccac82 | 2004-04-22 23:07:39 +0000 | [diff] [blame] | 51 | |
Chad Rosier | f0d3786 | 2011-09-16 21:09:17 +0000 | [diff] [blame] | 52 | // ExtractFuncs - The functions to extract from the module. |
Dan Gohman | f684e45 | 2010-02-10 23:58:53 +0000 | [diff] [blame] | 53 | static cl::list<std::string> |
| 54 | ExtractFuncs("func", cl::desc("Specify function to extract"), |
| 55 | cl::ZeroOrMore, cl::value_desc("function")); |
Chris Lattner | f5cad15 | 2002-07-22 02:10:13 +0000 | [diff] [blame] | 56 | |
Andrew Trick | dc073ad | 2013-09-18 23:31:10 +0000 | [diff] [blame] | 57 | // ExtractRegExpFuncs - The functions, matched via regular expression, to |
Chad Rosier | f0d3786 | 2011-09-16 21:09:17 +0000 | [diff] [blame] | 58 | // extract from the module. |
| 59 | static cl::list<std::string> |
| 60 | ExtractRegExpFuncs("rfunc", cl::desc("Specify function(s) to extract using a " |
| 61 | "regular expression"), |
| 62 | cl::ZeroOrMore, cl::value_desc("rfunction")); |
| 63 | |
Rafael Espindola | 7043858a | 2012-10-29 02:23:07 +0000 | [diff] [blame] | 64 | // ExtractAlias - The alias to extract from the module. |
| 65 | static cl::list<std::string> |
| 66 | ExtractAliases("alias", cl::desc("Specify alias to extract"), |
| 67 | cl::ZeroOrMore, cl::value_desc("alias")); |
| 68 | |
| 69 | |
| 70 | // ExtractRegExpAliases - The aliases, matched via regular expression, to |
| 71 | // extract from the module. |
| 72 | static cl::list<std::string> |
| 73 | ExtractRegExpAliases("ralias", cl::desc("Specify alias(es) to extract using a " |
| 74 | "regular expression"), |
| 75 | cl::ZeroOrMore, cl::value_desc("ralias")); |
| 76 | |
Chad Rosier | f0d3786 | 2011-09-16 21:09:17 +0000 | [diff] [blame] | 77 | // ExtractGlobals - The globals to extract from the module. |
Dan Gohman | f684e45 | 2010-02-10 23:58:53 +0000 | [diff] [blame] | 78 | static cl::list<std::string> |
| 79 | ExtractGlobals("glob", cl::desc("Specify global to extract"), |
| 80 | cl::ZeroOrMore, cl::value_desc("global")); |
Andrew Lenharth | 3f13b66 | 2008-03-07 19:51:57 +0000 | [diff] [blame] | 81 | |
Chad Rosier | f0d3786 | 2011-09-16 21:09:17 +0000 | [diff] [blame] | 82 | // ExtractRegExpGlobals - The globals, matched via regular expression, to |
| 83 | // extract from the module... |
| 84 | static cl::list<std::string> |
| 85 | ExtractRegExpGlobals("rglob", cl::desc("Specify global(s) to extract using a " |
| 86 | "regular expression"), |
| 87 | cl::ZeroOrMore, cl::value_desc("rglobal")); |
| 88 | |
Dan Gohman | e592923 | 2009-09-11 20:46:33 +0000 | [diff] [blame] | 89 | static cl::opt<bool> |
| 90 | OutputAssembly("S", |
| 91 | cl::desc("Write output as LLVM assembly"), cl::Hidden); |
| 92 | |
Duncan P. N. Exon Smith | 8a7b84b | 2015-04-15 03:14:06 +0000 | [diff] [blame] | 93 | static cl::opt<bool> PreserveBitcodeUseListOrder( |
| 94 | "preserve-bc-uselistorder", |
| 95 | cl::desc("Preserve use-list order when writing LLVM bitcode."), |
| 96 | cl::init(true), cl::Hidden); |
| 97 | |
| 98 | static cl::opt<bool> PreserveAssemblyUseListOrder( |
| 99 | "preserve-ll-uselistorder", |
| 100 | cl::desc("Preserve use-list order when writing LLVM assembly."), |
| 101 | cl::init(false), cl::Hidden); |
| 102 | |
Chris Lattner | 055de18 | 2002-05-22 20:27:00 +0000 | [diff] [blame] | 103 | int main(int argc, char **argv) { |
Chris Lattner | e3fc2d1 | 2009-03-06 05:34:10 +0000 | [diff] [blame] | 104 | // Print a stack trace if we signal out. |
Chris Lattner | 2793699 | 2007-05-06 05:13:17 +0000 | [diff] [blame] | 105 | sys::PrintStackTraceOnErrorSignal(); |
Chris Lattner | e3fc2d1 | 2009-03-06 05:34:10 +0000 | [diff] [blame] | 106 | PrettyStackTraceProgram X(argc, argv); |
Owen Anderson | 6773d38 | 2009-07-01 16:58:40 +0000 | [diff] [blame] | 107 | |
Owen Anderson | 19251ec | 2009-07-15 22:16:10 +0000 | [diff] [blame] | 108 | LLVMContext &Context = getGlobalContext(); |
Chris Lattner | e3fc2d1 | 2009-03-06 05:34:10 +0000 | [diff] [blame] | 109 | llvm_shutdown_obj Y; // Call llvm_shutdown() on exit. |
| 110 | cl::ParseCommandLineOptions(argc, argv, "llvm extractor\n"); |
Chris Lattner | 055de18 | 2002-05-22 20:27:00 +0000 | [diff] [blame] | 111 | |
Dan Gohman | bf15459 | 2010-08-25 23:33:07 +0000 | [diff] [blame] | 112 | // Use lazy loading, since we only care about selected global values. |
Dan Gohman | e592923 | 2009-09-11 20:46:33 +0000 | [diff] [blame] | 113 | SMDiagnostic Err; |
Rafael Espindola | d233b06 | 2014-08-26 17:29:46 +0000 | [diff] [blame] | 114 | std::unique_ptr<Module> M = getLazyIRFileModule(InputFilename, Err, Context); |
Dan Gohman | e592923 | 2009-09-11 20:46:33 +0000 | [diff] [blame] | 115 | |
Craig Topper | e6cb63e | 2014-04-25 04:24:47 +0000 | [diff] [blame] | 116 | if (!M.get()) { |
Chris Lattner | a3a0681 | 2011-10-16 04:47:35 +0000 | [diff] [blame] | 117 | Err.print(argv[0], errs()); |
Chris Lattner | 2793699 | 2007-05-06 05:13:17 +0000 | [diff] [blame] | 118 | return 1; |
| 119 | } |
| 120 | |
Chad Rosier | f0d3786 | 2011-09-16 21:09:17 +0000 | [diff] [blame] | 121 | // Use SetVector to avoid duplicates. |
| 122 | SetVector<GlobalValue *> GVs; |
Andrew Lenharth | 3f13b66 | 2008-03-07 19:51:57 +0000 | [diff] [blame] | 123 | |
Rafael Espindola | 7043858a | 2012-10-29 02:23:07 +0000 | [diff] [blame] | 124 | // Figure out which aliases we should extract. |
| 125 | for (size_t i = 0, e = ExtractAliases.size(); i != e; ++i) { |
| 126 | GlobalAlias *GA = M->getNamedAlias(ExtractAliases[i]); |
| 127 | if (!GA) { |
| 128 | errs() << argv[0] << ": program doesn't contain alias named '" |
| 129 | << ExtractAliases[i] << "'!\n"; |
| 130 | return 1; |
| 131 | } |
| 132 | GVs.insert(GA); |
| 133 | } |
| 134 | |
| 135 | // Extract aliases via regular expression matching. |
| 136 | for (size_t i = 0, e = ExtractRegExpAliases.size(); i != e; ++i) { |
| 137 | std::string Error; |
| 138 | Regex RegEx(ExtractRegExpAliases[i]); |
| 139 | if (!RegEx.isValid(Error)) { |
| 140 | errs() << argv[0] << ": '" << ExtractRegExpAliases[i] << "' " |
| 141 | "invalid regex: " << Error; |
| 142 | } |
| 143 | bool match = false; |
| 144 | for (Module::alias_iterator GA = M->alias_begin(), E = M->alias_end(); |
| 145 | GA != E; GA++) { |
| 146 | if (RegEx.match(GA->getName())) { |
| 147 | GVs.insert(&*GA); |
| 148 | match = true; |
| 149 | } |
| 150 | } |
| 151 | if (!match) { |
| 152 | errs() << argv[0] << ": program doesn't contain global named '" |
| 153 | << ExtractRegExpAliases[i] << "'!\n"; |
| 154 | return 1; |
| 155 | } |
| 156 | } |
| 157 | |
Dan Gohman | f684e45 | 2010-02-10 23:58:53 +0000 | [diff] [blame] | 158 | // Figure out which globals we should extract. |
| 159 | for (size_t i = 0, e = ExtractGlobals.size(); i != e; ++i) { |
Nick Lewycky | 5079e4d | 2011-12-30 19:17:23 +0000 | [diff] [blame] | 160 | GlobalValue *GV = M->getNamedGlobal(ExtractGlobals[i]); |
Dan Gohman | f684e45 | 2010-02-10 23:58:53 +0000 | [diff] [blame] | 161 | if (!GV) { |
| 162 | errs() << argv[0] << ": program doesn't contain global named '" |
| 163 | << ExtractGlobals[i] << "'!\n"; |
| 164 | return 1; |
| 165 | } |
Chad Rosier | f0d3786 | 2011-09-16 21:09:17 +0000 | [diff] [blame] | 166 | GVs.insert(GV); |
| 167 | } |
| 168 | |
| 169 | // Extract globals via regular expression matching. |
| 170 | for (size_t i = 0, e = ExtractRegExpGlobals.size(); i != e; ++i) { |
| 171 | std::string Error; |
| 172 | Regex RegEx(ExtractRegExpGlobals[i]); |
| 173 | if (!RegEx.isValid(Error)) { |
| 174 | errs() << argv[0] << ": '" << ExtractRegExpGlobals[i] << "' " |
| 175 | "invalid regex: " << Error; |
| 176 | } |
| 177 | bool match = false; |
Rafael Espindola | bfe44e1 | 2014-05-08 19:30:17 +0000 | [diff] [blame] | 178 | for (auto &GV : M->globals()) { |
| 179 | if (RegEx.match(GV.getName())) { |
| 180 | GVs.insert(&GV); |
Chad Rosier | f0d3786 | 2011-09-16 21:09:17 +0000 | [diff] [blame] | 181 | match = true; |
| 182 | } |
| 183 | } |
| 184 | if (!match) { |
| 185 | errs() << argv[0] << ": program doesn't contain global named '" |
| 186 | << ExtractRegExpGlobals[i] << "'!\n"; |
| 187 | return 1; |
| 188 | } |
Dan Gohman | f684e45 | 2010-02-10 23:58:53 +0000 | [diff] [blame] | 189 | } |
Andrew Lenharth | 3f13b66 | 2008-03-07 19:51:57 +0000 | [diff] [blame] | 190 | |
Dan Gohman | f684e45 | 2010-02-10 23:58:53 +0000 | [diff] [blame] | 191 | // Figure out which functions we should extract. |
| 192 | for (size_t i = 0, e = ExtractFuncs.size(); i != e; ++i) { |
Nick Lewycky | 5079e4d | 2011-12-30 19:17:23 +0000 | [diff] [blame] | 193 | GlobalValue *GV = M->getFunction(ExtractFuncs[i]); |
Dan Gohman | f684e45 | 2010-02-10 23:58:53 +0000 | [diff] [blame] | 194 | if (!GV) { |
| 195 | errs() << argv[0] << ": program doesn't contain function named '" |
| 196 | << ExtractFuncs[i] << "'!\n"; |
| 197 | return 1; |
| 198 | } |
Chad Rosier | f0d3786 | 2011-09-16 21:09:17 +0000 | [diff] [blame] | 199 | GVs.insert(GV); |
| 200 | } |
| 201 | // Extract functions via regular expression matching. |
| 202 | for (size_t i = 0, e = ExtractRegExpFuncs.size(); i != e; ++i) { |
| 203 | std::string Error; |
| 204 | StringRef RegExStr = ExtractRegExpFuncs[i]; |
| 205 | Regex RegEx(RegExStr); |
| 206 | if (!RegEx.isValid(Error)) { |
| 207 | errs() << argv[0] << ": '" << ExtractRegExpFuncs[i] << "' " |
| 208 | "invalid regex: " << Error; |
| 209 | } |
| 210 | bool match = false; |
Nick Lewycky | 5079e4d | 2011-12-30 19:17:23 +0000 | [diff] [blame] | 211 | for (Module::iterator F = M->begin(), E = M->end(); F != E; |
Chad Rosier | f0d3786 | 2011-09-16 21:09:17 +0000 | [diff] [blame] | 212 | F++) { |
| 213 | if (RegEx.match(F->getName())) { |
| 214 | GVs.insert(&*F); |
| 215 | match = true; |
| 216 | } |
| 217 | } |
| 218 | if (!match) { |
| 219 | errs() << argv[0] << ": program doesn't contain global named '" |
| 220 | << ExtractRegExpFuncs[i] << "'!\n"; |
| 221 | return 1; |
| 222 | } |
Chris Lattner | 2793699 | 2007-05-06 05:13:17 +0000 | [diff] [blame] | 223 | } |
| 224 | |
Rafael Espindola | be2cfb2 | 2015-12-18 22:40:27 +0000 | [diff] [blame^] | 225 | auto Materialize = [&](GlobalValue &GV) { |
| 226 | if (std::error_code EC = GV.materialize()) { |
| 227 | errs() << argv[0] << ": error reading input: " << EC.message() << "\n"; |
| 228 | exit(1); |
Dan Gohman | 0d2c07c | 2010-09-23 00:33:13 +0000 | [diff] [blame] | 229 | } |
Rafael Espindola | be2cfb2 | 2015-12-18 22:40:27 +0000 | [diff] [blame^] | 230 | }; |
| 231 | |
| 232 | // Materialize requisite global values. |
| 233 | if (!DeleteFn) { |
| 234 | for (size_t i = 0, e = GVs.size(); i != e; ++i) |
| 235 | Materialize(*GVs[i]); |
| 236 | } else { |
Dan Gohman | 0d2c07c | 2010-09-23 00:33:13 +0000 | [diff] [blame] | 237 | // Deleting. Materialize every GV that's *not* in GVs. |
| 238 | SmallPtrSet<GlobalValue *, 8> GVSet(GVs.begin(), GVs.end()); |
Rafael Espindola | bfe44e1 | 2014-05-08 19:30:17 +0000 | [diff] [blame] | 239 | for (auto &G : M->globals()) { |
Rafael Espindola | be2cfb2 | 2015-12-18 22:40:27 +0000 | [diff] [blame^] | 240 | if (!GVSet.count(&G)) |
| 241 | Materialize(G); |
Dan Gohman | 0d2c07c | 2010-09-23 00:33:13 +0000 | [diff] [blame] | 242 | } |
Rafael Espindola | bfe44e1 | 2014-05-08 19:30:17 +0000 | [diff] [blame] | 243 | for (auto &F : *M) { |
Rafael Espindola | be2cfb2 | 2015-12-18 22:40:27 +0000 | [diff] [blame^] | 244 | if (!GVSet.count(&F)) |
| 245 | Materialize(F); |
Dan Gohman | bf15459 | 2010-08-25 23:33:07 +0000 | [diff] [blame] | 246 | } |
| 247 | } |
| 248 | |
Chris Lattner | 2793699 | 2007-05-06 05:13:17 +0000 | [diff] [blame] | 249 | // In addition to deleting all other functions, we also want to spiff it |
| 250 | // up a little bit. Do this now. |
Chandler Carruth | 30d69c2 | 2015-02-13 10:01:29 +0000 | [diff] [blame] | 251 | legacy::PassManager Passes; |
Andrew Lenharth | 3f13b66 | 2008-03-07 19:51:57 +0000 | [diff] [blame] | 252 | |
Chad Rosier | f0d3786 | 2011-09-16 21:09:17 +0000 | [diff] [blame] | 253 | std::vector<GlobalValue*> Gvs(GVs.begin(), GVs.end()); |
| 254 | |
| 255 | Passes.add(createGVExtractionPass(Gvs, DeleteFn)); |
Chris Lattner | 2793699 | 2007-05-06 05:13:17 +0000 | [diff] [blame] | 256 | if (!DeleteFn) |
| 257 | Passes.add(createGlobalDCEPass()); // Delete unreachable globals |
Devang Patel | 9b2a93a | 2010-07-01 19:58:05 +0000 | [diff] [blame] | 258 | Passes.add(createStripDeadDebugInfoPass()); // Remove dead debug info |
Chris Lattner | 2793699 | 2007-05-06 05:13:17 +0000 | [diff] [blame] | 259 | Passes.add(createStripDeadPrototypesPass()); // Remove dead func decls |
| 260 | |
Rafael Espindola | 3fd1e99 | 2014-08-25 18:16:47 +0000 | [diff] [blame] | 261 | std::error_code EC; |
| 262 | tool_output_file Out(OutputFilename, EC, sys::fs::F_None); |
| 263 | if (EC) { |
| 264 | errs() << EC.message() << '\n'; |
Chris Lattner | abd1736 | 2009-08-23 02:56:05 +0000 | [diff] [blame] | 265 | return 1; |
Chris Lattner | 2793699 | 2007-05-06 05:13:17 +0000 | [diff] [blame] | 266 | } |
| 267 | |
Dan Gohman | e592923 | 2009-09-11 20:46:33 +0000 | [diff] [blame] | 268 | if (OutputAssembly) |
Duncan P. N. Exon Smith | 679db33 | 2015-04-15 00:34:24 +0000 | [diff] [blame] | 269 | Passes.add( |
Duncan P. N. Exon Smith | 8a7b84b | 2015-04-15 03:14:06 +0000 | [diff] [blame] | 270 | createPrintModulePass(Out.os(), "", PreserveAssemblyUseListOrder)); |
| 271 | else if (Force || !CheckBitcodeOutputToConsole(Out.os(), true)) |
| 272 | Passes.add(createBitcodeWriterPass(Out.os(), PreserveBitcodeUseListOrder)); |
Dan Gohman | 61a8796 | 2009-08-25 15:34:52 +0000 | [diff] [blame] | 273 | |
Chris Lattner | 2793699 | 2007-05-06 05:13:17 +0000 | [diff] [blame] | 274 | Passes.run(*M.get()); |
| 275 | |
Dan Gohman | 4cc73ba | 2010-08-20 01:12:13 +0000 | [diff] [blame] | 276 | // Declare success. |
| 277 | Out.keep(); |
| 278 | |
Chris Lattner | 2793699 | 2007-05-06 05:13:17 +0000 | [diff] [blame] | 279 | return 0; |
Chris Lattner | 055de18 | 2002-05-22 20:27:00 +0000 | [diff] [blame] | 280 | } |