[PATCH] Resurrect the assertion removed by r227717

Jingyue Wu jingyue at google.com
Mon Feb 2 10:12:28 PST 2015


I suspect the issue you saw is a bug in MSVC. There **is** a path from `MDOperand &` to `const MDNode *`. http://llvm.org/docs/doxygen/html/Metadata_8h_source.html#l00547 defines a type caster from `MDOperand &` to `Metadata *`, `Metadata` is a super class of `MDNode`, and finally changing constness is a valid implicit cast.

Anyhow, I noticed `Loop::getLoopID()` returns `MDNode *` instead of `const MDNode *`, and using `MDNode *` seems to work for MSVC. Therefore, I took this approach. Did you confirm it does fix the building error on your end?


http://reviews.llvm.org/D7327

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list