[clang] [SystemZ][z/OS] Implement #pragma export (PR #141671)
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Thu Nov 20 07:50:03 PST 2025
================
@@ -1327,6 +1327,60 @@ void Sema::AddImplicitMSFunctionNoBuiltinAttr(FunctionDecl *FD) {
FD->addAttr(NoBuiltinAttr::CreateImplicit(Context, V.data(), V.size()));
}
+NamedDecl *Sema::lookupExternCName(IdentifierInfo *IdentId,
+ SourceLocation NameLoc, Scope *curScope) {
+ LookupResult Result(*this, IdentId, NameLoc, LookupOrdinaryName);
+ LookupName(Result, curScope);
+ if (!getLangOpts().CPlusPlus)
+ return Result.getAsSingle<NamedDecl>();
+ for (LookupResult::iterator I = Result.begin(); I != Result.end(); ++I) {
+ NamedDecl *D = (*I)->getUnderlyingDecl();
+ if (auto *FD = dyn_cast<FunctionDecl>(D->getCanonicalDecl()))
----------------
erichkeane wrote:
Don't do `getCanonicalDecl`, else you get the 1st one. For functions, we always want the 'most recent', as they'll have the most information. I'd suggest not doing `getCanonicalDecl` at all.
https://github.com/llvm/llvm-project/pull/141671
More information about the cfe-commits
mailing list