clang  10.0.0svn
Functions
DependencyDirectivesSourceMinimizer.cpp File Reference

This is the implementation for minimizing header and source files to the minimum necessary preprocessor directives for evaluating includes. More...

#include "clang/Lex/DependencyDirectivesSourceMinimizer.h"
#include "clang/Basic/CharInfo.h"
#include "clang/Basic/Diagnostic.h"
#include "clang/Lex/LexDiagnostic.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/Support/MemoryBuffer.h"
Include dependency graph for DependencyDirectivesSourceMinimizer.cpp:

Go to the source code of this file.

Functions

static void skipOverSpaces (const char *&First, const char *const End)
 
static LLVM_NODISCARD bool isRawStringLiteral (const char *First, const char *Current)
 
static void skipRawString (const char *&First, const char *const End)
 
static void skipString (const char *&First, const char *const End)
 
static unsigned isEOL (const char *First, const char *const End)
 
static unsigned skipNewline (const char *&First, const char *End)
 
static bool wasLineContinuation (const char *First, unsigned EOLLen)
 
static void skipToNewlineRaw (const char *&First, const char *const End)
 
static const char * reverseOverSpaces (const char *First, const char *Last)
 
static void skipLineComment (const char *&First, const char *const End)
 
static void skipBlockComment (const char *&First, const char *const End)
 
static bool isQuoteCppDigitSeparator (const char *const Start, const char *const Cur, const char *const End)
 
static void skipLine (const char *&First, const char *const End)
 
static void skipDirective (StringRef Name, const char *&First, const char *const End)
 
static void skipWhitespace (const char *&First, const char *const End)
 
static LLVM_NODISCARD const char * lexRawIdentifier (const char *First, const char *const End)
 
static LLVM_NODISCARD const char * getIdentifierContinuation (const char *First, const char *const End)
 
static bool isStartOfRelevantLine (char First)
 
static void skipUTF8ByteOrderMark (const char *&First, const char *const End)
 

Detailed Description

This is the implementation for minimizing header and source files to the minimum necessary preprocessor directives for evaluating includes.

It reduces the source down to #define, #include, #import, , and any conditional preprocessor logic that contains one of those.

Definition in file DependencyDirectivesSourceMinimizer.cpp.

Function Documentation

◆ getIdentifierContinuation()

static LLVM_NODISCARD const char* getIdentifierContinuation ( const char *  First,
const char *const  End 
)
static

◆ isEOL()

static unsigned isEOL ( const char *  First,
const char *const  End 
)
static

◆ isQuoteCppDigitSeparator()

static bool isQuoteCppDigitSeparator ( const char *const  Start,
const char *const  Cur,
const char *const  End 
)
static
Returns
True if the current single quotation mark character is a C++ 14 digit separator.

Definition at line 275 of file DependencyDirectivesSourceMinimizer.cpp.

References clang::isIdentifierBody(), and clang::isPreprocessingNumberBody().

Referenced by skipLine().

◆ isRawStringLiteral()

static LLVM_NODISCARD bool isRawStringLiteral ( const char *  First,
const char *  Current 
)
static

Definition at line 121 of file DependencyDirectivesSourceMinimizer.cpp.

Referenced by skipLine().

◆ isStartOfRelevantLine()

static bool isStartOfRelevantLine ( char  First)
static

◆ lexRawIdentifier()

static LLVM_NODISCARD const char* lexRawIdentifier ( const char *  First,
const char *const  End 
)
static

◆ reverseOverSpaces()

static const char* reverseOverSpaces ( const char *  First,
const char *  Last 
)
static

◆ skipBlockComment()

static void skipBlockComment ( const char *&  First,
const char *const  End 
)
static

Definition at line 260 of file DependencyDirectivesSourceMinimizer.cpp.

References End.

Referenced by skipLine(), and skipWhitespace().

◆ skipDirective()

static void skipDirective ( StringRef  Name,
const char *&  First,
const char *const  End 
)
static

Definition at line 349 of file DependencyDirectivesSourceMinimizer.cpp.

Referenced by isStartOfRelevantLine().

◆ skipLine()

static void skipLine ( const char *&  First,
const char *const  End 
)
static

◆ skipLineComment()

static void skipLineComment ( const char *&  First,
const char *const  End 
)
static

Definition at line 254 of file DependencyDirectivesSourceMinimizer.cpp.

References skipToNewlineRaw().

Referenced by skipLine(), and skipWhitespace().

◆ skipNewline()

static unsigned skipNewline ( const char *&  First,
const char *  End 
)
static

◆ skipOverSpaces()

static void skipOverSpaces ( const char *&  First,
const char *const  End 
)
static

Definition at line 116 of file DependencyDirectivesSourceMinimizer.cpp.

References clang::isHorizontalWhitespace().

Referenced by skipWhitespace().

◆ skipRawString()

static void skipRawString ( const char *&  First,
const char *const  End 
)
static

Definition at line 146 of file DependencyDirectivesSourceMinimizer.cpp.

References clang::Last.

Referenced by skipLine().

◆ skipString()

static void skipString ( const char *&  First,
const char *const  End 
)
static

Definition at line 188 of file DependencyDirectivesSourceMinimizer.cpp.

Referenced by skipLine().

◆ skipToNewlineRaw()

static void skipToNewlineRaw ( const char *&  First,
const char *const  End 
)
static

Definition at line 224 of file DependencyDirectivesSourceMinimizer.cpp.

References isEOL().

Referenced by skipLineComment().

◆ skipUTF8ByteOrderMark()

static void skipUTF8ByteOrderMark ( const char *&  First,
const char *const  End 
)
static

◆ skipWhitespace()

static void skipWhitespace ( const char *&  First,
const char *const  End 
)
static

◆ wasLineContinuation()

static bool wasLineContinuation ( const char *  First,
unsigned  EOLLen 
)
static

Definition at line 220 of file DependencyDirectivesSourceMinimizer.cpp.

Referenced by skipLine().