Lines Matching refs:startBuf

430     bool BufferContainsPPDirectives(const char *startBuf, const char *endBuf);
774 const char *startBuf = SM->getCharacterData(startLoc); in RewritePropertyImplDecl() local
775 assert((*startBuf == '@') && "bogus @synthesize location"); in RewritePropertyImplDecl()
776 const char *semiBuf = strchr(startBuf, ';'); in RewritePropertyImplDecl()
779 startLoc.getLocWithOffset(semiBuf-startBuf+1); in RewritePropertyImplDecl()
908 const char *startBuf = SM->getCharacterData(startLoc); in RewriteForwardClassEpilogue() local
909 const char *semiPtr = strchr(startBuf, ';'); in RewriteForwardClassEpilogue()
911 ReplaceText(startLoc, semiPtr - startBuf + 1, typedefString); in RewriteForwardClassEpilogue()
1007 const char *startBuf = SM->getCharacterData(LocStart); in RewriteProtocolDecl() local
1009 for (const char *p = startBuf; p < endBuf; p++) { in RewriteProtocolDecl()
1011 SourceLocation OptionalLoc = LocStart.getLocWithOffset(p-startBuf); in RewriteProtocolDecl()
1016 SourceLocation OptionalLoc = LocStart.getLocWithOffset(p-startBuf); in RewriteProtocolDecl()
1182 const char *startBuf = SM->getCharacterData(LocStart); in RewriteImplementationDecl() local
1184 ReplaceText(LocStart, endBuf-startBuf, ResultStr); in RewriteImplementationDecl()
1195 const char *startBuf = SM->getCharacterData(LocStart); in RewriteImplementationDecl() local
1197 ReplaceText(LocStart, endBuf-startBuf, ResultStr); in RewriteImplementationDecl()
1489 const char *startBuf = SM->getCharacterData(startLoc); in RewriteObjCForCollectionStmt() local
1529 const char *startCollectionBuf = startBuf; in RewriteObjCForCollectionStmt()
1542 ReplaceText(startLoc, startCollectionBuf - startBuf, buf); in RewriteObjCForCollectionStmt()
1546 SourceLocation lparenLoc = startLoc.getLocWithOffset(rparenBuf-startBuf); in RewriteObjCForCollectionStmt()
1653 const char *startBuf = SM->getCharacterData(startLoc); in RewriteObjCSynchronizedStmt() local
1655 assert((*startBuf == '@') && "bogus @synchronized location"); in RewriteObjCSynchronizedStmt()
1659 const char *lparenBuf = startBuf; in RewriteObjCSynchronizedStmt()
1661 ReplaceText(startLoc, lparenBuf-startBuf+1, buf); in RewriteObjCSynchronizedStmt()
1668 SourceLocation rparenLoc = startLoc.getLocWithOffset(endBuf-startBuf); in RewriteObjCSynchronizedStmt()
1679 startBuf = SM->getCharacterData(startLoc); in RewriteObjCSynchronizedStmt()
1681 assert((*startBuf == '}') && "bogus @synchronized block"); in RewriteObjCSynchronizedStmt()
1754 const char *startBuf = SM->getCharacterData(startLoc); in RewriteTryReturnStmts() local
1755 const char *semiBuf = strchr(startBuf, ';'); in RewriteTryReturnStmts()
1757 SourceLocation onePastSemiLoc = startLoc.getLocWithOffset(semiBuf-startBuf+1); in RewriteTryReturnStmts()
1775 const char *startBuf = SM->getCharacterData(startLoc); in RewriteSyncReturnStmts() local
1777 const char *semiBuf = strchr(startBuf, ';'); in RewriteSyncReturnStmts()
1779 SourceLocation onePastSemiLoc = startLoc.getLocWithOffset(semiBuf-startBuf+1); in RewriteSyncReturnStmts()
1794 const char *startBuf = SM->getCharacterData(startLoc); in RewriteObjCTryStmt() local
1796 assert((*startBuf == '@') && "bogus @try location"); in RewriteObjCTryStmt()
1810 startBuf = SM->getCharacterData(startLoc); in RewriteObjCTryStmt()
1812 assert((*startBuf == '}') && "bogus @try block"); in RewriteObjCTryStmt()
1841 startBuf = SM->getCharacterData(startLoc); in RewriteObjCTryStmt()
1843 assert((*startBuf == '@') && "bogus @catch location"); in RewriteObjCTryStmt()
1845 const char *lParenLoc = strchr(startBuf, '('); in RewriteObjCTryStmt()
1857 Rewrite.ReplaceText(startLoc, bodyBuf-startBuf+1, buf); in RewriteObjCTryStmt()
1862 ReplaceText(startLoc, lParenLoc-startBuf+1, buf); in RewriteObjCTryStmt()
1871 ReplaceText(startLoc, lParenLoc-startBuf+1, buf); in RewriteObjCTryStmt()
1912 startBuf = SM->getCharacterData(startLoc); in RewriteObjCTryStmt()
1913 assert((*startBuf == '@') && "bogus @finally start"); in RewriteObjCTryStmt()
1962 const char *startBuf = SM->getCharacterData(startLoc); in RewriteObjCThrowStmt() local
1964 assert((*startBuf == '@') && "bogus @throw location"); in RewriteObjCThrowStmt()
1974 const char *wBuf = strchr(startBuf, 'w'); in RewriteObjCThrowStmt()
1976 ReplaceText(startLoc, wBuf-startBuf+1, buf); in RewriteObjCThrowStmt()
1978 const char *semiBuf = strchr(startBuf, ';'); in RewriteObjCThrowStmt()
1980 SourceLocation semiLoc = startLoc.getLocWithOffset(semiBuf-startBuf); in RewriteObjCThrowStmt()
2037 static bool scanForProtocolRefs(const char *startBuf, const char *endBuf, in scanForProtocolRefs() argument
2039 while (startBuf < endBuf) { in scanForProtocolRefs()
2040 if (*startBuf == '<') in scanForProtocolRefs()
2041 startRef = startBuf; // mark the start. in scanForProtocolRefs()
2042 if (*startBuf == '>') { in scanForProtocolRefs()
2044 endRef = startBuf; // mark the end. in scanForProtocolRefs()
2049 startBuf++; in scanForProtocolRefs()
2100 const char *startBuf = SM->getCharacterData(Loc); in RewriteObjCQualifiedInterfaceTypes() local
2103 if (scanForProtocolRefs(startBuf, endBuf, startRef, endRef)) { in RewriteObjCQualifiedInterfaceTypes()
2105 SourceLocation LessLoc = Loc.getLocWithOffset(startRef-startBuf); in RewriteObjCQualifiedInterfaceTypes()
2106 SourceLocation GreaterLoc = Loc.getLocWithOffset(endRef-startBuf+1); in RewriteObjCQualifiedInterfaceTypes()
2144 const char *startBuf = endBuf; in RewriteObjCQualifiedInterfaceTypes() local
2145 while (*startBuf != ';' && *startBuf != '<' && startBuf != MainFileStart) in RewriteObjCQualifiedInterfaceTypes()
2146 startBuf--; // scan backward (from the decl location) for return type. in RewriteObjCQualifiedInterfaceTypes()
2148 if (scanForProtocolRefs(startBuf, endBuf, startRef, endRef)) { in RewriteObjCQualifiedInterfaceTypes()
2160 const char *startBuf = SM->getCharacterData(Loc); in RewriteObjCQualifiedInterfaceTypes() local
2161 const char *startFuncBuf = startBuf; in RewriteObjCQualifiedInterfaceTypes()
2166 const char *endBuf = startBuf; in RewriteObjCQualifiedInterfaceTypes()
2170 if (scanForProtocolRefs(startBuf, endBuf, startRef, endRef)) { in RewriteObjCQualifiedInterfaceTypes()
2180 startBuf = ++endBuf; in RewriteObjCQualifiedInterfaceTypes()
2185 while (*startBuf && *startBuf != ')' && *startBuf != ',') in RewriteObjCQualifiedInterfaceTypes()
2186 startBuf++; // scan forward (from the decl location) for argument types. in RewriteObjCQualifiedInterfaceTypes()
2187 startBuf++; in RewriteObjCQualifiedInterfaceTypes()
2206 const char *startBuf = SM->getCharacterData(DeclLoc); in RewriteTypeOfDecl() local
2218 ReplaceText(DeclLoc, endBuf-startBuf-1, TypeAsString); in RewriteTypeOfDecl()
2224 ReplaceText(DeclLoc, endBuf-startBuf-1, TypeAsString); in RewriteTypeOfDecl()
3058 bool RewriteObjC::BufferContainsPPDirectives(const char *startBuf, in BufferContainsPPDirectives() argument
3060 while (startBuf < endBuf) { in BufferContainsPPDirectives()
3061 if (*startBuf == '#') { in BufferContainsPPDirectives()
3063 for (++startBuf; startBuf[0] == ' ' || startBuf[0] == '\t'; ++startBuf) in BufferContainsPPDirectives()
3065 if (!strncmp(startBuf, "if", strlen("if")) || in BufferContainsPPDirectives()
3066 !strncmp(startBuf, "ifdef", strlen("ifdef")) || in BufferContainsPPDirectives()
3067 !strncmp(startBuf, "ifndef", strlen("ifndef")) || in BufferContainsPPDirectives()
3068 !strncmp(startBuf, "define", strlen("define")) || in BufferContainsPPDirectives()
3069 !strncmp(startBuf, "undef", strlen("undef")) || in BufferContainsPPDirectives()
3070 !strncmp(startBuf, "else", strlen("else")) || in BufferContainsPPDirectives()
3071 !strncmp(startBuf, "elif", strlen("elif")) || in BufferContainsPPDirectives()
3072 !strncmp(startBuf, "endif", strlen("endif")) || in BufferContainsPPDirectives()
3073 !strncmp(startBuf, "pragma", strlen("pragma")) || in BufferContainsPPDirectives()
3074 !strncmp(startBuf, "include", strlen("include")) || in BufferContainsPPDirectives()
3075 !strncmp(startBuf, "import", strlen("import")) || in BufferContainsPPDirectives()
3076 !strncmp(startBuf, "include_next", strlen("include_next"))) in BufferContainsPPDirectives()
3079 startBuf++; in BufferContainsPPDirectives()
3099 const char *startBuf = SM->getCharacterData(LocStart); in RewriteObjCInternalStruct() local
3107 ReplaceText(LocStart, endBuf-startBuf, Result); in RewriteObjCInternalStruct()
3119 const char *cursor = strchr(startBuf, '{'); in RewriteObjCInternalStruct()
3137 if (BufferContainsPPDirectives(startBuf, cursor)) { in RewriteObjCInternalStruct()
3149 ReplaceText(LocStart, endHeader-startBuf, Result); in RewriteObjCInternalStruct()
3152 ReplaceText(LocStart, cursor-startBuf, Result); in RewriteObjCInternalStruct()
3163 LocStart.getLocWithOffset(cursor-startBuf+1); in RewriteObjCInternalStruct()
3171 SourceLocation atLoc = LocStart.getLocWithOffset(cursor-startBuf); in RewriteObjCInternalStruct()
3188 SourceLocation atLoc = LocStart.getLocWithOffset(cursor-startBuf); in RewriteObjCInternalStruct()
3192 atLoc = LocStart.getLocWithOffset(cursor-startBuf); in RewriteObjCInternalStruct()
3195 SourceLocation caretLoc = LocStart.getLocWithOffset(cursor-startBuf); in RewriteObjCInternalStruct()
3209 ReplaceText(LocStart, endBuf-startBuf, Result); in RewriteObjCInternalStruct()
3893 const char *startBuf = SM->getCharacterData(LocStart); in RewriteCastExpr() local
3903 ReplaceText(LocStart, endBuf-startBuf+1, TypeAsString); in RewriteCastExpr()
3907 const char *argPtr = startBuf; in RewriteCastExpr()
3913 LocStart = LocStart.getLocWithOffset(argPtr-startBuf); in RewriteCastExpr()
3925 const char *startBuf = SM->getCharacterData(DeclLoc); in RewriteBlockPointerFunctionArgs() local
3926 const char *startArgList = strchr(startBuf, '('); in RewriteBlockPointerFunctionArgs()
3932 DeclLoc = DeclLoc.getLocWithOffset(startArgList-startBuf); in RewriteBlockPointerFunctionArgs()
4033 const char *startBuf = SM->getCharacterData(DeclLoc); in RewriteBlockPointerDecl() local
4034 const char *endBuf = startBuf; in RewriteBlockPointerDecl()
4036 while (*startBuf != '^' && *startBuf != ';' && startBuf != MainFileStart) in RewriteBlockPointerDecl()
4037 startBuf--; in RewriteBlockPointerDecl()
4038 SourceLocation Start = DeclLoc.getLocWithOffset(startBuf-endBuf); in RewriteBlockPointerDecl()
4043 if (*startBuf == '^') { in RewriteBlockPointerDecl()
4046 startBuf++; in RewriteBlockPointerDecl()
4049 while (*startBuf != ')') { in RewriteBlockPointerDecl()
4050 buf += *startBuf; in RewriteBlockPointerDecl()
4051 startBuf++; in RewriteBlockPointerDecl()
4062 startBuf = SM->getCharacterData(DeclLoc); in RewriteBlockPointerDecl()
4064 GetExtentOfArgList(startBuf, argListBegin, argListEnd); in RewriteBlockPointerDecl()
4177 const char *startBuf = SM->getCharacterData(DeclLoc); in RewriteByRefVar() local
4265 ReplaceText(DeclLoc, endBuf-startBuf+nameSize, ByrefType); in RewriteByRefVar()
4292 ReplaceText(DeclLoc, endBuf-startBuf, ByrefType); in RewriteByRefVar()
4635 const char *startBuf = SM->getCharacterData(startLoc); in RewriteFunctionBodyOrGlobalInitializer()
4640 messString.append(startBuf, endBuf-startBuf+1); in RewriteFunctionBodyOrGlobalInitializer()