Address review comments for #pragma weak.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72926 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/Sema.h b/lib/Sema/Sema.h
index 743c46b..736a496 100644
--- a/lib/Sema/Sema.h
+++ b/lib/Sema/Sema.h
@@ -2451,12 +2451,12 @@
SourceLocation LParenLoc,
SourceLocation RParenLoc);
- /// ActOnPragmaPack - Called on well formed #pragma weak ident.
+ /// ActOnPragmaWeakID - Called on well formed #pragma weak ident.
virtual void ActOnPragmaWeakID(IdentifierInfo* WeakName,
SourceLocation PragmaLoc,
SourceLocation WeakNameLoc);
- /// ActOnPragmaPack - Called on well formed #pragma weak ident = ident.
+ /// ActOnPragmaWeakAlias - Called on well formed #pragma weak ident = ident.
virtual void ActOnPragmaWeakAlias(IdentifierInfo* WeakName,
IdentifierInfo* AliasName,
SourceLocation PragmaLoc,
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 18636a4..51b5449 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -4439,6 +4439,7 @@
// FIXME: This implementation is an ugly hack!
if (PrevDecl) {
PrevDecl->addAttr(::new (Context) AliasAttr(AliasName->getName()));
+ PrevDecl->addAttr(::new (Context) WeakAttr());
return;
}
Diag(PragmaLoc, diag::err_unsupported_pragma_weak);