aboutsummaryrefslogtreecommitdiff
path: root/lib/Lex/PPDirectives.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-02-20 22:31:31 +0000
committerChris Lattner <sabre@nondot.org>2009-02-20 22:31:31 +0000
commitcf29e0716bb3ecbbc15b74cd648367d6b075fdf0 (patch)
treed7c63bce9ff21325790470ef37f04f8ea69bd3fd /lib/Lex/PPDirectives.cpp
parent0301b3ff132a4d986c092d161cb77d74b04cd2a6 (diff)
detemplatify setArgumentList and some other cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65187 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/PPDirectives.cpp')
-rw-r--r--lib/Lex/PPDirectives.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/Lex/PPDirectives.cpp b/lib/Lex/PPDirectives.cpp
index 5a100995b8..e6b2f8464d 100644
--- a/lib/Lex/PPDirectives.cpp
+++ b/lib/Lex/PPDirectives.cpp
@@ -40,7 +40,7 @@ MacroInfo *Preprocessor::AllocateMacroInfo(SourceLocation L) {
/// be reused for allocating new MacroInfo objects.
void Preprocessor::ReleaseMacroInfo(MacroInfo* MI) {
MICache.push_back(MI);
- MI->Destroy();
+ MI->FreeArgumentList();
}
@@ -1097,10 +1097,8 @@ bool Preprocessor::ReadMacroDefinitionArgList(MacroInfo *MI) {
switch (Tok.getKind()) {
case tok::r_paren:
// Found the end of the argument list.
- if (Arguments.empty()) { // #define FOO()
- MI->setArgumentList(Arguments.begin(), Arguments.end());
+ if (Arguments.empty()) // #define FOO()
return false;
- }
// Otherwise we have #define FOO(A,)
Diag(Tok, diag::err_pp_expected_ident_in_arg_list);
return true;
@@ -1117,7 +1115,7 @@ bool Preprocessor::ReadMacroDefinitionArgList(MacroInfo *MI) {
// Add the __VA_ARGS__ identifier as an argument.
Arguments.push_back(Ident__VA_ARGS__);
MI->setIsC99Varargs();
- MI->setArgumentList(Arguments.begin(), Arguments.end());
+ MI->setArgumentList(&Arguments[0], Arguments.size());
return false;
case tok::eom: // #define X(
Diag(Tok, diag::err_pp_missing_rparen_in_macro_def);
@@ -1151,7 +1149,7 @@ bool Preprocessor::ReadMacroDefinitionArgList(MacroInfo *MI) {
Diag(Tok, diag::err_pp_expected_comma_in_arg_list);
return true;
case tok::r_paren: // #define X(A)
- MI->setArgumentList(Arguments.begin(), Arguments.end());
+ MI->setArgumentList(&Arguments[0], Arguments.size());
return false;
case tok::comma: // #define X(A,
break;
@@ -1167,7 +1165,7 @@ bool Preprocessor::ReadMacroDefinitionArgList(MacroInfo *MI) {
}
MI->setIsGNUVarargs();
- MI->setArgumentList(Arguments.begin(), Arguments.end());
+ MI->setArgumentList(&Arguments[0], Arguments.size());
return false;
}
}