diff options
-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 + "("; |