mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Use Ptr for Member (#786)
This commit is contained in:
@@ -16,7 +16,7 @@ namespace Carbon {
|
||||
struct ClassDefinition {
|
||||
SourceLocation loc;
|
||||
std::string name;
|
||||
std::list<Member*> members;
|
||||
std::list<Ptr<Member>> members;
|
||||
};
|
||||
|
||||
} // namespace Carbon
|
||||
|
||||
@@ -20,7 +20,7 @@ void Declaration::Print(llvm::raw_ostream& out) const {
|
||||
const ClassDefinition& class_def =
|
||||
cast<ClassDeclaration>(*this).Definition();
|
||||
out << "class " << class_def.name << " {\n";
|
||||
for (Member* m : class_def.members) {
|
||||
for (Ptr<Member> m : class_def.members) {
|
||||
out << *m;
|
||||
}
|
||||
out << "}\n";
|
||||
|
||||
@@ -77,7 +77,7 @@ class FunctionDeclaration : public Declaration {
|
||||
class ClassDeclaration : public Declaration {
|
||||
public:
|
||||
ClassDeclaration(SourceLocation loc, std::string name,
|
||||
std::list<Member*> members)
|
||||
std::list<Ptr<Member>> members)
|
||||
: Declaration(Kind::ClassDeclaration, loc),
|
||||
definition({.loc = loc,
|
||||
.name = std::move(name),
|
||||
|
||||
Reference in New Issue
Block a user