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