There are "FIXME"s in include/llvm/IR/DataLayout.h to remove the default arguments.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
source/Expression/IRInterpreter.cpp | ||
---|---|---|
389 ↗ | (On Diff #122969) | I like that you are trying to get rid of the default arguments to those methods, because I think that there are some "errors" lurking around when using the default arguments. And that is probably the reason for the FIXME in DataLayout (it is about going through the code and making sure we pass the _correct_ address space at every call to those methods). However, when I read your code here it is hard for me to tell if you have analyzed that it is correct to always use address space zero here. It is still a "magic" 0 in the argument. Could you perhaps write this as: // Address space is always 0 here because .... unsigned AS = 0; return Malloc(m_target_data.getPointerSize(AS), m_target_data.getPointerPrefAlignment(AS)); to give the constant a name, and preferably also include a comment describing why it should be zero. |