summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-06-11 15:29:10 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-06-11 15:29:10 +0000
commit4fbf6633024d40dcb7849f45db5a4d41b2a5b3f1 (patch)
tree8a5886e6ba03ef6eae7ca6b4e9eb48c14d6783a1 /include
parentd27a9785d5290a54b1400c85d70e92c2b6106098 (diff)
downloadllvm-4fbf6633024d40dcb7849f45db5a4d41b2a5b3f1.tar.gz
llvm-4fbf6633024d40dcb7849f45db5a4d41b2a5b3f1.tar.bz2
llvm-4fbf6633024d40dcb7849f45db5a4d41b2a5b3f1.tar.xz
Fix variable name style. Don't cast to and from int.
This enables the compiler to see the enum and produce warnings about a switch not being fully covered. Fix one of these warnings. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183749 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Support/FileSystem.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/include/llvm/Support/FileSystem.h b/include/llvm/Support/FileSystem.h
index 9c74554a85..f861f79e2c 100644
--- a/include/llvm/Support/FileSystem.h
+++ b/include/llvm/Support/FileSystem.h
@@ -181,7 +181,7 @@ public:
/// file_magic - An "enum class" enumeration of file types based on magic (the first
/// N bytes of the file).
struct file_magic {
- enum _ {
+ enum Impl {
unknown = 0, ///< Unrecognized file
bitcode, ///< Bitcode file
archive, ///< ar style archive file
@@ -204,16 +204,15 @@ struct file_magic {
};
bool is_object() const {
- return v_ == unknown ? false : true;
+ return V == unknown ? false : true;
}
- file_magic() : v_(unknown) {}
- file_magic(_ v) : v_(v) {}
- explicit file_magic(int v) : v_(_(v)) {}
- operator int() const {return v_;}
+ file_magic() : V(unknown) {}
+ file_magic(Impl V) : V(V) {}
+ operator Impl() const { return V; }
private:
- int v_;
+ Impl V;
};
/// @}