diff options
| author | Anton Korobeynikov <asl@math.spbu.ru> | 2008-08-08 18:25:07 +0000 |
|---|---|---|
| committer | Anton Korobeynikov <asl@math.spbu.ru> | 2008-08-08 18:25:07 +0000 |
| commit | f5b6a47bb57fb5ffc734416d4d5d993e1a06273b (patch) | |
| tree | dda81f3507c9be0dfebf5e749923a6bd75722b68 /lib/CodeGen | |
| parent | 382f0022726bff5ed088a171005c1ebde3635925 (diff) | |
Handle visibility printing with all generality. Remove bunch of duplicate code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54540 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
| -rw-r--r-- | lib/CodeGen/AsmPrinter.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/CodeGen/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter.cpp index 1ee71bdc72..b01ae7d6b5 100644 --- a/lib/CodeGen/AsmPrinter.cpp +++ b/lib/CodeGen/AsmPrinter.cpp @@ -1469,3 +1469,14 @@ void AsmPrinter::printSuffixedName(const char *Name, const char *Suffix, 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'; + } +} |
