Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
Show First 20 Lines • Show All 851 Lines • ▼ Show 20 Lines | void CodeViewDebug::emitCompilerInformation() { | ||||
NamedMDNode *CUs = MMI->getModule()->getNamedMetadata("llvm.dbg.cu"); | NamedMDNode *CUs = MMI->getModule()->getNamedMetadata("llvm.dbg.cu"); | ||||
const MDNode *Node = *CUs->operands().begin(); | const MDNode *Node = *CUs->operands().begin(); | ||||
const auto *CU = cast<DICompileUnit>(Node); | const auto *CU = cast<DICompileUnit>(Node); | ||||
StringRef CompilerVersion = CU->getProducer(); | StringRef CompilerVersion = CU->getProducer(); | ||||
Version FrontVer = parseVersion(CompilerVersion); | Version FrontVer = parseVersion(CompilerVersion); | ||||
OS.AddComment("Frontend version"); | OS.AddComment("Frontend version"); | ||||
for (int N : FrontVer.Part) | for (int N : FrontVer.Part) { | ||||
N = std::min<int>(N, std::numeric_limits<uint16_t>::max()); | |||||
OS.emitInt16(N); | OS.emitInt16(N); | ||||
} | |||||
// Some Microsoft tools, like Binscope, expect a backend version number of at | // Some Microsoft tools, like Binscope, expect a backend version number of at | ||||
// least 8.something, so we'll coerce the LLVM version into a form that | // least 8.something, so we'll coerce the LLVM version into a form that | ||||
// guarantees it'll be big enough without really lying about the version. | // guarantees it'll be big enough without really lying about the version. | ||||
int Major = 1000 * LLVM_VERSION_MAJOR + | int Major = 1000 * LLVM_VERSION_MAJOR + | ||||
10 * LLVM_VERSION_MINOR + | 10 * LLVM_VERSION_MINOR + | ||||
LLVM_VERSION_PATCH; | LLVM_VERSION_PATCH; | ||||
// Clamp it for builds that use unusually large version numbers. | // Clamp it for builds that use unusually large version numbers. | ||||
▲ Show 20 Lines • Show All 2,487 Lines • Show Last 20 Lines |