summaryrefslogtreecommitdiffstats
path: root/clang/utils
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2019-12-13 03:37:23 -0500
committerJohn McCall <rjmccall@apple.com>2019-12-14 00:16:48 -0500
commit3ce3d23facf146698c4ef6107d1b9425b3ff5764 (patch)
treed607d66c351b4ed2e1833e376ae43590e220479a /clang/utils
parent139006ceb641f038a2b19cac1174316e57004ed6 (diff)
downloadbcm5719-llvm-3ce3d23facf146698c4ef6107d1b9425b3ff5764.tar.gz
bcm5719-llvm-3ce3d23facf146698c4ef6107d1b9425b3ff5764.zip
Standardize the reader methods in ASTReader; NFC.
There are three significant changes here: - Most of the methods to read various embedded structures (`APInt`, `NestedNameSpecifier`, `DeclarationName`, etc.) have been moved from `ASTReader` to `ASTRecordReader`. This cleans up quite a bit of code which was passing around `(F, Record, Idx)` arguments everywhere or doing explicit indexing, and it nicely parallels how it works on the writer side. It also sets us up to then move most of these methods into the `BasicReader`s that I'm introducing as part of abstract serialization. As part of this, several of the top-level reader methods (e.g. `readTypeRecord`) have been converted to use `ASTRecordReader` internally, which is a nice readability improvement. - I've standardized most of these method names on `readFoo` rather than `ReadFoo` (used in some of the helper structures) or `GetFoo` (used for some specific types for no apparent reason). - I've changed a few of these methods to return their result instead of reading into an argument passed by reference. This is partly for general consistency and partly because it will make the metaprogramming easier with abstract serialization.
Diffstat (limited to 'clang/utils')
-rw-r--r--clang/utils/TableGen/ClangAttrEmitter.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/utils/TableGen/ClangAttrEmitter.cpp b/clang/utils/TableGen/ClangAttrEmitter.cpp
index 6c32c5f8e24..4c3742c8e33 100644
--- a/clang/utils/TableGen/ClangAttrEmitter.cpp
+++ b/clang/utils/TableGen/ClangAttrEmitter.cpp
@@ -102,9 +102,9 @@ static std::string ReadPCHRecord(StringRef type) {
return StringSwitch<std::string>(type)
.EndsWith("Decl *", "Record.GetLocalDeclAs<"
+ std::string(type, 0, type.size()-1) + ">(Record.readInt())")
- .Case("TypeSourceInfo *", "Record.getTypeSourceInfo()")
+ .Case("TypeSourceInfo *", "Record.readTypeSourceInfo()")
.Case("Expr *", "Record.readExpr()")
- .Case("IdentifierInfo *", "Record.getIdentifierInfo()")
+ .Case("IdentifierInfo *", "Record.readIdentifier()")
.Case("StringRef", "Record.readString()")
.Case("ParamIdx", "ParamIdx::deserialize(Record.readInt())")
.Default("Record.readInt()");
@@ -585,7 +585,7 @@ namespace {
OS << " " << getLowerName() << "Ptr = Record.readExpr();\n";
OS << " else\n";
OS << " " << getLowerName()
- << "Ptr = Record.getTypeSourceInfo();\n";
+ << "Ptr = Record.readTypeSourceInfo();\n";
}
void writePCHWrite(raw_ostream &OS) const override {
OpenPOWER on IntegriCloud