summaryrefslogtreecommitdiffstats
path: root/lld/ELF/ScriptParser.cpp
diff options
context:
space:
mode:
authorEugene Leviant <eleviant@accesssoftek.com>2016-11-28 09:58:04 +0000
committerEugene Leviant <eleviant@accesssoftek.com>2016-11-28 09:58:04 +0000
commited30ce7ae43967dc26e4cecb4d377fa81f031d4d (patch)
tree79e2859ca3675afa4f5fbb1c158bfd42240ed432 /lld/ELF/ScriptParser.cpp
parent0f0d5d8f8d4c0b1d325822406cb1a94fff3bf105 (diff)
downloadbcm5719-llvm-ed30ce7ae43967dc26e4cecb4d377fa81f031d4d.tar.gz
bcm5719-llvm-ed30ce7ae43967dc26e4cecb4d377fa81f031d4d.zip
[ELF] Print file:line for 'undefined section' errors
Differential revision: https://reviews.llvm.org/D27108 llvm-svn: 288019
Diffstat (limited to 'lld/ELF/ScriptParser.cpp')
-rw-r--r--lld/ELF/ScriptParser.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lld/ELF/ScriptParser.cpp b/lld/ELF/ScriptParser.cpp
index 33c2f9095f1..fc0d233138e 100644
--- a/lld/ELF/ScriptParser.cpp
+++ b/lld/ELF/ScriptParser.cpp
@@ -172,6 +172,13 @@ void ScriptParserBase::expect(StringRef Expect) {
setError(Expect + " expected, but got " + Tok);
}
+std::string ScriptParserBase::currentLocation() {
+ MemoryBufferRef MB = currentBuffer();
+ return (MB.getBufferIdentifier() + ":" +
+ Twine(getPos(MB.getBuffer(), Tokens[Pos - 1]).first))
+ .str();
+}
+
// Returns true if string 'Bigger' contains string 'Shorter'.
static bool containsString(StringRef Bigger, StringRef Shorter) {
const char *BiggerEnd = Bigger.data() + Bigger.size();
OpenPOWER on IntegriCloud