@@ -50,7 +50,7 @@ mlir::Location CIRGenModule::getLoc(SourceRange cRange) {
50
50
return mlir::FusedLoc::get ({begin, end}, metadata, builder.getContext ());
51
51
}
52
52
53
- void CIRGenModule::emitGlobal (clang::GlobalDecl gd) {
53
+ void CIRGenModule::buildGlobal (clang::GlobalDecl gd) {
54
54
const auto *global = cast<ValueDecl>(gd.getDecl ());
55
55
56
56
if (const auto *fd = dyn_cast<FunctionDecl>(global)) {
@@ -71,19 +71,19 @@ void CIRGenModule::emitGlobal(clang::GlobalDecl gd) {
71
71
}
72
72
73
73
// TODO(CIR): Defer emitting some global definitions until later
74
- emitGlobalDefinition (gd);
74
+ buildGlobalDefinition (gd);
75
75
}
76
76
77
- void CIRGenModule::emitGlobalFunctionDefinition (clang::GlobalDecl gd,
78
- mlir::Operation *op) {
77
+ void CIRGenModule::buildGlobalFunctionDefinition (clang::GlobalDecl gd,
78
+ mlir::Operation *op) {
79
79
auto const *funcDecl = cast<FunctionDecl>(gd.getDecl ());
80
80
auto funcOp = builder.create <cir::FuncOp>(
81
81
getLoc (funcDecl->getSourceRange ()), funcDecl->getIdentifier ()->getName ());
82
82
theModule.push_back (funcOp);
83
83
}
84
84
85
- void CIRGenModule::emitGlobalDefinition (clang::GlobalDecl gd,
86
- mlir::Operation *op) {
85
+ void CIRGenModule::buildGlobalDefinition (clang::GlobalDecl gd,
86
+ mlir::Operation *op) {
87
87
const auto *decl = cast<ValueDecl>(gd.getDecl ());
88
88
if (const auto *fd = dyn_cast<FunctionDecl>(decl)) {
89
89
// TODO(CIR): Skip generation of CIR for functions with available_externally
@@ -99,15 +99,15 @@ void CIRGenModule::emitGlobalDefinition(clang::GlobalDecl gd,
99
99
100
100
if (fd->isMultiVersion ())
101
101
errorNYI (fd->getSourceRange (), " multiversion functions" );
102
- emitGlobalFunctionDefinition (gd, op);
102
+ buildGlobalFunctionDefinition (gd, op);
103
103
return ;
104
104
}
105
105
106
- llvm_unreachable (" Invalid argument to CIRGenModule::emitGlobalDefinition " );
106
+ llvm_unreachable (" Invalid argument to CIRGenModule::buildGlobalDefinition " );
107
107
}
108
108
109
109
// Emit code for a single top level declaration.
110
- void CIRGenModule::emitTopLevelDecl (Decl *decl) {
110
+ void CIRGenModule::buildTopLevelDecl (Decl *decl) {
111
111
112
112
// Ignore dependent declarations.
113
113
if (decl->isTemplated ())
@@ -123,7 +123,7 @@ void CIRGenModule::emitTopLevelDecl(Decl *decl) {
123
123
auto *fd = cast<FunctionDecl>(decl);
124
124
// Consteval functions shouldn't be emitted.
125
125
if (!fd->isConsteval ())
126
- emitGlobal (fd);
126
+ buildGlobal (fd);
127
127
break ;
128
128
}
129
129
}
0 commit comments