[PATCH] D36556: [IR] AutoUpgrade ModuleFlagBehavior for PIC and PIE level
Duncan P. N. Exon Smith via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 18 18:02:49 PDT 2017
dexonsmith requested changes to this revision.
dexonsmith added inline comments.
This revision now requires changes to proceed.
================
Comment at: lib/IR/AutoUpgrade.cpp:2305-2311
+ if (ID->getString() == "PIC Level" || ID->getString() == "PIE Level") {
+ if (auto *Behavior =
+ mdconst::dyn_extract_or_null<ConstantInt>(Op->getOperand(0))) {
+ if (Behavior->getLimitedValue() == Module::Error)
+ MFBUpdate = true;
+ }
+ }
----------------
I think you should just change `ModFlags->getOperand(I)` in place. I think you'll need to add some API to `NamedMDNode`, but that should be straightforward.
https://reviews.llvm.org/D36556
More information about the llvm-commits
mailing list