mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-05 02:07:16 +00:00
Mark some static arrays as const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157377 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c5ce4d1d52
commit
e329810482
@ -32,7 +32,7 @@ namespace {
|
||||
Unknown
|
||||
};
|
||||
|
||||
static const char* DepTypeStr[];
|
||||
static const char *const DepTypeStr[];
|
||||
|
||||
typedef PointerIntPair<const Instruction *, 2, DepType> InstTypePair;
|
||||
typedef std::pair<InstTypePair, const BasicBlock *> Dep;
|
||||
@ -88,7 +88,7 @@ FunctionPass *llvm::createMemDepPrinter() {
|
||||
return new MemDepPrinter();
|
||||
}
|
||||
|
||||
const char* MemDepPrinter::DepTypeStr[]
|
||||
const char *const MemDepPrinter::DepTypeStr[]
|
||||
= {"Clobber", "Def", "NonFuncLocal", "Unknown"};
|
||||
|
||||
bool MemDepPrinter::runOnFunction(Function &F) {
|
||||
|
@ -2364,7 +2364,7 @@ static bool BURRSort(SUnit *left, SUnit *right, RegReductionPQBase *SPQ) {
|
||||
bool RHasPhysReg = right->hasPhysRegDefs;
|
||||
if (LHasPhysReg != RHasPhysReg) {
|
||||
#ifndef NDEBUG
|
||||
const char *PhysRegMsg[] = {" has no physreg", " defines a physreg"};
|
||||
const char *const PhysRegMsg[] = {" has no physreg"," defines a physreg"};
|
||||
#endif
|
||||
DEBUG(dbgs() << " SU (" << left->NodeNum << ") "
|
||||
<< PhysRegMsg[LHasPhysReg] << " SU(" << right->NodeNum << ") "
|
||||
|
@ -44,7 +44,7 @@ struct TripleMap {
|
||||
const char *String;
|
||||
};
|
||||
|
||||
static struct TripleMap triplemap[] = {
|
||||
static const struct TripleMap triplemap[] = {
|
||||
{ Triple::x86, "i386-unknown-unknown" },
|
||||
{ Triple::x86_64, "x86_64-unknown-unknown" },
|
||||
{ Triple::arm, "arm-unknown-unknown" },
|
||||
|
@ -60,11 +60,11 @@ static const ArchiveMemberHeader *ToHeader(const char *base) {
|
||||
|
||||
|
||||
static bool isInternalMember(const ArchiveMemberHeader &amh) {
|
||||
const char *internals[] = {
|
||||
static const char *const internals[] = {
|
||||
"/",
|
||||
"//",
|
||||
"#_LLVM_SYM_TAB_#"
|
||||
};
|
||||
};
|
||||
|
||||
StringRef name = amh.getName();
|
||||
for (std::size_t i = 0; i < sizeof(internals) / sizeof(*internals); ++i) {
|
||||
|
@ -788,7 +788,7 @@ error_code MachOObjectFile::getRelocationTypeName(DataRefImpl Rel,
|
||||
|
||||
switch (Arch) {
|
||||
case Triple::x86: {
|
||||
const char* Table[] = {
|
||||
static const char *const Table[] = {
|
||||
"GENERIC_RELOC_VANILLA",
|
||||
"GENERIC_RELOC_PAIR",
|
||||
"GENERIC_RELOC_SECTDIFF",
|
||||
@ -803,7 +803,7 @@ error_code MachOObjectFile::getRelocationTypeName(DataRefImpl Rel,
|
||||
break;
|
||||
}
|
||||
case Triple::x86_64: {
|
||||
const char* Table[] = {
|
||||
static const char *const Table[] = {
|
||||
"X86_64_RELOC_UNSIGNED",
|
||||
"X86_64_RELOC_SIGNED",
|
||||
"X86_64_RELOC_BRANCH",
|
||||
@ -822,7 +822,7 @@ error_code MachOObjectFile::getRelocationTypeName(DataRefImpl Rel,
|
||||
break;
|
||||
}
|
||||
case Triple::arm: {
|
||||
const char* Table[] = {
|
||||
static const char *const Table[] = {
|
||||
"ARM_RELOC_VANILLA",
|
||||
"ARM_RELOC_PAIR",
|
||||
"ARM_RELOC_SECTDIFF",
|
||||
@ -841,7 +841,7 @@ error_code MachOObjectFile::getRelocationTypeName(DataRefImpl Rel,
|
||||
break;
|
||||
}
|
||||
case Triple::ppc: {
|
||||
const char* Table[] = {
|
||||
static const char *const Table[] = {
|
||||
"PPC_RELOC_VANILLA",
|
||||
"PPC_RELOC_PAIR",
|
||||
"PPC_RELOC_BR14",
|
||||
|
Loading…
Reference in New Issue
Block a user