Logan Chien avatar Logan Chien committed 6f4e0a9

Migrate to newer API.

Following function (left) is deprecated, use the right version

llvm::sys::Path::getLast -> llvm::sys::path::filename
llvm::sys::Path::getBasename -> llvm::sys::path::stem
llvm::sys::Path::getDirname -> llvm::sys::path::parent_path

Comments (0)

Files changed (3)

   ExpandArgv(argc, argv, ArgVector, SavedStrings);
   // Argv0
-  llvm::sys::Path Path = llvm::sys::Path(ArgVector[0]);
-  Argv0 = Path.getBasename();
+  Argv0 = llvm::sys::path::stem(ArgVector[0]);
   // Setup diagnostic engine
   clang::TextDiagnosticPrinter *DiagClient =
   slangAssert((OutputFile != NULL) && (Error != NULL) && (Diag != NULL) &&
               "Invalid parameter!");
-  llvm::sys::Path OutputFilePath(OutputFile);
-  if (SlangUtils::CreateDirectoryWithParents(OutputFilePath.getDirname(),
-                                             Error)) {
+  if (SlangUtils::CreateDirectoryWithParents(
+                        llvm::sys::path::parent_path(OutputFile), Error)) {
     llvm::tool_output_file *F =
           new llvm::tool_output_file(OutputFile, *Error, Flags);
     if (F != NULL)
                                        const clang::SourceManager &SourceMgr) {
   clang::FullSourceLoc FSL(FD->getLocStart(), SourceMgr);
   clang::PresumedLoc PLoc = SourceMgr.getPresumedLoc(FSL);
-  llvm::sys::Path HeaderFilename(PLoc.getFilename());
-  return IsRSHeaderFile(HeaderFilename.getLast().data());
+  return IsRSHeaderFile(llvm::sys::path::filename(PLoc.getFilename()).data());
 SlangRS::SlangRS() : Slang(), mRSContext(NULL), mAllowRSPrefix(false) {
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.