📄 msvc_objectmodel.cpp
字号:
StructMemberAlignment(alignNotSet), SuppressStartupBanner(unset), TreatWChar_tAsBuiltInType(unset), TurnOffAssemblyGeneration(unset), UndefineAllPreprocessorDefinitions(unset), UsePrecompiledHeader(pchNone), WarnAsError(unset), WarningLevel(warningLevel_0), WholeProgramOptimization(unset){}/* * Some values for the attribute UsePrecompiledHeader have changed from VS 2003 to VS 2005, * see the following chart, so we need a function that transforms those values if we are * using NET2005: * * Meaning 2003 2005 * ----------------------------------------- * Don't use PCH 0 0 * Create PCH (/Yc) 1 1 * Automatically generate (/YX) 2 (seems that it was removed) * Use specific PCH (/Yu) 3 2 * */inline XmlOutput::xml_output xformUsePrecompiledHeaderForNET2005(pchOption whatPch, DotNET compilerVersion){ if (compilerVersion == NET2005) { if (whatPch == pchGenerateAuto) whatPch = (pchOption)0; if (whatPch == pchUseUsingSpecific) whatPch = (pchOption)2; } return attrE(_UsePrecompiledHeader, whatPch);}inline XmlOutput::xml_output xformExceptionHandlingNET2005(exceptionHandling eh, DotNET compilerVersion){ if (eh == ehDefault) return noxml(); if (compilerVersion == NET2005) return attrE(_ExceptionHandling, eh); return attrS(_ExceptionHandling, (eh == ehNoSEH ? "true" : "false"));}XmlOutput &operator<<(XmlOutput &xml, const VCCLCompilerTool &tool){ return xml << tag(_Tool) << attrS(_Name, _VCCLCompilerTool) << attrX(_AdditionalIncludeDirectories, tool.AdditionalIncludeDirectories) << attrX(_AdditionalOptions, tool.AdditionalOptions, " ") << attrX(_AdditionalUsingDirectories, tool.AdditionalUsingDirectories) << attrS(_AssemblerListingLocation, tool.AssemblerListingLocation) << attrE(_AssemblerOutput, tool.AssemblerOutput, /*ifNot*/ asmListingNone) << attrE(_BasicRuntimeChecks, tool.BasicRuntimeChecks, /*ifNot*/ runtimeBasicCheckNone) << attrE(_BrowseInformation, tool.BrowseInformation, /*ifNot*/ brInfoNone) << attrS(_BrowseInformationFile, tool.BrowseInformationFile) << attrT(_BufferSecurityCheck, tool.BufferSecurityCheck) << attrE(_CallingConvention, tool.CallingConvention, /*ifNot*/ callConventionDefault) << attrE(_CompileAs, tool.CompileAs, compileAsDefault) << attrE(_CompileAsManaged, tool.CompileAsManaged, /*ifNot*/ managedDefault) << attrT(_CompileOnly, tool.CompileOnly) << attrE(_DebugInformationFormat, tool.DebugInformationFormat, /*ifNot*/ debugUnknown) << attrT(_DefaultCharIsUnsigned, tool.DefaultCharIsUnsigned) << attrT(_Detect64BitPortabilityProblems, tool.Detect64BitPortabilityProblems) << attrT(_DisableLanguageExtensions, tool.DisableLanguageExtensions) << attrX(_DisableSpecificWarnings, tool.DisableSpecificWarnings) << attrE(_EnableEnhancedInstructionSet, tool.EnableEnhancedInstructionSet, /*ifnot*/ archNotSet) << attrT(_EnableFiberSafeOptimizations, tool.EnableFiberSafeOptimizations) << attrT(_EnableFunctionLevelLinking, tool.EnableFunctionLevelLinking) << attrT(_EnableIntrinsicFunctions, tool.EnableIntrinsicFunctions) << xformExceptionHandlingNET2005(tool.ExceptionHandling, tool.config->CompilerVersion) << attrT(_ExpandAttributedSource, tool.ExpandAttributedSource) << attrE(_FavorSizeOrSpeed, tool.FavorSizeOrSpeed, /*ifNot*/ favorNone) << attrE(_FloatingPointModel, tool.FloatingPointModel, /*ifNot*/ floatingPointNotSet) << attrT(_FloatingPointExceptions, tool.FloatingPointExceptions) << attrT(_ForceConformanceInForLoopScope, tool.ForceConformanceInForLoopScope) << attrX(_ForcedIncludeFiles, tool.ForcedIncludeFiles) << attrX(_ForcedUsingFiles, tool.ForcedUsingFiles) << attrE(_GeneratePreprocessedFile, tool.GeneratePreprocessedFile, /*ifNot*/ preprocessUnknown) << attrT(_GlobalOptimizations, tool.GlobalOptimizations) << attrT(_IgnoreStandardIncludePath, tool.IgnoreStandardIncludePath) << attrT(_ImproveFloatingPointConsistency, tool.ImproveFloatingPointConsistency) << attrE(_InlineFunctionExpansion, tool.InlineFunctionExpansion, /*ifNot*/ expandDefault) << attrT(_KeepComments, tool.KeepComments) << attrT(_MinimalRebuild, tool.MinimalRebuild) << attrS(_ObjectFile, tool.ObjectFile) << attrT(_OmitFramePointers, tool.OmitFramePointers) << attrE(_Optimization, tool.Optimization, /*ifNot*/ optimizeDefault) << attrE(_OptimizeForProcessor, tool.OptimizeForProcessor, /*ifNot*/ procOptimizeBlended) << attrT(_OptimizeForWindowsApplication, tool.OptimizeForWindowsApplication) << attrS(_OutputFile, tool.OutputFile) << attrS(_PrecompiledHeaderFile, tool.PrecompiledHeaderFile) << attrS(_PrecompiledHeaderThrough, tool.PrecompiledHeaderThrough) << attrX(_PreprocessorDefinitions, tool.PreprocessorDefinitions) << (tool.ProgramDataBaseFileName.isNull() ? noxml() : attr(_ProgramDataBaseFileName, tool.ProgramDataBaseFileName)) << attrE(_RuntimeLibrary, tool.RuntimeLibrary, /*ifNot*/ rtUnknown) << attrT(_RuntimeTypeInfo, tool.RuntimeTypeInfo) << attrT(_ShowIncludes, tool.ShowIncludes) << attrT(_SmallerTypeCheck, tool.SmallerTypeCheck) << attrT(_StringPooling, tool.StringPooling) << attrE(_StructMemberAlignment, tool.StructMemberAlignment, /*ifNot*/ alignNotSet) << attrT(_SuppressStartupBanner, tool.SuppressStartupBanner) << attrT(_TreatWChar_tAsBuiltInType, tool.TreatWChar_tAsBuiltInType) << attrT(_TurnOffAssemblyGeneration, tool.TurnOffAssemblyGeneration) << attrT(_UndefineAllPreprocessorDefinitions, tool.UndefineAllPreprocessorDefinitions) << attrX(_UndefinePreprocessorDefinitions, tool.UndefinePreprocessorDefinitions) << (!tool.PrecompiledHeaderFile.isEmpty() || !tool.PrecompiledHeaderThrough.isEmpty() ? xformUsePrecompiledHeaderForNET2005(tool.UsePrecompiledHeader, tool.config->CompilerVersion) : noxml()) << attrT(_WarnAsError, tool.WarnAsError) << attrE(_WarningLevel, tool.WarningLevel, /*ifNot*/ warningLevelUnknown) << attrT(_WholeProgramOptimization, tool.WholeProgramOptimization) << closetag(_Tool);}bool VCCLCompilerTool::parseOption(const char* option){ // skip index 0 ('/' or '-') char first = option[1]; char second = option[2]; char third = option[3]; char fourth = option[4]; bool found = true; switch (first) { case '?': case 'h': qWarning("Generator: Option '/?', '/help': MSVC.NET projects do not support outputting help info"); found = false; break; case '@': qWarning("Generator: Option '/@': MSVC.NET projects do not support the use of a response file"); found = false; break; case 'l': qWarning("Generator: Option '/link': qmake generator does not support passing link options through the compiler tool"); found = false; break; case 'A': if(second != 'I') { found = false; break; } AdditionalUsingDirectories += option+3; break; case 'C': KeepComments = _True; break; case 'D': PreprocessorDefinitions += option+2; break; case 'E': if(second == 'H') { QString opt(option); if (opt.contains('a') && !opt.contains('s') && !opt.contains('c')) ExceptionHandling = ehSEH; else if (!opt.contains('a') && opt.contains('s') && opt.contains('c')) ExceptionHandling = ehNoSEH; else { // ExceptionHandling must be false, or it will override // with an /EHsc option ExceptionHandling = ehNone; AdditionalOptions += option; } if (config->CompilerVersion != NET2005 && ExceptionHandling == ehSEH) { ExceptionHandling = ehNone; AdditionalOptions += option; } break; } GeneratePreprocessedFile = preprocessYes; break; case 'F': if(second <= '9' && second >= '0') { AdditionalOptions += option; break; } else { switch (second) { case 'A': if(third == 'c') { AssemblerOutput = asmListingAsmMachine; if(fourth == 's') AssemblerOutput = asmListingAsmMachineSrc; } else if(third == 's') { AssemblerOutput = asmListingAsmSrc; } else { AssemblerOutput = asmListingAssemblyOnly; } break; case 'a': AssemblerListingLocation = option+3; break; case 'I': ForcedIncludeFiles += option+3; break; case 'R': BrowseInformation = brAllInfo; BrowseInformationFile = option+3; break; case 'r': BrowseInformation = brNoLocalSymbols; BrowseInformationFile = option+3; break; case 'U': ForcedUsingFiles += option+3; break; case 'd': ProgramDataBaseFileName = option+3; break; case 'e': OutputFile = option+3; break; case 'm': AdditionalOptions += option; break; case 'o': ObjectFile = option+3; break; case 'p': PrecompiledHeaderFile = option+3; break; case 'x': ExpandAttributedSource = _True; break; default: found = false; break; } } break; case 'G': switch (second) { case '3': case '4': qWarning("Option '/G3' and '/G4' were phased out in Visual C++ 5.0"); found = false; break; case '5': OptimizeForProcessor = procOptimizePentium; break; case '6': case 'B': OptimizeForProcessor = procOptimizePentiumProAndAbove; break; case '7': OptimizeForProcessor = procOptimizePentium4AndAbove; break; case 'A': OptimizeForWindowsApplication = _True; break; case 'F': StringPooling = _True; break; case 'H': AdditionalOptions += option; break; case 'L': WholeProgramOptimization = _True; if(third == '-') WholeProgramOptimization = _False; break; case 'R': RuntimeTypeInfo = _True; if(third == '-') RuntimeTypeInfo = _False; break; case 'S': BufferSecurityCheck = _True; break; case 'T': EnableFiberSafeOptimizations = _True; break; case 'X': // Same as the /EHsc option, which is Exception Handling without SEH ExceptionHandling = ehNoSEH; break; case 'Z': case 'e': case 'h': AdditionalOptions += option; break; case 'd': CallingConvention = callConventionCDecl; break; case 'f': StringPooling = _True; AdditionalOptions += option; break; case 'm': MinimalRebuild = _True; if(third == '-') MinimalRebuild = _False; break; case 'r': CallingConvention = callConventionFastCall; break; case 's': // Warning: following [num] is not used, // were should we put it? BufferSecurityCheck = _True; break; case 'y': EnableFunctionLevelLinking = _True; break; case 'z': CallingConvention = callConventionStdCall; break; default: found = false; break; }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -