From 87e23e57339d62733a68de452ea65873a25b4d30 Mon Sep 17 00:00:00 2001 From: Quentin Colombet Date: Fri, 26 Feb 2016 20:05:02 +0000 Subject: [PATCH] [GlobalISel] Fix a ranlib warning about empty TOC. Fixes PR26733 llvm-svn: 262057 --- llvm/lib/CodeGen/GlobalISel/EmptyFile.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/llvm/lib/CodeGen/GlobalISel/EmptyFile.cpp b/llvm/lib/CodeGen/GlobalISel/EmptyFile.cpp index 02cfde832e13..cc509ff1e878 100644 --- a/llvm/lib/CodeGen/GlobalISel/EmptyFile.cpp +++ b/llvm/lib/CodeGen/GlobalISel/EmptyFile.cpp @@ -14,8 +14,11 @@ #include "llvm/Support/Compiler.h" -// Anonymous namespace so that we do not step on anyone's toes. -namespace { -LLVM_ATTRIBUTE_UNUSED void foo(void) { + +namespace llvm { +// Export a global symbol so that ranlib does not complain +// about the TOC being empty for the global-isel library when +// we do not build global-isel. +LLVM_ATTRIBUTE_UNUSED void DummyFunctionToSilenceRanlib(void) { } }