[cfe-commits] r147452 - in /cfe/trunk: include/clang/AST/ include/clang/Basic/ include/clang/Lex/ include/clang/Parse/ include/clang/Sema/ lib/AST/ lib/Lex/ lib/Parse/ lib/Sema/ test/Modules/ test/Modules/Inputs/

Douglas Gregor dgregor at apple.com
Tue Jan 3 10:04:47 PST 2012


Author: dgregor
Date: Tue Jan  3 12:04:46 2012
New Revision: 147452

URL: http://llvm.org/viewvc/llvm-project?rev=147452&view=rev
Log:
Introduce a non-uglified syntax for module imports in Objective-C:

  @import identifier [. identifier]* ;


Modified:
    cfe/trunk/include/clang/AST/Decl.h
    cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td
    cfe/trunk/include/clang/Basic/IdentifierTable.h
    cfe/trunk/include/clang/Basic/TokenKinds.def
    cfe/trunk/include/clang/Lex/Preprocessor.h
    cfe/trunk/include/clang/Parse/Parser.h
    cfe/trunk/include/clang/Sema/Sema.h
    cfe/trunk/lib/AST/Decl.cpp
    cfe/trunk/lib/AST/DeclPrinter.cpp
    cfe/trunk/lib/Lex/Preprocessor.cpp
    cfe/trunk/lib/Parse/ParseObjc.cpp
    cfe/trunk/lib/Parse/Parser.cpp
    cfe/trunk/lib/Sema/SemaDecl.cpp
    cfe/trunk/test/Modules/Inputs/category_bottom.h
    cfe/trunk/test/Modules/Inputs/category_left.h
    cfe/trunk/test/Modules/Inputs/category_right.h
    cfe/trunk/test/Modules/Inputs/redecl-merge-bottom.h
    cfe/trunk/test/Modules/Inputs/redecl-merge-left-left.h
    cfe/trunk/test/Modules/Inputs/redecl-merge-left.h
    cfe/trunk/test/Modules/Inputs/redecl-merge-right.h
    cfe/trunk/test/Modules/decldef.mm
    cfe/trunk/test/Modules/header-import.m
    cfe/trunk/test/Modules/inferred-submodules.m
    cfe/trunk/test/Modules/lookup.m
    cfe/trunk/test/Modules/objc-categories.m
    cfe/trunk/test/Modules/on-demand-build-warnings.m
    cfe/trunk/test/Modules/on-demand-build.m
    cfe/trunk/test/Modules/on-demand-macros.m
    cfe/trunk/test/Modules/redecl-merge.m
    cfe/trunk/test/Modules/redeclarations.m
    cfe/trunk/test/Modules/requires.m
    cfe/trunk/test/Modules/subframeworks.m
    cfe/trunk/test/Modules/submodules.m

Modified: cfe/trunk/include/clang/AST/Decl.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Decl.h?rev=147452&r1=147451&r2=147452&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Decl.h (original)
+++ cfe/trunk/include/clang/AST/Decl.h Tue Jan  3 12:04:46 2012
@@ -3058,7 +3058,7 @@
 ///
 /// An import declaration imports the named module (or submodule). For example:
 /// \code
-///   __import_module__ std.vector;
+///   @import std.vector;
 /// \endcode
 ///
 /// Import declarations can also be implicitly generated from #include/#import 
@@ -3080,10 +3080,10 @@
   friend class ASTDeclReader;
   friend class ASTContext;
   
-  ImportDecl(DeclContext *DC, SourceLocation ImportLoc, Module *Imported,
+  ImportDecl(DeclContext *DC, SourceLocation StartLoc, Module *Imported,
              ArrayRef<SourceLocation> IdentifierLocs);
 
-  ImportDecl(DeclContext *DC, SourceLocation ImportLoc, Module *Imported,
+  ImportDecl(DeclContext *DC, SourceLocation StartLoc, Module *Imported,
              SourceLocation EndLoc);
 
   ImportDecl(EmptyShell Empty) : Decl(Import, Empty), NextLocalImport() { }
@@ -3091,13 +3091,13 @@
 public:
   /// \brief Create a new module import declaration.
   static ImportDecl *Create(ASTContext &C, DeclContext *DC, 
-                            SourceLocation ImportLoc, Module *Imported,
+                            SourceLocation StartLoc, Module *Imported,
                             ArrayRef<SourceLocation> IdentifierLocs);
   
   /// \brief Create a new module import declaration for an implicitly-generated
   /// import.
   static ImportDecl *CreateImplicit(ASTContext &C, DeclContext *DC, 
-                                    SourceLocation ImportLoc, Module *Imported, 
+                                    SourceLocation StartLoc, Module *Imported, 
                                     SourceLocation EndLoc);
   
   /// \brief Create a new module import declaration.

Modified: cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td?rev=147452&r1=147451&r2=147452&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td Tue Jan  3 12:04:46 2012
@@ -689,7 +689,7 @@
 
 let CategoryName = "Modules Issue" in {
 def err_module_expected_ident : Error<
-  "expected a module name after '__import_module__'">;
+  "expected a module name after module import">;
 def err_module_expected_semi : Error<
   "expected a semicolon name after module name">;
 }

Modified: cfe/trunk/include/clang/Basic/IdentifierTable.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/IdentifierTable.h?rev=147452&r1=147451&r2=147452&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/IdentifierTable.h (original)
+++ cfe/trunk/include/clang/Basic/IdentifierTable.h Tue Jan  3 12:04:46 2012
@@ -295,7 +295,8 @@
     NeedsHandleIdentifier =
       (isPoisoned() | hasMacroDefinition() | isCPlusPlusOperatorKeyword() |
        isExtensionToken() | isCXX11CompatKeyword() || isOutOfDate() ||
-       (getTokenID() == tok::kw___import_module__));
+       (getTokenID() == tok::kw___import_module__) ||
+       (getObjCKeywordID() == tok::objc_import));
   }
 };
 

Modified: cfe/trunk/include/clang/Basic/TokenKinds.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/TokenKinds.def?rev=147452&r1=147451&r2=147452&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/TokenKinds.def (original)
+++ cfe/trunk/include/clang/Basic/TokenKinds.def Tue Jan  3 12:04:46 2012
@@ -548,6 +548,7 @@
 OBJC2_AT_KEYWORD(optional)
 OBJC2_AT_KEYWORD(synthesize)
 OBJC2_AT_KEYWORD(dynamic)
+OBJC2_AT_KEYWORD(import)
 
 // TODO: What to do about context-sensitive keywords like:
 //       bycopy/byref/in/inout/oneway/out?

Modified: cfe/trunk/include/clang/Lex/Preprocessor.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Lex/Preprocessor.h?rev=147452&r1=147451&r2=147452&view=diff
==============================================================================
--- cfe/trunk/include/clang/Lex/Preprocessor.h (original)
+++ cfe/trunk/include/clang/Lex/Preprocessor.h Tue Jan  3 12:04:46 2012
@@ -162,8 +162,8 @@
   /// for preprocessing.
   SourceLocation CodeCompletionFileLoc;
 
-  /// \brief The source location of the __import_module__ keyword we just
-  /// lexed, if any.
+  /// \brief The source location of the __import_module__ or 'import' keyword we 
+  /// just lexed, if any.
   SourceLocation ModuleImportLoc;
 
   /// \brief The module import path that we're currently processing.

Modified: cfe/trunk/include/clang/Parse/Parser.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Parse/Parser.h?rev=147452&r1=147451&r2=147452&view=diff
==============================================================================
--- cfe/trunk/include/clang/Parse/Parser.h (original)
+++ cfe/trunk/include/clang/Parse/Parser.h Tue Jan  3 12:04:46 2012
@@ -2127,7 +2127,7 @@
 
   //===--------------------------------------------------------------------===//
   // Modules
-  DeclGroupPtrTy ParseModuleImport();
+  DeclGroupPtrTy ParseModuleImport(SourceLocation AtLoc);
 
   //===--------------------------------------------------------------------===//
   // GNU G++: Type Traits [Type-Traits.html in the GCC manual]

Modified: cfe/trunk/include/clang/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=147452&r1=147451&r2=147452&view=diff
==============================================================================
--- cfe/trunk/include/clang/Sema/Sema.h (original)
+++ cfe/trunk/include/clang/Sema/Sema.h Tue Jan  3 12:04:46 2012
@@ -1120,10 +1120,14 @@
 
   /// \brief The parser has processed a module import declaration.
   ///
-  /// \param ImportLoc The location of the '__import_module__' keyword.
+  /// \param AtLoc The location of the '@' symbol, if present.
+  ///
+  /// \param ImportLoc The location of the '__import_module__' or 'import' 
+  /// keyword.
   ///
   /// \param Path The module access path.
-  DeclResult ActOnModuleImport(SourceLocation ImportLoc, ModuleIdPath Path);
+  DeclResult ActOnModuleImport(SourceLocation AtLoc, SourceLocation ImportLoc, 
+                               ModuleIdPath Path);
 
   /// \brief Retrieve a suitable printing policy.
   PrintingPolicy getPrintingPolicy() const;

Modified: cfe/trunk/lib/AST/Decl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Decl.cpp?rev=147452&r1=147451&r2=147452&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Decl.cpp (original)
+++ cfe/trunk/lib/AST/Decl.cpp Tue Jan  3 12:04:46 2012
@@ -2755,10 +2755,10 @@
   return Result;
 }
 
-ImportDecl::ImportDecl(DeclContext *DC, SourceLocation ImportLoc, 
+ImportDecl::ImportDecl(DeclContext *DC, SourceLocation StartLoc, 
                        Module *Imported,
                        ArrayRef<SourceLocation> IdentifierLocs)
-  : Decl(Import, DC, ImportLoc), ImportedAndComplete(Imported, true),
+  : Decl(Import, DC, StartLoc), ImportedAndComplete(Imported, true),
     NextLocalImport()
 {
   assert(getNumModuleIdentifiers(Imported) == IdentifierLocs.size());
@@ -2767,28 +2767,28 @@
          IdentifierLocs.size() * sizeof(SourceLocation));
 }
 
-ImportDecl::ImportDecl(DeclContext *DC, SourceLocation ImportLoc, 
+ImportDecl::ImportDecl(DeclContext *DC, SourceLocation StartLoc, 
                        Module *Imported, SourceLocation EndLoc)
-  : Decl(Import, DC, ImportLoc), ImportedAndComplete(Imported, false),
+  : Decl(Import, DC, StartLoc), ImportedAndComplete(Imported, false),
     NextLocalImport()
 {
   *reinterpret_cast<SourceLocation *>(this + 1) = EndLoc;
 }
 
 ImportDecl *ImportDecl::Create(ASTContext &C, DeclContext *DC, 
-                               SourceLocation ImportLoc, Module *Imported,
+                               SourceLocation StartLoc, Module *Imported,
                                ArrayRef<SourceLocation> IdentifierLocs) {
   void *Mem = C.Allocate(sizeof(ImportDecl) + 
                          IdentifierLocs.size() * sizeof(SourceLocation));
-  return new (Mem) ImportDecl(DC, ImportLoc, Imported, IdentifierLocs);
+  return new (Mem) ImportDecl(DC, StartLoc, Imported, IdentifierLocs);
 }
 
 ImportDecl *ImportDecl::CreateImplicit(ASTContext &C, DeclContext *DC, 
-                                       SourceLocation ImportLoc,
+                                       SourceLocation StartLoc,
                                        Module *Imported, 
                                        SourceLocation EndLoc) {
   void *Mem = C.Allocate(sizeof(ImportDecl) + sizeof(SourceLocation));
-  ImportDecl *Import = new (Mem) ImportDecl(DC, ImportLoc, Imported, EndLoc);
+  ImportDecl *Import = new (Mem) ImportDecl(DC, StartLoc, Imported, EndLoc);
   Import->setImplicit();
   return Import;
 }

Modified: cfe/trunk/lib/AST/DeclPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclPrinter.cpp?rev=147452&r1=147451&r2=147452&view=diff
==============================================================================
--- cfe/trunk/lib/AST/DeclPrinter.cpp (original)
+++ cfe/trunk/lib/AST/DeclPrinter.cpp Tue Jan  3 12:04:46 2012
@@ -647,7 +647,7 @@
 }
 
 void DeclPrinter::VisitImportDecl(ImportDecl *D) {
-  Out << "__import_module__ " << D->getImportedModule()->getFullModuleName()
+  Out << "@import " << D->getImportedModule()->getFullModuleName()
       << ";\n";
 }
 

Modified: cfe/trunk/lib/Lex/Preprocessor.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/Preprocessor.cpp?rev=147452&r1=147451&r2=147452&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/Preprocessor.cpp (original)
+++ cfe/trunk/lib/Lex/Preprocessor.cpp Tue Jan  3 12:04:46 2012
@@ -548,9 +548,10 @@
   if (II.isExtensionToken() && !DisableMacroExpansion)
     Diag(Identifier, diag::ext_token_used);
   
-  // If this is the '__import_module__' keyword, note that the next token
-  // indicates a module name.
-  if (II.getTokenID() == tok::kw___import_module__ &&
+  // If this is the '__import_module__' or 'import' keyword, note that the next 
+  // token indicates a module name.
+  if ((II.getTokenID() == tok::kw___import_module__ ||
+       II.getObjCKeywordID() == tok::objc_import) &&
       !InMacroArgs && !DisableMacroExpansion) {
     ModuleImportLoc = Identifier.getLocation();
     ModuleImportPath.clear();
@@ -559,7 +560,8 @@
   }
 }
 
-/// \brief Lex a token following the __import_module__ keyword.
+/// \brief Lex a token following the __import_module__ or 'import' keyword.
+///
 void Preprocessor::LexAfterModuleImport(Token &Result) {
   // Figure out what kind of lexer we actually have.
   if (CurLexer)
@@ -578,8 +580,12 @@
   //
   //   __import_module__ identifier (. identifier)*
   //
+  // or
+  //
+  //   import identifier (. identifier)*
+  //
   // indicates a module import directive. We already saw the __import_module__
-  // keyword, so now we're looking for the identifiers.
+  // or 'import' keyword, so now we're looking for the identifiers.
   if (ModuleImportExpectsIdentifier && Result.getKind() == tok::identifier) {
     // We expected to see an identifier here, and we did; continue handling
     // identifiers.

Modified: cfe/trunk/lib/Parse/ParseObjc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseObjc.cpp?rev=147452&r1=147451&r2=147452&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseObjc.cpp (original)
+++ cfe/trunk/lib/Parse/ParseObjc.cpp Tue Jan  3 12:04:46 2012
@@ -66,6 +66,8 @@
   case tok::objc_dynamic:
     SingleDecl = ParseObjCPropertyDynamic(AtLoc);
     break;
+  case tok::objc_import:
+    return ParseModuleImport(AtLoc);
   default:
     Diag(AtLoc, diag::err_unexpected_at);
     SkipUntil(tok::semi);

Modified: cfe/trunk/lib/Parse/Parser.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/Parser.cpp?rev=147452&r1=147451&r2=147452&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/Parser.cpp (original)
+++ cfe/trunk/lib/Parse/Parser.cpp Tue Jan  3 12:04:46 2012
@@ -668,7 +668,7 @@
     return DeclGroupPtrTy();
 
   case tok::kw___import_module__:
-    return ParseModuleImport();
+    return ParseModuleImport(SourceLocation());
       
   default:
   dont_know:
@@ -1569,8 +1569,9 @@
   Braces.consumeClose();
 }
 
-Parser::DeclGroupPtrTy Parser::ParseModuleImport() {
-  assert(Tok.is(tok::kw___import_module__) && 
+Parser::DeclGroupPtrTy Parser::ParseModuleImport(SourceLocation AtLoc) {
+  assert((Tok.is(tok::kw___import_module__) || 
+          Tok.isObjCAtKeyword(tok::objc_import)) && 
          "Improper start to module import");
   SourceLocation ImportLoc = ConsumeToken();
   
@@ -1596,7 +1597,7 @@
     break;
   } while (true);
   
-  DeclResult Import = Actions.ActOnModuleImport(ImportLoc, Path);
+  DeclResult Import = Actions.ActOnModuleImport(AtLoc, ImportLoc, Path);
   ExpectAndConsumeSemi(diag::err_module_expected_semi);
   if (Import.isInvalid())
     return DeclGroupPtrTy();

Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=147452&r1=147451&r2=147452&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Tue Jan  3 12:04:46 2012
@@ -9896,7 +9896,9 @@
   return New;
 }
 
-DeclResult Sema::ActOnModuleImport(SourceLocation ImportLoc, ModuleIdPath Path) {
+DeclResult Sema::ActOnModuleImport(SourceLocation AtLoc, 
+                                   SourceLocation ImportLoc, 
+                                   ModuleIdPath Path) {
   Module *Mod = PP.getModuleLoader().loadModule(ImportLoc, Path, 
                                                 Module::AllVisible,
                                                 /*IsIncludeDirective=*/false);
@@ -9917,8 +9919,8 @@
 
   ImportDecl *Import = ImportDecl::Create(Context, 
                                           Context.getTranslationUnitDecl(),
-                                          ImportLoc, Mod,
-                                          IdentifierLocs);
+                                          AtLoc.isValid()? AtLoc : ImportLoc, 
+                                          Mod, IdentifierLocs);
   Context.getTranslationUnitDecl()->addDecl(Import);
   return Import;
 }

Modified: cfe/trunk/test/Modules/Inputs/category_bottom.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/category_bottom.h?rev=147452&r1=147451&r2=147452&view=diff
==============================================================================
--- cfe/trunk/test/Modules/Inputs/category_bottom.h (original)
+++ cfe/trunk/test/Modules/Inputs/category_bottom.h Tue Jan  3 12:04:46 2012
@@ -1,10 +1,10 @@
-__import_module__ category_left;
+ at import category_left;
 
 @interface Foo(Bottom)
 -(void)bottom;
 @end
 
-__import_module__ category_right;
+ at import category_right;
 
 @interface LeftFoo(Bottom)
 -(void)bottom;

Modified: cfe/trunk/test/Modules/Inputs/category_left.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/category_left.h?rev=147452&r1=147451&r2=147452&view=diff
==============================================================================
--- cfe/trunk/test/Modules/Inputs/category_left.h (original)
+++ cfe/trunk/test/Modules/Inputs/category_left.h Tue Jan  3 12:04:46 2012
@@ -1,4 +1,4 @@
-__import_module__ category_top;
+ at import category_top;
 
 @interface Foo(Left)
 -(void)left;

Modified: cfe/trunk/test/Modules/Inputs/category_right.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/category_right.h?rev=147452&r1=147451&r2=147452&view=diff
==============================================================================
--- cfe/trunk/test/Modules/Inputs/category_right.h (original)
+++ cfe/trunk/test/Modules/Inputs/category_right.h Tue Jan  3 12:04:46 2012
@@ -1,4 +1,4 @@
-__import_module__ category_top;
+ at import category_top;
 
 @interface Foo(Right1)
 -(void)right1;

Modified: cfe/trunk/test/Modules/Inputs/redecl-merge-bottom.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/redecl-merge-bottom.h?rev=147452&r1=147451&r2=147452&view=diff
==============================================================================
--- cfe/trunk/test/Modules/Inputs/redecl-merge-bottom.h (original)
+++ cfe/trunk/test/Modules/Inputs/redecl-merge-bottom.h Tue Jan  3 12:04:46 2012
@@ -1,11 +1,11 @@
-__import_module__ redecl_merge_left;
+ at import redecl_merge_left;
 
 @class C4;
 @class C4;
 @protocol P4;
 @protocol P4;
 @protocol P4;
-__import_module__ redecl_merge_right;
+ at import redecl_merge_right;
 
 @class B;
 

Modified: cfe/trunk/test/Modules/Inputs/redecl-merge-left-left.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/redecl-merge-left-left.h?rev=147452&r1=147451&r2=147452&view=diff
==============================================================================
--- cfe/trunk/test/Modules/Inputs/redecl-merge-left-left.h (original)
+++ cfe/trunk/test/Modules/Inputs/redecl-merge-left-left.h Tue Jan  3 12:04:46 2012
@@ -1,4 +1,4 @@
-__import_module__ redecl_merge_left;
+ at import redecl_merge_left;
 
 @class C4;
 void accept_a_C4(C4*);

Modified: cfe/trunk/test/Modules/Inputs/redecl-merge-left.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/redecl-merge-left.h?rev=147452&r1=147451&r2=147452&view=diff
==============================================================================
--- cfe/trunk/test/Modules/Inputs/redecl-merge-left.h (original)
+++ cfe/trunk/test/Modules/Inputs/redecl-merge-left.h Tue Jan  3 12:04:46 2012
@@ -1,4 +1,4 @@
-__import_module__ redecl_merge_top;
+ at import redecl_merge_top;
 
 @class A;
 

Modified: cfe/trunk/test/Modules/Inputs/redecl-merge-right.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/redecl-merge-right.h?rev=147452&r1=147451&r2=147452&view=diff
==============================================================================
--- cfe/trunk/test/Modules/Inputs/redecl-merge-right.h (original)
+++ cfe/trunk/test/Modules/Inputs/redecl-merge-right.h Tue Jan  3 12:04:46 2012
@@ -1,4 +1,4 @@
-__import_module__ redecl_merge_top;
+ at import redecl_merge_top;
 
 @interface Super
 @end
@@ -55,5 +55,5 @@
 #endif
 
 int ONE;
-__import_module__ redecl_merge_top.Explicit;
+ at import redecl_merge_top.Explicit;
 const int one = ONE;

Modified: cfe/trunk/test/Modules/decldef.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/decldef.mm?rev=147452&r1=147451&r2=147452&view=diff
==============================================================================
--- cfe/trunk/test/Modules/decldef.mm (original)
+++ cfe/trunk/test/Modules/decldef.mm Tue Jan  3 12:04:46 2012
@@ -10,10 +10,10 @@
 
 // in other file: expected-note{{previous definition is here}}
 
-__import_module__ decldef;
+ at import decldef;
 A *a1; // expected-error{{unknown type name 'A'}}
 B *b1; // expected-error{{unknown type name 'B'}}
-__import_module__ decldef.Decl;
+ at import decldef.Decl;
 
 A *a2;
 B *b;

Modified: cfe/trunk/test/Modules/header-import.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/header-import.m?rev=147452&r1=147451&r2=147452&view=diff
==============================================================================
--- cfe/trunk/test/Modules/header-import.m (original)
+++ cfe/trunk/test/Modules/header-import.m Tue Jan  3 12:04:46 2012
@@ -2,6 +2,6 @@
 // RUN: %clang_cc1 -fmodule-cache-path %t -F %S/Inputs -I %S/Inputs -verify %s
 
 #import "point.h"
-__import_module__ Module;
+ at import Module;
 #import "point.h"
 

Modified: cfe/trunk/test/Modules/inferred-submodules.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/inferred-submodules.m?rev=147452&r1=147451&r2=147452&view=diff
==============================================================================
--- cfe/trunk/test/Modules/inferred-submodules.m (original)
+++ cfe/trunk/test/Modules/inferred-submodules.m Tue Jan  3 12:04:46 2012
@@ -1,13 +1,13 @@
 // RUN: rm -rf %t
 // RUN: %clang_cc1 -x objective-c -Wauto-import -fmodule-cache-path %t -fmodules -F %S/Inputs %s -verify
 
-__import_module__ Module.Sub;
+ at import Module.Sub;
 
 void test_Module_Sub() {
   int *ip = Module_Sub;
 }
 
-__import_module__ Module.Buried.Treasure;
+ at import Module.Buried.Treasure;
 
 void dig() {
   unsigned *up = Buried_Treasure;

Modified: cfe/trunk/test/Modules/lookup.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/lookup.m?rev=147452&r1=147451&r2=147452&view=diff
==============================================================================
--- cfe/trunk/test/Modules/lookup.m (original)
+++ cfe/trunk/test/Modules/lookup.m Tue Jan  3 12:04:46 2012
@@ -1,8 +1,8 @@
 
 // lookup_left.h: expected-note{{using}}
 // lookup_right.h: expected-note{{also found}}
-__import_module__ lookup_left_objc;
-__import_module__ lookup_right_objc;
+ at import lookup_left_objc;
+ at import lookup_right_objc;
 
 void test(id x) {
   [x method]; // expected-warning{{multiple methods named 'method' found}}

Modified: cfe/trunk/test/Modules/objc-categories.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/objc-categories.m?rev=147452&r1=147451&r2=147452&view=diff
==============================================================================
--- cfe/trunk/test/Modules/objc-categories.m (original)
+++ cfe/trunk/test/Modules/objc-categories.m Tue Jan  3 12:04:46 2012
@@ -5,7 +5,7 @@
 // RUN: %clang_cc1 -fmodule-cache-path %t -x objective-c -fmodule-name=category_bottom -emit-module %S/Inputs/module.map
 // RUN: %clang_cc1 -fmodule-cache-path %t %s -verify
 
-__import_module__ category_bottom;
+ at import category_bottom;
 
 
 // in category_left.h: expected-note {{previous definition}}

Modified: cfe/trunk/test/Modules/on-demand-build-warnings.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/on-demand-build-warnings.m?rev=147452&r1=147451&r2=147452&view=diff
==============================================================================
--- cfe/trunk/test/Modules/on-demand-build-warnings.m (original)
+++ cfe/trunk/test/Modules/on-demand-build-warnings.m Tue Jan  3 12:04:46 2012
@@ -1,5 +1,5 @@
 // RUN: rm -rf %t
 // RUN: %clang_cc1 -fno-objc-infer-related-result-type -Wmodule-build -fmodule-cache-path %t -F %S/Inputs -verify %s
 
-__import_module__ Module; // expected-warning{{building module 'Module' from source}}
+ at import Module; // expected-warning{{building module 'Module' from source}}
 

Modified: cfe/trunk/test/Modules/on-demand-build.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/on-demand-build.m?rev=147452&r1=147451&r2=147452&view=diff
==============================================================================
--- cfe/trunk/test/Modules/on-demand-build.m (original)
+++ cfe/trunk/test/Modules/on-demand-build.m Tue Jan  3 12:04:46 2012
@@ -3,7 +3,7 @@
 // RUN: %clang_cc1 -fno-objc-infer-related-result-type -Werror -Wno-error=incomplete-umbrella -x objective-c++ -fmodule-cache-path %t -F %S/Inputs -verify %s
 // RUN: %clang_cc1 -fno-objc-infer-related-result-type -Werror -Wno-error=incomplete-umbrella -fmodule-cache-path %t -F %S/Inputs -verify %s
 #define FOO
-__import_module__ Module;
+ at import Module;
 @interface OtherClass
 @end
 

Modified: cfe/trunk/test/Modules/on-demand-macros.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/on-demand-macros.m?rev=147452&r1=147451&r2=147452&view=diff
==============================================================================
--- cfe/trunk/test/Modules/on-demand-macros.m (original)
+++ cfe/trunk/test/Modules/on-demand-macros.m Tue Jan  3 12:04:46 2012
@@ -2,7 +2,7 @@
 // RUN: %clang_cc1 -fmodule-cache-path %t -F %S/Inputs -DFOO_RETURNS_INT_PTR -verify %s
 // RUN: %clang_cc1 -fmodule-cache-path %t -F %S/Inputs -verify %s
 
-__import_module__ CmdLine;
+ at import CmdLine;
 
 void test() {
 #ifdef FOO_RETURNS_INT_PTR

Modified: cfe/trunk/test/Modules/redecl-merge.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/redecl-merge.m?rev=147452&r1=147451&r2=147452&view=diff
==============================================================================
--- cfe/trunk/test/Modules/redecl-merge.m (original)
+++ cfe/trunk/test/Modules/redecl-merge.m Tue Jan  3 12:04:46 2012
@@ -4,12 +4,12 @@
 @class C2;
 @class C3;
 @class C3;
-__import_module__ redecl_merge_left;
+ at import redecl_merge_left;
 
 @protocol P4;
 @class C3;
 @class C3;
-__import_module__ redecl_merge_right;
+ at import redecl_merge_right;
 
 @implementation A
 - (Super*)init { return self; }
@@ -62,14 +62,14 @@
 }
 
 C4 *global_C4;
-__import_module__ redecl_merge_left_left;
+ at import redecl_merge_left_left;
 
 void test_C4a(C4 *c4) {
   global_C4 = c4 = get_a_C4();
   accept_a_C4(c4);
 }
 
-__import_module__ redecl_merge_bottom;
+ at import redecl_merge_bottom;
 
 void test_C4b() {
   if (&refers_to_C4) {

Modified: cfe/trunk/test/Modules/redeclarations.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/redeclarations.m?rev=147452&r1=147451&r2=147452&view=diff
==============================================================================
--- cfe/trunk/test/Modules/redeclarations.m (original)
+++ cfe/trunk/test/Modules/redeclarations.m Tue Jan  3 12:04:46 2012
@@ -1,5 +1,5 @@
-__import_module__ redeclarations_left;
-__import_module__ redeclarations_right;
+ at import redeclarations_left;
+ at import redeclarations_right;
 
 @interface MyObject : NSObject
 @end

Modified: cfe/trunk/test/Modules/requires.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/requires.m?rev=147452&r1=147451&r2=147452&view=diff
==============================================================================
--- cfe/trunk/test/Modules/requires.m (original)
+++ cfe/trunk/test/Modules/requires.m Tue Jan  3 12:04:46 2012
@@ -1,5 +1,5 @@
 // RUN: rm -rf %t
 // RUN: %clang_cc1 -Wauto-import -fmodule-cache-path %t -fmodules -F %S/Inputs %s -verify
 
-__import_module__ DependsOnModule.CXX; // expected-error{{module 'DependsOnModule.CXX' requires feature 'cplusplus'}}
+ at import DependsOnModule.CXX; // expected-error{{module 'DependsOnModule.CXX' requires feature 'cplusplus'}}
 

Modified: cfe/trunk/test/Modules/subframeworks.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/subframeworks.m?rev=147452&r1=147451&r2=147452&view=diff
==============================================================================
--- cfe/trunk/test/Modules/subframeworks.m (original)
+++ cfe/trunk/test/Modules/subframeworks.m Tue Jan  3 12:04:46 2012
@@ -2,13 +2,13 @@
 // RUN: %clang_cc1 -Wauto-import -fmodule-cache-path %t -fmodules -F %S/Inputs %s -verify
 // RUN: %clang_cc1 -x objective-c++ -Wauto-import -fmodule-cache-path %t -fmodules -F %S/Inputs %s -verify
 
-__import_module__ DependsOnModule;
+ at import DependsOnModule;
 
 void testSubFramework() {
   float *sf1 = sub_framework; // expected-error{{use of undeclared identifier 'sub_framework'}}
 }
 
-__import_module__ DependsOnModule.SubFramework;
+ at import DependsOnModule.SubFramework;
 
 void testSubFrameworkAgain() {
   float *sf2 = sub_framework;
@@ -16,7 +16,7 @@
 }
 
 #ifdef __cplusplus
-__import_module__ DependsOnModule.CXX;
+ at import DependsOnModule.CXX;
 
 CXXOnly cxxonly;
 #endif

Modified: cfe/trunk/test/Modules/submodules.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/submodules.m?rev=147452&r1=147451&r2=147452&view=diff
==============================================================================
--- cfe/trunk/test/Modules/submodules.m (original)
+++ cfe/trunk/test/Modules/submodules.m Tue Jan  3 12:04:46 2012
@@ -3,7 +3,7 @@
 // RUN: %clang_cc1 -Wauto-import -fmodule-cache-path %t -fmodules -F %S/Inputs %s -verify
 
 // Note: transitively imports Module.Sub2.
-__import_module__ Module.Sub;
+ at import Module.Sub;
 
 int getValue() { 
   return *Module_Sub + *Module_Sub2;





More information about the cfe-commits mailing list