Skip to content

Commit

Permalink
[gold-plugin] - Fix compilation after LLVM update (r314883). NFC.
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314899 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
George Rimar committed Oct 4, 2017
1 parent c54be30 commit c7c50af
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions tools/gold/gold-plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -608,16 +608,11 @@ static std::string getThinLTOObjectFileName(StringRef Path, StringRef OldSuffix,
return NewNewPath;
}

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.
static bool isValidCIdentifier(StringRef S) {
return !S.empty() && isAlpha(S[0]) &&
std::all_of(S.begin() + 1, S.end(), isAlnum);
return !S.empty() && (isAlpha(S[0]) || S[0] == '_') &&
std::all_of(S.begin() + 1, S.end(),
[](char C) { return C == '_' || isAlnum(C); });
}

static void addModule(LTO &Lto, claimed_file &F, const void *View,
Expand Down

0 comments on commit c7c50af

Please sign in to comment.