//
// The LLVM Compiler Infrastructure
//
-// This file was developed by the LLVM research group and is distributed under
-// the University of Illinois Open Source License. See LICENSE.TXT for details.
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
#include "llvm/Debugger/ProgramInfo.h"
#include "llvm/Constants.h"
+#include "llvm/Analysis/ValueTracking.h"
#include "llvm/DerivedTypes.h"
#include "llvm/Intrinsics.h"
#include "llvm/IntrinsicInst.h"
#include "llvm/Debugger/SourceFile.h"
#include "llvm/Debugger/SourceLanguage.h"
#include "llvm/Support/SlowOperationInformer.h"
+#include "llvm/Support/Streams.h"
#include "llvm/ADT/STLExtras.h"
using namespace llvm;
if (ConstantInt *CUI = dyn_cast<ConstantInt>(CS->getOperand(1)))
Version = CUI->getZExtValue();
- BaseName = CS->getOperand(3)->getStringValue();
- Directory = CS->getOperand(4)->getStringValue();
+ if (!GetConstantStringInfo(CS->getOperand(3), BaseName))
+ BaseName = "";
+ if (!GetConstantStringInfo(CS->getOperand(4), Directory))
+ Directory = "";
}
}
SourceFile = &PI.getSourceFile(GV);
// Entry #2 is the function name.
- Name = CS->getOperand(2)->getStringValue();
+ if (!GetConstantStringInfo(CS->getOperand(2), Name))
+ Name = "";
}
}
// should be on the use list of the llvm.dbg.translation_units global.
//
GlobalVariable *Units =
- M->getGlobalVariable("llvm.dbg.translation_units",
- StructType::get(std::vector<const Type*>()));
+ M->getGlobalVariable("llvm.dbg.translation_units",
+ StructType::get(M->getContext()));
if (Units == 0)
throw "Program contains no debugging information!";
// should be on the use list of the llvm.dbg.translation_units global.
//
GlobalVariable *Units =
- M->getGlobalVariable("llvm.dbg.globals",
- StructType::get(std::vector<const Type*>()));
+ M->getGlobalVariable("llvm.dbg.globals", StructType::get(M->getContext()));
if (Units == 0)
throw "Program contains no debugging information!";