[PATCH] D23768: [ELF] Linkerscript: eliminate LayoutInputSection

Eugene Leviant via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 22 06:57:21 PDT 2016


evgeny777 created this revision.
evgeny777 added a reviewer: ruiu.
evgeny777 added subscribers: grimar, ikudrin, llvm-commits.
evgeny777 set the repository for this revision to rL LLVM.
evgeny777 added a project: lld.

Current implementation of LayoutInputSection relies on LLVM-style casting to InputSection<ELFT>, which is not a base class for it. The following statements will be successfully compiled and executed:

```
InputSection<ELFT> *I = ...;
LayoutInputSection<ELFT> *L = cast<LayoutInputSection<ELFT>>(I);
```

And the following one cannot compile:

```
LayoutInputSection<ELFT> *L = static_cast<LayoutInputSection<ELFT> *>(I);
```

This patch eliminates LayoutInputSection by saving pointer to preceding input section in SymbolAssignment class.

Repository:
  rL LLVM

https://reviews.llvm.org/D23768

Files:
  ELF/InputSection.cpp
  ELF/InputSection.h
  ELF/LinkerScript.cpp
  ELF/LinkerScript.h
  ELF/OutputSections.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23768.68855.patch
Type: text/x-patch
Size: 11187 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160822/0c4f810b/attachment.bin>


More information about the llvm-commits mailing list