[PATCH] D19687: Set PIELevel module flag
Reid Kleckner via cfe-commits
cfe-commits at lists.llvm.org
Thu Apr 28 15:03:23 PDT 2016
rnk added a comment.
still lgtm
================
Comment at: lib/CodeGen/CodeGenModule.cpp:480
@@ -479,8 +479,3 @@
if (uint32_t PLevel = Context.getLangOpts().PICLevel) {
- llvm::PICLevel::Level PL = llvm::PICLevel::Default;
- switch (PLevel) {
- case 0: break;
- case 1: PL = llvm::PICLevel::Small; break;
- case 2: PL = llvm::PICLevel::Large; break;
- default: llvm_unreachable("Invalid PIC Level");
- }
+ assert (PLevel < 3 && "Invalid PIC Level");
+ getModule().setPICLevel(static_cast<llvm::PICLevel::Level>(PLevel));
----------------
formatting nit: no space between 'assert' and '('
http://reviews.llvm.org/D19687
More information about the cfe-commits
mailing list