enum AddrSpaceMapMangling { ASMM_Target, ASMM_On, ASMM_Off };
+ enum MSVCMajorVersion {
+ MSVC2010 = 16,
+ MSVC2012 = 17,
+ MSVC2013 = 18,
+ MSVC2015 = 19
+ };
+
public:
/// \brief Set of enabled sanitizers.
SanitizerSet Sanitize;
!ObjCSubscriptingLegacyRuntime;
}
- bool isCompatibleWithMSVC(unsigned MajorVersion) const {
+ bool isCompatibleWithMSVC(MSVCMajorVersion MajorVersion) const {
return MSCompatibilityVersion >= MajorVersion * 10000000U;
}
isa<TemplateTemplateParmDecl>(Parm))
// MSVC 2015 changed the mangling for empty expanded template packs,
// use the old mangling for link compatibility for old versions.
- Out << (Context.getASTContext().getLangOpts().isCompatibleWithMSVC(19)
+ Out << (Context.getASTContext().getLangOpts().isCompatibleWithMSVC(
+ LangOptions::MSVC2015)
? "$$V"
: "$$$V");
else if (isa<NonTypeTemplateParmDecl>(Parm))
// Don't add this keyword under MSVCCompat.
if (LangOpts.MSVCCompat && (Flags & KEYNOMS18) &&
- !LangOpts.isCompatibleWithMSVC(19))
+ !LangOpts.isCompatibleWithMSVC(LangOptions::MSVC2015))
return;
// Don't add this keyword under OpenCL.
// FIXME We cannot encode the revision information into 32-bits
Builder.defineMacro("_MSC_BUILD", Twine(1));
- if (Opts.CPlusPlus11 && Opts.isCompatibleWithMSVC(19))
+ if (Opts.CPlusPlus11 && Opts.isCompatibleWithMSVC(LangOptions::MSVC2015))
Builder.defineMacro("_HAS_CHAR16_T_LANGUAGE_SUPPORT", Twine(1));
}
name = "_ZSt9terminatev";
} else if (getLangOpts().CPlusPlus &&
getTarget().getCXXABI().isMicrosoft()) {
- if (getLangOpts().isCompatibleWithMSVC(19))
+ if (getLangOpts().isCompatibleWithMSVC(LangOptions::MSVC2015))
name = "__std_terminate";
else
name = "\01?terminate@@YAXXZ";
OS << ',';
// Visual Studio 2010 or earlier expects column number to be off by one
if (LangOpts.MSCompatibilityVersion &&
- LangOpts.MSCompatibilityVersion < 170000000)
+ !LangOpts.isCompatibleWithMSVC(LangOptions::MSVC2012))
ColNo--;
} else
OS << ':';
// We will pick our mangling number depending on which version of MSVC is being
// targeted.
static unsigned getMSManglingNumber(const LangOptions &LO, Scope *S) {
- return LO.isCompatibleWithMSVC(19) ? S->getMSCurManglingNumber()
- : S->getMSLastManglingNumber();
+ return LO.isCompatibleWithMSVC(LangOptions::MSVC2015)
+ ? S->getMSCurManglingNumber()
+ : S->getMSLastManglingNumber();
}
void Sema::handleTagNumbering(const TagDecl *Tag, Scope *TagScope) {
// MSVC versions before 2015 don't export the move assignment operators,
// so don't attempt to import them if we have a definition.
if (ClassImported && MD->isMoveAssignmentOperator() &&
- !S.getLangOpts().isCompatibleWithMSVC(19))
+ !S.getLangOpts().isCompatibleWithMSVC(LangOptions::MSVC2015))
continue;
}
}