Commit Graph

14 Commits

Author SHA1 Message Date
Rui Ueyama 5bed6388df Simplify ScriptParser.
- Rename currentBuffer -> getCurrentMB to start it with verb.
 - Simplify containsString.
 - Add llvm_unreachable at end of getCurrentMB.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@288310 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-01 04:36:54 +00:00
Rui Ueyama 49c036c231 Make get{Line,Column}Number members of StringParser.
This patch also renames currentLocation getCurrentLocation.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@288308 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-01 04:36:49 +00:00
Eugene Leviant bbd5d323bf [ELF] Print file:line for 'undefined section' errors
Differential revision: https://reviews.llvm.org/D27108


git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@288019 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-28 09:58:04 +00:00
Eugene Leviant 91d98a530b [ELF] Better error reporting for linker scripts
Differential revision: https://reviews.llvm.org/D26795


git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@287547 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-21 15:49:56 +00:00
Rui Ueyama 2113acd799 Rename skip(StringRef) -> consume(StringRef).
skip() and skip(StringRef) were overloaded functions that
have different semantics. This patch rename one of the functions
to avoid function overloading.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@284396 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-17 16:01:53 +00:00
Justin Bogner a2529b657d ELF: Add a skip() overload to ignore any token
Most functions that return StringRef should check their return values,
so I'm planning on marking StringRef [[nodiscard]]. This requires
splitting up functions like next() that are sometimes just used for
side effects.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@284363 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-17 06:21:13 +00:00
Rui Ueyama a78bbfb761 Remove dead ctor.
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@277255 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-30 00:13:30 +00:00
Rui Ueyama 918a54e2b2 Create Strings.cpp and move string manipulation functions to that file.
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@274109 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-29 08:01:32 +00:00
Benjamin Kramer 3f3311607e Apply clang-tidy's misc-move-constructor-init to lld.
No functionality change intended.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@271686 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-03 16:57:13 +00:00
Rui Ueyama 1a85e79a99 Add explicit.
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@269703 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-16 21:06:31 +00:00
Rui Ueyama 1b66b9a608 Use ScriptParserBase features to parse linker script expressions.
Previously, we have re-implemented utility functions such as `expect`
or `next` in LinkerScript.cpp. This patch reuses the existing
implementation that is in ScriptParser.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@267255 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-23 00:04:03 +00:00
Rui Ueyama e2c9a4e76f Devirtualize ScriptParserBase. NFC.
ScriptParserBase class is a container of collection of various methods
to parse linker script-ish text. It had a virtual method `run` to run
the parser. But we don't have to enforce its descendents to implement
that. It's up to them.

This patch removes pure virtual function `run`.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@267246 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-22 22:59:24 +00:00
Adhemerval Zanella 9b352efa3c [lld] Fix build failure from r265600
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@265603 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-06 21:33:18 +00:00
Adhemerval Zanella 646a64159f [lld] [ELF] Add ScriptParserBase class
This patch add a base script tokenizer class to decouple parsing from
linker script handling.  The idea is to use this base class on dynamic
list parsing (--dynamic-list option). No functionality added.


git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@265600 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-06 20:59:11 +00:00