summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2014-12-19 02:13:56 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2014-12-19 02:13:56 +0000
commitce1d30142c19a05e45f4e73e7dae689ceb6ba26e (patch)
treeda103af4bf274561cd7a494e65f56680ac20f99e
parenta865a1683aeaaeedfb47e0a2d1cb539d513118e5 (diff)
downloadbcm5719-llvm-ce1d30142c19a05e45f4e73e7dae689ceb6ba26e.tar.gz
bcm5719-llvm-ce1d30142c19a05e45f4e73e7dae689ceb6ba26e.zip
Fix layering violation, Lex shouldn't know about Decl
llvm-svn: 224562
-rw-r--r--clang/include/clang/Lex/Token.h9
-rw-r--r--clang/lib/Parse/ParseCXXInlineMethods.cpp4
2 files changed, 6 insertions, 7 deletions
diff --git a/clang/include/clang/Lex/Token.h b/clang/include/clang/Lex/Token.h
index a4b4e125575..4a53c9c1bb1 100644
--- a/clang/include/clang/Lex/Token.h
+++ b/clang/include/clang/Lex/Token.h
@@ -23,7 +23,6 @@
namespace clang {
-class Decl;
class IdentifierInfo;
/// Token - This structure provides full information about a lexed token.
@@ -174,14 +173,14 @@ public:
PtrData = (void*) II;
}
- const Decl *getDecl() const {
+ const void *getEofData() const {
assert(is(tok::eof));
- return reinterpret_cast<const Decl *>(PtrData);
+ return reinterpret_cast<const void *>(PtrData);
}
- void setDecl(const Decl *D) {
+ void setEofData(const void *D) {
assert(is(tok::eof));
assert(!PtrData);
- PtrData = const_cast<Decl *>(D);
+ PtrData = const_cast<void *>(D);
}
/// getRawIdentifier - For a raw identifier token (i.e., an identifier
diff --git a/clang/lib/Parse/ParseCXXInlineMethods.cpp b/clang/lib/Parse/ParseCXXInlineMethods.cpp
index 96d35bc249c..e39f2f1627b 100644
--- a/clang/lib/Parse/ParseCXXInlineMethods.cpp
+++ b/clang/lib/Parse/ParseCXXInlineMethods.cpp
@@ -218,7 +218,7 @@ void Parser::ParseCXXNonStaticMemberInitializer(Decl *VarD) {
Eof.startToken();
Eof.setKind(tok::eof);
Eof.setLocation(Tok.getLocation());
- Eof.setDecl(VarD);
+ Eof.setEofData(VarD);
Toks.push_back(Eof);
}
@@ -624,7 +624,7 @@ void Parser::ParseLexedMemberInitializer(LateParsedMemberInitializer &MI) {
ConsumeAnyToken();
}
// Make sure this is *our* artificial EOF token.
- if (Tok.getDecl() == MI.Field)
+ if (Tok.getEofData() == MI.Field)
ConsumeAnyToken();
}
OpenPOWER on IntegriCloud