Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
clang/lib/AST/Mangle.cpp
Show First 20 Lines • Show All 105 Lines • ▼ Show 20 Lines | |||||
bool MangleContext::shouldMangleDeclName(const NamedDecl *D) { | bool MangleContext::shouldMangleDeclName(const NamedDecl *D) { | ||||
const ASTContext &ASTContext = getASTContext(); | const ASTContext &ASTContext = getASTContext(); | ||||
CCMangling CC = getCallingConvMangling(ASTContext, D); | CCMangling CC = getCallingConvMangling(ASTContext, D); | ||||
if (CC != CCM_Other) | if (CC != CCM_Other) | ||||
return true; | return true; | ||||
// If the declaration has an owning module for linkage purposes that needs to | // If the declaration is attached to a named module, we must mangle its name. | ||||
// be mangled, we must mangle its name. | if (!D->hasExternalFormalLinkage() && D->getModuleAttachment()) | ||||
if (!D->hasExternalFormalLinkage() && D->getOwningModuleForLinkage()) | |||||
return true; | return true; | ||||
// C functions with internal linkage have to be mangled with option | // C functions with internal linkage have to be mangled with option | ||||
// -funique-internal-linkage-names. | // -funique-internal-linkage-names. | ||||
if (!getASTContext().getLangOpts().CPlusPlus && | if (!getASTContext().getLangOpts().CPlusPlus && | ||||
isUniqueInternalLinkageDecl(D)) | isUniqueInternalLinkageDecl(D)) | ||||
return true; | return true; | ||||
▲ Show 20 Lines • Show All 477 Lines • Show Last 20 Lines |