[PATCH] D16139: [MIPS] initFeatureMap() to handle empty string argument
Daniel Sanders via cfe-commits
cfe-commits at lists.llvm.org
Sat Mar 5 06:16:18 PST 2016
dsanders added a comment.
In http://reviews.llvm.org/D16139#368217, @echristo wrote:
> This seems wrong. You should fix setCPU instead or set a default CPU.
We already set a default CPU in the constructor (e.g. Mips32TargetInfoBase::Mips32TargetInfoBase() provides "mips32r2"). It's the CPU argument to initFeatureMap() that's the root problem. In several targets, this argument has the same name as a member variable and is not subject to anything the constructor or setCPU() does to that member variable.
I suspect the right thing to do is to drop the CPU argument and use the member variable instead but there may be differences in value/usage that make this difficult. For now, this patch serves as a stop-gap measure that resolves the empty string to a real CPU name.
More information about the cfe-commits