diff --git a/llvm/docs/ReleaseNotes.rst b/llvm/docs/ReleaseNotes.rst --- a/llvm/docs/ReleaseNotes.rst +++ b/llvm/docs/ReleaseNotes.rst @@ -122,9 +122,9 @@ Changes to the PowerPC Backend ------------------------------ -* A new option ``-mroptr`` is added to ``clang`` and ``llc``. When this option - is present, constant objects with relocatable address values are put into the - RO data section. This option should be used with the ``-fdata-sections`` +* A new option ``-mxcoff-roptr`` is added to ``clang`` and ``llc``. When this + option is present, constant objects with relocatable address values are put + into the RO data section. This option should be used with the ``-fdata-sections`` option, and is not supported with ``-fno-data-sections``. The option is only supported on AIX. * On AIX, teach the profile runtime to check for a build-id string; such string diff --git a/llvm/lib/CodeGen/CommandFlags.cpp b/llvm/lib/CodeGen/CommandFlags.cpp --- a/llvm/lib/CodeGen/CommandFlags.cpp +++ b/llvm/lib/CodeGen/CommandFlags.cpp @@ -480,7 +480,7 @@ CGBINDOPT(JMCInstrument); static cl::opt XCOFFReadOnlyPointers( - "mroptr", + "mxcoff-roptr", cl::desc("When set to true, const objects with relocatable address " "values are put into the RO data section."), cl::init(false)); diff --git a/llvm/test/CodeGen/PowerPC/aix-xcoff-roptr.ll b/llvm/test/CodeGen/PowerPC/aix-xcoff-roptr.ll --- a/llvm/test/CodeGen/PowerPC/aix-xcoff-roptr.ll +++ b/llvm/test/CodeGen/PowerPC/aix-xcoff-roptr.ll @@ -1,11 +1,11 @@ -; RUN: llc -mtriple powerpc-ibm-aix-xcoff -mroptr < %s | FileCheck %s -; RUN: llc -mtriple powerpc-ibm-aix-xcoff -mroptr -filetype=obj -o %t.o < %s +; RUN: llc -mtriple powerpc-ibm-aix-xcoff -mxcoff-roptr < %s | FileCheck %s +; RUN: llc -mtriple powerpc-ibm-aix-xcoff -mxcoff-roptr -filetype=obj -o %t.o < %s ; RUN: llvm-objdump -t --symbol-description %t.o | FileCheck %s --check-prefix=OBJ -; RUN: not llc -mtriple powerpc-ibm-aix-xcoff -mroptr -data-sections=false \ +; RUN: not llc -mtriple powerpc-ibm-aix-xcoff -mxcoff-roptr -data-sections=false \ ; RUN: < %s 2>&1 | FileCheck %s --check-prefix=DS_ERR -; DS_ERR: -mroptr option must be used with -data-sections +; DS_ERR: -mxcoff-roptr option must be used with -data-sections %union.U = type { %"struct.U::A" } %"struct.U::A" = type { ptr } diff --git a/llvm/test/CodeGen/PowerPC/aix64-xcoff-roptr.ll b/llvm/test/CodeGen/PowerPC/aix64-xcoff-roptr.ll --- a/llvm/test/CodeGen/PowerPC/aix64-xcoff-roptr.ll +++ b/llvm/test/CodeGen/PowerPC/aix64-xcoff-roptr.ll @@ -1,14 +1,14 @@ -; RUN: llc -mtriple powerpc64-ibm-aix-xcoff -mroptr < %s | FileCheck %s -; RUN: llc -mtriple powerpc64-ibm-aix-xcoff -mroptr -filetype=obj -o %t.o < %s +; RUN: llc -mtriple powerpc64-ibm-aix-xcoff -mxcoff-roptr < %s | FileCheck %s +; RUN: llc -mtriple powerpc64-ibm-aix-xcoff -mxcoff-roptr -filetype=obj -o %t.o < %s ; RUN: llvm-objdump -t --symbol-description %t.o | FileCheck %s --check-prefix=OBJ -; RUN: not llc -mtriple powerpc64-ibm-aix-xcoff -mroptr -data-sections=false \ +; RUN: not llc -mtriple powerpc64-ibm-aix-xcoff -mxcoff-roptr -data-sections=false \ ; RUN: < %s 2>&1 | FileCheck %s --check-prefix=DS_ERR -; RUN: not llc -mtriple powerpc64le-unknown-linux-gnu -mroptr \ +; RUN: not llc -mtriple powerpc64le-unknown-linux-gnu -mxcoff-roptr \ ; RUN: < %s 2>&1 | FileCheck %s --check-prefix=OS_ERR -; DS_ERR: -mroptr option must be used with -data-sections -; OS_ERR: -mroptr option is only supported on AIX +; DS_ERR: -mxcoff-roptr option must be used with -data-sections +; OS_ERR: -mxcoff-roptr option is only supported on AIX %union.U = type { %"struct.U::A" } %"struct.U::A" = type { ptr } diff --git a/llvm/tools/llc/llc.cpp b/llvm/tools/llc/llc.cpp --- a/llvm/tools/llc/llc.cpp +++ b/llvm/tools/llc/llc.cpp @@ -499,7 +499,8 @@ if (Options.XCOFFReadOnlyPointers) { if (!TheTriple.isOSAIX()) - reportError("-mroptr option is only supported on AIX", InputFilename); + reportError("-mxcoff-roptr option is only supported on AIX", + InputFilename); // Since the storage mapping class is specified per csect, // without using data sections, it is less effective to use read-only @@ -510,7 +511,7 @@ // since we have not found reasons to do otherwise that overcome the user // surprise of not respecting the setting. if (!Options.DataSections) - reportError("-mroptr option must be used with -data-sections", + reportError("-mxcoff-roptr option must be used with -data-sections", InputFilename); }