Home | History | Annotate | Download | only in Lex

Lines Matching refs:Result

45   MacroArgs *Result;
48 Result = (MacroArgs*)malloc(sizeof(MacroArgs) + NumToks*sizeof(Token));
50 new (Result) MacroArgs(NumToks, VarargsElided);
52 Result = *ResultEnt;
54 *ResultEnt = Result->ArgCache;
55 Result->NumUnexpArgTokens = NumToks;
56 Result->VarargsElided = VarargsElided;
59 // Copy the actual unexpanded tokens to immediately after the result ptr.
61 memcpy(const_cast<Token*>(Result->getUnexpArgument(0)),
64 return Result;
113 const Token *Result = Start;
115 for (; Arg; ++Result) {
116 assert(Result < Start+NumUnexpArgTokens && "Invalid arg #");
117 if (Result->is(tok::eof))
120 assert(Result < Start+NumUnexpArgTokens && "Invalid arg #");
121 return Result;
152 std::vector<Token> &Result = PreExpArgTokens[Arg];
153 if (!Result.empty()) return Result;
158 // Otherwise, we have to pre-expand this argument, populating Result. To do
165 // Lex all of the macro-expanded tokens into Result.
167 Result.push_back(Token());
168 Token &Tok = Result.back();
170 } while (Result.back().isNot(tok::eof));
178 return Result;
197 llvm::SmallString<128> Result;
198 Result += "\"";
204 Result += ' ';
216 Result.append(Str.begin(), Str.end());
221 unsigned CurStrLen = Result.size();
222 Result.resize(CurStrLen+Tok.getLength());
223 const char *BufPtr = &Result[CurStrLen];
230 if (BufPtr != &Result[CurStrLen])
231 memcpy(&Result[CurStrLen], BufPtr, ActualTokLen);
235 Result.resize(CurStrLen+ActualTokLen);
242 if (Result.back() == '\\') {
245 unsigned FirstNonSlash = Result.size()-2;
247 while (Result[FirstNonSlash] == '\\')
249 if ((Result.size()-1-FirstNonSlash) & 1) {
252 Result.pop_back(); // remove one of the \'s.
255 Result += '"';
257 // If this is the charify operation and the result is not a legal character
261 Result[0] = '\'';
262 Result[Result.size()-1] = '\'';
266 if (Result.size() == 3)
267 isBad = Result[1] == '\''; // ''' is not legal. '\' already fixed above.
269 isBad = (Result.size() != 4 || Result[1] != '\\'); // Not '\x'
273 Result = "' '"; // Use something arbitrary, but legal.
277 PP.CreateString(&Result[0], Result.size(), Tok, hashInstLoc);