[PATCH] D19687: Set PIELevel module flag
Reid Kleckner via cfe-commits
cfe-commits at lists.llvm.org
Thu Apr 28 14:04:24 PDT 2016
rnk accepted this revision.
rnk added a comment.
This revision is now accepted and ready to land.
lgtm
================
Comment at: lib/CodeGen/CodeGenModule.cpp:492-498
@@ +491,9 @@
+ if (uint32_t PLevel = Context.getLangOpts().PIELevel) {
+ llvm::PIELevel::Level PL = llvm::PIELevel::Default;
+ switch (PLevel) {
+ case 0: break;
+ case 1: PL = llvm::PIELevel::Small; break;
+ case 2: PL = llvm::PIELevel::Large; break;
+ default: llvm_unreachable("Invalid PIE Level");
+ }
+
----------------
This seems simpler as:
assert(PLevel < 3 && "invalid PIE level");
getModule().setPIELevel(static_cast<llvm::PIELevel::Level>(PLevel));
http://reviews.llvm.org/D19687
More information about the cfe-commits
mailing list