[cfe-dev] PCHReader: FileIDs in ParseLineTable()

Douglas Gregor dgregor at apple.com
Fri May 22 10:53:55 PDT 2009


On May 22, 2009, at 2:00 AM, Zhongxing Xu wrote:
> The FileIDs in ParseLineTable() of PCHReader.cpp probably is not
> needed, since we emit filenames in their ID order, and read filenames
> in the same order. The file IDs remains unchanged. In practice we are
> always creating identity mapping from x to x.


I actually did think about this when I added the FileIDs map, and it  
was that "probably" that made me write it this way. I'm fairly certain  
that we don't need the map. However, since #line directives are so  
rare in headers, and the failure mode is likely to be weird--- 
diagnostics showing up in the wrong place---I decided that it was  
better to be defensive here, since it won't cost us much. Plus, if we  
ever get to the point of loading multiple PCH (or PCH-like) files,  
we'll need this map.

	- Doug



More information about the cfe-dev mailing list