Reduce diff

This commit is contained in:
Apollo Zhu
2024-01-12 16:34:43 -08:00
parent cfa044334e
commit c55dbda50e
3 changed files with 4 additions and 7 deletions

View File

@@ -7523,16 +7523,15 @@ ERROR(extension_macro_invalid_conformance,none,
ERROR(macro_attached_to_invalid_decl,none,
"'%0' macro cannot be attached to %1 (%base2)",
(StringRef, DescriptiveDeclKind, const Decl *))
ERROR(conformance_macro,none,
"conformance macros are replaced by extension macros",
())
ERROR(macro_as_default_argument, none,
"non-built-in macro cannot be used as default argument",
())
ERROR(macro_as_default_argument_arguments_must_be_literal, none,
"argument to macro used as default argument must be literal",
())
ERROR(conformance_macro,none,
"conformance macros are replaced by extension macros",
())
ERROR(macro_resolve_circular_reference, none,
"circular reference resolving %select{freestanding|attached}0 macro %1",

View File

@@ -921,7 +921,7 @@ ModuleDecl::getOriginalLocation(SourceLoc loc) const {
break;
}
case GeneratedSourceInfo::DefaultArgument:
// TODO: ApolloZhu
// No original location as it's not actually in any source file
case GeneratedSourceInfo::ReplacedFunctionBody:
// There's not really any "original" location for locations within
// replaced function bodies. The body is actually different code to the

View File

@@ -719,9 +719,7 @@ static SourceFile *createDefaultArgumentSourceFile(StringRef macroExpression,
llvm::SmallString<256> builder;
unsigned line, column;
// TODO: ApolloZhu check getPresumedLineAndColumnForLoc
std::tie(line, column) = sourceMgr.getLineAndColumnInBuffer(insertionPoint);
// TODO: ApolloZhu check getVirtualFile/getOutermostParentSourceFile
auto file = dc->getParentSourceFile()->getFilename();
// find a way to pass the file:line:column to macro expansion