diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-21 05:54:26 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-21 05:54:26 +0000 |
| commit | c56877035d6600b463a9cbf0e339f7548c0b46fd (patch) | |
| tree | 5b2af13b7f8f097d8de5436a729b39e85427b9f0 /lib/CodeGen/FunctionGen.cc | |
| parent | dd5bbae055fd34ce2e12ef63f8a261c6b15dc83e (diff) | |
feat(codegen): instantiate function templates by deduction
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'lib/CodeGen/FunctionGen.cc')
| -rw-r--r-- | lib/CodeGen/FunctionGen.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/CodeGen/FunctionGen.cc b/lib/CodeGen/FunctionGen.cc index 543bd14..c01b042 100644 --- a/lib/CodeGen/FunctionGen.cc +++ b/lib/CodeGen/FunctionGen.cc @@ -11,7 +11,7 @@ using namespace cps; // Symbols the compiler itself declares (libc + runtime); a user // FUNCTION/PROCEDURE with one of these names would hijack the runtime. -static bool isReservedRuntimeName(const std::string &Name) { +bool FunctionGen::isReservedRuntimeName(const std::string &Name) { static const char *Reserved[] = { "__cps_main", "__cps_user_line", "printf", "scanf", "malloc", "free", "strlen", "memcpy", "strcpy", "strcat", "toupper", "tolower", "sprintf", "snprintf", "strtol", "strtoll", @@ -105,12 +105,12 @@ void FunctionGen::createArgumentAllocas(Function *F, const std::vector<ParamDecl } } -std::vector<const FuncSig *> FunctionGen::getOverloads(const std::string &Name) const { +std::vector<const FuncSig *> FunctionGen::getOverloads(const std::string &Name, bool AllUnits) const { std::vector<const FuncSig *> Result; auto It = Signatures.find(sameIdentifier(Name, "MAIN") ? "__cps_main" : Name); if (It != Signatures.end()) for (const FuncSig &Sig : It->second) - if (!Visible || Visible(Sig.OwnerUnit)) Result.push_back(&Sig); + if (AllUnits || !Visible || Visible(Sig.OwnerUnit)) Result.push_back(&Sig); return Result; } |
