summaryrefslogtreecommitdiffstats
path: root/clang/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
commitf8362f9e5d8b3e2fdfc2d54cdc5cb45c84dff06b (patch)
treee3ba94b1a17f8e27353583c3b06f317f61d91f97 /clang/lib/Parse/MinimalAction.cpp
parent0c248e7ed89fa993c69444a5db740695092bd761 (diff)
downloadbcm5719-llvm-f8362f9e5d8b3e2fdfc2d54cdc5cb45c84dff06b.tar.gz
bcm5719-llvm-f8362f9e5d8b3e2fdfc2d54cdc5cb45c84dff06b.zip
"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. llvm-svn: 58498
Diffstat (limited to 'clang/lib/Parse/MinimalAction.cpp')
-rw-r--r--clang/lib/Parse/MinimalAction.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/clang/lib/Parse/MinimalAction.cpp b/clang/lib/Parse/MinimalAction.cpp
index cb130c3d268..c98830ca79c 100644
--- a/clang/lib/Parse/MinimalAction.cpp
+++ b/clang/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);
OpenPOWER on IntegriCloud