Skip to content

Commit d686a3e

Browse files
committed
Handle $FeatureName custom conditions in CompilerBuildConfiguration
1 parent a844f4f commit d686a3e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/AST/ASTBridging.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,12 @@ unsigned BridgedASTContext_majorLanguageVersion(BridgedASTContext cContext) {
123123

124124
bool BridgedASTContext_langOptsCustomConditionSet(BridgedASTContext cContext,
125125
BridgedStringRef cName) {
126-
return cContext.unbridged().LangOpts
127-
.isCustomConditionalCompilationFlagSet(cName.unbridged());
126+
ASTContext &ctx = cContext.unbridged();
127+
auto name = cName.unbridged();
128+
if (name.starts_with("$") && ctx.LangOpts.hasFeature(name.drop_front()))
129+
return true;
130+
131+
return ctx.LangOpts.isCustomConditionalCompilationFlagSet(name);
128132
}
129133

130134
bool BridgedASTContext_langOptsHasFeatureNamed(BridgedASTContext cContext,

0 commit comments

Comments
 (0)