From f8362f9e5d8b3e2fdfc2d54cdc5cb45c84dff06b Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Fri, 31 Oct 2008 08:56:51 +0000 Subject: "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 --- clang/lib/Parse/MinimalAction.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'clang/lib/Parse/MinimalAction.cpp') 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()); II->setFETokenInfo(TI); -- cgit v1.2.3