Skip to content

Pin coverage tool using outdated C++ namespace #162

@kauwua

Description

@kauwua

Hi,

While compiling the Pin coverage tool in https://github.com/gaasedelen/lighthouse/tree/562595be9bd99e8a5dfef6017d608467f5706630/coverage/pin using the latest Pin version (4.0), I was met with the following errors:

CodeCoverage.cpp:21:28: error: ‘tr1’ in namespace ‘std’ does not name a type
   21 | using unordered_set = std::tr1::unordered_set<V>;
      |                            ^~~
CodeCoverage.cpp:24:28: error: ‘tr1’ in namespace ‘std’ does not name a type
   24 | using unordered_map = std::tr1::unordered_map<K, V>;

std::tr1 seems to be an old C++ namespace used for functionalities proposed in the C++ Technical Report 1, a lot of which were later integrated in C++11 (from what I read). The comments indicate std::tr1 was used because of Pin using an old standard lib but it seems to have been fixed.

In any case, replacing std::tr1 by std:: solved the issue and I was able to use the coverage tool on a fairly large program (on amd64 Linux).

I'm proposing this MR #161 which removes the unordered_set and unordered_map aliases, as unordered_set is unused and std::unordered_map works. It should be tested on MacOS and Windows as well however, and I'm wondering if compatiblity with older Pin versions is important (std::tr1 could be used for specific versions only).

Best,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions