]> granicus.if.org Git - llvm/commit
[Analysis] Add LibFunc_ prefix to enums in TargetLibraryInfo. (NFC)
authorDavid L. Jones <dlj@google.com>
Mon, 23 Jan 2017 23:16:46 +0000 (23:16 +0000)
committerDavid L. Jones <dlj@google.com>
Mon, 23 Jan 2017 23:16:46 +0000 (23:16 +0000)
commit32028c8f08ff146b4fbf93108cd519d025b312d3
tree28a2e51de8034492fe351eaa2acb00e7d26dc17b
parent50ca9e146bbd06993a091b8f537ec2a48980d4d9
[Analysis] Add LibFunc_ prefix to enums in TargetLibraryInfo. (NFC)

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 "LibFFunc_". (Unfortunately, a scoped enum is not sufficient to override
macros.)

There are additional changes required in clang.

Reviewers: rsmith

Subscribers: mehdi_amini, mzolotukhin, nemanjai, llvm-commits

Differential Revision: https://reviews.llvm.org/D28476

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292848 91177308-0d34-0410-b5e6-96231b3b80d8
23 files changed:
include/llvm/Analysis/TargetLibraryInfo.def
include/llvm/Analysis/TargetLibraryInfo.h
include/llvm/Transforms/Utils/SimplifyLibCalls.h
lib/Analysis/BasicAliasAnalysis.cpp
lib/Analysis/ConstantFolding.cpp
lib/Analysis/MemoryBuiltins.cpp
lib/Analysis/MemoryLocation.cpp
lib/Analysis/TargetLibraryInfo.cpp
lib/Analysis/ValueTracking.cpp
lib/CodeGen/SelectionDAG/FastISel.cpp
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
lib/LTO/UpdateCompilerUsed.cpp
lib/Target/PowerPC/PPCCTRLoops.cpp
lib/Transforms/IPO/GlobalOpt.cpp
lib/Transforms/Scalar/DeadStoreElimination.cpp
lib/Transforms/Scalar/LoopIdiomRecognize.cpp
lib/Transforms/Scalar/MemCpyOptimizer.cpp
lib/Transforms/Scalar/PartiallyInlineLibCalls.cpp
lib/Transforms/Utils/BuildLibCalls.cpp
lib/Transforms/Utils/LibCallsShrinkWrap.cpp
lib/Transforms/Utils/Local.cpp
lib/Transforms/Utils/SimplifyLibCalls.cpp
unittests/Analysis/TargetLibraryInfoTest.cpp