Merged xfBuild patch for dependency tree generation. See #286.

This commit is contained in:
Christian Kamm
2009-05-20 21:13:41 +02:00
parent 95c35225bb
commit 8e56fe69a4
5 changed files with 133 additions and 3 deletions

View File

@@ -143,7 +143,9 @@ int main(int argc, char** argv)
global.params.libfiles = new Array();
global.params.objfiles = new Array();
global.params.ddocfiles = new Array();
global.params.moduleDeps = NULL;
global.params.moduleDepsFile = NULL;
// Set predefined version identifiers
VersionCondition::addPredefinedGlobalIdent("LLVM");
@@ -222,6 +224,12 @@ int main(int argc, char** argv)
global.params.hdrdir || global.params.hdrname;
#endif
initFromString(global.params.moduleDepsFile, moduleDepsFile);
if (global.params.moduleDepsFile != NULL)
{
global.params.moduleDeps = new OutBuffer;
}
processVersions(debugArgs, "debug",
DebugCondition::setGlobalLevel,
DebugCondition::addGlobalIdent);
@@ -830,6 +838,17 @@ int main(int argc, char** argv)
if (global.errors)
fatal();
// write module dependencies to file if requested
if (global.params.moduleDepsFile != NULL)
{
assert (global.params.moduleDepsFile != NULL);
File deps(global.params.moduleDepsFile);
OutBuffer* ob = global.params.moduleDeps;
deps.setbuffer((void*)ob->data, ob->offset);
deps.write();
}
// collects llvm modules to be linked if singleobj is passed
std::vector<llvm::Module*> llvmModules;