mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 07:38:19 +00:00
script_opt: Use Func::GetName()
This commit is contained in:
parent
89127722ea
commit
71e9c8d436
16 changed files with 49 additions and 48 deletions
|
@ -19,7 +19,7 @@ void CPPCompile::DeclareFunc(const FuncInfo& func) {
|
|||
CreateFunction(f->GetType(), pf, fname, body, priority, nullptr, f->Flavor());
|
||||
|
||||
if ( f->GetBodies().size() == 1 )
|
||||
compiled_simple_funcs[f->Name()] = fname;
|
||||
compiled_simple_funcs[f->GetName()] = fname;
|
||||
}
|
||||
|
||||
void CPPCompile::DeclareLambda(const LambdaExpr* l, const ProfileFunc* pf) {
|
||||
|
|
|
@ -47,7 +47,7 @@ void CPPCompile::Compile(bool report_uncompilable) {
|
|||
if ( ! allow_cond && ! func.ShouldSkip() && ! ofiles.empty() && files_with_conditionals.count(fn) > 0 ) {
|
||||
if ( report_uncompilable )
|
||||
reporter->Warning("%s cannot be compiled to C++ due to source file %s having conditional code",
|
||||
f->Name(), fn.c_str());
|
||||
f->GetName().c_str(), fn.c_str());
|
||||
|
||||
else if ( filenames_reported_as_skipped.count(fn) == 0 ) {
|
||||
reporter->Warning("skipping compilation of files in %s due to presence of conditional code",
|
||||
|
@ -60,7 +60,7 @@ void CPPCompile::Compile(bool report_uncompilable) {
|
|||
}
|
||||
|
||||
if ( func.ShouldSkip() ) {
|
||||
not_fully_compilable.insert(f->Name());
|
||||
not_fully_compilable.insert(f->GetName());
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -79,10 +79,10 @@ void CPPCompile::Compile(bool report_uncompilable) {
|
|||
else {
|
||||
if ( reason && report_uncompilable ) {
|
||||
had_to_skip = true;
|
||||
reporter->Warning("%s cannot be compiled to C++ due to %s", f->Name(), reason);
|
||||
reporter->Warning("%s cannot be compiled to C++ due to %s", f->GetName().c_str(), reason);
|
||||
}
|
||||
|
||||
not_fully_compilable.insert(f->Name());
|
||||
not_fully_compilable.insert(f->GetName());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -177,7 +177,7 @@ void CPPCompile::DeclareLocals(const ProfileFunc* pf, const IDPList* lambda_ids)
|
|||
string CPPCompile::BodyName(const FuncInfo& func) {
|
||||
const auto& f = func.Func();
|
||||
const auto& body = func.Body();
|
||||
string fname = f->Name();
|
||||
auto fname = f->GetName();
|
||||
|
||||
// Extend name with location information.
|
||||
auto loc = body->GetLocationInfo();
|
||||
|
|
|
@ -282,15 +282,15 @@ void CPPCompile::GenStandaloneActivation() {
|
|||
hashes = "{" + hashes + "}";
|
||||
|
||||
auto f = fb.first;
|
||||
auto fn = f->Name();
|
||||
const auto& fn = f->GetName();
|
||||
const auto& ft = f->GetType();
|
||||
|
||||
auto var = extract_var_name(fn);
|
||||
auto mod = extract_module_name(fn);
|
||||
auto var = extract_var_name(fn.c_str());
|
||||
auto mod = extract_module_name(fn.c_str());
|
||||
|
||||
auto fid = lookup_ID(var.c_str(), mod.c_str(), false, true, false);
|
||||
if ( ! fid )
|
||||
reporter->InternalError("can't find identifier %s", fn);
|
||||
reporter->InternalError("can't find identifier %s", fn.c_str());
|
||||
|
||||
auto exported = fid->IsExport() ? "true" : "false";
|
||||
|
||||
|
|
|
@ -283,7 +283,7 @@ FuncConstInfo::FuncConstInfo(CPPCompile* _c, ValPtr v) : CompoundItemInfo(_c, v)
|
|||
|
||||
void FuncConstInfo::InitializerVals(std::vector<std::string>& ivs) const {
|
||||
auto f = fv->AsFunc();
|
||||
const auto& fn = f->Name();
|
||||
const auto& fn = f->GetName();
|
||||
const auto& bodies = f->GetBodies();
|
||||
|
||||
ivs.emplace_back(Fmt(type));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue