Files
revng-revng/lib/Pipeline/GlobalsMap.cpp
Ivan Krysak 7d235f4fd0 Enforce licence header consistency
Also do some basic cleanup: capitalize first letters, add `.`
at the end of the sentences, and so on.
2023-07-03 15:23:10 +00:00

39 lines
1007 B
C++

/// \file GlobalsMap.cpp
//
// This file is distributed under the MIT License. See LICENSE.md for details.
//
#include <system_error>
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/raw_ostream.h"
#include "revng/Pipeline/GlobalsMap.h"
using namespace std;
using namespace pipeline;
using namespace llvm;
llvm::Error GlobalsMap::storeToDisk(llvm::StringRef Path) const {
for (const auto &Global : Map) {
llvm::SmallString<128> Filename;
llvm::sys::path::append(Filename, Path, Global.first);
if (auto E = Global.second->storeToDisk(Filename); !!E)
return E;
}
return llvm::Error::success();
}
llvm::Error GlobalsMap::loadFromDisk(llvm::StringRef Path) {
for (const auto &Global : Map) {
llvm::SmallString<128> Filename;
llvm::sys::path::append(Filename, Path, Global.first);
if (auto E = Global.second->loadFromDisk(Filename); !!E)
return E;
}
return llvm::Error::success();
}