[PATCH] [Object/ELF] Add support for setVisibility()
Simon Atanasyan
simon at atanasyan.com
Wed Mar 11 22:38:13 PDT 2015
REPOSITORY
rL LLVM
================
Comment at: include/llvm/Object/ELFTypes.h:199
@@ +198,3 @@
+ assert(v < 4 && "Invalid value for visibility");
+ st_other &= v;
+ }
----------------
The `st_other` field might contain other flags except STV_xxx. If one sets such flags and then call `setVisibility` its overwrites the `st_other` field completely. Maybe write this function something like this:
```
STV_MASK = 3;
void setVisibility(unsigned char v) {
assert(v < 4 && "Invalid value for visibility");
st_other = (st_other & ~STV_MASK) | v;
}
```
http://reviews.llvm.org/D8279
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the llvm-commits
mailing list