[MC] Constify MCELF::GetVisibility and MCELF::getOther
authorUlrich Weigand <ulrich.weigand@de.ibm.com>
Fri, 11 Jul 2014 17:34:44 +0000 (17:34 +0000)
committerUlrich Weigand <ulrich.weigand@de.ibm.com>
Fri, 11 Jul 2014 17:34:44 +0000 (17:34 +0000)
These two routines didn't take a "const MCSymbolData &SD"
like the other MCELF::Get routines for some reason ...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212834 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/MC/MCELF.h
lib/MC/MCELF.cpp

index 7e59911a89c39002bc309eb68ed404585b80ee04..294a51bf7c76551594ba60cf9c72b0abfb139d64 100644 (file)
@@ -27,9 +27,9 @@ class MCELF {
   static void SetType(MCSymbolData &SD, unsigned Type);
   static unsigned GetType(const MCSymbolData &SD);
   static void SetVisibility(MCSymbolData &SD, unsigned Visibility);
-  static unsigned GetVisibility(MCSymbolData &SD);
+  static unsigned GetVisibility(const MCSymbolData &SD);
   static void setOther(MCSymbolData &SD, unsigned Other);
-  static unsigned getOther(MCSymbolData &SD);
+  static unsigned getOther(const MCSymbolData &SD);
 };
 
 }
index 0a9cd31dda00694fb5a0831c7b8eeb7839523b44..386c2099f2e27277542fac3f3c0c5d23cda62d9a 100644 (file)
@@ -61,7 +61,7 @@ void MCELF::SetVisibility(MCSymbolData &SD, unsigned Visibility) {
   SD.setFlags(OtherFlags | (Visibility << ELF_STV_Shift));
 }
 
-unsigned MCELF::GetVisibility(MCSymbolData &SD) {
+unsigned MCELF::GetVisibility(const MCSymbolData &SD) {
   unsigned Visibility =
     (SD.getFlags() & (0x3 << ELF_STV_Shift)) >> ELF_STV_Shift;
   assert(Visibility == ELF::STV_DEFAULT || Visibility == ELF::STV_INTERNAL ||
@@ -76,7 +76,7 @@ void MCELF::setOther(MCSymbolData &SD, unsigned Other) {
   SD.setFlags(OtherFlags | (Other << ELF_STO_Shift));
 }
 
-unsigned MCELF::getOther(MCSymbolData &SD) {
+unsigned MCELF::getOther(const MCSymbolData &SD) {
   unsigned Other =
     (SD.getFlags() & (0x3f << ELF_STO_Shift)) >> ELF_STO_Shift;
   return Other;