ccls/src/clang_tu.h

36 lines
1.2 KiB
C
Raw Normal View History

#pragma once
2018-02-22 07:34:32 +00:00
#include "position.h"
#include "working_files.h"
#include <clang/Frontend/ASTUnit.h>
#include <clang/Frontend/CompilerInstance.h>
#include <llvm/Support/CrashRecoveryContext.h>
2018-05-28 00:50:02 +00:00
#include <memory>
#include <string>
#include <vector>
#include <stdlib.h>
std::vector<clang::ASTUnit::RemappedFile>
GetRemapped(const WorkingFiles::Snapshot &snapshot);
2018-05-28 00:50:02 +00:00
Range FromCharRange(const clang::SourceManager &SM, const clang::LangOptions &LangOpts,
clang::SourceRange R,
llvm::sys::fs::UniqueID *UniqueID = nullptr);
Range FromTokenRange(const clang::SourceManager &SM, const clang::LangOptions &LangOpts,
clang::SourceRange R,
llvm::sys::fs::UniqueID *UniqueID = nullptr);
2018-05-28 00:50:02 +00:00
struct ClangTranslationUnit {
static std::unique_ptr<ClangTranslationUnit>
2018-07-15 17:10:24 +00:00
Create(const std::string &filepath, const std::vector<std::string> &args,
const WorkingFiles::Snapshot &snapshot, bool diagnostic);
2018-05-28 00:50:02 +00:00
int Reparse(llvm::CrashRecoveryContext &CRC,
const WorkingFiles::Snapshot &snapshot);
2018-05-28 00:50:02 +00:00
std::shared_ptr<clang::PCHContainerOperations> PCHCO;
std::unique_ptr<clang::ASTUnit> Unit;
2018-05-28 00:50:02 +00:00
};