summaryrefslogtreecommitdiffstats
path: root/lld/ELF/OutputSections.cpp
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2016-06-29 09:08:02 +0000
committerRui Ueyama <ruiu@google.com>2016-06-29 09:08:02 +0000
commitfbbde548cfcc25613c5f87928215fc73eff5e766 (patch)
tree61796b64e70a74bfe5cbc041b64eb910e23a7da2 /lld/ELF/OutputSections.cpp
parent9fc1d4ed7586afbe15bd29ffb08ac616f3e59ea8 (diff)
downloadbcm5719-llvm-fbbde548cfcc25613c5f87928215fc73eff5e766.tar.gz
bcm5719-llvm-fbbde548cfcc25613c5f87928215fc73eff5e766.zip
Move isValidCIdentifier to Strings.cpp.
llvm-svn: 274112
Diffstat (limited to 'lld/ELF/OutputSections.cpp')
-rw-r--r--lld/ELF/OutputSections.cpp13
1 files changed, 1 insertions, 12 deletions
diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp
index 4636b9990b0..4be8447391b 100644
--- a/lld/ELF/OutputSections.cpp
+++ b/lld/ELF/OutputSections.cpp
@@ -11,6 +11,7 @@
#include "Config.h"
#include "EhFrame.h"
#include "LinkerScript.h"
+#include "Strings.h"
#include "SymbolTable.h"
#include "Target.h"
#include "lld/Core/Parallel.h"
@@ -29,18 +30,6 @@ using namespace llvm::ELF;
using namespace lld;
using namespace lld::elf;
-static bool isAlpha(char C) {
- return ('a' <= C && C <= 'z') || ('A' <= C && C <= 'Z') || C == '_';
-}
-
-static bool isAlnum(char C) { return isAlpha(C) || ('0' <= C && C <= '9'); }
-
-// Returns true if S is valid as a C language identifier.
-bool elf::isValidCIdentifier(StringRef S) {
- return !S.empty() && isAlpha(S[0]) &&
- std::all_of(S.begin() + 1, S.end(), isAlnum);
-}
-
template <class ELFT>
OutputSectionBase<ELFT>::OutputSectionBase(StringRef Name, uint32_t Type,
uintX_t Flags)
OpenPOWER on IntegriCloud