//===-- llvm-mc.cpp - Machine Code Hacking Driver ---------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
}
if (!MainFileName.empty())
Ctx.setMainFileName(MainFileName);
- if (GenDwarfForAssembly && DwarfVersion >= 5) {
- // DWARF v5 needs the root file as well as the compilation directory.
- // If we find a '.file 0' directive that will supersede these values.
- MD5 Hash;
- MD5::MD5Result *Cksum =
- (MD5::MD5Result *)Ctx.allocate(sizeof(MD5::MD5Result), 1);
- Hash.update(Buffer->getBuffer());
- Hash.final(*Cksum);
- Ctx.setMCLineTableRootFile(
- /*CUID=*/0, Ctx.getCompilationDir(),
- !MainFileName.empty() ? MainFileName : InputFilename, Cksum, None);
- }
+ if (GenDwarfForAssembly)
+ Ctx.setGenDwarfRootFile(InputFilename, Buffer->getBuffer());
// Package up features to be passed to target/subtarget
std::string FeaturesStr;