diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-12-03 20:53:37 -0500 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-12-03 20:53:37 -0500 |
commit | 4b538b9e48d6e729caeeccefb0974d524c476d33 (patch) | |
tree | 3f82508c4167bbf5d32154b9c52dcd308301e486 | |
parent | 30ffd65550ba806a6ac1e66767e58bc565004c67 (diff) |
ensure function tables
-rw-r--r-- | lib/Target/CppBackend/CPPBackend.cpp | 4 | ||||
-rw-r--r-- | lib/Target/CppBackend/CallHandlers.h | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/lib/Target/CppBackend/CPPBackend.cpp b/lib/Target/CppBackend/CPPBackend.cpp index eee89ed9d1..3330f74691 100644 --- a/lib/Target/CppBackend/CPPBackend.cpp +++ b/lib/Target/CppBackend/CPPBackend.cpp @@ -258,6 +258,10 @@ namespace { IndexedFunctions[Name] = Index; return Index; } + void ensureFunctionTable(const FunctionType *F) { + std::string Sig = getFunctionSignature(F); + FunctionTables[Sig]; + } // Return a constant we are about to write into a global as a numeric offset. If the // value is not known at compile time, emit a postSet to that location. unsigned getConstAsOffset(const Value *V, unsigned AbsoluteTarget) { diff --git a/lib/Target/CppBackend/CallHandlers.h b/lib/Target/CppBackend/CallHandlers.h index 927d60a01f..a6a2f7399e 100644 --- a/lib/Target/CppBackend/CallHandlers.h +++ b/lib/Target/CppBackend/CallHandlers.h @@ -18,6 +18,7 @@ DEF_CALL_HANDLER(__default__, { FunctionType *FT = dyn_cast<FunctionType>(dyn_cast<PointerType>(CV->getType())->getElementType()); std::string Sig = getFunctionSignature(FT); Name = std::string("FUNCTION_TABLE_") + Sig + "[" + Name + " & #FM_" + Sig + "#]"; + ensureFunctionTable(FT); } Type *RT = CI->getType(); std::string text = Name + "("; |