Implement protected visibility. This partly implements PR1363. Linker
should be taught to deal with protected symbols.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36565 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AsmParser/Lexer.l b/lib/AsmParser/Lexer.l
index 382ce24..b67f6ff 100644
--- a/lib/AsmParser/Lexer.l
+++ b/lib/AsmParser/Lexer.l
@@ -206,6 +206,7 @@
dllimport { return DLLIMPORT; }
dllexport { return DLLEXPORT; }
hidden { return HIDDEN; }
+protected { return PROTECTED; }
extern_weak { return EXTERN_WEAK; }
external { return EXTERNAL; }
thread_local { return THREAD_LOCAL; }
diff --git a/lib/AsmParser/Lexer.l.cvs b/lib/AsmParser/Lexer.l.cvs
index 382ce24..b67f6ff 100644
--- a/lib/AsmParser/Lexer.l.cvs
+++ b/lib/AsmParser/Lexer.l.cvs
@@ -206,6 +206,7 @@
dllimport { return DLLIMPORT; }
dllexport { return DLLEXPORT; }
hidden { return HIDDEN; }
+protected { return PROTECTED; }
extern_weak { return EXTERN_WEAK; }
external { return EXTERNAL; }
thread_local { return THREAD_LOCAL; }
diff --git a/lib/AsmParser/llvmAsmParser.y b/lib/AsmParser/llvmAsmParser.y
index c47b6fc..63f2261 100644
--- a/lib/AsmParser/llvmAsmParser.y
+++ b/lib/AsmParser/llvmAsmParser.y
@@ -1099,7 +1099,7 @@
%token NORETURN INREG SRET NOUNWIND
// Visibility Styles
-%token DEFAULT HIDDEN
+%token DEFAULT HIDDEN PROTECTED
%start Module
%%
@@ -1180,9 +1180,10 @@
;
GVVisibilityStyle
- : /*empty*/ { $$ = GlobalValue::DefaultVisibility; }
- | DEFAULT { $$ = GlobalValue::DefaultVisibility; }
- | HIDDEN { $$ = GlobalValue::HiddenVisibility; }
+ : /*empty*/ { $$ = GlobalValue::DefaultVisibility; }
+ | DEFAULT { $$ = GlobalValue::DefaultVisibility; }
+ | HIDDEN { $$ = GlobalValue::HiddenVisibility; }
+ | PROTECTED { $$ = GlobalValue::ProtectedVisibility; }
;
FunctionDeclareLinkage
diff --git a/lib/AsmParser/llvmAsmParser.y.cvs b/lib/AsmParser/llvmAsmParser.y.cvs
index c47b6fc..63f2261 100644
--- a/lib/AsmParser/llvmAsmParser.y.cvs
+++ b/lib/AsmParser/llvmAsmParser.y.cvs
@@ -1099,7 +1099,7 @@
%token NORETURN INREG SRET NOUNWIND
// Visibility Styles
-%token DEFAULT HIDDEN
+%token DEFAULT HIDDEN PROTECTED
%start Module
%%
@@ -1180,9 +1180,10 @@
;
GVVisibilityStyle
- : /*empty*/ { $$ = GlobalValue::DefaultVisibility; }
- | DEFAULT { $$ = GlobalValue::DefaultVisibility; }
- | HIDDEN { $$ = GlobalValue::HiddenVisibility; }
+ : /*empty*/ { $$ = GlobalValue::DefaultVisibility; }
+ | DEFAULT { $$ = GlobalValue::DefaultVisibility; }
+ | HIDDEN { $$ = GlobalValue::HiddenVisibility; }
+ | PROTECTED { $$ = GlobalValue::ProtectedVisibility; }
;
FunctionDeclareLinkage