aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/BackendUtil.cpp
diff options
context:
space:
mode:
authorDavid L. Jones <dlj@google.com>2017-01-23 23:16:58 +0000
committerDavid L. Jones <dlj@google.com>2017-01-23 23:16:58 +0000
commit7a7dd031e998460fc203e9ec7c0f358f1b24f9ba (patch)
tree2ae0a2e0a49658eb8687df0d1e101ec3bbdfdb64 /clang/lib/CodeGen/BackendUtil.cpp
parentd21529fa0df71327aab230786e345b2071f4ac4f (diff)
downloadllvm-7a7dd031e998460fc203e9ec7c0f358f1b24f9ba.zip
llvm-7a7dd031e998460fc203e9ec7c0f358f1b24f9ba.tar.gz
llvm-7a7dd031e998460fc203e9ec7c0f358f1b24f9ba.tar.bz2
Add LF_ prefix to LibFunc enums in TargetLibraryInfo.
Summary: The LibFunc::Func enum holds enumerators named for libc functions. Unfortunately, there are real situations, including libc implementations, where function names are actually macros (musl uses "#define fopen64 fopen", for example; any other transitively visible macro would have similar effects). Strictly speaking, a conforming C++ Standard Library should provide any such macros as functions instead (via <cstdio>). However, there are some "library" functions which are not part of the standard, and thus not subject to this rule (fopen64, for example). So, in order to be both portable and consistent, the enum should not use the bare function names. The old enum naming used a namespace LibFunc and an enum Func, with bare enumerators. This patch changes LibFunc to be an enum with enumerators prefixed with "LF_". (Unfortunately, a scoped enum is not sufficient to override macros.) These changes are for clang. See https://reviews.llvm.org/D28476 for LLVM. Reviewers: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D28477 llvm-svn: 292849
Diffstat (limited to 'clang/lib/CodeGen/BackendUtil.cpp')
-rw-r--r--clang/lib/CodeGen/BackendUtil.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp
index bac1e89..893729b 100644
--- a/clang/lib/CodeGen/BackendUtil.cpp
+++ b/clang/lib/CodeGen/BackendUtil.cpp
@@ -262,7 +262,7 @@ static TargetLibraryInfoImpl *createTLII(llvm::Triple &TargetTriple,
TLII->disableAllFunctions();
else {
// Disable individual libc/libm calls in TargetLibraryInfo.
- LibFunc::Func F;
+ LibFunc F;
for (auto &FuncName : CodeGenOpts.getNoBuiltinFuncs())
if (TLII->getLibFunc(FuncName, F))
TLII->setUnavailable(F);