summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2016-09-19 13:33:38 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2016-09-19 13:33:38 +0000
commitf135f0ec1daa7779a7bcc49f232165d1f09f3fdc (patch)
tree022d1264b25a47700a180f43ddb2735337d7ce01
parentb31dd37005f51330658b56c0c17eef14ca974125 (diff)
downloadbcm5719-llvm-f135f0ec1daa7779a7bcc49f232165d1f09f3fdc.tar.gz
bcm5719-llvm-f135f0ec1daa7779a7bcc49f232165d1f09f3fdc.zip
Remove unnecessary const_canst. NFC.
llvm-svn: 281901
-rw-r--r--lld/ELF/LinkerScript.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp
index 7a326c4b6bb..e4f8378417c 100644
--- a/lld/ELF/LinkerScript.cpp
+++ b/lld/ELF/LinkerScript.cpp
@@ -109,12 +109,6 @@ bool LinkerScript<ELFT>::shouldKeep(InputSectionBase<ELFT> *S) {
return false;
}
-// We need to use const_cast because match() is not a const function.
-// This function encapsulates that ugliness.
-static bool match(const Regex &Re, StringRef S) {
- return const_cast<Regex &>(Re).match(S);
-}
-
static bool comparePriority(InputSectionData *A, InputSectionData *B) {
return getPriority(A->Name) < getPriority(B->Name);
}
@@ -170,13 +164,13 @@ void LinkerScript<ELFT>::computeInputSections(InputSectionDescription *I) {
for (SectionPattern &Pat : I->SectionPatterns) {
for (ObjectFile<ELFT> *F : Symtab<ELFT>::X->getObjectFiles()) {
StringRef Filename = sys::path::filename(F->getName());
- if (!match(I->FileRe, Filename) || match(Pat.ExcludedFileRe, Filename))
+ if (!I->FileRe.match(Filename) || Pat.ExcludedFileRe.match(Filename))
continue;
for (InputSectionBase<ELFT> *S : F->getSections())
- if (!isDiscarded(S) && !S->OutSec && match(Pat.SectionRe, S->Name))
+ if (!isDiscarded(S) && !S->OutSec && Pat.SectionRe.match(S->Name))
I->Sections.push_back(S);
- if (match(Pat.SectionRe, "COMMON"))
+ if (Pat.SectionRe.match("COMMON"))
I->Sections.push_back(CommonInputSection<ELFT>::X);
}
}
OpenPOWER on IntegriCloud