diff options
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 2 | ||||
-rw-r--r-- | clang/test/CodeGenCXX/visibility.cpp | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 6e234112d7d..7cece2b3dd9 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -1296,7 +1296,7 @@ static Visibility parseVisibility(Arg *arg, ArgList &args, StringRef value = arg->getValue(); if (value == "default") { return DefaultVisibility; - } else if (value == "hidden") { + } else if (value == "hidden" || value == "internal") { return HiddenVisibility; } else if (value == "protected") { // FIXME: diagnose if target does not support protected visibility diff --git a/clang/test/CodeGenCXX/visibility.cpp b/clang/test/CodeGenCXX/visibility.cpp index 7239cbe0022..aff6554282c 100644 --- a/clang/test/CodeGenCXX/visibility.cpp +++ b/clang/test/CodeGenCXX/visibility.cpp @@ -1,5 +1,8 @@ // RUN: %clang_cc1 %s -std=c++11 -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s // RUN: %clang_cc1 %s -std=c++11 -triple=x86_64-apple-darwin10 -fvisibility hidden -emit-llvm -o - | FileCheck %s -check-prefix=CHECK-HIDDEN +// For clang, "internal" is just an alias for "hidden". We could use it for some +// optimization purposes on 32-bit x86, but it's not worth it. +// RUN: %clang_cc1 %s -std=c++11 -triple=x86_64-apple-darwin10 -fvisibility internal -emit-llvm -o - | FileCheck %s -check-prefix=CHECK-HIDDEN #define HIDDEN __attribute__((visibility("hidden"))) #define PROTECTED __attribute__((visibility("protected"))) |