Home | History | Annotate | Download | only in Frontend

Lines Matching defs:ASTUnit

1 //===--- ASTUnit.h - ASTUnit utility ----------------------------*- C++ -*-===//
10 // ASTUnit utility class.
65 class ASTUnit : public ModuleLoader {
113 /// \brief Whether the ASTUnit should delete the remapped buffers.
116 /// Track the top-level decls which appeared in an ASTUnit which was loaded
120 // of a PCH file when using the Index library on an ASTUnit loaded from
133 /// The name of the original source file used to generate this ASTUnit.
268 ASTUnit &AST, bool CaptureDiagnostics);
378 ASTUnit(const ASTUnit &) LLVM_DELETED_FUNCTION;
379 void operator=(const ASTUnit &) LLVM_DELETED_FUNCTION;
381 explicit ASTUnit(bool MainFileIsAST);
397 /// \param CI to this ASTUnit.
400 /// \brief Allows us to assert that ASTUnit is not being used concurrently,
404 /// using the ASTUnit in a way that isn't intended to be concurrent, which is
423 ASTUnit &Self;
426 explicit ConcurrencyCheck(ASTUnit &Self)
437 ~ASTUnit();
461 assert(TheSema && "ASTUnit does not have a Sema object!");
476 /// \brief Add a temporary file that the ASTUnit depends on.
478 /// This file will be erased when the ASTUnit is destroyed.
488 /// \brief If this ASTUnit came from an AST file, returns the filename for it.
494 assert(!isMainFileAST() && "Invalid call for AST based ASTUnit!");
501 assert(!isMainFileAST() && "Invalid call for AST based ASTUnit!");
508 assert(!isMainFileAST() && "Invalid call for AST based ASTUnit!");
513 assert(!isMainFileAST() && "Invalid call for AST based ASTUnit!");
637 /// \brief Returns true if the ASTUnit was constructed from a serialized
653 /// \brief Create a ASTUnit. Gets ownership of the passed CompilerInvocation.
654 static ASTUnit *create(CompilerInvocation *CI,
659 /// \brief Create a ASTUnit from an AST file.
664 /// lifetime is expected to extend past that of the returned ASTUnit.
666 /// \returns - The initialized ASTUnit or null if the AST failed to load.
667 static ASTUnit *LoadFromASTFile(const std::string &Filename,
685 /// \c ASTUnit itself is invalid), or \c false otherwise.
690 /// \brief Create an ASTUnit from a source file, via a CompilerInvocation
694 /// source file. The ASTUnit takes ownership of the CompilerInvocation object.
697 /// lifetime is expected to extend past that of the returned ASTUnit.
702 /// \param Unit - optionally an already created ASTUnit. Its ownership is not
705 /// \param Persistent - if true the returned ASTUnit will be complete.
710 /// (e.g. because the PCH could not be loaded), this accepts the ASTUnit
712 /// This will only receive an ASTUnit if a new one was created. If an already
713 /// created ASTUnit was passed in \p Unit then the caller can check that.
715 static ASTUnit *LoadFromCompilerInvocationAction(CompilerInvocation *CI,
718 ASTUnit *Unit = 0,
727 OwningPtr<ASTUnit> *ErrAST = 0);
729 /// LoadFromCompilerInvocation - Create an ASTUnit from a source file, via a
733 /// source file. The ASTUnit takes ownership of the CompilerInvocation object.
736 /// lifetime is expected to extend past that of the returned ASTUnit.
738 // FIXME: Move OnlyLocalDecls, UseBumpAllocator to setters on the ASTUnit, we
740 static ASTUnit *LoadFromCompilerInvocation(CompilerInvocation *CI,
750 /// LoadFromCommandLine - Create an ASTUnit from a vector of command line
758 /// lifetime is expected to extend past that of the returned ASTUnit.
763 /// (e.g. because the PCH could not be loaded), this accepts the ASTUnit
766 // FIXME: Move OnlyLocalDecls, UseBumpAllocator to setters on the ASTUnit, we
768 static ASTUnit *LoadFromCommandLine(const char **ArgBegin,
785 OwningPtr<ASTUnit> *ErrAST = 0);
790 /// \returns True if a failure occurred that causes the ASTUnit not to
840 // ASTUnit doesn't know how to load modules (not that this matters).