From b6b514124d82fcd467210982389c001a7990b2e8 Mon Sep 17 00:00:00 2001 From: Mikhail Glushenkov Date: Wed, 21 Jan 2009 13:04:33 +0000 Subject: [PATCH] Change the hook API back to prevent memory leaks. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62686 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/llvmc/doc/LLVMC-Reference.rst | 2 +- utils/TableGen/LLVMCConfigurationEmitter.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/llvmc/doc/LLVMC-Reference.rst b/tools/llvmc/doc/LLVMC-Reference.rst index 9eb927c1658..53049d7b3c2 100644 --- a/tools/llvmc/doc/LLVMC-Reference.rst +++ b/tools/llvmc/doc/LLVMC-Reference.rst @@ -565,7 +565,7 @@ or names in the configuration file. This can be easily achieved via the hooks mechanism. To write your own hooks, just add their definitions to the ``PluginMain.cpp`` or drop a ``.cpp`` file into the your plugin directory. Hooks should live in the ``hooks`` namespace -and have the signature ``const char* hooks::MyHookName ([const char* +and have the signature ``std::string hooks::MyHookName ([const char* Arg0 [ const char* Arg2 [, ...]]])``. They can be used from the ``cmd_line`` tool property:: diff --git a/utils/TableGen/LLVMCConfigurationEmitter.cpp b/utils/TableGen/LLVMCConfigurationEmitter.cpp index 3de4d37f25e..ec023ba728a 100644 --- a/utils/TableGen/LLVMCConfigurationEmitter.cpp +++ b/utils/TableGen/LLVMCConfigurationEmitter.cpp @@ -1866,7 +1866,7 @@ void EmitHookDeclarations(const ToolDescriptions& ToolDescs, std::ostream& O) { O << "namespace hooks {\n"; for (StringMap::const_iterator B = HookNames.begin(), E = HookNames.end(); B != E; ++B) { - O << Indent1 << "const char* " << B->first() << "("; + O << Indent1 << "std::string " << B->first() << "("; for (unsigned i = 0, j = B->second; i < j; ++i) { O << "const char* Arg" << i << (i+1 == j ? "" : ", "); -- 2.34.1