Index: lib/CodeGen/BackendUtil.cpp =================================================================== --- lib/CodeGen/BackendUtil.cpp +++ lib/CodeGen/BackendUtil.cpp @@ -573,7 +573,6 @@ Options.DisableIntegratedAS = CodeGenOpts.DisableIntegratedAS; Options.CompressDebugSections = CodeGenOpts.CompressDebugSections; Options.RelaxELFRelocations = CodeGenOpts.RelaxELFRelocations; - Options.DebugInfoForProfiling = CodeGenOpts.DebugInfoForProfiling; // Set EABI version. Options.EABIVersion = llvm::StringSwitch(TargetOpts.EABIVersion) Index: lib/CodeGen/CodeGenModule.cpp =================================================================== --- lib/CodeGen/CodeGenModule.cpp +++ lib/CodeGen/CodeGenModule.cpp @@ -448,6 +448,8 @@ // (and warn about it, too). getModule().addModuleFlag(llvm::Module::Warning, "Debug Info Version", llvm::DEBUG_METADATA_VERSION); + if (CodeGenOpts.DebugInfoForProfiling) + getModule().addModuleFlag(llvm::Module::Warning, "DebugInfoForProfiling", 1); // We need to record the widths of enums and wchar_t, so that we can generate // the correct build attributes in the ARM backend.