1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 19:52:54 +01:00

Fix some accidental global initializers by using StringLiteral instead of StringRef

llvm-svn: 369850
This commit is contained in:
Benjamin Kramer 2019-08-24 15:24:25 +00:00
parent 3622195dfc
commit f29a7ec8d3
3 changed files with 7 additions and 6 deletions

View File

@ -48,7 +48,7 @@ class TargetLibraryInfoImpl {
unsigned char AvailableArray[(NumLibFuncs+3)/4];
llvm::DenseMap<unsigned, std::string> CustomNames;
static StringRef const StandardNames[NumLibFuncs];
static StringLiteral const StandardNames[NumLibFuncs];
bool ShouldExtI32Param, ShouldExtI32Return, ShouldSignExtI32Param;
enum AvailabilityState {

View File

@ -28,7 +28,8 @@ static cl::opt<TargetLibraryInfoImpl::VectorLibrary> ClVectorLibrary(
clEnumValN(TargetLibraryInfoImpl::SVML, "SVML",
"Intel SVML library")));
StringRef const TargetLibraryInfoImpl::StandardNames[LibFunc::NumLibFuncs] = {
StringLiteral const TargetLibraryInfoImpl::StandardNames[LibFunc::NumLibFuncs] =
{
#define TLI_DEFINE_STRING
#include "llvm/Analysis/TargetLibraryInfo.def"
};
@ -65,7 +66,7 @@ static bool hasBcmp(const Triple &TT) {
/// target triple. This should be carefully written so that a missing target
/// triple gets a sane set of defaults.
static void initialize(TargetLibraryInfoImpl &TLI, const Triple &T,
ArrayRef<StringRef> StandardNames) {
ArrayRef<StringLiteral> StandardNames) {
// Verify that the StandardNames array is in alphabetical order.
assert(std::is_sorted(StandardNames.begin(), StandardNames.end(),
[](StringRef LHS, StringRef RHS) {

View File

@ -55,7 +55,7 @@ enum EManglingParam {
};
struct ManglingRule {
StringRef const Name;
StringLiteral const Name;
unsigned char Lead[2];
unsigned char Param[5];
@ -133,8 +133,8 @@ unsigned ManglingRule::getNumArgs() const {
// E_ANY - use prev lead type, E_CONSTPTR_ANY - make const pointer out of
// prev lead type, etc. see ParamIterator::getNextParam() for details.
static const ManglingRule manglingRules[] = {
{ StringRef(), {0}, {0} },
static constexpr ManglingRule manglingRules[] = {
{ "", {0}, {0} },
{ "abs" , {1}, {E_ANY}},
{ "abs_diff" , {1}, {E_ANY,E_COPY}},
{ "acos" , {1}, {E_ANY}},