This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [v3] RFC make check-abi, round 2


> all ok. I think this is ready to be checked in, but I'll give a 24
> hour comment period.

Looks good here.  My only two comments at present can be addressed after
checkin:


> + const char*
> + demangle(const std::string& mangled)
> + {
> +   const char* name;
> +   if (mangled.find("_Z") == std::string::npos)
> +     {
> +       // This is not a mangled symbol, thus has "C" linkage.

Rather than searching the whole string in the "C" linkage case for a
sequence we know will never be there, we could just

    if (mangled[0] != '_' && mangled[1] != 'Z')
        // not mangled, etc

On a modern processor, this could save us as much as 2 nanoseconds.  :-)


> +   const char quote = '"';
> +   const char bslash = '\\';
> +   ostringstream cmd;
> +   cmd << "readelf -s -W " << test_lib << " | sed '/" << bslash 
> +       << ".dynsym/,/^$/p;d' | egrep -v ' (LOCAL|UND) ' | "
> +       << "awk '{ if ($4 == " << quote << "FUNC" << quote << "|| $4 == " 
> +       << quote << "NOTYPE" << quote << ") printf " << quote << "%s:%s"
> +       << bslash << "n" << quote << ", $4, $8; else if ($4 == " 
> +       << quote << "OBJECT" << quote << ") printf " << quote
> +       << "%s:%s:%s" << bslash << "n" << quote << ", $4, $3, $8;}' | "
> +       << "sort >& " << test_file;

My eyes are bleeding.  I'm almost sorry I suggested system() now; no idea
it would be that much hassle to write.  You're a more tolerant man than I.

As penance, I'll write the equivalent constant string literal and see if
it's any more readable/portable/maintainable.  If it is, I'll patch it
after checkin.


Phil

-- 
I would therefore like to posit that computing's central challenge, viz. "How
not to make a mess of it," has /not/ been met.
                                                 - Edsger Dijkstra, 1930-2002


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]