llvm-project/clang/lib
David L. Jones 7a7dd031e9 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
2017-01-23 23:16:58 +00:00
..
ARCMigrate Reapply "IntrusiveRefCntPtr -> std::shared_ptr for CompilerInvocationBase and CodeCompleteConsumer" 2017-01-06 19:49:01 +00:00
AST ASTImporter: improve support for C++ templates 2017-01-23 09:30:36 +00:00
ASTMatchers Move VariantMatcher's Payload to std::shared_ptr rather than IntrusiveRefCntPtr 2017-01-05 18:51:54 +00:00
Analysis PR31631: fix bad CFG (and bogus warnings) when an if-statement has an init-statement and has binary operator as its condition. 2017-01-13 22:16:41 +00:00
Basic AMDGPU: Update for changed subtarget feature name 2017-01-23 22:31:14 +00:00
CodeGen Add LF_ prefix to LibFunc enums in TargetLibraryInfo. 2017-01-23 23:16:58 +00:00
Driver [Hexagon] Linux linker does not support .gnu-hash 2017-01-19 16:54:04 +00:00
Edit Fix problems in "[OpenCL] Enabling the usage of CLK_NULL_QUEUE as compare operand." 2016-12-23 14:55:49 +00:00
Format clang-format: fix fallback style set to "none" not always formatting 2017-01-20 01:22:42 +00:00
Frontend [Frontend] The macro that describes the Objective-C bool type should 2017-01-20 16:48:25 +00:00
FrontendTool unique_ptrify createDriverOptTable 2017-01-13 17:34:15 +00:00
Headers Guard __gnuc_va_list typedef. 2017-01-23 19:09:21 +00:00
Index [index] Introduce symbol subkinds to mark an accessor getter or setter. 2017-01-11 21:42:48 +00:00
Lex P0426: Make the library implementation of constexpr char_traits a little easier 2017-01-20 00:45:35 +00:00
Parse Revert r292508 given that we intend to remove driver options for cxx modules. 2017-01-20 20:03:00 +00:00
Rewrite [analyzer] Re-apply r283092, attempt no.4, chunk no.4 (last) 2016-10-07 19:25:10 +00:00
Sema PR31692: Don't mark a declaration as invalid if we haven't necessarily emitted a (user-visible) error. 2017-01-23 23:14:23 +00:00
Serialization [OpenMP] Support for the if-clause on the combined directive 'target parallel'. 2017-01-18 20:40:48 +00:00
StaticAnalyzer [analyzer] Fix memory space of static locals seen from nested blocks. 2017-01-23 16:57:11 +00:00
Tooling clang-format: Make GetStyle return Expected<FormatStyle> instead of FormatStyle 2017-01-17 00:12:27 +00:00
CMakeLists.txt