Currently, we assign common symbols an internal input file and store the original input in CommonELFSection::Origin. We then use CommonELFSection::getOrigin for rule-matching, printing the filename in the diagnostics, and so on. Instead of creating a new member function in CommonELFSection and adding an if-condition on every path which requires the input filename of the section, we can reuse the already existing virtual function in the base class ELFSection, getOldInputFile, and use this instead for retrieving the original input file of the CommonELFSections. Wen can (and should) reuse getOldInputFile because it follows the same/similar semantics as of CommonELFSection::getOrigin. For example, old input file must be used for rule-matching and printing the input file name in the diagnostics.
Currently, we assign common symbols an internal input file and store the original input in
CommonELFSection::Origin. We then useCommonELFSection::getOriginfor rule-matching, printing the filename in the diagnostics, and so on. Instead of creating a new member function inCommonELFSectionand adding an if-condition on every path which requires the input filename of the section, we can reuse the already existing virtual function in the base classELFSection,getOldInputFile, and use this instead for retrieving the original input file of theCommonELFSections. Wen can (and should) reusegetOldInputFilebecause it follows the same/similar semantics as ofCommonELFSection::getOrigin. For example, old input file must be used for rule-matching and printing the input file name in the diagnostics.