From a10a6062c4139ef7a144caa138e6aaeae785d2a9 Mon Sep 17 00:00:00 2001 From: Konstantin Zhuravlyov Date: Wed, 26 Jul 2017 21:59:45 +0000 Subject: [PATCH] Convert mac file format to unix Differential Revision: https://reviews.llvm.org/D35900 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309193 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Lex/VariadicMacroSupport.h | 112 +++++++++++------------ 1 file changed, 56 insertions(+), 56 deletions(-) diff --git a/include/clang/Lex/VariadicMacroSupport.h b/include/clang/Lex/VariadicMacroSupport.h index dd36e39f4e..a311ee5a42 100644 --- a/include/clang/Lex/VariadicMacroSupport.h +++ b/include/clang/Lex/VariadicMacroSupport.h @@ -1,56 +1,56 @@ -//===- VariadicMacroSupport.h - scope-guards etc. -*- C++ -*---------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file defines support types to help with preprocessing variadic macro -// (i.e. macros that use: ellipses __VA_ARGS__ ) definitions and -// expansions. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_LEX_VARIADICMACROSUPPORT_H -#define LLVM_CLANG_LEX_VARIADICMACROSUPPORT_H - -#include "clang/Lex/Preprocessor.h" - -namespace clang { - -/// An RAII class that tracks when the Preprocessor starts and stops lexing the -/// definition of a (ISO C/C++) variadic macro. As an example, this is useful -/// for unpoisoning and repoisoning certain identifiers (such as __VA_ARGS__) -/// that are only allowed in this context. Also, being a friend of the -/// Preprocessor class allows it to access PP's cached identifiers directly (as -/// opposed to performing a lookup each time). -class VariadicMacroScopeGuard { - const Preprocessor &PP; - IdentifierInfo &Ident__VA_ARGS__; - -public: - VariadicMacroScopeGuard(const Preprocessor &P) - : PP(P), Ident__VA_ARGS__(*PP.Ident__VA_ARGS__) { - assert(Ident__VA_ARGS__.isPoisoned() && "__VA_ARGS__ should be poisoned " - "outside an ISO C/C++ variadic " - "macro definition!"); - } - - /// Client code should call this function just before the Preprocessor is - /// about to Lex tokens from the definition of a variadic (ISO C/C++) macro. - void enterScope() { Ident__VA_ARGS__.setIsPoisoned(false); } - - /// Client code should call this function as soon as the Preprocessor has - /// either completed lexing the macro's definition tokens, or an error occured - /// and the context is being exited. This function is idempotent (might be - /// explicitly called, and then reinvoked via the destructor). - void exitScope() { Ident__VA_ARGS__.setIsPoisoned(true); } - - ~VariadicMacroScopeGuard() { exitScope(); } -}; - -} // end namespace clang - -#endif +//===- VariadicMacroSupport.h - scope-guards etc. -*- C++ -*---------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file defines support types to help with preprocessing variadic macro +// (i.e. macros that use: ellipses __VA_ARGS__ ) definitions and +// expansions. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_LEX_VARIADICMACROSUPPORT_H +#define LLVM_CLANG_LEX_VARIADICMACROSUPPORT_H + +#include "clang/Lex/Preprocessor.h" + +namespace clang { + +/// An RAII class that tracks when the Preprocessor starts and stops lexing the +/// definition of a (ISO C/C++) variadic macro. As an example, this is useful +/// for unpoisoning and repoisoning certain identifiers (such as __VA_ARGS__) +/// that are only allowed in this context. Also, being a friend of the +/// Preprocessor class allows it to access PP's cached identifiers directly (as +/// opposed to performing a lookup each time). +class VariadicMacroScopeGuard { + const Preprocessor &PP; + IdentifierInfo &Ident__VA_ARGS__; + +public: + VariadicMacroScopeGuard(const Preprocessor &P) + : PP(P), Ident__VA_ARGS__(*PP.Ident__VA_ARGS__) { + assert(Ident__VA_ARGS__.isPoisoned() && "__VA_ARGS__ should be poisoned " + "outside an ISO C/C++ variadic " + "macro definition!"); + } + + /// Client code should call this function just before the Preprocessor is + /// about to Lex tokens from the definition of a variadic (ISO C/C++) macro. + void enterScope() { Ident__VA_ARGS__.setIsPoisoned(false); } + + /// Client code should call this function as soon as the Preprocessor has + /// either completed lexing the macro's definition tokens, or an error occured + /// and the context is being exited. This function is idempotent (might be + /// explicitly called, and then reinvoked via the destructor). + void exitScope() { Ident__VA_ARGS__.setIsPoisoned(true); } + + ~VariadicMacroScopeGuard() { exitScope(); } +}; + +} // end namespace clang + +#endif -- 2.40.0