A quick nm audit turned up several fixed tables and objects that were
marked read-write. Use const so that they can be allocated in a
read-only segment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48800 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/ARM/ARMTargetAsmInfo.cpp b/lib/Target/ARM/ARMTargetAsmInfo.cpp
index 3e7b69f..65947fb 100644
--- a/lib/Target/ARM/ARMTargetAsmInfo.cpp
+++ b/lib/Target/ARM/ARMTargetAsmInfo.cpp
@@ -17,7 +17,8 @@
#include <cctype>
using namespace llvm;
-static const char* arm_asm_table[] = {"{r0}", "r0",
+static const char *const arm_asm_table[] = {
+ "{r0}", "r0",
"{r1}", "r1",
"{r2}", "r2",
"{r3}", "r3",
diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp
index eb7d585..24ac8f9 100644
--- a/lib/Target/CBackend/CBackend.cpp
+++ b/lib/Target/CBackend/CBackend.cpp
@@ -2825,7 +2825,7 @@
assert(c.Codes.size() == 1 && "Too many asm constraint codes to handle");
- const char** table = 0;
+ const char *const *table = 0;
//Grab the translation table from TargetAsmInfo if it exists
if (!TAsm) {
diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
index 20b0d2a..0711313 100644
--- a/lib/Target/PowerPC/PPCAsmPrinter.cpp
+++ b/lib/Target/PowerPC/PPCAsmPrinter.cpp
@@ -860,7 +860,7 @@
bool DarwinAsmPrinter::doInitialization(Module &M) {
- static const char *CPUDirectives[] = {
+ static const char *const CPUDirectives[] = {
"",
"ppc",
"ppc601",
diff --git a/lib/Target/X86/X86TargetAsmInfo.cpp b/lib/Target/X86/X86TargetAsmInfo.cpp
index 43948ec..390c5a6 100644
--- a/lib/Target/X86/X86TargetAsmInfo.cpp
+++ b/lib/Target/X86/X86TargetAsmInfo.cpp
@@ -25,7 +25,8 @@
using namespace llvm;
using namespace llvm::dwarf;
-static const char* x86_asm_table[] = {"{si}", "S",
+static const char *const x86_asm_table[] = {
+ "{si}", "S",
"{di}", "D",
"{ax}", "a",
"{cx}", "c",