summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-03-25 21:45:14 +0000
committerDan Gohman <gohman@apple.com>2008-03-25 21:45:14 +0000
commitbdc24adaafc3ec79eba2fb279b8f5546bfbedae5 (patch)
treea060cad83ba4846ccb3ad5690dcc0cd1016ac68f /llvm/lib/Target
parenta7ba51f6ecb26372e38a4552f16bb634375fecad (diff)
downloadbcm5719-llvm-bdc24adaafc3ec79eba2fb279b8f5546bfbedae5.tar.gz
bcm5719-llvm-bdc24adaafc3ec79eba2fb279b8f5546bfbedae5.zip
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. llvm-svn: 48800
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp3
-rw-r--r--llvm/lib/Target/CBackend/CBackend.cpp2
-rw-r--r--llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp2
-rw-r--r--llvm/lib/Target/X86/X86TargetAsmInfo.cpp3
4 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp b/llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp
index 3e7b69f9fb0..65947fb188f 100644
--- a/llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp
+++ b/llvm/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/llvm/lib/Target/CBackend/CBackend.cpp b/llvm/lib/Target/CBackend/CBackend.cpp
index eb7d58517bc..24ac8f9e5c0 100644
--- a/llvm/lib/Target/CBackend/CBackend.cpp
+++ b/llvm/lib/Target/CBackend/CBackend.cpp
@@ -2825,7 +2825,7 @@ std::string CWriter::InterpretASMConstraint(InlineAsm::ConstraintInfo& c) {
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/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
index 20b0d2adf4f..07113131392 100644
--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
@@ -860,7 +860,7 @@ bool DarwinAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
bool DarwinAsmPrinter::doInitialization(Module &M) {
- static const char *CPUDirectives[] = {
+ static const char *const CPUDirectives[] = {
"",
"ppc",
"ppc601",
diff --git a/llvm/lib/Target/X86/X86TargetAsmInfo.cpp b/llvm/lib/Target/X86/X86TargetAsmInfo.cpp
index 43948ec8ef3..390c5a6ff30 100644
--- a/llvm/lib/Target/X86/X86TargetAsmInfo.cpp
+++ b/llvm/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",
OpenPOWER on IntegriCloud