} while (Value);
}
-/// SizeULEB128 - Compute the number of bytes required for an unsigned leb128
-/// value.
-unsigned AsmPrinter::SizeULEB128(unsigned Value) {
- unsigned Size = 0;
- do {
- Value >>= 7;
- Size += sizeof(int8_t);
- } while (Value);
- return Size;
-}
-
/// PrintSLEB128 - Print a series of hexidecimal values (separated by commas)
/// representing a signed leb128 value.
void AsmPrinter::PrintSLEB128(int Value) const {
int Sign = Value >> (8 * sizeof(Value) - 1);
bool IsMore;
-
+
do {
unsigned Byte = Value & 0x7f;
Value >>= 7;
} while (IsMore);
}
-/// SizeSLEB128 - Compute the number of bytes required for a signed leb128
-/// value.
-unsigned AsmPrinter::SizeSLEB128(int Value) {
- unsigned Size = 0;
- int Sign = Value >> (8 * sizeof(Value) - 1);
- bool IsMore;
-
- do {
- unsigned Byte = Value & 0x7f;
- Value >>= 7;
- IsMore = Value != Sign || ((Byte ^ Sign) & 0x40) != 0;
- Size += sizeof(int8_t);
- } while (IsMore);
- return Size;
-}
-
//===--------------------------------------------------------------------===//
// Emission and print routines
//
void AsmPrinter::printSuffixedName(const std::string &Name, const char* Suffix) {
printSuffixedName(Name.c_str(), Suffix);
}
+
+void AsmPrinter::printVisibility(const std::string& Name,
+ unsigned Visibility) const {
+ if (Visibility == GlobalValue::HiddenVisibility) {
+ if (const char *Directive = TAI->getHiddenDirective())
+ O << Directive << Name << '\n';
+ } else if (Visibility == GlobalValue::ProtectedVisibility) {
+ if (const char *Directive = TAI->getProtectedDirective())
+ O << Directive << Name << '\n';
+ }
+}