aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-09-08 18:10:11 +0000
committerChris Lattner <sabre@nondot.org>2009-09-08 18:10:11 +0000
commitc4f1fb125d4fe2c8879030d6f6e8b2f75cb681f1 (patch)
treef8c4621e619e8e468c6fe84e1b2b08dcc2f70419
parent6b2becfc434b0bdced8560802c4d0e03148c61b8 (diff)
reduce indentation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81234 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Sema/SemaDeclAttr.cpp33
1 files changed, 16 insertions, 17 deletions
diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp
index 735eef7e3a..df2fa16aba 100644
--- a/lib/Sema/SemaDeclAttr.cpp
+++ b/lib/Sema/SemaDeclAttr.cpp
@@ -1887,23 +1887,22 @@ NamedDecl * Sema::DeclClonePragmaWeak(NamedDecl *ND, IdentifierInfo *II)
/// DeclApplyPragmaWeak - A declaration (maybe definition) needs #pragma weak
/// applied to it, possibly with an alias.
void Sema::DeclApplyPragmaWeak(Scope *S, NamedDecl *ND, WeakInfo &W) {
- if (!W.getUsed()) { // only do this once
- W.setUsed(true);
- if (W.getAlias()) { // clone decl, impersonate __attribute(weak,alias(...))
- IdentifierInfo *NDId = ND->getIdentifier();
- NamedDecl *NewD = DeclClonePragmaWeak(ND, W.getAlias());
- NewD->addAttr(::new (Context) AliasAttr(NDId->getName()));
- NewD->addAttr(::new (Context) WeakAttr());
- WeakTopLevelDecl.push_back(NewD);
- // FIXME: "hideous" code from Sema::LazilyCreateBuiltin
- // to insert Decl at TU scope, sorry.
- DeclContext *SavedContext = CurContext;
- CurContext = Context.getTranslationUnitDecl();
- PushOnScopeChains(NewD, S);
- CurContext = SavedContext;
- } else { // just add weak to existing
- ND->addAttr(::new (Context) WeakAttr());
- }
+ if (W.getUsed()) return; // only do this once
+ W.setUsed(true);
+ if (W.getAlias()) { // clone decl, impersonate __attribute(weak,alias(...))
+ IdentifierInfo *NDId = ND->getIdentifier();
+ NamedDecl *NewD = DeclClonePragmaWeak(ND, W.getAlias());
+ NewD->addAttr(::new (Context) AliasAttr(NDId->getName()));
+ NewD->addAttr(::new (Context) WeakAttr());
+ WeakTopLevelDecl.push_back(NewD);
+ // FIXME: "hideous" code from Sema::LazilyCreateBuiltin
+ // to insert Decl at TU scope, sorry.
+ DeclContext *SavedContext = CurContext;
+ CurContext = Context.getTranslationUnitDecl();
+ PushOnScopeChains(NewD, S);
+ CurContext = SavedContext;
+ } else { // just add weak to existing
+ ND->addAttr(::new (Context) WeakAttr());
}
}