Eliminate some VC++ warnings, patch by Hartmut Kaiser!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41685 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Lex/Lexer.cpp b/Lex/Lexer.cpp
index c45a36a..f8640b3 100644
--- a/Lex/Lexer.cpp
+++ b/Lex/Lexer.cpp
@@ -141,26 +141,26 @@
 /// isIdentifierBody - Return true if this is the body character of an
 /// identifier, which is [a-zA-Z0-9_].
 static inline bool isIdentifierBody(unsigned char c) {
-  return CharInfo[c] & (CHAR_LETTER|CHAR_NUMBER|CHAR_UNDER);
+  return (CharInfo[c] & (CHAR_LETTER|CHAR_NUMBER|CHAR_UNDER)) ? true : false;
 }
 
 /// isHorizontalWhitespace - Return true if this character is horizontal
 /// whitespace: ' ', '\t', '\f', '\v'.  Note that this returns false for '\0'.
 static inline bool isHorizontalWhitespace(unsigned char c) {
-  return CharInfo[c] & CHAR_HORZ_WS;
+  return (CharInfo[c] & CHAR_HORZ_WS) ? true : false;
 }
 
 /// isWhitespace - Return true if this character is horizontal or vertical
 /// whitespace: ' ', '\t', '\f', '\v', '\n', '\r'.  Note that this returns false
 /// for '\0'.
 static inline bool isWhitespace(unsigned char c) {
-  return CharInfo[c] & (CHAR_HORZ_WS|CHAR_VERT_WS);
+  return (CharInfo[c] & (CHAR_HORZ_WS|CHAR_VERT_WS)) ? true : false;
 }
 
 /// isNumberBody - Return true if this is the body character of an
 /// preprocessing number, which is [a-zA-Z0-9_.].
 static inline bool isNumberBody(unsigned char c) {
-  return CharInfo[c] & (CHAR_LETTER|CHAR_NUMBER|CHAR_UNDER|CHAR_PERIOD);
+  return (CharInfo[c] & (CHAR_LETTER|CHAR_NUMBER|CHAR_UNDER|CHAR_PERIOD)) ? true : false;
 }
 
 
diff --git a/Lex/LiteralSupport.cpp b/Lex/LiteralSupport.cpp
index 0428256..c2bdd8e 100644
--- a/Lex/LiteralSupport.cpp
+++ b/Lex/LiteralSupport.cpp
@@ -88,7 +88,7 @@
     for (; ThisTokBuf != ThisTokEnd; ++ThisTokBuf) {
       int CharVal = HexDigitValue(ThisTokBuf[0]);
       if (CharVal == -1) break;
-      Overflow |= ResultChar & 0xF0000000;  // About to shift out a digit?
+      Overflow |= (ResultChar & 0xF0000000) ? true : false;  // About to shift out a digit?
       ResultChar <<= 4;
       ResultChar |= CharVal;
     }
diff --git a/include/clang/AST/Type.h b/include/clang/AST/Type.h
index b58652c..c61cc69 100644
--- a/include/clang/AST/Type.h
+++ b/include/clang/AST/Type.h
@@ -106,13 +106,13 @@
   }
 
   bool isConstQualified() const {
-    return ThePtr & Const;
+    return (ThePtr & Const) ? true : false;
   }
   bool isVolatileQualified() const {
-    return ThePtr & Volatile;
+    return (ThePtr & Volatile) ? true : false;
   }
   bool isRestrictQualified() const {
-    return ThePtr & Restrict;
+    return (ThePtr & Restrict) ? true : false;
   }
   
   /// addConst/addVolatile/addRestrict - add the specified type qual to this
diff --git a/include/clang/Basic/TargetInfo.h b/include/clang/Basic/TargetInfo.h
index 689fbfc..4eb6c3d 100644
--- a/include/clang/Basic/TargetInfo.h
+++ b/include/clang/Basic/TargetInfo.h
@@ -15,6 +15,7 @@
 #define LLVM_CLANG_BASIC_TARGETINFO_H
 
 #include "clang/Basic/SourceLocation.h"
+#include "llvm/Support/DataTypes.h"
 #include <vector>
 #include <string>
 
diff --git a/include/clang/Lex/IdentifierTable.h b/include/clang/Lex/IdentifierTable.h
index 0320164..f18924c 100644
--- a/include/clang/Lex/IdentifierTable.h
+++ b/include/clang/Lex/IdentifierTable.h
@@ -21,7 +21,7 @@
 
 namespace clang {
   class MacroInfo;
-  class LangOptions;
+  struct LangOptions;
   
 /// IdentifierInfo - One of these records is kept for each identifier that
 /// is lexed.  This contains information about whether the token was #define'd,
diff --git a/include/clang/Lex/Token.h b/include/clang/Lex/Token.h
index f336370..a075400 100644
--- a/include/clang/Lex/Token.h
+++ b/include/clang/Lex/Token.h
@@ -96,15 +96,15 @@
   
   /// isAtStartOfLine - Return true if this token is at the start of a line.
   ///
-  bool isAtStartOfLine() const { return Flags & StartOfLine; }
+  bool isAtStartOfLine() const { return (Flags & StartOfLine) ? true : false; }
   
   /// hasLeadingSpace - Return true if this token has whitespace before it.
   ///
-  bool hasLeadingSpace() const { return Flags & LeadingSpace; }
+  bool hasLeadingSpace() const { return (Flags & LeadingSpace) ? true : false; }
   
   /// isExpandDisabled - Return true if this identifier token should never
   /// be expanded in the future, due to C99 6.10.3.4p2.
-  bool isExpandDisabled() const { return Flags & DisableExpand; }
+  bool isExpandDisabled() const { return (Flags & DisableExpand) ? true : false; }
   
   /// isObjCAtKeyword - Return true if we have an ObjC keyword identifier. 
   bool isObjCAtKeyword(tok::ObjCKeywordKind objcKey) const;
@@ -115,7 +115,7 @@
   /// needsCleaning - Return true if this token has trigraphs or escaped
   /// newlines in it.
   ///
-  bool needsCleaning() const { return Flags & NeedsCleaning; }
+  bool needsCleaning() const { return (Flags & NeedsCleaning) ? true : false; }
 };
 
 /// PPConditionalInfo - Information about the conditional stack (#if directives)
diff --git a/include/clang/Parse/DeclSpec.h b/include/clang/Parse/DeclSpec.h
index c0956dc..6a15290 100644
--- a/include/clang/Parse/DeclSpec.h
+++ b/include/clang/Parse/DeclSpec.h
@@ -20,11 +20,11 @@
 #include "llvm/ADT/SmallVector.h"
 
 namespace clang {
-  class LangOptions;
+  struct LangOptions;
   class IdentifierInfo;
   
 /// DeclSpec - This class captures information about "declaration specifiers",
-/// which encompases storage-class-specifiers, type-specifiers, type-qualifiers,
+/// which encompasses storage-class-specifiers, type-specifiers, type-qualifiers,
 /// and function-specifiers.
 class DeclSpec {
 public: