Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
clang-tools-extra/clangd/Preamble.h
Show First 20 Lines • Show All 151 Lines • ▼ Show 20 Lines | public: | ||||
PreambleBounds modifiedBounds() const { return ModifiedBounds; } | PreambleBounds modifiedBounds() const { return ModifiedBounds; } | ||||
/// Returns textual patch contents. | /// Returns textual patch contents. | ||||
llvm::StringRef text() const { return PatchContents; } | llvm::StringRef text() const { return PatchContents; } | ||||
/// Whether diagnostics generated using this patch are trustable. | /// Whether diagnostics generated using this patch are trustable. | ||||
bool preserveDiagnostics() const; | bool preserveDiagnostics() const; | ||||
static constexpr llvm::StringLiteral HeaderName = "__preamble_patch__.h"; | |||||
private: | private: | ||||
static PreamblePatch create(llvm::StringRef FileName, | static PreamblePatch create(llvm::StringRef FileName, | ||||
const ParseInputs &Modified, | const ParseInputs &Modified, | ||||
const PreambleData &Baseline, | const PreambleData &Baseline, | ||||
PatchType PatchType); | PatchType PatchType); | ||||
PreamblePatch() = default; | PreamblePatch() = default; | ||||
std::string PatchContents; | std::string PatchContents; | ||||
std::string PatchFileName; | std::string PatchFileName; | ||||
/// Includes that are present in both \p Baseline and \p Modified. Used for | /// Includes that are present in both \p Baseline and \p Modified. Used for | ||||
/// patching includes of baseline preamble. | /// patching includes of baseline preamble. | ||||
std::vector<Inclusion> PreambleIncludes; | std::vector<Inclusion> PreambleIncludes; | ||||
PreambleBounds ModifiedBounds = {0, false}; | PreambleBounds ModifiedBounds = {0, false}; | ||||
}; | }; | ||||
/// Translates locations inside preamble patch to their main-file equivalent | |||||
/// using presumed locations. Returns \p Loc if it isn't inside preamble patch. | |||||
SourceLocation translatePreamblePatchLocation(SourceLocation Loc, | |||||
const SourceManager &SM); | |||||
} // namespace clangd | } // namespace clangd | ||||
} // namespace clang | } // namespace clang | ||||
#endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_PREAMBLE_H | #endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_PREAMBLE_H |