From e030a63868484a6738b10b5ecb224e5fe0ab8c67 Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Wed, 7 Nov 2012 00:43:05 +0000 Subject: [PATCH] modern ObjC translator. Insert line number for @synchronized statements. llvm-svn: 167511 --- clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp b/clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp index 2f2f005..a86da54 100644 --- a/clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp +++ b/clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp @@ -1855,7 +1855,9 @@ Stmt *RewriteModernObjC::RewriteObjCSynchronizedStmt(ObjCAtSynchronizedStmt *S) assert((*startBuf == '@') && "bogus @synchronized location"); std::string buf; - buf = "{ id _rethrow = 0; id _sync_obj = "; + SourceLocation SynchLoc = S->getAtSynchronizedLoc(); + ConvertSourceLocationToLineDirective(SynchLoc, buf); + buf += "{ id _rethrow = 0; id _sync_obj = "; const char *lparenBuf = startBuf; while (*lparenBuf != '(') lparenBuf++; -- 2.7.4