Skip to content

Commit 35869a2

Browse files
committed
Rename builtin_lang -> Langs to match the rest of the code a bit better.
llvm-svn: 244126
1 parent b20d770 commit 35869a2

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

clang/include/clang/Basic/Builtins.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ enum ID {
5151

5252
struct Info {
5353
const char *Name, *Type, *Attributes, *HeaderName;
54-
LanguageID builtin_lang;
54+
LanguageID Langs;
5555
};
5656

5757
/// \brief Holds information about both target-independent and

clang/lib/Basic/Builtins.cpp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,12 @@ using namespace clang;
2222
static const Builtin::Info BuiltinInfo[] = {
2323
{ "not a builtin function", nullptr, nullptr, nullptr, ALL_LANGUAGES},
2424
#define BUILTIN(ID, TYPE, ATTRS) { #ID, TYPE, ATTRS, 0, ALL_LANGUAGES },
25-
#define LANGBUILTIN(ID, TYPE, ATTRS, BUILTIN_LANG) { #ID, TYPE, ATTRS, 0, BUILTIN_LANG },
26-
#define LIBBUILTIN(ID, TYPE, ATTRS, HEADER, BUILTIN_LANG) { #ID, TYPE, ATTRS, HEADER,\
27-
BUILTIN_LANG },
25+
#define LANGBUILTIN(ID, TYPE, ATTRS, LANGS) \
26+
{ #ID, TYPE, ATTRS, 0, LANGS } \
27+
,
28+
#define LIBBUILTIN(ID, TYPE, ATTRS, HEADER, LANGS) \
29+
{ #ID, TYPE, ATTRS, HEADER, LANGS } \
30+
,
2831
#include "clang/Basic/Builtins.def"
2932
};
3033

@@ -53,12 +56,10 @@ bool Builtin::Context::BuiltinIsSupported(const Builtin::Info &BuiltinInfo,
5356
bool MathBuiltinsUnsupported =
5457
LangOpts.NoMathBuiltin && BuiltinInfo.HeaderName &&
5558
llvm::StringRef(BuiltinInfo.HeaderName).equals("math.h");
56-
bool GnuModeUnsupported = !LangOpts.GNUMode &&
57-
(BuiltinInfo.builtin_lang & GNU_LANG);
58-
bool MSModeUnsupported = !LangOpts.MicrosoftExt &&
59-
(BuiltinInfo.builtin_lang & MS_LANG);
60-
bool ObjCUnsupported = !LangOpts.ObjC1 &&
61-
BuiltinInfo.builtin_lang == OBJC_LANG;
59+
bool GnuModeUnsupported = !LangOpts.GNUMode && (BuiltinInfo.Langs & GNU_LANG);
60+
bool MSModeUnsupported =
61+
!LangOpts.MicrosoftExt && (BuiltinInfo.Langs & MS_LANG);
62+
bool ObjCUnsupported = !LangOpts.ObjC1 && BuiltinInfo.Langs == OBJC_LANG;
6263
return !BuiltinsUnsupported && !MathBuiltinsUnsupported &&
6364
!GnuModeUnsupported && !MSModeUnsupported && !ObjCUnsupported;
6465
}

0 commit comments

Comments
 (0)