* Cleanup.

This commit is contained in:
Eelco Dolstra 2004-06-08 13:21:03 +00:00
parent e8411948ff
commit 1bc6afefac

View file

@ -103,6 +103,12 @@ struct Goal
/* Referenceable paths (i.e., input and output paths). */ /* Referenceable paths (i.e., input and output paths). */
PathSet allPaths; PathSet allPaths;
/* The normal forms of the input store expressions. */
PathSet inputNFs;
/* The successor mappings for the input store expressions. */
map<Path, Path> inputSucs;
/* The process ID of the builder. */ /* The process ID of the builder. */
pid_t pid; pid_t pid;
@ -119,10 +125,6 @@ struct Goal
Pipe toHook; Pipe toHook;
Pipe fromHook; Pipe fromHook;
/* !!! clean up */
PathSet fnord;
map<Path, Path> xyzzy;
Goal(); Goal();
~Goal(); ~Goal();
@ -473,8 +475,8 @@ bool Normaliser::prepareBuild(Goal & goal)
checkInterrupt(); checkInterrupt();
Path nfPath = useSuccessor(*i); Path nfPath = useSuccessor(*i);
realiseClosure(nfPath); realiseClosure(nfPath);
goal.fnord.insert(nfPath); goal.inputNFs.insert(nfPath);
if (nfPath != *i) goal.xyzzy[*i] = nfPath; if (nfPath != *i) goal.inputSucs[*i] = nfPath;
/* !!! nfPath should be a root of the garbage collector while /* !!! nfPath should be a root of the garbage collector while
we are building */ we are building */
StoreExpr ne = storeExprFromPath(nfPath); StoreExpr ne = storeExprFromPath(nfPath);
@ -755,6 +757,11 @@ Normaliser::HookReply Normaliser::tryBuildHook(Goal & goal)
return rpAccept; return rpAccept;
} }
/* Write the information that the hook needs to perform the
build, i.e., the set of input paths (including closure
expressions), the set of output paths, and the successor
mappings for the input expressions. */
Path inputListFN = goal.tmpDir + "/inputs"; Path inputListFN = goal.tmpDir + "/inputs";
Path outputListFN = goal.tmpDir + "/outputs"; Path outputListFN = goal.tmpDir + "/outputs";
Path successorsListFN = goal.tmpDir + "/successors"; Path successorsListFN = goal.tmpDir + "/successors";
@ -763,8 +770,8 @@ Normaliser::HookReply Normaliser::tryBuildHook(Goal & goal)
for (ClosureElems::iterator i = goal.inClosures.begin(); for (ClosureElems::iterator i = goal.inClosures.begin();
i != goal.inClosures.end(); ++i) i != goal.inClosures.end(); ++i)
s += i->first + "\n"; s += i->first + "\n";
for (PathSet::iterator i = goal.fnord.begin(); for (PathSet::iterator i = goal.inputNFs.begin();
i != goal.fnord.end(); ++i) i != goal.inputNFs.end(); ++i)
s += *i + "\n"; s += *i + "\n";
writeStringToFile(inputListFN, s); writeStringToFile(inputListFN, s);
@ -775,8 +782,8 @@ Normaliser::HookReply Normaliser::tryBuildHook(Goal & goal)
writeStringToFile(outputListFN, s); writeStringToFile(outputListFN, s);
s = ""; s = "";
for (map<Path, Path>::iterator i = goal.xyzzy.begin(); for (map<Path, Path>::iterator i = goal.inputSucs.begin();
i != goal.xyzzy.end(); ++i) i != goal.inputSucs.end(); ++i)
s += i->first + " " + i->second + "\n"; s += i->first + " " + i->second + "\n";
writeStringToFile(successorsListFN, s); writeStringToFile(successorsListFN, s);