clang  16.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. More...
 
 TestAST (StringRef Code)
 
 TestAST (TestAST &&M)
 
TestASToperator= (TestAST &&)
 
 ~TestAST ()
 
ASTContextcontext ()
 Provides access to the AST context and other parts of Clang. More...
 
Semasema ()
 
SourceManagersourceManager ()
 
FileManagerfileManager ()
 
Preprocessorpreprocessor ()
 
FrontendActionaction ()
 
llvm::ArrayRef< StoredDiagnosticdiagnostics ()
 Returns diagnostics emitted during parsing. More...
 

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 65 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 75 of file TestAST.cpp.

References clang::TestInputs::Code, clang::TestInputs::ErrorOK, clang::getCC1ArgsForTesting(), and clang::TestInputs::Language.

◆ TestAST() [2/3]

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

Definition at line 73 of file TestAST.h.

◆ TestAST() [3/3]

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

Definition at line 159 of file TestAST.cpp.

◆ ~TestAST()

clang::TestAST::~TestAST ( )

Definition at line 161 of file TestAST.cpp.

Member Function Documentation

◆ action()

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

Definition at line 85 of file TestAST.h.

◆ context()

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

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

Definition at line 80 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 89 of file TestAST.h.

◆ fileManager()

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

Definition at line 83 of file TestAST.h.

◆ operator=()

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

Definition at line 151 of file TestAST.cpp.

◆ preprocessor()

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

Definition at line 84 of file TestAST.h.

◆ sema()

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

Definition at line 81 of file TestAST.h.

◆ sourceManager()

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

Definition at line 82 of file TestAST.h.


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