diff options
author | Chris Lattner <sabre@nondot.org> | 2010-08-17 15:55:45 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-08-17 15:55:45 +0000 |
commit | f47724bf78299c7a50f008e0443c5f9f9f279ddc (patch) | |
tree | b7cf002f25b853d985b12d445f45fa94b338b1a4 /lib/Lex/MacroInfo.cpp | |
parent | 47c03a75d5a6d1dd4d9de21b9b3543e49b825809 (diff) |
Implement #pragma push_macro, patch by Francois Pichet!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111234 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/MacroInfo.cpp')
-rw-r--r-- | lib/Lex/MacroInfo.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/Lex/MacroInfo.cpp b/lib/Lex/MacroInfo.cpp index 7a09986e3d..6eac0364f6 100644 --- a/lib/Lex/MacroInfo.cpp +++ b/lib/Lex/MacroInfo.cpp @@ -23,11 +23,29 @@ MacroInfo::MacroInfo(SourceLocation DefLoc) : Location(DefLoc) { IsFromPCH = false; IsDisabled = false; IsUsed = true; + IsAllowRedefinitionsWithoutWarning = false; ArgumentList = 0; NumArguments = 0; } +MacroInfo::MacroInfo(const MacroInfo &MI, llvm::BumpPtrAllocator &PPAllocator) { + Location = MI.Location; + EndLocation = MI.EndLocation; + ReplacementTokens = MI.ReplacementTokens; + IsFunctionLike = MI.IsFunctionLike; + IsC99Varargs = MI.IsC99Varargs; + IsGNUVarargs = MI.IsGNUVarargs; + IsBuiltinMacro = MI.IsBuiltinMacro; + IsFromPCH = MI.IsFromPCH; + IsDisabled = MI.IsDisabled; + IsUsed = MI.IsUsed; + IsAllowRedefinitionsWithoutWarning = MI.IsAllowRedefinitionsWithoutWarning; + ArgumentList = 0; + NumArguments = 0; + setArgumentList(MI.ArgumentList, MI.NumArguments, PPAllocator); +} + /// isIdenticalTo - Return true if the specified macro definition is equal to /// this macro in spelling, arguments, and whitespace. This is used to emit /// duplicate definition warnings. This implements the rules in C99 6.10.3. |