[llvm] r369850 - Fix some accidental global initializers by using StringLiteral instead of StringRef
Benjamin Kramer via llvm-commits
llvm-commits at lists.llvm.org
Sat Aug 24 08:24:25 PDT 2019
Author: d0k
Date: Sat Aug 24 08:24:25 2019
New Revision: 369850
URL: http://llvm.org/viewvc/llvm-project?rev=369850&view=rev
Log:
Fix some accidental global initializers by using StringLiteral instead of StringRef
Modified:
llvm/trunk/include/llvm/Analysis/TargetLibraryInfo.h
llvm/trunk/lib/Analysis/TargetLibraryInfo.cpp
llvm/trunk/lib/Target/AMDGPU/AMDGPULibFunc.cpp
Modified: llvm/trunk/include/llvm/Analysis/TargetLibraryInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/TargetLibraryInfo.h?rev=369850&r1=369849&r2=369850&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/TargetLibraryInfo.h (original)
+++ llvm/trunk/include/llvm/Analysis/TargetLibraryInfo.h Sat Aug 24 08:24:25 2019
@@ -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 {
Modified: llvm/trunk/lib/Analysis/TargetLibraryInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/TargetLibraryInfo.cpp?rev=369850&r1=369849&r2=369850&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/TargetLibraryInfo.cpp (original)
+++ llvm/trunk/lib/Analysis/TargetLibraryInfo.cpp Sat Aug 24 08:24:25 2019
@@ -28,7 +28,8 @@ static cl::opt<TargetLibraryInfoImpl::Ve
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) {
Modified: llvm/trunk/lib/Target/AMDGPU/AMDGPULibFunc.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/AMDGPULibFunc.cpp?rev=369850&r1=369849&r2=369850&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/AMDGPULibFunc.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/AMDGPULibFunc.cpp Sat Aug 24 08:24:25 2019
@@ -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() cons
// 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}},
More information about the llvm-commits
mailing list