clang 20.0.0git
Public Member Functions | List of all members
clang::TestAST Class Reference

The result of parsing a file specified by TestInputs. More...

#include "clang/Testing/TestAST.h"

Public Member Functions

 TestAST (const TestInputs &)
 Constructing a TestAST parses the virtual file.
 
 TestAST (StringRef Code)
 
 TestAST (TestAST &&M)
 
TestASToperator= (TestAST &&)
 
 ~TestAST ()
 
ASTContextcontext ()
 Provides access to the AST context and other parts of Clang.
 
Semasema ()
 
SourceManagersourceManager ()
 
FileManagerfileManager ()
 
Preprocessorpreprocessor ()
 
FrontendActionaction ()
 
llvm::ArrayRef< StoredDiagnosticdiagnostics ()
 Returns diagnostics emitted during parsing.
 

Detailed Description

The result of parsing a file specified by TestInputs.

The ASTContext, Sema etc are valid as long as this object is alive.

Definition at line 72 of file TestAST.h.

Constructor & Destructor Documentation

◆ TestAST() [1/3]

clang::TestAST::TestAST ( const TestInputs In)

Constructing a TestAST parses the virtual file.

To keep tests terse, critical errors (e.g. invalid flags) are reported as unit test failures with ADD_FAILURE() and produce an empty ASTContext, Sema etc. This frees the test code from handling these explicitly.

Definition at line 77 of file TestAST.cpp.

References clang::CompilerInvocation::CreateFromArgs(), Filename, clang::getCC1ArgsForTesting(), and clang::getFilenameForTesting().

◆ TestAST() [2/3]

clang::TestAST::TestAST ( StringRef  Code)
inline

Definition at line 80 of file TestAST.h.

◆ TestAST() [3/3]

clang::TestAST::TestAST ( TestAST &&  M)

Definition at line 167 of file TestAST.cpp.

◆ ~TestAST()

clang::TestAST::~TestAST ( )

Definition at line 169 of file TestAST.cpp.

Member Function Documentation

◆ action()

FrontendAction & clang::TestAST::action ( )
inline

Definition at line 92 of file TestAST.h.

◆ context()

ASTContext & clang::TestAST::context ( )
inline

Provides access to the AST context and other parts of Clang.

Definition at line 87 of file TestAST.h.

◆ diagnostics()

llvm::ArrayRef< StoredDiagnostic > clang::TestAST::diagnostics ( )
inline

Returns diagnostics emitted during parsing.

(By default, errors cause test failures, see TestInputs::ErrorOK).

Definition at line 96 of file TestAST.h.

◆ fileManager()

FileManager & clang::TestAST::fileManager ( )
inline

Definition at line 90 of file TestAST.h.

◆ operator=()

TestAST & clang::TestAST::operator= ( TestAST &&  M)

Definition at line 159 of file TestAST.cpp.

◆ preprocessor()

Preprocessor & clang::TestAST::preprocessor ( )
inline

Definition at line 91 of file TestAST.h.

◆ sema()

Sema & clang::TestAST::sema ( )
inline

Definition at line 88 of file TestAST.h.

◆ sourceManager()

SourceManager & clang::TestAST::sourceManager ( )
inline

Definition at line 89 of file TestAST.h.


The documentation for this class was generated from the following files: