summaryrefslogtreecommitdiffstats
path: root/llvm/lib/System
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2008-07-22 18:00:36 +0000
committerDevang Patel <dpatel@apple.com>2008-07-22 18:00:36 +0000
commitbd06440440f8a98a3eb75a930cd2720f6269c85e (patch)
treeaa07ca8052b139ff2cf2e4a9ff06931fa8d45f6e /llvm/lib/System
parent57c749294c5d79b0cfaa4cafc4f339eed5e93060 (diff)
downloadbcm5719-llvm-bd06440440f8a98a3eb75a930cd2720f6269c85e.tar.gz
bcm5719-llvm-bd06440440f8a98a3eb75a930cd2720f6269c85e.zip
Handle bitcode wrappers.
llvm-svn: 53924
Diffstat (limited to 'llvm/lib/System')
-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 88479fe5083..c5a4b0676ff 100644
--- a/llvm/lib/System/Path.cpp
+++ b/llvm/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 {
OpenPOWER on IntegriCloud