aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-01-19 06:46:35 +0000
committerChris Lattner <sabre@nondot.org>2009-01-19 06:46:35 +0000
commitbcc2a67e5180612417727cbdd8afd0f79fdf726d (patch)
tree6ec0a17c76a1d8ac80373d73b1e732d125dffc79 /include
parentec0d7a6f4b0699cc9960e6d9fee0f957c64d1cf9 (diff)
Make SourceLocation::getFileLoc private to reduce the API exposure of
SourceLocation. This requires making some cleanups to token pasting and _Pragma expansion. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62490 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/clang/Basic/SourceLocation.h3
-rw-r--r--include/clang/Basic/SourceManager.h1
-rw-r--r--include/clang/Lex/Lexer.h5
3 files changed, 6 insertions, 3 deletions
diff --git a/include/clang/Basic/SourceLocation.h b/include/clang/Basic/SourceLocation.h
index 4c0f0e9d46..858b763666 100644
--- a/include/clang/Basic/SourceLocation.h
+++ b/include/clang/Basic/SourceLocation.h
@@ -64,6 +64,7 @@ private:
/// an input translation unit.
class SourceLocation {
unsigned ID;
+ friend class SourceManager;
public:
enum {
// FileID Layout:
@@ -100,6 +101,7 @@ public:
bool isValid() const { return ID != 0; }
bool isInvalid() const { return ID == 0; }
+private:
static SourceLocation getFileLoc(unsigned ChunkID, unsigned FilePos) {
SourceLocation L;
// If a FilePos is larger than (1<<FilePosBits), the SourceManager makes
@@ -116,6 +118,7 @@ public:
L.ID = (ChunkID << FilePosBits) | FilePos;
return L;
}
+public:
static bool isValidMacroSpellingOffs(int Val) {
if (Val >= 0)
diff --git a/include/clang/Basic/SourceManager.h b/include/clang/Basic/SourceManager.h
index 08929e39c1..629d8ca574 100644
--- a/include/clang/Basic/SourceManager.h
+++ b/include/clang/Basic/SourceManager.h
@@ -324,7 +324,6 @@ public:
return SourceLocation::getFileLoc(FID.ID, 0);
}
-
/// getInstantiationLoc - Return a new SourceLocation that encodes the fact
/// that a token at Loc should actually be referenced from InstantiationLoc.
SourceLocation getInstantiationLoc(SourceLocation Loc,
diff --git a/include/clang/Lex/Lexer.h b/include/clang/Lex/Lexer.h
index afaf4ba07b..42cdd9170a 100644
--- a/include/clang/Lex/Lexer.h
+++ b/include/clang/Lex/Lexer.h
@@ -93,8 +93,9 @@ public:
/// Create_PragmaLexer: Lexer constructor - Create a new lexer object for
/// _Pragma expansion. This has a variety of magic semantics that this method
/// sets up. It returns a new'd Lexer that must be delete'd when done.
- static Lexer *Create_PragmaLexer(SourceLocation TokStartLoc, unsigned TokLen,
- Preprocessor &PP);
+ static Lexer *Create_PragmaLexer(SourceLocation SpellingLoc,
+ SourceLocation InstantiationLoc,
+ unsigned TokLen, Preprocessor &PP);
/// getFeatures - Return the language features currently enabled. NOTE: this