[PATCH] Atoms generated by a pass should be owned by the generated file and not the pass itself.
kledzik at apple.com
kledzik at apple.com
Thu Dec 18 09:39:05 PST 2014
I see what you are trying to do, but it leaves the pass-generated atoms in an odd state. All the other atoms (from .o files) still have their file() method returning their original file. But the pass-generated atoms now have their file() return the temp mergedFile. When inspecting atoms in the Writer, it is nice to be able to see where they came from. This patch looses that.
Perhaps we can change Pass::perform() to return a std::unique_ptr<File> which is the owning file of any atoms generated during the pass. And the PassManager owns those Files even it it deletes the pass objects.
Also, I see this same pattern in other Passes. It is not mach-o specific.
REPOSITORY
rL LLVM
http://reviews.llvm.org/D6719
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the llvm-commits
mailing list