mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Sema: Change a couple of Identifier usages to DeclName instead
This commit is contained in:
@@ -7891,7 +7891,7 @@ ERROR(expected_macro_expansion_expr,PointsToFirstBadToken,
|
|||||||
ERROR(expected_macro_expansion_decls,PointsToFirstBadToken,
|
ERROR(expected_macro_expansion_decls,PointsToFirstBadToken,
|
||||||
"expected macro expansion to produce a declaration", ())
|
"expected macro expansion to produce a declaration", ())
|
||||||
ERROR(macro_undefined,PointsToFirstBadToken,
|
ERROR(macro_undefined,PointsToFirstBadToken,
|
||||||
"no macro named %0", (Identifier))
|
"no macro named %0", (DeclName))
|
||||||
ERROR(external_macro_not_found,none,
|
ERROR(external_macro_not_found,none,
|
||||||
"external macro implementation type '%0.%1' could not be found for "
|
"external macro implementation type '%0.%1' could not be found for "
|
||||||
"macro %2; %3", (StringRef, StringRef, DeclName, StringRef))
|
"macro %2; %3", (StringRef, StringRef, DeclName, StringRef))
|
||||||
|
|||||||
@@ -520,7 +520,7 @@ struct ASTContext::Implementation {
|
|||||||
llvm::DenseMap<const AbstractFunctionDecl *, SourceRange> OriginalBodySourceRanges;
|
llvm::DenseMap<const AbstractFunctionDecl *, SourceRange> OriginalBodySourceRanges;
|
||||||
|
|
||||||
/// Macro discriminators per context.
|
/// Macro discriminators per context.
|
||||||
llvm::DenseMap<std::pair<const void *, Identifier>, unsigned>
|
llvm::DenseMap<std::pair<const void *, DeclBaseName>, unsigned>
|
||||||
NextMacroDiscriminator;
|
NextMacroDiscriminator;
|
||||||
|
|
||||||
/// Local and closure discriminators per context.
|
/// Local and closure discriminators per context.
|
||||||
@@ -2286,8 +2286,8 @@ unsigned ASTContext::getNextMacroDiscriminator(
|
|||||||
MacroDiscriminatorContext context,
|
MacroDiscriminatorContext context,
|
||||||
DeclBaseName baseName
|
DeclBaseName baseName
|
||||||
) {
|
) {
|
||||||
std::pair<const void *, Identifier> key(
|
std::pair<const void *, DeclBaseName> key(
|
||||||
context.getOpaqueValue(), baseName.getIdentifier());
|
context.getOpaqueValue(), baseName);
|
||||||
return getImpl().NextMacroDiscriminator[key]++;
|
return getImpl().NextMacroDiscriminator[key]++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4068,8 +4068,8 @@ namespace {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Lookup all macros with the given macro name.
|
/// Lookup all macros with the given macro name.
|
||||||
SmallVector<OverloadChoice, 1> lookupMacros(Identifier moduleName,
|
SmallVector<OverloadChoice, 1> lookupMacros(DeclName moduleName,
|
||||||
Identifier macroName,
|
DeclName macroName,
|
||||||
FunctionRefInfo functionRefInfo,
|
FunctionRefInfo functionRefInfo,
|
||||||
MacroRoles roles) {
|
MacroRoles roles) {
|
||||||
SmallVector<OverloadChoice, 1> choices;
|
SmallVector<OverloadChoice, 1> choices;
|
||||||
@@ -4100,8 +4100,8 @@ namespace {
|
|||||||
CS.associateArgumentList(locator, expr->getArgs());
|
CS.associateArgumentList(locator, expr->getArgs());
|
||||||
|
|
||||||
// Look up the macros with this name.
|
// Look up the macros with this name.
|
||||||
auto moduleIdent = expr->getModuleName().getBaseIdentifier();
|
auto moduleIdent = expr->getModuleName().getBaseName();
|
||||||
auto macroIdent = expr->getMacroName().getBaseIdentifier();
|
auto macroIdent = expr->getMacroName().getBaseName();
|
||||||
FunctionRefInfo functionRefInfo = FunctionRefInfo::singleBaseNameApply();
|
FunctionRefInfo functionRefInfo = FunctionRefInfo::singleBaseNameApply();
|
||||||
auto macros = lookupMacros(moduleIdent, macroIdent, functionRefInfo,
|
auto macros = lookupMacros(moduleIdent, macroIdent, functionRefInfo,
|
||||||
expr->getMacroRoles());
|
expr->getMacroRoles());
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
// {"signature":"swift::DeclAndTypePrinter::Implementation::visitVarDecl(swift::VarDecl*)"}
|
// {"signature":"swift::DeclAndTypePrinter::Implementation::visitVarDecl(swift::VarDecl*)"}
|
||||||
// RUN: not --crash %target-swift-frontend -typecheck %s
|
// RUN: not %target-swift-frontend -typecheck %s
|
||||||
#init
|
#init
|
||||||
Reference in New Issue
Block a user