aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/MinimalAction.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2008-10-31 08:56:51 +0000
committerDaniel Dunbar <daniel@zuster.org>2008-10-31 08:56:51 +0000
commite10b0f236bc8487445bc99b8d14bd40666b1998d (patch)
tree3030724feb334878b30813e384df9f631f68f447 /lib/Parse/MinimalAction.cpp
parent9881cf0f09aeada2894b203c854bd12b1babfd5d (diff)
"One" line fix for -parse-noop failure, "id" and several other things
were being treated as type names for non-Objective-C files. - Other lines are just because MinimalAction didn't have access to the LangOptions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58498 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/MinimalAction.cpp')
-rw-r--r--lib/Parse/MinimalAction.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/Parse/MinimalAction.cpp b/lib/Parse/MinimalAction.cpp
index cb130c3d26..c98830ca79 100644
--- a/lib/Parse/MinimalAction.cpp
+++ b/lib/Parse/MinimalAction.cpp
@@ -28,12 +28,16 @@ struct TypeNameInfo {
}
};
-void MinimalAction:: ActOnTranslationUnitScope(SourceLocation Loc, Scope *S) {
+MinimalAction::MinimalAction(Preprocessor &pp)
+ : Idents(pp.getIdentifierTable()), PP(pp) {}
+
+void MinimalAction::ActOnTranslationUnitScope(SourceLocation Loc, Scope *S) {
TUScope = S;
+ if (!PP.getLangOptions().ObjC1) return;
+
+ // recognize the ObjC built-in type identifiers.
IdentifierInfo *II;
TypeNameInfo *TI;
-
- // recognize the ObjC built-in type identifiers.
II = &Idents.get("id");
TI = new TypeNameInfo(1, II->getFETokenInfo<TypeNameInfo>());
II->setFETokenInfo(TI);