/** * @brief Shutdown the port library and thread library * * Shutdown should only happen after all tests that derive from the JitTest * fixture have finished executing. */ static void shutdownPortLib() { PortLib.port_shutdown_library(&PortLib); omrthread_shutdown_library(); }
int main(int argc, char *argv[]) { omrthread_attach(NULL); OMRPortLibrary portLibrary; omrport_init_library(&portLibrary, sizeof(portLibrary)); DDR_RC rc = DDR_RC_OK; /* Get options. */ const char *macroFile = "src/macros/test/macroList"; const char *supersetFile = "superset.out"; const char *blobFile = "blob.dat"; const char *overrideFile = NULL; vector<string> debugFiles; rc = getOptions(&portLibrary, argc, argv, ¯oFile, &supersetFile, &blobFile, &overrideFile, &debugFiles); /* Create IR from input. */ #if defined(_MSC_VER) PdbScanner scanner; #else /* defined(_MSC_VER) */ DwarfScanner scanner; #endif /* defined(_MSC_VER) */ Symbol_IR ir; if ((DDR_RC_OK == rc) && !debugFiles.empty()) { rc = scanner.startScan(&portLibrary, &ir, &debugFiles); } /* Compute field offsets for UDTs. */ if (DDR_RC_OK == rc) { rc = ir.computeOffsets(); } /* Remove duplicate types. */ if (DDR_RC_OK == rc) { rc = ir.removeDuplicates(); } MacroTool macroTool; /* Read macros. */ if ((DDR_RC_OK == rc) && (NULL != macroFile)) { rc = macroTool.getMacros(macroFile); } /* Add Macros to IR. */ if (DDR_RC_OK == rc) { rc = macroTool.addMacrosToIR(&ir); } /* Apply Type Overrides; must be after scanning and loading macros. */ if ((DDR_RC_OK == rc) && (NULL != overrideFile)) { rc = ir.applyOverrideList(&portLibrary, overrideFile); } /* Generate output. */ if ((DDR_RC_OK == rc) && !ir._types.empty()) { rc = genBlob(&portLibrary, &ir, supersetFile, blobFile); } portLibrary.port_shutdown_library(&portLibrary); omrthread_detach(NULL); omrthread_shutdown_library(); return 0; }