File tree
2 files changed
+13
-11
lines changed- lldb
- include/lldb/Utility
- source/Commands
2 files changed
+13
-11
lines changedLines changed: 9 additions & 0 deletions
@@ -302,6 +302,15 @@ class Loader final {
302
302
return GetRoot().CopyByAppendingPathComponent(T::file);
303
303
}
304
304
305
+ template <typename T> llvm::Expected<std::string> LoadBuffer() {
306
+ FileSpec file = GetFile<typename T::Info>();
307
+ llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> buffer =
308
+ llvm::vfs::getRealFileSystem()->getBufferForFile(file.GetPath());
309
+ if (!buffer)
310
+ return llvm::errorCodeToError(buffer.getError());
311
+ return (*buffer)->getBuffer().str();
312
+ }
313
+
305
314
llvm::Error LoadIndex();
306
315
307
316
const FileSpec &GetRoot() const { return m_root; }
Lines changed: 4 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
265 | 265 |
| |
266 | 266 |
| |
267 | 267 |
| |
268 |
| - | |
269 |
| - | |
270 |
| - | |
271 |
| - | |
272 |
| - | |
273 |
| - | |
274 |
| - | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
275 | 271 |
| |
276 | 272 |
| |
277 |
| - | |
278 |
| - | |
279 |
| - | |
280 |
| - | |
| 273 | + | |
281 | 274 |
| |
282 | 275 |
| |
283 | 276 |
| |
|
0 commit comments