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

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 23 23:36:32 PDT 2016


grimar added inline comments.

================
Comment at: ELF/SymbolTable.cpp:609-610
@@ -600,2 +608,4 @@
   std::map<std::string, SymbolBody *> Result;
+  if (!hasExternCpp())
+    return Result;
   for (Symbol *Sym : SymVector) {
----------------
ruiu wrote:
> Why did you move this inside this function?
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 *>();
```


https://reviews.llvm.org/D23794





More information about the llvm-commits mailing list