]> granicus.if.org Git - clang/commitdiff
Fix the build on win32.
authorCedric Venet <cedric.venet@laposte.net>
Sat, 14 Feb 2009 16:15:20 +0000 (16:15 +0000)
committerCedric Venet <cedric.venet@laposte.net>
Sat, 14 Feb 2009 16:15:20 +0000 (16:15 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64556 91177308-0d34-0410-b5e6-96231b3b80d8

Driver/ASTConsumers.h
Driver/CacheTokens.cpp
include/clang/Basic/FileManager.h
include/clang/Basic/IdentifierTable.h
include/clang/Basic/LangOptions.h
include/clang/Basic/SourceManager.h
lib/AST/Builtins.cpp
lib/Basic/SourceManager.cpp

index 0093a7046acc1fcf1d984cd62adb6418bd450c72..2032a2d598c4b6f429f5cd5d57b506f64326166c 100644 (file)
@@ -30,7 +30,7 @@ class FileManager;
 class Preprocessor;
 class PreprocessorFactory;
 struct CompileOptions;
-struct LangOptions;
+class LangOptions;
 
 ASTConsumer *CreateASTPrinter(llvm::raw_ostream* OS = NULL);
 
index 02e9f6cff01f5cac0d866475a12a7665af066b55..d2921f0152c738bbd905d5138e432491e017835a 100644 (file)
 #include "llvm/Support/Compiler.h"
 #include "llvm/Support/Streams.h"
 
+// FIXME: put this somewhere else?
+#ifndef S_ISDIR
+#define S_ISDIR(x) (((x)&_S_IFDIR)!=0)
+#endif
+
 using namespace clang;
 
 typedef uint32_t Offset;
index 5a1aaaa9f1cd61e25e6c0be5e64ac2b4538d5ce4..6aa88629ce9289d8d98978558bf4656c5dff70b0 100644 (file)
@@ -18,6 +18,7 @@
 #include "llvm/ADT/OwningPtr.h"
 #include "llvm/Bitcode/SerializationFwd.h"
 #include "llvm/Support/Allocator.h"
+#include "llvm/Config/config.h" // for mode_t
 #include <map>
 #include <set>
 #include <string>
index 27697df76c5c944e78f0dbf7703884e2694d456f..c4022b649652ff34e56d384fe8cefce2c322e6bf 100644 (file)
@@ -29,7 +29,7 @@ namespace llvm {
 }
 
 namespace clang {
-  struct LangOptions;
+  class LangOptions;
   class IdentifierInfo;
   class IdentifierTable;
   class SourceLocation;
index b85a74bc4abb2b84d9cece6dc56f86eef2973022..96c79aa8aa4a2e4a0be1c528e19826bcfa34221c 100644 (file)
@@ -20,8 +20,8 @@ namespace clang {
 
 /// LangOptions - This class keeps track of the various options that can be
 /// enabled, which controls the dialect of C that is accepted.
-struct LangOptions {
-  
+class LangOptions {
+public:
   unsigned Trigraphs         : 1;  // Trigraphs in source files.
   unsigned BCPLComment       : 1;  // BCPL-style '//' comments.
   unsigned DollarIdents      : 1;  // '$' allowed in identifiers.
index 565cb0e17eb17f0c60eebeb480a31289104ce1e2..77ad2b2086e6aed4971a545eaba4cd2bd0b41a97 100644 (file)
@@ -571,7 +571,7 @@ public:
                                           FileManager &FMgr);
   
 private:
-  friend struct SrcMgr::ContentCache; // Used for deserialization.
+  friend class SrcMgr::ContentCache; // Used for deserialization.
   
   /// isOffsetInFileID - Return true if the specified FileID contains the
   /// specified SourceLocation offset.  This is a very hot method.
index e345898b79cde5af4bc6adcfd22d65b69ccb28ca..92b05975f5523925d4d309294aed33bd12928264 100644 (file)
@@ -50,7 +50,7 @@ void Builtin::Context::InitializeBuiltins(IdentifierTable &Table,
 }
 
 std::string Builtin::Context::getHeaderName(unsigned ID) const {
-  char *Name = strchr(GetRecord(ID).Attributes, 'f');
+  const char *Name = strchr(GetRecord(ID).Attributes, 'f');
   if (!Name)
     return 0;
   ++Name;
@@ -59,7 +59,7 @@ std::string Builtin::Context::getHeaderName(unsigned ID) const {
     return 0;
 
   ++Name;
-  char *NameEnd = strchr(Name, ':');
+  const char *NameEnd = strchr(Name, ':');
   assert(NameEnd && "Missing ':' after header name");
   return std::string(Name, NameEnd);
 }
@@ -67,7 +67,7 @@ std::string Builtin::Context::getHeaderName(unsigned ID) const {
 bool 
 Builtin::Context::isPrintfLike(unsigned ID, unsigned &FormatIdx, 
                                bool &HasVAListArg) {
-  char *Printf = strpbrk(GetRecord(ID).Attributes, "pP");
+  const char *Printf = strpbrk(GetRecord(ID).Attributes, "pP");
   if (!Printf)
     return false;
 
@@ -77,7 +77,7 @@ Builtin::Context::isPrintfLike(unsigned ID, unsigned &FormatIdx,
   assert(*Printf == ':' && "p or P specifier must have be followed by a ':'");
   ++Printf;
 
-  char *PrintfEnd = strchr(Printf, ':');
+  const char *PrintfEnd = strchr(Printf, ':');
   assert(PrintfEnd && "printf specifier must end with a ':'");
 
   FormatIdx = strtol(Printf, 0, 10);
index cc75b87c467fd8b0429773a149a01c4649817334..e023a91f2f164d9d4be79a0b5094b7f194b71fbc 100644 (file)
@@ -94,6 +94,12 @@ struct LineEntry {
   }
 };
 
+// needed for FindNearestLineEntry (upper_bound of LineEntry)
+inline bool operator<(const LineEntry &lhs, const LineEntry &rhs) {
+  // FIXME: should check the other field?
+  return lhs.FileOffset < rhs.FileOffset;
+}
+
 inline bool operator<(const LineEntry &E, unsigned Offset) {
   return E.FileOffset < Offset;
 }