mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 04:30:23 +00:00
Work around pr23045 and make it easier to reproduce.
Dropping old debug format requires the entire module to be read upfront. This was failing only with the gold plugin, but that is just because llvm-link was not upgrading metadata. The new testcase using llvm-link shows the problem. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233381 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
121eb4257d
commit
ac406dfb70
BIN
test/Linker/Inputs/drop-debug.bc
Normal file
BIN
test/Linker/Inputs/drop-debug.bc
Normal file
Binary file not shown.
6
test/Linker/drop-debug.ll
Normal file
6
test/Linker/drop-debug.ll
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
; RUN: llvm-link %p/Inputs/drop-debug.bc -o %t 2>&1 | FileCheck %s
|
||||||
|
|
||||||
|
;; drop-debug.bc was created from "void f(void) {}" with clang 3.5 and
|
||||||
|
; -gline-tables-only, so it contains old debug info.
|
||||||
|
|
||||||
|
; CHECK: warning: ignoring debug info with an invalid version (1) in {{.*}}/Inputs/drop-debug.bc
|
@ -20,7 +20,6 @@
|
|||||||
#include "llvm/Bitcode/ReaderWriter.h"
|
#include "llvm/Bitcode/ReaderWriter.h"
|
||||||
#include "llvm/CodeGen/Analysis.h"
|
#include "llvm/CodeGen/Analysis.h"
|
||||||
#include "llvm/CodeGen/CommandFlags.h"
|
#include "llvm/CodeGen/CommandFlags.h"
|
||||||
#include "llvm/IR/AutoUpgrade.h"
|
|
||||||
#include "llvm/IR/Constants.h"
|
#include "llvm/IR/Constants.h"
|
||||||
#include "llvm/IR/DiagnosticInfo.h"
|
#include "llvm/IR/DiagnosticInfo.h"
|
||||||
#include "llvm/IR/DiagnosticPrinter.h"
|
#include "llvm/IR/DiagnosticPrinter.h"
|
||||||
@ -603,8 +602,11 @@ getModuleForFile(LLVMContext &Context, claimed_file &F,
|
|||||||
|
|
||||||
Module &M = Obj.getModule();
|
Module &M = Obj.getModule();
|
||||||
|
|
||||||
M.materializeMetadata();
|
// Fixme (pr23045). We would like to upgrade the metadata with something like
|
||||||
UpgradeDebugInfo(M);
|
// Result->materializeMetadata();
|
||||||
|
// UpgradeDebugInfo(*Result);
|
||||||
|
// but that fails to drop old debug info from function bodies.
|
||||||
|
M.materializeAllPermanently();
|
||||||
|
|
||||||
SmallPtrSet<GlobalValue *, 8> Used;
|
SmallPtrSet<GlobalValue *, 8> Used;
|
||||||
collectUsedGlobalVariables(M, Used, /*CompilerUsed*/ false);
|
collectUsedGlobalVariables(M, Used, /*CompilerUsed*/ false);
|
||||||
|
@ -69,6 +69,12 @@ loadFile(const char *argv0, const std::string &FN, LLVMContext &Context) {
|
|||||||
if (!Result)
|
if (!Result)
|
||||||
Err.print(argv0, errs());
|
Err.print(argv0, errs());
|
||||||
|
|
||||||
|
// Fixme (pr23045). We would like to upgrade the metadata with something like
|
||||||
|
// Result->materializeMetadata();
|
||||||
|
// UpgradeDebugInfo(*Result);
|
||||||
|
// but that fails to drop old debug info from function bodies.
|
||||||
|
Result->materializeAllPermanently();
|
||||||
|
|
||||||
return Result;
|
return Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user