diff options
Diffstat (limited to 'lib/System/Path.cpp')
-rw-r--r-- | lib/System/Path.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/System/Path.cpp b/lib/System/Path.cpp index 88479fe508..c5a4b0676f 100644 --- a/lib/System/Path.cpp +++ b/lib/System/Path.cpp @@ -194,7 +194,10 @@ Path::isBitcodeFile() const { std::string actualMagic; if (!getMagicNumber(actualMagic, 4)) return false; - return actualMagic == "BC\xC0\xDE"; + LLVMFileType FT = + IdentifyFileType(actualMagic.c_str(), + static_cast<unsigned>(actualMagic.length())); + return FT == Bitcode_FileType; } bool Path::hasMagicNumber(const std::string &Magic) const { |