diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2010-01-05 18:15:57 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-01-05 18:15:57 +0000 |
commit | e1f84f8e4cd02347ab0e74eb8f328b3bcacb369c (patch) | |
tree | a2a81bea87b76570c2f8e941db138aa80186beb6 /lib/Frontend/RewriteObjC.cpp | |
parent | cd826370bb146a25bddea48399953dd3077710cf (diff) |
Minor clean up.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92746 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/RewriteObjC.cpp')
-rw-r--r-- | lib/Frontend/RewriteObjC.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/Frontend/RewriteObjC.cpp b/lib/Frontend/RewriteObjC.cpp index 419011e3c8..253e081658 100644 --- a/lib/Frontend/RewriteObjC.cpp +++ b/lib/Frontend/RewriteObjC.cpp @@ -4508,14 +4508,14 @@ void RewriteObjC::RewriteByRefVar(VarDecl *ND) { // {0, &ND, some_flag, __size=sizeof(struct __Block_byref_ND), // initializer-if-any}; bool hasInit = (ND->getInit() != 0); + unsigned flags = 0; + if (HasCopyAndDispose) + flags |= BLOCK_HAS_COPY_DISPOSE; Name = ND->getNameAsString(); ByrefType = "struct __Block_byref_" + Name; if (!hasInit) { ByrefType += " " + Name + " = "; ByrefType += "{0, &" + Name + ", "; - unsigned flags = 0; - if (HasCopyAndDispose) - flags |= BLOCK_HAS_COPY_DISPOSE; ByrefType += utostr(flags); ByrefType += ", "; ByrefType += "sizeof(struct __Block_byref_" + Name + ")"; @@ -4535,9 +4535,6 @@ void RewriteObjC::RewriteByRefVar(VarDecl *ND) { ReplaceText(DeclLoc, endBuf-startBuf, ByrefType.c_str(), ByrefType.size()); ByrefType = " = {0, &" + Name + ", "; - unsigned flags = 0; - if (HasCopyAndDispose) - flags |= BLOCK_HAS_COPY_DISPOSE; ByrefType += utostr(flags); ByrefType += ", "; ByrefType += "sizeof(struct __Block_byref_" + Name + "), "; |