const Value *ReportUnreachableInExit::getRemarkBB() const { return BB; }
std::string ReportUnreachableInExit::getMessage() const {
- std::string BBName = BB->getName();
+ std::string BBName = BB->getName().str();
return "Unreachable in exit block" + BBName;
}
std::string ReportDifferentArrayElementSize::getEndUserMessage() const {
StringRef BaseName = BaseValue->getName();
- std::string Name = BaseName.empty() ? "UNKNOWN" : BaseName;
+ std::string Name = BaseName.empty() ? "UNKNOWN" : BaseName.str();
return "The array \"" + Name +
"\" is accessed through elements that differ "
"in size";
std::string ReportNonAffineAccess::getEndUserMessage() const {
StringRef BaseName = BaseValue->getName();
- std::string Name = BaseName.empty() ? "UNKNOWN" : BaseName;
+ std::string Name = BaseName.empty() ? "UNKNOWN" : BaseName.str();
return "The array subscript of \"" + Name + "\" is not affine";
}
static std::string getCallParamName(CallInst *Call) {
std::string Result;
raw_string_ostream OS(Result);
- std::string Name = Call->getCalledFunction()->getName();
+ std::string Name = Call->getCalledFunction()->getName().str();
auto Iterator = KnownNames.find(Name);
if (Iterator != KnownNames.end())
// we use this name as it is likely to be unique and more useful than just
// a number.
if (Val->hasName())
- ParameterName = Val->getName();
+ ParameterName = Val->getName().str();
else if (LoadInst *LI = dyn_cast<LoadInst>(Val)) {
auto *LoadOrigin = LI->getPointerOperand()->stripInBoundsOffsets();
if (LoadOrigin->hasName()) {
} // namespace
static std::string getFileName(Scop &S, StringRef Suffix = "") {
- std::string FunctionName = S.getFunction().getName();
+ std::string FunctionName = S.getFunction().getName().str();
std::string FileName = FunctionName + "___" + S.getNameStr() + ".jscop";
if (Suffix != "")
std::error_code EC;
ToolOutputFile F(FileName, EC, llvm::sys::fs::OF_Text);
- std::string FunctionName = S.getFunction().getName();
+ std::string FunctionName = S.getFunction().getName().str();
errs() << "Writing JScop '" << S.getNameStr() << "' in function '"
<< FunctionName << "' to '" << FileName << "'.\n";
return false;
}
- isl::set NewContext =
- isl::set{S.getIslCtx().get(), JScop.getString("context").getValue()};
+ isl::set NewContext = isl::set{S.getIslCtx().get(),
+ JScop.getString("context").getValue().str()};
// Check whether the context was parsed successfully.
if (!NewContext) {
// Statistics.
++NewAccessMapFound;
if (NewAccessStrings)
- NewAccessStrings->push_back(Accesses);
+ NewAccessStrings->push_back(Accesses.str());
MA->setNewAccessRelation(isl::manage(NewAccessMap));
} else {
isl_map_free(NewAccessMap);
for (; ArrayIdx < Arrays.size(); ArrayIdx++) {
const json::Object &Array = *Arrays[ArrayIdx].getAsObject();
- auto *ElementType = parseTextType(
- Array.get("type")->getAsString().getValue(), S.getSE()->getContext());
+ auto *ElementType =
+ parseTextType(Array.get("type")->getAsString().getValue().str(),
+ S.getSE()->getContext());
if (!ElementType) {
errs() << "Error while parsing element type for new array.\n";
return false;
const json::Array &SizesArray = *Array.getArray("sizes");
std::vector<unsigned> DimSizes;
for (unsigned i = 0; i < SizesArray.size(); i++) {
- auto Size = std::stoi(SizesArray[i].getAsString().getValue());
+ auto Size = std::stoi(SizesArray[i].getAsString().getValue().str());
// Check if the size if positive.
if (Size <= 0) {
}
auto NewSAI = S.createScopArrayInfo(
- ElementType, Array.getString("name").getValue(), DimSizes);
+ ElementType, Array.getString("name").getValue().str(), DimSizes);
if (Array.get("allocation")) {
NewSAI->setIsOnHeap(Array.getString("allocation").getValue() == "heap");
std::vector<std::string> *NewAccessStrings = nullptr) {
std::string FileName = ImportDir + "/" + getFileName(S, ImportPostfix);
- std::string FunctionName = S.getFunction().getName();
+ std::string FunctionName = S.getFunction().getName().str();
errs() << "Reading JScop '" << S.getNameStr() << "' in function '"
<< FunctionName << "' from '" << FileName << "'.\n";
ErrorOr<std::unique_ptr<MemoryBuffer>> result =