This is an archive of the discontinued LLVM Phabricator instance.

[ELF] - Versionscript: support wildcards for extern "c++" tag.
ClosedPublic

Authored by grimar on Aug 23 2016, 2:23 AM.

Details

Summary

Previously for extern keyword only names in quotes (exact match) was supported.
Patch adds support for wildcards, so next scripts can be handled properly:

LIBSAMPLE_1.0 {
   global:            
     extern "C++" {  
       foo*;   
   };                  
 };

Diff Detail

Repository
rL LLVM

Event Timeline

grimar updated this revision to Diff 68960.Aug 23 2016, 2:23 AM
grimar retitled this revision from to [ELF] - Versionscript: support wildcards for extern "c++" tag..
grimar updated this object.
grimar added reviewers: ruiu, rafael.
grimar updated this object.
grimar added subscribers: llvm-commits, grimar, evgeny777, emaste.
ruiu added inline comments.Aug 23 2016, 11:28 PM
ELF/SymbolTable.cpp
609–610 ↗(On Diff #68960)

Why did you move this inside this function?

grimar added inline comments.Aug 23 2016, 11:36 PM
ELF/SymbolTable.cpp
609–610 ↗(On Diff #68960)

Idea was to make
std::map<std::string, SymbolBody *> Demangled to be const.

This change allows to have one-line initialization below then:

const std::map<std::string, SymbolBody *> Demangled = getDemangledSyms();

Instead of something like:

const std::map<std::string, SymbolBody *> Demangled =
    hasExternCpp() ? getDemangledSyms()
                   : std::map<std::string, SymbolBody *>();
grimar added inline comments.Aug 24 2016, 2:28 AM
ELF/SymbolTable.cpp
609–610 ↗(On Diff #68960)

And actually his change is relative to D23793, this patch depends on it.

grimar updated this revision to Diff 69218.Aug 25 2016, 2:43 AM
  • Updated.
ruiu accepted this revision.Aug 29 2016, 4:20 PM
ruiu edited edge metadata.

LGTM

ELF/SymbolTable.cpp
680 ↗(On Diff #69218)
if (!hasWildcard(Sym.Name))
  continue;
This revision is now accepted and ready to land.Aug 29 2016, 4:20 PM
This revision was automatically updated to reflect the committed changes.
grimar added inline comments.Aug 30 2016, 2:48 AM
ELF/SymbolTable.cpp
680 ↗(On Diff #69218)

Done in r280068.