+ return 0;
+ return cast<ConstantInt>(Val->getValue())->getZExtValue();
+}
+
+unsigned Module::getCodeViewFlag() const {
+ auto *Val = cast_or_null<ConstantAsMetadata>(getModuleFlag("CodeView"));
+ if (!Val)
+ return 0;
+ return cast<ConstantInt>(Val->getValue())->getZExtValue();
+}
+
+Comdat *Module::getOrInsertComdat(StringRef Name) {
+ auto &Entry = *ComdatSymTab.insert(std::make_pair(Name, Comdat())).first;
+ Entry.second.Name = &Entry;
+ return &Entry.second;
+}
+
+PICLevel::Level Module::getPICLevel() const {
+ auto *Val = cast_or_null<ConstantAsMetadata>(getModuleFlag("PIC Level"));
+
+ if (Val == NULL)
+ return PICLevel::Default;
+
+ return static_cast<PICLevel::Level>(
+ cast<ConstantInt>(Val->getValue())->getZExtValue());
+}
+
+void Module::setPICLevel(PICLevel::Level PL) {
+ addModuleFlag(ModFlagBehavior::Error, "PIC Level", PL);