Lines Matching refs:startBuf
281 bool BufferContainsPPDirectives(const char *startBuf, const char *endBuf);
808 const char *startBuf = SM->getCharacterData(startLoc);
809 assert((*startBuf == '@') && "bogus @synthesize location");
810 const char *semiBuf = strchr(startBuf, ';');
813 startLoc.getLocWithOffset(semiBuf-startBuf+1);
938 const char *startBuf = SM->getCharacterData(startLoc);
939 const char *semiPtr = strchr(startBuf, ';');
941 ReplaceText(startLoc, semiPtr-startBuf+1, typedefString);
1051 const char *startBuf = SM->getCharacterData(LocStart);
1053 for (const char *p = startBuf; p < endBuf; p++) {
1055 SourceLocation OptionalLoc = LocStart.getLocWithOffset(p-startBuf);
1060 SourceLocation OptionalLoc = LocStart.getLocWithOffset(p-startBuf);
1220 const char *startBuf = SM->getCharacterData(LocStart);
1222 ReplaceText(LocStart, endBuf-startBuf, ResultStr);
1235 const char *startBuf = SM->getCharacterData(LocStart);
1237 ReplaceText(LocStart, endBuf-startBuf, ResultStr);
1662 const char *startBuf = SM->getCharacterData(startLoc);
1702 const char *startCollectionBuf = startBuf;
1715 ReplaceText(startLoc, startCollectionBuf - startBuf, buf);
1719 SourceLocation lparenLoc = startLoc.getLocWithOffset(rparenBuf-startBuf);
1826 const char *startBuf = SM->getCharacterData(startLoc);
1828 assert((*startBuf == '@') && "bogus @synchronized location");
1832 const char *lparenBuf = startBuf;
1834 ReplaceText(startLoc, lparenBuf-startBuf+1, buf);
1841 SourceLocation rparenLoc = startLoc.getLocWithOffset(endBuf-startBuf);
1852 startBuf = SM->getCharacterData(startLoc);
1854 assert((*startBuf == '}') && "bogus @synchronized block");
1929 const char *startBuf = SM->getCharacterData(startLoc);
1931 const char *semiBuf = strchr(startBuf, ';');
1933 SourceLocation onePastSemiLoc = startLoc.getLocWithOffset(semiBuf-startBuf+1);
1952 const char *startBuf = SM->getCharacterData(startLoc);
1954 const char *semiBuf = strchr(startBuf, ';');
1956 SourceLocation onePastSemiLoc = startLoc.getLocWithOffset(semiBuf-startBuf+1);
1972 const char *startBuf = SM->getCharacterData(startLoc);
1974 assert((*startBuf == '@') && "bogus @try location");
1988 startBuf = SM->getCharacterData(startLoc);
1990 assert((*startBuf == '}') && "bogus @try block");
2019 startBuf = SM->getCharacterData(startLoc);
2021 assert((*startBuf == '@') && "bogus @catch location");
2023 const char *lParenLoc = strchr(startBuf, '(');
2035 Rewrite.ReplaceText(startLoc, bodyBuf-startBuf+1, buf);
2040 ReplaceText(startLoc, lParenLoc-startBuf+1, buf);
2049 ReplaceText(startLoc, lParenLoc-startBuf+1, buf);
2090 startBuf = SM->getCharacterData(startLoc);
2091 assert((*startBuf == '@') && "bogus @finally start");
2140 const char *startBuf = SM->getCharacterData(startLoc);
2142 assert((*startBuf == '@') && "bogus @throw location");
2152 const char *wBuf = strchr(startBuf, 'w');
2154 ReplaceText(startLoc, wBuf-startBuf+1, buf);
2156 const char *semiBuf = strchr(startBuf, ';');
2158 SourceLocation semiLoc = startLoc.getLocWithOffset(semiBuf-startBuf);
2221 static bool scanForProtocolRefs(const char *startBuf, const char *endBuf,
2223 while (startBuf < endBuf) {
2224 if (*startBuf == '<')
2225 startRef = startBuf; // mark the start.
2226 if (*startBuf == '>') {
2228 endRef = startBuf; // mark the end.
2233 startBuf++;
2284 const char *startBuf = SM->getCharacterData(Loc);
2287 if (scanForProtocolRefs(startBuf, endBuf, startRef, endRef)) {
2289 SourceLocation LessLoc = Loc.getLocWithOffset(startRef-startBuf);
2290 SourceLocation GreaterLoc = Loc.getLocWithOffset(endRef-startBuf+1);
2328 const char *startBuf = endBuf;
2329 while (*startBuf != ';' && *startBuf != '<' && startBuf != MainFileStart)
2330 startBuf--; // scan backward (from the decl location) for return type.
2332 if (scanForProtocolRefs(startBuf, endBuf, startRef, endRef)) {
2344 const char *startBuf = SM->getCharacterData(Loc);
2345 const char *startFuncBuf = startBuf;
2350 const char *endBuf = startBuf;
2354 if (scanForProtocolRefs(startBuf, endBuf, startRef, endRef)) {
2364 startBuf = ++endBuf;
2369 while (*startBuf && *startBuf != ')' && *startBuf != ',')
2370 startBuf++; // scan forward (from the decl location) for argument types.
2371 startBuf++;
2390 const char *startBuf = SM->getCharacterData(DeclLoc);
2402 ReplaceText(DeclLoc, endBuf-startBuf-1, TypeAsString);
2408 ReplaceText(DeclLoc, endBuf-startBuf-1, TypeAsString);
3286 bool RewriteObjC::BufferContainsPPDirectives(const char *startBuf,
3288 while (startBuf < endBuf) {
3289 if (*startBuf == '#') {
3291 for (++startBuf; startBuf[0] == ' ' || startBuf[0] == '\t'; ++startBuf)
3293 if (!strncmp(startBuf, "if", strlen("if")) ||
3294 !strncmp(startBuf, "ifdef", strlen("ifdef")) ||
3295 !strncmp(startBuf, "ifndef", strlen("ifndef")) ||
3296 !strncmp(startBuf, "define", strlen("define")) ||
3297 !strncmp(startBuf, "undef", strlen("undef")) ||
3298 !strncmp(startBuf, "else", strlen("else")) ||
3299 !strncmp(startBuf, "elif", strlen("elif")) ||
3300 !strncmp(startBuf, "endif", strlen("endif")) ||
3301 !strncmp(startBuf, "pragma", strlen("pragma")) ||
3302 !strncmp(startBuf, "include", strlen("include")) ||
3303 !strncmp(startBuf, "import", strlen("import")) ||
3304 !strncmp(startBuf, "include_next", strlen("include_next")))
3307 startBuf++;
3327 const char *startBuf = SM->getCharacterData(LocStart);
3335 ReplaceText(LocStart, endBuf-startBuf, Result);
3347 const char *cursor = strchr(startBuf, '{');
3365 if (BufferContainsPPDirectives(startBuf, cursor)) {
3377 ReplaceText(LocStart, endHeader-startBuf, Result);
3380 ReplaceText(LocStart, cursor-startBuf, Result);
3391 LocStart.getLocWithOffset(cursor-startBuf+1);
3399 SourceLocation atLoc = LocStart.getLocWithOffset(cursor-startBuf);
3416 SourceLocation atLoc = LocStart.getLocWithOffset(cursor-startBuf);
3420 atLoc = LocStart.getLocWithOffset(cursor-startBuf);
3423 SourceLocation caretLoc = LocStart.getLocWithOffset(cursor-startBuf);
3437 ReplaceText(LocStart, endBuf-startBuf, Result);
4913 const char *startBuf = SM->getCharacterData(LocStart);
4923 ReplaceText(LocStart, endBuf-startBuf+1, TypeAsString);
4927 const char *argPtr = startBuf;
4933 LocStart = LocStart.getLocWithOffset(argPtr-startBuf);
4946 const char *startBuf = SM->getCharacterData(DeclLoc);
4947 const char *startArgList = strchr(startBuf, '(');
4953 DeclLoc = DeclLoc.getLocWithOffset(startArgList-startBuf);
5057 const char *startBuf = SM->getCharacterData(DeclLoc);
5058 const char *endBuf = startBuf;
5060 while (*startBuf != '^' && *startBuf != ';' && startBuf != MainFileStart)
5061 startBuf--;
5062 SourceLocation Start = DeclLoc.getLocWithOffset(startBuf-endBuf);
5065 // *startBuf != '^' if we are dealing with a pointer to function that
5067 if (*startBuf == '^') {
5070 startBuf++;
5073 while (*startBuf != ')') {
5074 buf += *startBuf;
5075 startBuf++;
5086 startBuf = SM->getCharacterData(DeclLoc);
5088 GetExtentOfArgList(startBuf, argListBegin, argListEnd);
5204 const char *startBuf = SM->getCharacterData(DeclLoc);
5292 ReplaceText(DeclLoc, endBuf-startBuf+nameSize, ByrefType);
5319 ReplaceText(DeclLoc, endBuf-startBuf, ByrefType);
5765 const char *startBuf = SM->getCharacterData(startLoc);
5770 messString.append(startBuf, endBuf-startBuf+1);