From f79454347262d4da2acbdb4832e838d64f9da116 Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Tue, 5 Jan 2010 18:15:57 +0000 Subject: Minor clean up. llvm-svn: 92746 --- clang/lib/Frontend/RewriteObjC.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'clang/lib') diff --git a/clang/lib/Frontend/RewriteObjC.cpp b/clang/lib/Frontend/RewriteObjC.cpp index 419011e3c86..253e0816581 100644 --- a/clang/lib/Frontend/RewriteObjC.cpp +++ b/clang/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 + "), "; -- cgit v1.2.3