summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/SearchForAddressOfSpecialSymbol.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Support/SearchForAddressOfSpecialSymbol.cpp')
-rw-r--r--llvm/lib/Support/SearchForAddressOfSpecialSymbol.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/llvm/lib/Support/SearchForAddressOfSpecialSymbol.cpp b/llvm/lib/Support/SearchForAddressOfSpecialSymbol.cpp
index 55f3320f640..711760b2479 100644
--- a/llvm/lib/Support/SearchForAddressOfSpecialSymbol.cpp
+++ b/llvm/lib/Support/SearchForAddressOfSpecialSymbol.cpp
@@ -14,10 +14,12 @@
//
//===----------------------------------------------------------------------===//
-#include <string.h>
+#include <cstring>
+
+namespace {
// Must declare the symbols in the global namespace.
-static void *DoSearch(const char* symbolName) {
+void *DoSearch(const char* symbolName) {
#define EXPLICIT_SYMBOL(SYM) \
extern void *SYM; if (!strcmp(symbolName, #SYM)) return &SYM
@@ -51,8 +53,12 @@ static void *DoSearch(const char* symbolName) {
return nullptr;
}
+} // end anonymous namespace
+
namespace llvm {
+
void *SearchForAddressOfSpecialSymbol(const char* symbolName) {
return DoSearch(symbolName);
}
-} // namespace llvm
+
+} // end namespace llvm
OpenPOWER on IntegriCloud