clang 20.0.0git
Internals.h
Go to the documentation of this file.
1//===-- Internals.h - Implementation Details---------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLVM_CLANG_LIB_ARCMIGRATE_INTERNALS_H
10#define LLVM_CLANG_LIB_ARCMIGRATE_INTERNALS_H
11
15#include "llvm/ADT/ArrayRef.h"
16#include <list>
17#include <optional>
18
19namespace clang {
20 class ASTContext;
21 class Sema;
22 class Stmt;
23
24namespace arcmt {
25
27 typedef std::list<StoredDiagnostic> ListTy;
28 ListTy List;
29
30public:
31 void push_back(const StoredDiagnostic &diag) { List.push_back(diag); }
32
34 bool hasDiagnostic(ArrayRef<unsigned> IDs, SourceRange range) const;
35
36 void reportDiagnostics(DiagnosticsEngine &diags) const;
37
38 bool hasErrors() const;
39
40 typedef ListTy::const_iterator iterator;
41 iterator begin() const { return List.begin(); }
42 iterator end() const { return List.end(); }
43};
44
45void writeARCDiagsToPlist(const std::string &outPath,
47 SourceManager &SM, const LangOptions &LangOpts);
48
50 DiagnosticsEngine &Diags;
51 CapturedDiagList &CapturedDiags;
52 void *Impl; // TransformActionsImpl.
53
54public:
56 ASTContext &ctx, Preprocessor &PP);
58
59 void startTransaction();
60 bool commitTransaction();
61 void abortTransaction();
62
63 void insert(SourceLocation loc, StringRef text);
64 void insertAfterToken(SourceLocation loc, StringRef text);
65 void remove(SourceRange range);
66 void removeStmt(Stmt *S);
67 void replace(SourceRange range, StringRef text);
68 void