[LLVMdev] getAnalysis<DataLayout>() Causing Compilation Error

Peter Finn peterdfinn at icloud.com
Sun Jun 21 16:31:42 PDT 2015


I’m debugging SAFECode source code files, and in AllocatorInfo.cpp, in the function getObjectSize(Value* V), the function getAnalysis<DataLayout>() is called.  I’ve run into this problem before, and the first time I saw it, my employer recommended I use M.getDataLayout() instead, where M was a reference to a Module.  However, in getObjectSize(Value* V), there is no Module reference in the list of parameters.  Is there a way to obtain a Module affiliated with the Value* argument, which I can then use to call M.getDataLayout?  Is there some other way I can get the DataLayout reference I need?

Thanks,
Peter Finn



More information about the llvm-dev mailing list