mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-16 12:24:03 +00:00
Fix bug 19437 - Only add discriminators for DWARF 4 and above.
Summary: This prevents the discriminator generation pass from triggering if the DWARF version being used in the module is prior to 4. Reviewers: echristo, dblaikie CC: llvm-commits Differential Revision: http://reviews.llvm.org/D3413 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206507 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -23,6 +23,7 @@
|
||||
#include "llvm/IR/InstrTypes.h"
|
||||
#include "llvm/IR/LLVMContext.h"
|
||||
#include "llvm/IR/LeakDetector.h"
|
||||
#include "llvm/Support/Dwarf.h"
|
||||
#include <algorithm>
|
||||
#include <cstdarg>
|
||||
#include <cstdlib>
|
||||
@ -429,3 +430,10 @@ void Module::dropAllReferences() {
|
||||
for(Module::alias_iterator I = alias_begin(), E = alias_end(); I != E; ++I)
|
||||
I->dropAllReferences();
|
||||
}
|
||||
|
||||
unsigned Module::getDwarfVersion() const {
|
||||
Value *Val = getModuleFlag("Dwarf Version");
|
||||
if (!Val)
|
||||
return dwarf::DWARF_VERSION;
|
||||
return cast<ConstantInt>(Val)->getZExtValue();
|
||||
}
|
||||
|
Reference in New Issue
Block a user