summaryrefslogtreecommitdiffstats
path: root/llvm/lib/System/Path.cpp
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2008-02-20 19:41:22 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2008-02-20 19:41:22 +0000
commit1872ad9888928f4bd87f4c6eee59d17a3d20ad45 (patch)
tree1c0317bef2c44694090aef0d9720de26ca59d2df /llvm/lib/System/Path.cpp
parentcf193b83204199e1621b2bf17e4ca322bc54e3e2 (diff)
downloadbcm5719-llvm-1872ad9888928f4bd87f4c6eee59d17a3d20ad45.tar.gz
bcm5719-llvm-1872ad9888928f4bd87f4c6eee59d17a3d20ad45.zip
Add convenient helper to get suffix of the file
llvm-svn: 47397
Diffstat (limited to 'llvm/lib/System/Path.cpp')
-rw-r--r--llvm/lib/System/Path.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/System/Path.cpp b/llvm/lib/System/Path.cpp
index 6f0667fba50..11035cfee7a 100644
--- a/llvm/lib/System/Path.cpp
+++ b/llvm/lib/System/Path.cpp
@@ -172,7 +172,10 @@ bool Path::hasMagicNumber(const std::string &Magic) const {
return false;
}
-
+std::string
+Path::getSuffix() const {
+ return path.substr(path.rfind('.') + 1);
+}
// Include the truly platform-specific parts of this class.
#if defined(LLVM_ON_UNIX)
OpenPOWER on IntegriCloud