Rename the section embeds bitcode from ".llvmbc,.llvmbc" to "LLVM,bitcode".
The new name matches MachO section naming convention.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
Don't you also need to check the segment name on macho? Or it is just invalid to create a FOO, bitcode?
lib/Object/FunctionIndexObjectFile.cpp | ||
---|---|---|
42 ↗ | (On Diff #48343) | You can just inline the call here (also true in the other case), as there's only one use of this variable. |
lib/Object/ObjectFile.cpp | ||
119 ↗ | (On Diff #48343) | this can be spelled in a more compact form. |
It will probably be better to check the segment name. I was hesitate to do
that because I couldn't figure out a way without adding more virtual method.
Here is a try to make it more robust. Note it does slightly change the
behavior because std::error not longer propagates through findBitcodeInObject.
I think this is fine given that it just mean that a section with a corrupted name is not bitcode. That is the same answer you would get if the corruption had changed the name to __bitcodx.
pcc, what do you think?