diff options
Diffstat (limited to 'lib/System/Path.cpp')
-rw-r--r-- | lib/System/Path.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/System/Path.cpp b/lib/System/Path.cpp index 8fc4153acb..5d8de65661 100644 --- a/lib/System/Path.cpp +++ b/lib/System/Path.cpp @@ -196,6 +196,21 @@ StringRef Path::GetDLLSuffix() { } bool +Path::appendSuffix(StringRef suffix) { + if (!suffix.empty()) { + std::string save(path); + path.append("."); + path.append(suffix); + if (!isValid()) { + path = save; + return false; + } + } + + return true; +} + +bool Path::isBitcodeFile() const { std::string actualMagic; if (!getMagicNumber(actualMagic, 4)) |