Folks,
Is anyone else the failure below?
On Mac OS X everything builds properly...
Thanks for any help,
snaroff
Folks,
Is anyone else the failure below?
On Mac OS X everything builds properly...
Thanks for any help,
snaroff
Fresh checkout, project generated using cmake, same error.
Look like something in llvmAsmParser.y that it does not like.
llvmAsmParser.y(1275) : error: 'NoCapture' : is not a member of 'llvm::Attribute'
llvmAsmParser.y(1275) : error: 'NoCapture' : undeclared identifier.
Got it.
On Mac OS, the build process update the llvmAsmParser.cpp.cvs file, and then generate llvmAsmParser.cpp from the .cvs file.
But on Window, it does not update the .cvs files (probably because bison is missing), and so, the llvmAsmParser.cpp is not in sync with the .y file.
As the Mac OS build process update the cvs files, commiting them after building on OS X should be enough to solve the issue.
Here's my problem, which I raised on IRC:
JIT::getPointerToFunction gets the address of the start of a function.
But how do I find out where the end of the function is? I need this
to register the function for profiling.
varth said: aph, you need to intercept the "endFunctionBody" call on
the memory manager, it will tell you the start pointer and the end
pointer
But how can I do this? The obvious way would be for me to inherit
from DefaultMemoryManager and pass an instance of my class to
ExecutionEngine::createJIT. But DefaultMemoryManager isn't public so
I can't inherit from it. It's not at all obvious to me how I'm
supposed to intercept endFunctionBody.
Thanks,
Andrew.
Sounds like this has to do with Bill backing out r61019, r61030, and r61040. I think 61031 (which update llvmAsmParser.cpp.cvs, etc.) should be backed out as well. Can someone do that?
Evan
Done. Sorry I forgot.
-bw
Hi Andrew,
Andrew Haley wrote:
Here's my problem, which I raised on IRC:
JIT::getPointerToFunction gets the address of the start of a function.
But how do I find out where the end of the function is? I need this
to register the function for profiling.varth said: aph, you need to intercept the "endFunctionBody" call on
the memory manager, it will tell you the start pointer and the end
pointer
Yep, that's what I said
But how can I do this? The obvious way would be for me to inherit
from DefaultMemoryManager and pass an instance of my class to
ExecutionEngine::createJIT.
Correct.
But DefaultMemoryManager isn't public so
I can't inherit from it.
You should inherit from JITMemoryManager.
It's not at all obvious to me how I'm
supposed to intercept endFunctionBody.
Here's how vmkit does it:
class MvmMemoryManager : public JITMemoryManager {
/// realMemoryManager - The real allocator
JITMemoryManager* realMemoryManager;
public:
MvmMemoryManager() : JITMemoryManager() {
realMemoryManager = JITMemoryManager::CreateDefaultMemManager();
}
And MvmMemoryManager redefines all the virtual functions to call the real memory manager. For endFunctionBody, it inserts in a map the start and end pointers.
Good luck!
Nicolas
Nicolas Geoffray wrote:
Hi Andrew,
Andrew Haley wrote:
Here's my problem, which I raised on IRC:
JIT::getPointerToFunction gets the address of the start of a function.
But how do I find out where the end of the function is? I need this
to register the function for profiling.varth said: aph, you need to intercept the "endFunctionBody" call on
the memory manager, it will tell you the start pointer and the end
pointer
Yep, that's what I saidBut how can I do this? The obvious way would be for me to inherit
from DefaultMemoryManager and pass an instance of my class to
ExecutionEngine::createJIT.Correct.
But DefaultMemoryManager isn't public so
I can't inherit from it.You should inherit from JITMemoryManager.
It's not at all obvious to me how I'm
supposed to intercept endFunctionBody.Here's how vmkit does it:
class MvmMemoryManager : public JITMemoryManager {
/// realMemoryManager - The real allocator
JITMemoryManager* realMemoryManager;public:
MvmMemoryManager() : JITMemoryManager() {
realMemoryManager = JITMemoryManager::CreateDefaultMemManager();
}And MvmMemoryManager redefines all the virtual functions to call the
real memory manager. For endFunctionBody, it inserts in a map the start
and end pointers.
So I have to define *all* the virtual functions and wrap the memory manager
just in order to intercept endFunctionBody? !! Sheesh.
Thanks,
Andrew.
Andrew Haley wrote:
So I have to define *all* the virtual functions and wrap the memory manager
just in order to intercept endFunctionBody? !! Sheesh.
Currently, yes. Or rewrite the memory manager in LLVM
Nicolas