blob: c85fdc4aa2a4d78d54a95b743a4768b5d513868b [file] [log] [blame]
Stephen Hines932bc6e2011-07-27 16:26:26 -07001/*
Stephen Hinescc366e52012-02-21 17:22:04 -08002 * Copyright 2011-2012, The Android Open Source Project
Stephen Hines932bc6e2011-07-27 16:26:26 -07003 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#include <bcinfo/BitcodeTranslator.h>
Stephen Hines04261e02012-01-21 17:11:22 -080018#include <bcinfo/BitcodeWrapper.h>
Stephen Hines932bc6e2011-07-27 16:26:26 -070019#include <bcinfo/MetadataExtractor.h>
20
Stephen Hinese126b622012-05-31 18:41:40 -070021#include <llvm/ADT/StringRef.h>
Stephen Hinese126b622012-05-31 18:41:40 -070022#include <llvm/Bitcode/ReaderWriter.h>
Tim Murrayc2074ca2014-04-08 15:39:08 -070023#include <llvm/IR/AssemblyAnnotationWriter.h>
Stephen Hinesb730e232013-01-09 15:31:36 -080024#include <llvm/IR/LLVMContext.h>
25#include <llvm/IR/Module.h>
Stephen Hinesa6300782014-05-28 15:17:19 -070026#include <llvm/Support/FileSystem.h>
Stephen Hinese126b622012-05-31 18:41:40 -070027#include <llvm/Support/ManagedStatic.h>
28#include <llvm/Support/MemoryBuffer.h>
29#include <llvm/Support/ToolOutputFile.h>
30
Stephen Hines932bc6e2011-07-27 16:26:26 -070031#include <ctype.h>
32#include <dlfcn.h>
33#include <stdarg.h>
34#include <stdint.h>
35#include <stdio.h>
36#include <stdlib.h>
37#include <string.h>
38#include <getopt.h>
39
40#include <errno.h>
41#include <sys/stat.h>
42#include <sys/types.h>
43
44#include <unistd.h>
45
Stephen Hinese126b622012-05-31 18:41:40 -070046#include <string>
Stephen Hines932bc6e2011-07-27 16:26:26 -070047#include <vector>
48
49// This file corresponds to the standalone bcinfo tool. It prints a variety of
50// information about a supplied bitcode input file.
51
Stephen Hinese126b622012-05-31 18:41:40 -070052std::string inFile;
53std::string outFile;
Stephen Hines3ffc8332012-08-28 17:23:47 -070054std::string infoFile;
Stephen Hines932bc6e2011-07-27 16:26:26 -070055
56extern int opterr;
57extern int optind;
58
Stephen Hines04261e02012-01-21 17:11:22 -080059bool translateFlag = false;
Stephen Hines3ffc8332012-08-28 17:23:47 -070060bool infoFlag = false;
61bool verbose = true;
Stephen Hines932bc6e2011-07-27 16:26:26 -070062
63static int parseOption(int argc, char** argv) {
64 int c;
Stephen Hines3ffc8332012-08-28 17:23:47 -070065 while ((c = getopt(argc, argv, "itv")) != -1) {
Stephen Hines932bc6e2011-07-27 16:26:26 -070066 opterr = 0;
67
68 switch(c) {
69 case '?':
70 // ignore any error
71 break;
72
73 case 't':
Stephen Hines04261e02012-01-21 17:11:22 -080074 translateFlag = true;
Stephen Hines932bc6e2011-07-27 16:26:26 -070075 break;
76
Stephen Hines3ffc8332012-08-28 17:23:47 -070077 case 'i':
78 // Turn off verbose so that we only generate the .info file.
79 infoFlag = true;
80 verbose = false;
81 break;
82
83 case 'v':
84 verbose = true;
85 break;
86
Stephen Hines932bc6e2011-07-27 16:26:26 -070087 default:
88 // Critical error occurs
89 return 0;
90 break;
91 }
92 }
93
94 if(optind >= argc) {
95 fprintf(stderr, "input file required\n");
96 return 0;
97 }
98
99 inFile = argv[optind];
Stephen Hinese126b622012-05-31 18:41:40 -0700100
101 int l = inFile.length();
102 if (l > 3 && inFile[l-3] == '.' && inFile[l-2] == 'b' && inFile[l-1] == 'c') {
103 outFile = std::string(inFile.begin(), inFile.end() - 3) + ".ll";
Stephen Hines3ffc8332012-08-28 17:23:47 -0700104 infoFile = std::string(inFile.begin(), inFile.end() - 3) + ".bcinfo";
Stephen Hinese126b622012-05-31 18:41:40 -0700105 } else {
106 outFile = inFile + ".ll";
Stephen Hines3ffc8332012-08-28 17:23:47 -0700107 infoFile = inFile + ".bcinfo";
Stephen Hinese126b622012-05-31 18:41:40 -0700108 }
Stephen Hines932bc6e2011-07-27 16:26:26 -0700109 return 1;
110}
111
112
David Grossa48ea362016-06-02 14:46:55 -0700113static void dumpReduceInfo(FILE *info, const char *Kind, const char *Name) {
David Gross79e1a052016-01-11 14:42:51 -0800114 if (Name)
115 fprintf(info, " %s(%s)\n", Kind, Name);
116}
117
Stephen Hines3ffc8332012-08-28 17:23:47 -0700118static int dumpInfo(bcinfo::MetadataExtractor *ME) {
119 if (!ME) {
120 return 1;
121 }
122
123 FILE *info = fopen(infoFile.c_str(), "w");
124 if (!info) {
125 fprintf(stderr, "Could not open info file %s\n", infoFile.c_str());
126 return 2;
127 }
128
Stephen Hines4cb4c552014-11-06 15:36:35 -0800129 fprintf(info, "exportVarCount: %zu\n", ME->getExportVarCount());
Stephen Hines3ffc8332012-08-28 17:23:47 -0700130 const char **varNameList = ME->getExportVarNameList();
131 for (size_t i = 0; i < ME->getExportVarCount(); i++) {
132 fprintf(info, "%s\n", varNameList[i]);
133 }
134
Stephen Hines4cb4c552014-11-06 15:36:35 -0800135 fprintf(info, "exportFuncCount: %zu\n", ME->getExportFuncCount());
Stephen Hines3ffc8332012-08-28 17:23:47 -0700136 const char **funcNameList = ME->getExportFuncNameList();
137 for (size_t i = 0; i < ME->getExportFuncCount(); i++) {
138 fprintf(info, "%s\n", funcNameList[i]);
139 }
140
Stephen Hines4cb4c552014-11-06 15:36:35 -0800141 fprintf(info, "exportForEachCount: %zu\n",
Stephen Hines3ffc8332012-08-28 17:23:47 -0700142 ME->getExportForEachSignatureCount());
143 const char **nameList = ME->getExportForEachNameList();
144 const uint32_t *sigList = ME->getExportForEachSignatureList();
Chris Wailesa6681822014-07-11 15:15:46 -0700145 const uint32_t *inputCountList = ME->getExportForEachInputCountList();
Stephen Hines3ffc8332012-08-28 17:23:47 -0700146 for (size_t i = 0; i < ME->getExportForEachSignatureCount(); i++) {
Chris Wailesa6681822014-07-11 15:15:46 -0700147 fprintf(info, "%u - %s - %u\n", sigList[i], nameList[i],
148 inputCountList[i]);
Stephen Hines3ffc8332012-08-28 17:23:47 -0700149 }
150
Matt Wala1895ac12015-07-16 15:34:29 -0700151 fprintf(info, "exportReduceCount: %zu\n", ME->getExportReduceCount());
David Grossa48ea362016-06-02 14:46:55 -0700152 const bcinfo::MetadataExtractor::Reduce *reduceList =
153 ME->getExportReduceList();
Matt Wala1895ac12015-07-16 15:34:29 -0700154 for (size_t i = 0; i < ME->getExportReduceCount(); i++) {
David Grossa48ea362016-06-02 14:46:55 -0700155 const bcinfo::MetadataExtractor::Reduce &reduce = reduceList[i];
156 fprintf(info, "%u - %s - %u - %u\n", reduce.mSignature, reduce.mReduceName,
157 reduce.mInputCount, reduce.mAccumulatorDataSize);
158 dumpReduceInfo(info, "initializer", reduce.mInitializerName);
159 dumpReduceInfo(info, "accumulator", reduce.mAccumulatorName);
160 dumpReduceInfo(info, "combiner", reduce.mCombinerName);
161 dumpReduceInfo(info, "outconverter", reduce.mOutConverterName);
162 dumpReduceInfo(info, "halter", reduce.mHalterName);
David Gross79e1a052016-01-11 14:42:51 -0800163 }
164
Stephen Hines4cb4c552014-11-06 15:36:35 -0800165 fprintf(info, "objectSlotCount: %zu\n", ME->getObjectSlotCount());
Stephen Hines3ffc8332012-08-28 17:23:47 -0700166 const uint32_t *slotList = ME->getObjectSlotList();
167 for (size_t i = 0; i < ME->getObjectSlotCount(); i++) {
168 fprintf(info, "%u\n", slotList[i]);
169 }
170
171 fclose(info);
172 return 0;
173}
174
175
Stephen Hines932bc6e2011-07-27 16:26:26 -0700176static void dumpMetadata(bcinfo::MetadataExtractor *ME) {
177 if (!ME) {
178 return;
179 }
180
Stephen Hinese1fd8042012-03-27 11:03:46 -0700181 printf("RSFloatPrecision: ");
182 switch (ME->getRSFloatPrecision()) {
183 case bcinfo::RS_FP_Full:
184 printf("Full\n\n");
185 break;
186 case bcinfo::RS_FP_Relaxed:
187 printf("Relaxed\n\n");
188 break;
Stephen Hinese1fd8042012-03-27 11:03:46 -0700189 default:
190 printf("UNKNOWN\n\n");
191 break;
192 }
193
Stephen Hines4cb4c552014-11-06 15:36:35 -0800194 printf("exportVarCount: %zu\n", ME->getExportVarCount());
Stephen Hines569986d2012-03-09 19:58:45 -0800195 const char **varNameList = ME->getExportVarNameList();
196 for (size_t i = 0; i < ME->getExportVarCount(); i++) {
Stephen Hines4cb4c552014-11-06 15:36:35 -0800197 printf("var[%zu]: %s\n", i, varNameList[i]);
Stephen Hines569986d2012-03-09 19:58:45 -0800198 }
199 printf("\n");
200
Stephen Hines4cb4c552014-11-06 15:36:35 -0800201 printf("exportFuncCount: %zu\n", ME->getExportFuncCount());
Stephen Hines569986d2012-03-09 19:58:45 -0800202 const char **funcNameList = ME->getExportFuncNameList();
203 for (size_t i = 0; i < ME->getExportFuncCount(); i++) {
Stephen Hines4cb4c552014-11-06 15:36:35 -0800204 printf("func[%zu]: %s\n", i, funcNameList[i]);
Stephen Hines569986d2012-03-09 19:58:45 -0800205 }
206 printf("\n");
Stephen Hines33f8fe22011-08-17 12:56:22 -0700207
Stephen Hines4cb4c552014-11-06 15:36:35 -0800208 printf("exportForEachSignatureCount: %zu\n",
Stephen Hines33f8fe22011-08-17 12:56:22 -0700209 ME->getExportForEachSignatureCount());
Stephen Hinescc366e52012-02-21 17:22:04 -0800210 const char **nameList = ME->getExportForEachNameList();
Stephen Hines33f8fe22011-08-17 12:56:22 -0700211 const uint32_t *sigList = ME->getExportForEachSignatureList();
Chris Wailesa6681822014-07-11 15:15:46 -0700212 const uint32_t *inputCountList = ME->getExportForEachInputCountList();
Stephen Hines33f8fe22011-08-17 12:56:22 -0700213 for (size_t i = 0; i < ME->getExportForEachSignatureCount(); i++) {
David Gross33cda5c2015-01-30 11:41:19 -0800214 printf("exportForEachSignatureList[%zu]: %s - 0x%08x - %u\n", i, nameList[i],
Chris Wailesa6681822014-07-11 15:15:46 -0700215 sigList[i], inputCountList[i]);
Stephen Hines33f8fe22011-08-17 12:56:22 -0700216 }
Stephen Hines569986d2012-03-09 19:58:45 -0800217 printf("\n");
Stephen Hines33f8fe22011-08-17 12:56:22 -0700218
Matt Wala1895ac12015-07-16 15:34:29 -0700219 printf("exportReduceCount: %zu\n", ME->getExportReduceCount());
David Grossa48ea362016-06-02 14:46:55 -0700220 const bcinfo::MetadataExtractor::Reduce *reduceList = ME->getExportReduceList();
Matt Wala1895ac12015-07-16 15:34:29 -0700221 for (size_t i = 0; i < ME->getExportReduceCount(); i++) {
David Grossa48ea362016-06-02 14:46:55 -0700222 const bcinfo::MetadataExtractor::Reduce &reduce = reduceList[i];
223 printf("exportReduceList[%zu]: %s - 0x%08x - %u - %u\n", i, reduce.mReduceName,
224 reduce.mSignature, reduce.mInputCount, reduce.mAccumulatorDataSize);
225 dumpReduceInfo(stdout, "initializer", reduce.mInitializerName);
226 dumpReduceInfo(stdout, "accumulator", reduce.mAccumulatorName);
227 dumpReduceInfo(stdout, "combiner", reduce.mCombinerName);
228 dumpReduceInfo(stdout, "outconverter", reduce.mOutConverterName);
229 dumpReduceInfo(stdout, "halter", reduce.mHalterName);
David Gross79e1a052016-01-11 14:42:51 -0800230 }
231 printf("\n");
232
Stephen Hines4cb4c552014-11-06 15:36:35 -0800233 printf("pragmaCount: %zu\n", ME->getPragmaCount());
Stephen Hines932bc6e2011-07-27 16:26:26 -0700234 const char **keyList = ME->getPragmaKeyList();
235 const char **valueList = ME->getPragmaValueList();
236 for (size_t i = 0; i < ME->getPragmaCount(); i++) {
Stephen Hines4cb4c552014-11-06 15:36:35 -0800237 printf("pragma[%zu]: %s - %s\n", i, keyList[i], valueList[i]);
Stephen Hines932bc6e2011-07-27 16:26:26 -0700238 }
Stephen Hines569986d2012-03-09 19:58:45 -0800239 printf("\n");
Stephen Hines932bc6e2011-07-27 16:26:26 -0700240
Stephen Hines4cb4c552014-11-06 15:36:35 -0800241 printf("objectSlotCount: %zu\n", ME->getObjectSlotCount());
Stephen Hines932bc6e2011-07-27 16:26:26 -0700242 const uint32_t *slotList = ME->getObjectSlotList();
243 for (size_t i = 0; i < ME->getObjectSlotCount(); i++) {
Stephen Hines4cb4c552014-11-06 15:36:35 -0800244 printf("objectSlotList[%zu]: %u\n", i, slotList[i]);
Stephen Hines932bc6e2011-07-27 16:26:26 -0700245 }
Stephen Hines569986d2012-03-09 19:58:45 -0800246 printf("\n");
Stephen Hines932bc6e2011-07-27 16:26:26 -0700247
248 return;
249}
250
251
252static size_t readBitcode(const char **bitcode) {
Stephen Hinese126b622012-05-31 18:41:40 -0700253 if (!inFile.length()) {
Stephen Hines932bc6e2011-07-27 16:26:26 -0700254 fprintf(stderr, "input file required\n");
Stephen Hinese126b622012-05-31 18:41:40 -0700255 return 0;
Stephen Hines932bc6e2011-07-27 16:26:26 -0700256 }
257
258 struct stat statInFile;
Stephen Hinese126b622012-05-31 18:41:40 -0700259 if (stat(inFile.c_str(), &statInFile) < 0) {
Stephen Hines932bc6e2011-07-27 16:26:26 -0700260 fprintf(stderr, "Unable to stat input file: %s\n", strerror(errno));
Stephen Hinese126b622012-05-31 18:41:40 -0700261 return 0;
Stephen Hines932bc6e2011-07-27 16:26:26 -0700262 }
263
264 if (!S_ISREG(statInFile.st_mode)) {
265 fprintf(stderr, "Input file should be a regular file.\n");
Stephen Hinese126b622012-05-31 18:41:40 -0700266 return 0;
Stephen Hines932bc6e2011-07-27 16:26:26 -0700267 }
268
Stephen Hinese126b622012-05-31 18:41:40 -0700269 FILE *in = fopen(inFile.c_str(), "r");
Stephen Hines932bc6e2011-07-27 16:26:26 -0700270 if (!in) {
Stephen Hinese126b622012-05-31 18:41:40 -0700271 fprintf(stderr, "Could not open input file %s\n", inFile.c_str());
272 return 0;
Stephen Hines932bc6e2011-07-27 16:26:26 -0700273 }
274
275 size_t bitcodeSize = statInFile.st_size;
276
277 *bitcode = (const char*) calloc(1, bitcodeSize + 1);
278 size_t nread = fread((void*) *bitcode, 1, bitcodeSize, in);
279
280 if (nread != bitcodeSize)
Stephen Hinese126b622012-05-31 18:41:40 -0700281 fprintf(stderr, "Could not read all of file %s\n", inFile.c_str());
Stephen Hines932bc6e2011-07-27 16:26:26 -0700282
283 fclose(in);
284 return nread;
285}
286
287
288static void releaseBitcode(const char **bitcode) {
289 if (bitcode && *bitcode) {
290 free((void*) *bitcode);
Chris Wailes900c6c12014-08-13 15:40:00 -0700291 *bitcode = nullptr;
Stephen Hines932bc6e2011-07-27 16:26:26 -0700292 }
293 return;
294}
295
296
297int main(int argc, char** argv) {
298 if(!parseOption(argc, argv)) {
299 fprintf(stderr, "failed to parse option\n");
300 return 1;
301 }
302
Chris Wailes900c6c12014-08-13 15:40:00 -0700303 const char *bitcode = nullptr;
Stephen Hines932bc6e2011-07-27 16:26:26 -0700304 size_t bitcodeSize = readBitcode(&bitcode);
305
Stephen Hines04261e02012-01-21 17:11:22 -0800306 unsigned int version = 0;
Stephen Hines932bc6e2011-07-27 16:26:26 -0700307
Stephen Hines04261e02012-01-21 17:11:22 -0800308 bcinfo::BitcodeWrapper bcWrapper((const char *)bitcode, bitcodeSize);
Stephen Hines04261e02012-01-21 17:11:22 -0800309 if (bcWrapper.getBCFileType() == bcinfo::BC_WRAPPER) {
310 version = bcWrapper.getTargetAPI();
Stephen Hines3ffc8332012-08-28 17:23:47 -0700311 if (verbose) {
312 printf("Found bitcodeWrapper\n");
313 }
Stephen Hines04261e02012-01-21 17:11:22 -0800314 } else if (translateFlag) {
Stephen Hines932bc6e2011-07-27 16:26:26 -0700315 version = 12;
316 }
317
Stephen Hines3ffc8332012-08-28 17:23:47 -0700318 if (verbose) {
319 printf("targetAPI: %u\n", version);
320 printf("compilerVersion: %u\n", bcWrapper.getCompilerVersion());
321 printf("optimizationLevel: %u\n\n", bcWrapper.getOptimizationLevel());
322 }
Stephen Hines04261e02012-01-21 17:11:22 -0800323
Stephen Hinesd0993af2014-07-15 16:49:25 -0700324 std::unique_ptr<bcinfo::BitcodeTranslator> BT;
Stephen Hinese126b622012-05-31 18:41:40 -0700325 BT.reset(new bcinfo::BitcodeTranslator(bitcode, bitcodeSize, version));
Stephen Hines932bc6e2011-07-27 16:26:26 -0700326 if (!BT->translate()) {
327 fprintf(stderr, "failed to translate bitcode\n");
Stephen Hines04261e02012-01-21 17:11:22 -0800328 return 3;
Stephen Hines932bc6e2011-07-27 16:26:26 -0700329 }
330
Stephen Hinesd0993af2014-07-15 16:49:25 -0700331 std::unique_ptr<bcinfo::MetadataExtractor> ME;
Stephen Hinese126b622012-05-31 18:41:40 -0700332 ME.reset(new bcinfo::MetadataExtractor(BT->getTranslatedBitcode(),
333 BT->getTranslatedBitcodeSize()));
Stephen Hines932bc6e2011-07-27 16:26:26 -0700334 if (!ME->extract()) {
335 fprintf(stderr, "failed to get metadata\n");
Stephen Hines04261e02012-01-21 17:11:22 -0800336 return 4;
Stephen Hines932bc6e2011-07-27 16:26:26 -0700337 }
338
Stephen Hines3ffc8332012-08-28 17:23:47 -0700339 if (verbose) {
340 dumpMetadata(ME.get());
Stephen Hines932bc6e2011-07-27 16:26:26 -0700341
Stephen Hines3ffc8332012-08-28 17:23:47 -0700342 const char *translatedBitcode = BT->getTranslatedBitcode();
343 size_t translatedBitcodeSize = BT->getTranslatedBitcodeSize();
Stephen Hinese126b622012-05-31 18:41:40 -0700344
Stephen Hines3ffc8332012-08-28 17:23:47 -0700345 llvm::LLVMContext &ctx = llvm::getGlobalContext();
346 llvm::llvm_shutdown_obj called_on_exit;
Stephen Hinese126b622012-05-31 18:41:40 -0700347
Stephen Hinesd0993af2014-07-15 16:49:25 -0700348 std::unique_ptr<llvm::MemoryBuffer> mem;
Stephen Hinese126b622012-05-31 18:41:40 -0700349
Stephen Hines57936132014-11-25 17:54:59 -0800350 mem = llvm::MemoryBuffer::getMemBuffer(
Stephen Hines3ffc8332012-08-28 17:23:47 -0700351 llvm::StringRef(translatedBitcode, translatedBitcodeSize),
Stephen Hines57936132014-11-25 17:54:59 -0800352 inFile.c_str(), false);
Stephen Hinese126b622012-05-31 18:41:40 -0700353
Stephen Hinesd0993af2014-07-15 16:49:25 -0700354 std::unique_ptr<llvm::Module> module;
Pirama Arumuga Nainar8e908932016-03-06 23:05:45 -0800355 llvm::ErrorOr<std::unique_ptr<llvm::Module> > moduleOrError =
356 llvm::parseBitcodeFile(mem.get()->getMemBufferRef(), ctx);
Stephen Hinesd0993af2014-07-15 16:49:25 -0700357 std::error_code ec = moduleOrError.getError();
Tim Murrayc2074ca2014-04-08 15:39:08 -0700358 if (!ec) {
Pirama Arumuga Nainar8e908932016-03-06 23:05:45 -0800359 module = std::move(moduleOrError.get());
360 ec = module->materializeAll();
Stephen Hinese126b622012-05-31 18:41:40 -0700361 }
Tim Murrayc2074ca2014-04-08 15:39:08 -0700362 std::string errmsg;
363 if (ec) {
364 errmsg = ec.message();
365 module.reset();
Stephen Hines3ffc8332012-08-28 17:23:47 -0700366 if (errmsg.size()) {
367 fprintf(stderr, "error: %s\n", errmsg.c_str());
368 } else {
369 fprintf(stderr, "error: failed to parse bitcode file\n");
370 }
371 return 5;
372 }
373
Stephen Hinesd0993af2014-07-15 16:49:25 -0700374 std::unique_ptr<llvm::tool_output_file> tof(
Stephen Hines57936132014-11-25 17:54:59 -0800375 new llvm::tool_output_file(outFile.c_str(), ec,
Tim Murrayc2074ca2014-04-08 15:39:08 -0700376 llvm::sys::fs::F_None));
Stephen Hinesd0993af2014-07-15 16:49:25 -0700377 std::unique_ptr<llvm::AssemblyAnnotationWriter> ann;
Stephen Hines3ffc8332012-08-28 17:23:47 -0700378 module->print(tof->os(), ann.get());
379
380 tof->keep();
Stephen Hinese126b622012-05-31 18:41:40 -0700381 }
382
Stephen Hines3ffc8332012-08-28 17:23:47 -0700383 if (infoFlag) {
384 if (dumpInfo(ME.get()) != 0) {
385 fprintf(stderr, "Error dumping info file\n");
386 return 6;
387 }
388 }
Stephen Hines932bc6e2011-07-27 16:26:26 -0700389
390 releaseBitcode(&bitcode);
391
392 return 0;
393}