summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/Driver/ASTConsumers.h2
-rw-r--r--clang/Driver/CacheTokens.cpp5
-rw-r--r--clang/include/clang/Basic/FileManager.h1
-rw-r--r--clang/include/clang/Basic/IdentifierTable.h2
-rw-r--r--clang/include/clang/Basic/LangOptions.h4
-rw-r--r--clang/include/clang/Basic/SourceManager.h2
-rw-r--r--clang/lib/AST/Builtins.cpp8
-rw-r--r--clang/lib/Basic/SourceManager.cpp6
8 files changed, 21 insertions, 9 deletions
diff --git a/clang/Driver/ASTConsumers.h b/clang/Driver/ASTConsumers.h
index 0093a7046ac..2032a2d598c 100644
--- a/clang/Driver/ASTConsumers.h
+++ b/clang/Driver/ASTConsumers.h
@@ -30,7 +30,7 @@ class FileManager;
class Preprocessor;
class PreprocessorFactory;
struct CompileOptions;
-struct LangOptions;
+class LangOptions;
ASTConsumer *CreateASTPrinter(llvm::raw_ostream* OS = NULL);
diff --git a/clang/Driver/CacheTokens.cpp b/clang/Driver/CacheTokens.cpp
index 02e9f6cff01..d2921f0152c 100644
--- a/clang/Driver/CacheTokens.cpp
+++ b/clang/Driver/CacheTokens.cpp
@@ -26,6 +26,11 @@
#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;
diff --git a/clang/include/clang/Basic/FileManager.h b/clang/include/clang/Basic/FileManager.h
index 5a1aaaa9f1c..6aa88629ce9 100644
--- a/clang/include/clang/Basic/FileManager.h
+++ b/clang/include/clang/Basic/FileManager.h
@@ -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>
diff --git a/clang/include/clang/Basic/IdentifierTable.h b/clang/include/clang/Basic/IdentifierTable.h
index 27697df76c5..c4022b64965 100644
--- a/clang/include/clang/Basic/IdentifierTable.h
+++ b/clang/include/clang/Basic/IdentifierTable.h
@@ -29,7 +29,7 @@ namespace llvm {
}
namespace clang {
- struct LangOptions;
+ class LangOptions;
class IdentifierInfo;
class IdentifierTable;
class SourceLocation;
diff --git a/clang/include/clang/Basic/LangOptions.h b/clang/include/clang/Basic/LangOptions.h
index b85a74bc4ab..96c79aa8aa4 100644
--- a/clang/include/clang/Basic/LangOptions.h
+++ b/clang/include/clang/Basic/LangOptions.h
@@ -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.
diff --git a/clang/include/clang/Basic/SourceManager.h b/clang/include/clang/Basic/SourceManager.h
index 565cb0e17eb..77ad2b2086e 100644
--- a/clang/include/clang/Basic/SourceManager.h
+++ b/clang/include/clang/Basic/SourceManager.h
@@ -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.
diff --git a/clang/lib/AST/Builtins.cpp b/clang/lib/AST/Builtins.cpp
index e345898b79c..92b05975f55 100644
--- a/clang/lib/AST/Builtins.cpp
+++ b/clang/lib/AST/Builtins.cpp
@@ -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);
diff --git a/clang/lib/Basic/SourceManager.cpp b/clang/lib/Basic/SourceManager.cpp
index cc75b87c467..e023a91f2f1 100644
--- a/clang/lib/Basic/SourceManager.cpp
+++ b/clang/lib/Basic/SourceManager.cpp
@@ -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;
}
OpenPOWER on IntegriCloud