}
const char *pcm_path = command.GetArgumentAtIndex(0);
- FileSpec pcm_file{pcm_path};
+ const FileSpec pcm_file{pcm_path};
if (pcm_file.GetFileNameExtension() != ".pcm") {
result.AppendError("file must have a .pcm extension");
static constexpr llvm::StringLiteral g_kdk_suffix = ".kdk";
PlatformDarwinKernel *thisp = (PlatformDarwinKernel *)baton;
- FileSpec file_spec(path);
+ const FileSpec file_spec(path);
if (ft == llvm::sys::fs::file_type::directory_file &&
(file_spec.GetFileNameExtension() == g_sdk_suffix ||
file_spec.GetFileNameExtension() == g_kdk_suffix)) {
static constexpr llvm::StringLiteral g_kext_suffix = ".kext";
static constexpr llvm::StringLiteral g_dsym_suffix = ".dSYM";
- FileSpec file_spec(path);
+ const FileSpec file_spec(path);
llvm::StringRef file_spec_extension = file_spec.GetFileNameExtension();
Log *log = GetLog(LLDBLog::Platform);
// it should iterate over every binary in the DWARF subdir
// and return them all.
std::vector<FileSpec>
-PlatformDarwinKernel::GetDWARFBinaryInDSYMBundle(FileSpec dsym_bundle) {
+PlatformDarwinKernel::GetDWARFBinaryInDSYMBundle(const FileSpec &dsym_bundle) {
std::vector<FileSpec> results;
static constexpr llvm::StringLiteral g_dsym_suffix = ".dSYM";
if (dsym_bundle.GetFileNameExtension() != g_dsym_suffix) {
// with the binary inside it ('.../foo.dSYM/Contents/Resources/DWARF/foo').
// A dSYM bundle may have multiple DWARF binaries in them, so a vector
// of matches is returned.
- static std::vector<FileSpec> GetDWARFBinaryInDSYMBundle(FileSpec dsym_bundle);
+ static std::vector<FileSpec>
+ GetDWARFBinaryInDSYMBundle(const FileSpec &dsym_bundle);
Status GetSharedModuleKext(const ModuleSpec &module_spec, Process *process,
lldb::ModuleSP &module_sp,
}
llvm::Error Lua::LoadModule(llvm::StringRef filename) {
- FileSpec file(filename);
+ const FileSpec file(filename);
if (!FileSystem::Instance().Exists(file)) {
return llvm::make_error<llvm::StringError>("invalid path",
llvm::inconvertibleErrorCode());
}
- llvm::StringRef module_extension = file.GetFileNameExtension();
- if (module_extension != ".lua") {
+ if (file.GetFileNameExtension() != ".lua") {
return llvm::make_error<llvm::StringError>("invalid extension",
llvm::inconvertibleErrorCode());
}