Files
revng-revng/lib/Pipeline/GlobalsMap.cpp
Giacomo Vercesi 0b2754c824 pipeline: drop Disk from storage methods
This commit changes the following method names across the codebase:
* `storeToDisk` -> `store`
* `loadFromDisk` -> `load`
This has been done since the storage is no longer bound to the local
storage.
2023-09-06 15:23:43 +02:00

37 lines
929 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::store(const revng::DirectoryPath &Path) const {
for (const auto &Global : Map) {
revng::FilePath Filename = Path.getFile(Global.first);
if (auto E = Global.second->store(Filename); !!E)
return E;
}
return llvm::Error::success();
}
llvm::Error GlobalsMap::load(const revng::DirectoryPath &Path) {
for (const auto &Global : Map) {
revng::FilePath Filename = Path.getFile(Global.first);
if (auto E = Global.second->load(Filename); !!E)
return E;
}
return llvm::Error::success();
}