From: Kovarththanan Rajaratnam Date: Sat, 9 Jan 2010 09:31:32 +0000 (+0000) Subject: Switch UndefineBuiltinMacro() over to using StringRef X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3e82f8ac70887905caf5e95efab53fd73f9364e1;p=clang Switch UndefineBuiltinMacro() over to using StringRef git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93049 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Frontend/InitPreprocessor.cpp b/lib/Frontend/InitPreprocessor.cpp index 456d624f73..88f28f3e8e 100644 --- a/lib/Frontend/InitPreprocessor.cpp +++ b/lib/Frontend/InitPreprocessor.cpp @@ -63,11 +63,11 @@ static void DefineBuiltinMacro(std::vector &Buf, llvm::StringRef Macro, // Append a #undef line to Buf for Macro. Macro should be of the form XXX // and we emit "#undef XXX". -static void UndefineBuiltinMacro(std::vector &Buf, const char *Macro) { +static void UndefineBuiltinMacro(std::vector &Buf, llvm::StringRef Macro) { // Push "macroname". const char Command[] = "#undef "; Buf.insert(Buf.end(), Command, Command+strlen(Command)); - Buf.insert(Buf.end(), Macro, Macro+strlen(Macro)); + Buf.insert(Buf.end(), Macro.begin(), Macro.end()); Buf.push_back('\n'); }