]> granicus.if.org Git - clang/commitdiff
Change @import to @__experimental_modules_import. We are not ready to commit to...
authorTed Kremenek <kremenek@apple.com>
Thu, 1 Mar 2012 22:07:04 +0000 (22:07 +0000)
committerTed Kremenek <kremenek@apple.com>
Thu, 1 Mar 2012 22:07:04 +0000 (22:07 +0000)
and don't have time to push it forward in the near future.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151841 91177308-0d34-0410-b5e6-96231b3b80d8

57 files changed:
include/clang/AST/Decl.h
include/clang/Basic/IdentifierTable.h
include/clang/Basic/TokenKinds.def
lib/AST/DeclPrinter.cpp
lib/Basic/IdentifierTable.cpp
lib/Lex/PPDirectives.cpp
lib/Lex/Preprocessor.cpp
lib/Parse/ParseObjc.cpp
lib/Parse/Parser.cpp
test/Index/complete-modules.m
test/Index/crash-recovery-modules.m
test/Modules/Inputs/MutuallyRecursive1.framework/Headers/MutuallyRecursive1.h
test/Modules/Inputs/MutuallyRecursive2.framework/Headers/MutuallyRecursive2.h
test/Modules/Inputs/category_bottom.h
test/Modules/Inputs/category_left.h
test/Modules/Inputs/category_other.h
test/Modules/Inputs/category_right.h
test/Modules/Inputs/diamond.h
test/Modules/Inputs/diamond_bottom.h
test/Modules/Inputs/diamond_left.h
test/Modules/Inputs/diamond_right.h
test/Modules/Inputs/namespaces-left.h
test/Modules/Inputs/namespaces-right.h
test/Modules/Inputs/redecl-merge-bottom.h
test/Modules/Inputs/redecl-merge-left-left.h
test/Modules/Inputs/redecl-merge-left.h
test/Modules/Inputs/redecl-merge-right.h
test/Modules/Inputs/wildcard-submodule-exports/C_one.h
test/Modules/Inputs/wildcard-submodule-exports/C_two.h
test/Modules/compiler_builtins.m
test/Modules/cstd.m
test/Modules/cycles.c
test/Modules/decldef.mm
test/Modules/diamond.c
test/Modules/header-import.m
test/Modules/inferred-submodules.m
test/Modules/irgen.c
test/Modules/load_failure.c
test/Modules/lookup.cpp
test/Modules/lookup.m
test/Modules/macros.c
test/Modules/method_pool.m
test/Modules/module-private.cpp
test/Modules/namespaces.cpp
test/Modules/normal-module-map.cpp
test/Modules/objc-categories.m
test/Modules/on-demand-build-warnings.m
test/Modules/on-demand-build.m
test/Modules/on-demand-macros.m
test/Modules/redecl-merge.m
test/Modules/redeclarations.m
test/Modules/requires.m
test/Modules/subframeworks.m
test/Modules/submodules-preprocess.cpp
test/Modules/submodules.cpp
test/Modules/submodules.m
test/Modules/wildcard-submodule-exports.cpp

index 68fa374913d5257634aad8f6400d4a91924c0949..25b6d7980459c1e962350c94e6039d1aae3d0a22 100644 (file)
@@ -3168,7 +3168,7 @@ public:
 ///
 /// An import declaration imports the named module (or submodule). For example:
 /// \code
-///   @import std.vector;
+///   @__experimental_modules_import std.vector;
 /// \endcode
 ///
 /// Import declarations can also be implicitly generated from #include/#import 
index b701effc83e60a66cd63dc26363d54df57f3cead..fce79aa652cab33ce4c95f9f3c06ed59a1bbb32d 100644 (file)
@@ -67,7 +67,7 @@ class IdentifierInfo {
   bool OutOfDate              : 1; // True if there may be additional
                                    // information about this identifier
                                    // stored externally.
-  bool IsImport               : 1; // True if this is the 'import' contextual
+  bool IsModulesImport               : 1; // True if this is the 'import' contextual
                                    // keyword.
   // 1 bit left in 32-bit word.
   
@@ -283,12 +283,14 @@ public:
       RecomputeNeedsHandleIdentifier();
   }
   
-  /// \brief Determine whether this is the contextual keyword 'import'.
-  bool isImport() const { return IsImport; }
+  /// \brief Determine whether this is the contextual keyword
+  /// '__experimental_modules_import'.
+  bool isModulesImport() const { return IsModulesImport; }
   
-  /// \brief Set whether this identifier is the contextual keyword 'import'.
-  void setImport(bool I) {
-    IsImport = I;
+  /// \brief Set whether this identifier is the contextual keyword 
+  /// '__experimental_modules_import'.
+  void setModulesImport(bool I) {
+    IsModulesImport = I;
     if (I)
       NeedsHandleIdentifier = true;
     else
@@ -307,7 +309,7 @@ private:
     NeedsHandleIdentifier =
       (isPoisoned() | hasMacroDefinition() | isCPlusPlusOperatorKeyword() |
        isExtensionToken() | isCXX11CompatKeyword() || isOutOfDate() ||
-       isImport());
+       isModulesImport());
   }
 };
 
@@ -458,9 +460,10 @@ public:
     // contents.
     II->Entry = &Entry;
 
-    // If this is the 'import' contextual keyword, mark it as such.
-    if (Name.equals("import"))
-      II->setImport(true);
+    // If this is the '__experimental_modules_import' contextual keyword,
+    // mark it as such.
+    if (Name.equals("__experimental_modules_import"))
+      II->setModulesImport(true);
 
     return *II;
   }
@@ -496,7 +499,7 @@ public:
       
       // If this is the 'import' contextual keyword, mark it as such.
       if (Name.equals("import"))
-        II->setImport(true);
+        II->setModulesImport(true);
     }
 
     return *II;
index 74072ba16a2fae31e4b71a3df0ca02f61d5420d0..bdceab48a07084767fc5889471ab06b361431faa 100644 (file)
@@ -549,7 +549,7 @@ OBJC2_AT_KEYWORD(required)
 OBJC2_AT_KEYWORD(optional)
 OBJC2_AT_KEYWORD(synthesize)
 OBJC2_AT_KEYWORD(dynamic)
-OBJC2_AT_KEYWORD(import)
+OBJC2_AT_KEYWORD(__experimental_modules_import)
 
 // TODO: What to do about context-sensitive keywords like:
 //       bycopy/byref/in/inout/oneway/out?
index 32bdba1a0b27fd18e93760f2e76022ba84204833..74e1c1bb9df9f808f16268845e5c0b7ed2bde7e5 100644 (file)
@@ -650,7 +650,7 @@ void DeclPrinter::VisitFileScopeAsmDecl(FileScopeAsmDecl *D) {
 }
 
 void DeclPrinter::VisitImportDecl(ImportDecl *D) {
-  Out << "@import " << D->getImportedModule()->getFullModuleName()
+  Out << "@__experimental_modules_import " << D->getImportedModule()->getFullModuleName()
       << ";\n";
 }
 
index 8bd76252b303a6c9a01cc05a8ff4536b025b599a..8945c2f47ca41c9efaf22b90e6e0300fdcd4dc03 100644 (file)
@@ -41,7 +41,7 @@ IdentifierInfo::IdentifierInfo() {
   ChangedAfterLoad = false;
   RevertedTokenID = false;
   OutOfDate = false;
-  IsImport = false;
+  IsModulesImport = false;
   FETokenInfo = 0;
   Entry = 0;
 }
index 0364e4279a559050dd20c0b4728b6b0233108790..b08bcffd20259bf6c0f1e0db541afbe1a0f2b774 100644 (file)
@@ -1401,7 +1401,7 @@ void Preprocessor::HandleIncludeDirective(SourceLocation HashLoc,
       Diag(HashLoc, diag::warn_auto_module_import)
         << IncludeKind << PathString 
         << FixItHint::CreateReplacement(ReplaceRange,
-             "@import " + PathString.str().str() + ";");
+             "@__experimental_modules_import " + PathString.str().str() + ";");
     }
     
     // Load the module.
index 96dfe360069a7a573020cd50522b5a502f4e43f9..b6ea65de499cbcc82d9a5824cabe00f7bf3655c4 100644 (file)
@@ -565,13 +565,13 @@ void Preprocessor::HandleIdentifier(Token &Identifier) {
   if (II.isExtensionToken() && !DisableMacroExpansion)
     Diag(Identifier, diag::ext_token_used);
   
-  // If this is the 'import' contextual keyword, note that the next token 
-  // indicates a module name.
+  // If this is the '__experimental_modules_import' contextual keyword, note
+  // that the next token indicates a module name.
   //
-  // Note that we do not treat 'import' as a contextual keyword when we're
-  // in a caching lexer, because caching lexers only get used in contexts where
-  // import declarations are disallowed.
-  if (II.isImport() && !InMacroArgs && !DisableMacroExpansion &&
+  // Note that we do not treat '__experimental_modules_import' as a contextual
+  // keyword when we're in a caching lexer, because caching lexers only get
+  // used in contexts where import declarations are disallowed.
+  if (II.isModulesImport() && !InMacroArgs && !DisableMacroExpansion &&
       getLangOptions().Modules && CurLexerKind != CLK_CachingLexer) {
     ModuleImportLoc = Identifier.getLocation();
     ModuleImportPath.clear();
index b135bba488caf3a909203c35cdded8eaa4bab8cf..eea9a7e981ee755a9e5aa989278b4e3a04be7b68 100644 (file)
@@ -64,7 +64,7 @@ Parser::DeclGroupPtrTy Parser::ParseObjCAtDirectives() {
   case tok::objc_dynamic:
     SingleDecl = ParseObjCPropertyDynamic(AtLoc);
     break;
-  case tok::objc_import:
+  case tok::objc___experimental_modules_import:
     if (getLang().Modules)
       return ParseModuleImport(AtLoc);
       
index 6927c50b8f7f5bc5252fd4d2c3771f1c14315b0f..6a479bc60cb3ff385e49d77c4b96ea5dbb38dd30 100644 (file)
@@ -1609,7 +1609,7 @@ void Parser::ParseMicrosoftIfExistsExternalDeclaration() {
 }
 
 Parser::DeclGroupPtrTy Parser::ParseModuleImport(SourceLocation AtLoc) {
-  assert(Tok.isObjCAtKeyword(tok::objc_import) && 
+  assert(Tok.isObjCAtKeyword(tok::objc___experimental_modules_import) && 
          "Improper start to module import");
   SourceLocation ImportLoc = ConsumeToken();
   
index a8737216e2127df4791aa411acb0b5cc9c1f4c11..b82430db9dbb79e414359c53b32dfa28121fc4f5 100644 (file)
@@ -1,14 +1,14 @@
 // Note: the run lines follow their respective tests, since line/column
 // matter in this test.
 
-@import LibA.Extensions;
+@__experimental_modules_import LibA.Extensions;
 
 // RUN: rm -rf %t
-// RUN: c-index-test -code-completion-at=%s:4:9 -fmodule-cache-path %t -fmodules -F %S/Inputs/Frameworks -I %S/Inputs/Headers %s | FileCheck -check-prefix=CHECK-TOP-LEVEL %s
+// RUN: c-index-test -code-completion-at=%s:4:32 -fmodule-cache-path %t -fmodules -F %S/Inputs/Frameworks -I %S/Inputs/Headers %s | FileCheck -check-prefix=CHECK-TOP-LEVEL %s
 // CHECK-TOP-LEVEL: NotImplemented:{TypedText Framework} (50)
 // CHECK-TOP-LEVEL: NotImplemented:{TypedText LibA} (50)
 // CHECK-TOP-LEVEL: NotImplemented:{TypedText nested} (50)
 
-// RUN: c-index-test -code-completion-at=%s:4:14 -fmodule-cache-path %t -fmodules -F %S/Inputs/Frameworks -I %S/Inputs/Headers %s | FileCheck -check-prefix=CHECK-LIBA %s
+// RUN: c-index-test -code-completion-at=%s:4:37 -fmodule-cache-path %t -fmodules -F %S/Inputs/Frameworks -I %S/Inputs/Headers %s | FileCheck -check-prefix=CHECK-LIBA %s
 // CHECK-LIBA: NotImplemented:{TypedText Extensions} (50)
 
index 8d93c1ae06d2409e102ffe2dc77716f25cce0296..212923f94be615431159cb1fcecdce674f452358 100644 (file)
@@ -4,7 +4,7 @@
 // Parse the file, such that building the module will cause Clang to crash.
 // RUN: not env CINDEXTEST_FAILONERROR=1 c-index-test -test-load-source all -fmodules -fmodule-cache-path %t -Xclang -fdisable-module-hash -I %S/Inputs/Headers -DCRASH %s 2> %t.err
 // RUN: FileCheck < %t.err -check-prefix=CHECK-CRASH %s
-// CHECK-CRASH: crash-recovery-modules.m:16:9:{16:2-16:14}: fatal error: could not build module 'Crash'
+// CHECK-CRASH: crash-recovery-modules.m:16:32:{16:2-16:37}: fatal error: could not build module 'Crash'
 
 // Parse the file again, without crashing, to make sure that
 // subsequent parses do the right thing.
@@ -13,7 +13,7 @@
 // REQUIRES: crash-recovery
 // REQUIRES: shell
 
-@import Crash;
+@__experimental_modules_import Crash;
 
 void test() {
   const char* error = getCrashString();
index 156c22604f5ac8b2766742c41f5d8234be8c8c05..5142f56e6015b8bb20b677ed482a861183a2758c 100644 (file)
@@ -1,3 +1,3 @@
 
-@import MutuallyRecursive2;
+@__experimental_modules_import MutuallyRecursive2;
 
index be3facd70eccb62bdb76f7ad96e83330d617e255..8a3cc338c222f0c84423fd4916764f4796d5a558 100644 (file)
@@ -1,6 +1,6 @@
 
 
-@import MutuallyRecursive1;
+@__experimental_modules_import MutuallyRecursive1;
 
 
 
index ab4c01c3149cdca6dfd65e01139138d061388b8d..b53d9c30d6f60be6c929e3987f5d10492a2e7a2e 100644 (file)
@@ -1,10 +1,10 @@
-@import category_left;
+@__experimental_modules_import category_left;
 
 @interface Foo(Bottom)
 -(void)bottom;
 @end
 
-@import category_right;
+@__experimental_modules_import category_right;
 
 @interface LeftFoo(Bottom)
 -(void)bottom;
index 05e2a1b96c525b37895925a70bd27a308d2667fb..736fa432690802d401c15be04bd161f68411f24d 100644 (file)
@@ -1,4 +1,4 @@
-@import category_top;
+@__experimental_modules_import category_top;
 
 @interface Foo(Left)
 -(void)left;
index 2c3f4794c2a71e694d12c6ffbcbc6c478085d813..1bb5a91cbd781e7b253f8469371783246cc81e6f 100644 (file)
@@ -1,4 +1,4 @@
-@import category_top;
+@__experimental_modules_import category_top;
 
 @interface Foo(Other)
 -(void)other;
index 48d4f6cd0a8161aff22035e98bddb01cceaaea20..d993b50db4bfd4b5223e22ee6fd112ef508b2691 100644 (file)
@@ -1,4 +1,4 @@
-@import category_top;
+@__experimental_modules_import category_top;
 
 @interface Foo(Right1)
 -(void)right1;
index 1990b45b5f856bd06176574638e8aaae9b36f5f3..15b529006160efecfdd346413b141ce595acd8fe 100644 (file)
@@ -1 +1 @@
-@import diamond_bottom;
+@__experimental_modules_import diamond_bottom;
index 2a0a84e3d7b3ec44de04b61ae4adcc1f536d917a..b45fa936d1e97e65ab57ac0030feae352bbe05dc 100644 (file)
@@ -1,4 +1,4 @@
-@import diamond_left;
-@import diamond_right;
+@__experimental_modules_import diamond_left;
+@__experimental_modules_import diamond_right;
 
 char bottom(char *x);
index fce2e48882f8f0acb691ca35262684779d302196..cc406ab3891f383491d7d9dd7d241d2cff7a12dd 100644 (file)
@@ -1,4 +1,4 @@
-@import diamond_top;
+@__experimental_modules_import diamond_top;
 
 float left(float *);
 
index fa408ea5ba7f1359e2ce7f22765c33a05d0e971a..2ba1d7744134e3417f89d2938e17e8b4bfd311f8 100644 (file)
@@ -1,4 +1,4 @@
-@import diamond_top;
+@__experimental_modules_import diamond_top;
 
 double right(double *);
 
index 7e9002aea8cdd2c0b50d8c6c531749cdaff0fd79..d253fed7c1b2eda0ba9f9a802880ed7a61a599b7 100644 (file)
@@ -1,4 +1,4 @@
-@import namespaces_top;
+@__experimental_modules_import namespaces_top;
 
 namespace N1 { }
 
index b18aeb44786b5a5f7582e0d55b7aa88e99678d10..7e7286e10b29ff3abf71943e9c730477d743b8dc 100644 (file)
@@ -1,4 +1,4 @@
-@import namespaces_top;
+@__experimental_modules_import namespaces_top;
 
 namespace N2 { }
 
index 4e52a6724783c057776fc6bff01b27cc4b15ef14..40a9404abf292a49f807d6db4b9125bd152c2f0d 100644 (file)
@@ -1,11 +1,11 @@
-@import redecl_merge_left;
+@__experimental_modules_import redecl_merge_left;
 
 @class C4;
 @class C4;
 @protocol P4;
 @protocol P4;
 @protocol P4;
-@import redecl_merge_right;
+@__experimental_modules_import redecl_merge_right;
 
 @class B;
 
index 79c4d620bee9f7f720b0a2c0896347dc45d9f9ba..5f48883bf15f6c3562137232ea1dbf7441453d04 100644 (file)
@@ -1,4 +1,4 @@
-@import redecl_merge_left;
+@__experimental_modules_import redecl_merge_left;
 
 @class C4;
 void accept_a_C4(C4*);
index 798aa83b503947eb77b9e4e34ceb843f1815ed91..b3a7ba83c1af2d6f7a0525e150f69a8529ca7c64 100644 (file)
@@ -1,4 +1,4 @@
-@import redecl_merge_top;
+@__experimental_modules_import redecl_merge_top;
 
 @class A;
 
index 113ff2217410b71b582bc15b6a9298e9d8df64f9..de7aa08cfb2b4bdcd86d038217c631c732623a9e 100644 (file)
@@ -1,4 +1,4 @@
-@import redecl_merge_top;
+@__experimental_modules_import redecl_merge_top;
 
 @interface Super
 @end
@@ -86,7 +86,7 @@ public:
 #endif
 
 int ONE;
-@import redecl_merge_top.Explicit;
+@__experimental_modules_import redecl_merge_top.Explicit;
 const int one = ONE;
 
 @interface ClassWithDef 
index e3b7593b80c8c1e9453783b2673e553665fa058c..fb1c7de845bcce06dee9c823e2eb26dcf7cb13f6 100644 (file)
@@ -1,4 +1,4 @@
-@import A.One;
-@import B.One;
+@__experimental_modules_import A.One;
+@__experimental_modules_import B.One;
 
 long *C1;
index b65dcf612ebc7b366f1684998fc7856e0c7ca604..050a8f3e88554153165c8e0a710ed91596da9891 100644 (file)
@@ -1,4 +1,4 @@
-@import A.Two;
-@import B.Two;
+@__experimental_modules_import A.Two;
+@__experimental_modules_import B.Two;
 
 unsigned long *C2;
index a4f1dc21328d88bdec22013345c6348b02cf6b40..de6f57b5f285bbd2c0ac25d4f70fb5133caa27c5 100644 (file)
@@ -2,9 +2,9 @@
 // RUN: %clang -fsyntax-only -fmodules -fmodule-cache-path %t -D__need_wint_t %s -Xclang -verify
 
 #ifdef __SSE__
-@import _Builtin_intrinsics.intel.sse;
+@__experimental_modules_import _Builtin_intrinsics.intel.sse;
 #endif
 
 #ifdef __AVX2__
-@import _Builtin_intrinsics.intel.avx2;
+@__experimental_modules_import _Builtin_intrinsics.intel.avx2;
 #endif
index 85780f49f5423d804df71ccab10d23f09d05c82c..1752cd314bb3791502586d46ab2ec9ae8ed30e0b 100644 (file)
@@ -2,24 +2,24 @@
 // RUN: %clang -fsyntax-only -isystem %S/Inputs/System/usr/include -fmodules -fmodule-cache-path %t -D__need_wint_t -Werror=implicit-function-declaration %s
 
 // Supplied by compiler, but referenced from the "/usr/include" module map.
-@import cstd.float_constants;
+@__experimental_modules_import cstd.float_constants;
 
 float getFltMax() { return FLT_MAX; }
 
 // Supplied by the "/usr/include" module map.
-@import cstd.stdio;
+@__experimental_modules_import cstd.stdio;
 
 void test_fprintf(FILE *file) {
   fprintf(file, "Hello, modules\n");
 }
 
 // Supplied by compiler, which forwards to the the "/usr/include" version.
-@import cstd.stdint;
+@__experimental_modules_import cstd.stdint;
 
 my_awesome_nonstandard_integer_type value;
 
 // Supplied by the compiler; that version wins.
-@import cstd.stdbool;
+@__experimental_modules_import cstd.stdbool;
 
 #ifndef bool
 #  error "bool was not defined!"
index df2a0a785df5edca3d82707d850c70e2b602fa33..256f118cc025556fe7613f6d72b52145514375a8 100644 (file)
@@ -1,12 +1,12 @@
 // RUN: rm -rf %t
 // RUN: %clang_cc1 -fmodules -x objective-c -fmodule-cache-path %t -F %S/Inputs %s 2>&1 | FileCheck %s
 // FIXME: When we have a syntax for modules in C, use that.
-@import MutuallyRecursive1;
+@__experimental_modules_import MutuallyRecursive1;
 
 // FIXME: Lots of redundant diagnostics here, because the preprocessor
 // can't currently tell the parser not to try to load the module again.
 
-// CHECK: MutuallyRecursive2.h:3:9: fatal error: cyclic dependency in module 'MutuallyRecursive1': MutuallyRecursive1 -> MutuallyRecursive2 -> MutuallyRecursive1
-// CHECK: MutuallyRecursive1.h:2:9: fatal error: could not build module 'MutuallyRecursive2'
-// CHECK: cycles.c:4:9: fatal error: could not build module 'MutuallyRecursive1'
+// CHECK: MutuallyRecursive2.h:3:32: fatal error: cyclic dependency in module 'MutuallyRecursive1': MutuallyRecursive1 -> MutuallyRecursive2 -> MutuallyRecursive1
+// CHECK: MutuallyRecursive1.h:2:32: fatal error: could not build module 'MutuallyRecursive2'
+// CHECK: cycles.c:4:32: fatal error: could not build module 'MutuallyRecursive1'
 
index c99fdea0d84ee0f646313beaa716f9a5660a4e9b..64a66d59d0e622af536621089a8709bdefb824ba 100644 (file)
 
 // in other file: expected-note{{previous definition is here}}
 
-@import decldef;
+@__experimental_modules_import decldef;
 A *a1; // expected-error{{unknown type name 'A'}}
 B *b1; // expected-error{{unknown type name 'B'}}
-@import decldef.Decl;
+@__experimental_modules_import decldef.Decl;
 
 A *a2;
 B *b;
index 1d8902101ee4b615bf39a9db7f519cae7c23032b..076eec4bf268fdbad58ae534c3c49e15a397d884 100644 (file)
@@ -3,7 +3,7 @@
 
 // in diamond-bottom.h: expected-note{{passing argument to parameter 'x' here}}
 
-@import diamond_bottom;
+@__experimental_modules_import diamond_bottom;
 
 void test_diamond(int i, float f, double d, char c) {
   top(&i);
index 960eecea22139bfb12af026924c8078027af70e3..5444854a62bfdde0a3a9539eb7fbe354e8471dcc 100644 (file)
@@ -2,6 +2,6 @@
 // RUN: %clang_cc1 -fmodules -fmodule-cache-path %t -F %S/Inputs -I %S/Inputs -verify %s
 
 #import "point.h"
-@import Module;
+@__experimental_modules_import Module;
 #import "point.h"
 
index aeb4aa467c22e9c03afbaac0a1b95dee06370a09..bee1cec98e4442c3fd35842b80d2318d0f61234b 100644 (file)
@@ -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.Sub;
+@__experimental_modules_import Module.Sub;
 
 void test_Module_Sub() {
   int *ip = Module_Sub;
 }
 
-@import Module.Buried.Treasure;
+@__experimental_modules_import Module.Buried.Treasure;
 
 void dig() {
   unsigned *up = Buried_Treasure;
index 8f4c299a7efbc02b185bd5855589a33ce28d3939..4a080db5b2eb4699f936d285324bcd73f76b219d 100644 (file)
@@ -3,7 +3,7 @@
 // RUN: %clang_cc1 -fmodules -x objective-c -fmodule-cache-path %t -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s
 // FIXME: When we have a syntax for modules in C, use that.
 
-@import irgen;
+@__experimental_modules_import irgen;
 
 // CHECK: define void @triple_value
 void triple_value(int *px) {
index bc0b42631598d976bf0e06e922b3a0e1eb919774..3a963012b19009d80b74ae6d7a3415767efb7758 100644 (file)
@@ -1,15 +1,15 @@
 #ifdef NONEXISTENT
-@import load_nonexistent;
+@__experimental_modules_import load_nonexistent;
 #endif
 
 #ifdef FAILURE
-@import load_failure;
+@__experimental_modules_import load_failure;
 #endif
 
 // RUN: rm -rf %t
 // RUN: %clang_cc1 -fmodules -x objective-c++ -fmodule-cache-path %t -fdisable-module-hash -emit-module -fmodule-name=load_failure %S/Inputs/module.map
 // RUN: %clang_cc1 -fmodules -x objective-c -fmodule-cache-path %t -fdisable-module-hash %s -DNONEXISTENT 2>&1 | FileCheck -check-prefix=CHECK-NONEXISTENT %s
-// CHECK-NONEXISTENT: load_failure.c:2:9: fatal error: module 'load_nonexistent' not found
+// CHECK-NONEXISTENT: load_failure.c:2:32: fatal error: module 'load_nonexistent' not found
 
 // RUN: not %clang_cc1 -fmodules -x objective-c -fmodule-cache-path %t -fdisable-module-hash %s -DFAILURE 2> %t.out
 // RUN: FileCheck -check-prefix=CHECK-FAILURE %s < %t.out
index fdbdfd7a5cf9b03c77ec3f1c6da649cc0b1a40f7..98390355339e6ad3883f63001e6efc53148e7da9 100644 (file)
@@ -1,8 +1,8 @@
 
-#define import @import
+#define import @__experimental_modules_import
 import lookup_left_cxx;
 #undef import
-#define IMPORT(X) @import X
+#define IMPORT(X) @__experimental_modules_import X
 IMPORT(lookup_right_cxx);
 
 void test(int i, float f) {
index 7ca0c23a46529a3bdd29f1bfbbe122485dd88f49..c82503f79035eb302ec0c8163b03ea64a46066dd 100644 (file)
@@ -1,8 +1,8 @@
 
 // lookup_left.h: expected-note{{using}}
 // lookup_right.h: expected-note{{also found}}
-@import lookup_left_objc;
-@import lookup_right_objc;
+@__experimental_modules_import lookup_left_objc;
+@__experimental_modules_import lookup_right_objc;
 
 void test(id x) {
   [x method]; // expected-warning{{multiple methods named 'method' found}}
index 35fde4a9a6522518424226ecfd1017be9e489222..83e1c66a101717c59994c689a770d0329f8206dc 100644 (file)
@@ -4,7 +4,7 @@
 // RUN: %clang_cc1 -E -fmodules -x objective-c -fmodule-cache-path %t %s | FileCheck -check-prefix CHECK-PREPROCESSED %s
 // FIXME: When we have a syntax for modules in C, use that.
 
-@import macros;
+@__experimental_modules_import macros;
 
 #ifndef INTEGER
 #  error INTEGER macro should be visible
index 9574caa15285fce5cb512ce62080fe5420181d6f..25582caec3a353554e9491abcba6010f30e71768 100644 (file)
@@ -1,7 +1,7 @@
 // RUN: rm -rf %t
 // RUN: %clang_cc1 -fmodule-cache-path %t -fmodules -I %S/Inputs %s -verify
 
-@import MethodPoolA;
+@__experimental_modules_import MethodPoolA;
 
 
 // in other file: // expected-note{{using}}
@@ -19,7 +19,7 @@ void testMethod2(id object) {
   [object method2:1];
 } 
 
-@import MethodPoolB;
+@__experimental_modules_import MethodPoolB;
 
 void testMethod1Again(id object) {
   [object method1];
index e972ce2891c0c64c116eae39af9e4589285a6fdd..246dcaf80e2497e4783a2dba93af07c5cb1e78f1 100644 (file)
@@ -4,8 +4,8 @@
 // RUN: %clang_cc1 -fmodules -x objective-c++ -fmodule-cache-path %t %s -verify
 // FIXME: When we have a syntax for modules in C++, use that.
 
-@import module_private_left;
-@import module_private_right;
+@__experimental_modules_import module_private_left;
+@__experimental_modules_import module_private_right;
 
 void test() {
   int &ir = f0(1.0); // okay: f0() from 'right' is not visible
index b60f75cff60c091ec0395a84c270b7cfaf861a47..a51c65992ebd1a49e9e50e6bf3b2abd14802a257 100644 (file)
@@ -7,8 +7,8 @@ namespace N6 {
 
 namespace N8 { }
 
-@import namespaces_left;
-@import namespaces_right;
+@__experimental_modules_import namespaces_left;
+@__experimental_modules_import namespaces_right;
 
 void test() {
   int &ir1 = N1::f(1);
index 2858dabae15572dc0051be392b622f95fda9e363..7cd448235d81f563c0f5adf77b715275c323b14a 100644 (file)
@@ -8,7 +8,7 @@ int getUmbrella() {
   return umbrella + umbrella_sub; 
 }
 
-@import Umbrella2;
+@__experimental_modules_import Umbrella2;
 
 #include "a1.h"
 #include "b1.h"
@@ -18,7 +18,7 @@ int test() {
   return a1 + b1 + nested2;
 }
 
-@import nested_umbrella.a;
+@__experimental_modules_import nested_umbrella.a;
 
 int testNestedUmbrellaA() {
   return nested_umbrella_a;
@@ -28,7 +28,7 @@ int testNestedUmbrellaBFail() {
   return nested_umbrella_b; // expected-error{{use of undeclared identifier 'nested_umbrella_b'; did you mean 'nested_umbrella_a'?}}
 }
 
-@import nested_umbrella.b;
+@__experimental_modules_import nested_umbrella.b;
 
 int testNestedUmbrellaB() {
   return nested_umbrella_b;
index a8f8fb3d04924cee44dfab6f4c4c22fa27475aaf..340f279adf3f6f6674999b10da1ebe46f0dc4e84 100644 (file)
@@ -6,7 +6,7 @@
 // RUN: %clang_cc1 -fmodules -fmodule-cache-path %t -x objective-c -fmodule-name=category_other -emit-module %S/Inputs/module.map
 // RUN: %clang_cc1 -fmodules -fmodule-cache-path %t %s -verify
 
-@import category_bottom;
+@__experimental_modules_import category_bottom;
 
 
 
@@ -33,7 +33,7 @@ void test(Foo *foo, LeftFoo *leftFoo) {
 
 // Load another module that also adds categories to Foo, verify that
 // we see those categories.
-@import category_other;
+@__experimental_modules_import category_other;
 
 void test_other(Foo *foo) {
   [foo other];
index 7116f01d381ba50536dfebc867b94aad285bb8f5..24975c01b781fb62738cd2974ae73903b20ab855 100644 (file)
@@ -1,5 +1,5 @@
 // RUN: rm -rf %t
 // RUN: %clang_cc1 -fmodules -fno-objc-infer-related-result-type -Wmodule-build -fmodule-cache-path %t -F %S/Inputs -verify %s
 
-@import Module; // expected-warning{{building module 'Module' from source}}
+@__experimental_modules_import Module; // expected-warning{{building module 'Module' from source}}
 
index a7521fe78fcea202fd96a46639fec78ab5802eb9..cf1ae99ce0c9289fcc2a6fc6a178dc74328b31db 100644 (file)
@@ -3,7 +3,7 @@
 // RUN: %clang_cc1 -fmodules -fno-objc-infer-related-result-type -Werror -Wno-error=incomplete-umbrella -x objective-c++ -fmodule-cache-path %t -F %S/Inputs -I %S/Inputs -verify %s
 // RUN: %clang_cc1 -fmodules -fno-objc-infer-related-result-type -Werror -Wno-error=incomplete-umbrella -fmodule-cache-path %t -F %S/Inputs -I %S/Inputs -verify %s
 #define FOO
-@import Module;
+@__experimental_modules_import Module;
 @interface OtherClass
 @end
 
@@ -22,6 +22,6 @@ void test_getModuleVersion() {
 #  error MODULE_SUBFRAMEWORK_H should be hidden
 #endif
 
-@import subdir;
+@__experimental_modules_import subdir;
 
 const char *getSubdirTest() { return getSubdir(); }
index a48ac88c1786da56e15cd58fcaa20c57ff0137ec..2b8c5456eb65dec35b650446ccc7db0f2e18fb3f 100644 (file)
@@ -2,7 +2,7 @@
 // RUN: %clang_cc1 -fmodules -fmodule-cache-path %t -F %S/Inputs -DFOO_RETURNS_INT_PTR -verify %s
 // RUN: %clang_cc1 -fmodules -fmodule-cache-path %t -F %S/Inputs -verify %s
 
-@import CmdLine;
+@__experimental_modules_import CmdLine;
 
 void test() {
 #ifdef FOO_RETURNS_INT_PTR
index 591c4a29a9e64f6f79f8977215cd6623c7a12b4d..2ddd563b133081c1e410f1487cfd1510248dc44c 100644 (file)
@@ -4,12 +4,12 @@
 @class C2;
 @class C3;
 @class C3;
-@import redecl_merge_left;
+@__experimental_modules_import redecl_merge_left;
 typedef struct my_struct_type *my_struct_ref;
 @protocol P4;
 @class C3;
 @class C3;
-@import redecl_merge_right;
+@__experimental_modules_import redecl_merge_right;
 
 @implementation A
 - (Super*)init { return self; }
@@ -113,7 +113,7 @@ C4 *global_C4;
 
 ClassWithDef *cwd1;
 
-@import redecl_merge_left_left;
+@__experimental_modules_import redecl_merge_left_left;
 
 void test_C4a(C4 *c4) {
   global_C4 = c4 = get_a_C4();
@@ -124,7 +124,7 @@ void test_ClassWithDef(ClassWithDef *cwd) {
   [cwd method];
 }
 
-@import redecl_merge_bottom;
+@__experimental_modules_import redecl_merge_bottom;
 
 void test_C4b() {
   if (&refers_to_C4) {
index d71e9e8600b05364dad0ce9983563bef9c493f2a..3f3e6954cc2ca33b006be9fc3f225d93ac605732 100644 (file)
@@ -1,5 +1,5 @@
-@import redeclarations_left;
-@import redeclarations_right;
+@__experimental_modules_import redeclarations_left;
+@__experimental_modules_import redeclarations_right;
 
 @interface MyObject : NSObject
 @end
index 70d6160b0f3cfffcb9520f6fc028f3c82563d2b0..ce2537c78b73756ca67168c52f77db2f13d3da38 100644 (file)
@@ -1,5 +1,5 @@
 // RUN: rm -rf %t
 // RUN: %clang_cc1 -Wauto-import -fmodule-cache-path %t -fmodules -F %S/Inputs %s -verify
 
-@import DependsOnModule.CXX; // expected-error{{module 'DependsOnModule.CXX' requires feature 'cplusplus'}}
+@__experimental_modules_import DependsOnModule.CXX; // expected-error{{module 'DependsOnModule.CXX' requires feature 'cplusplus'}}
 
index e87bc6bac33a53b0fcf49c583998d6657464405b..09298c49395889a4b0d2a7a5423113f82e9775a7 100644 (file)
@@ -2,13 +2,13 @@
 // RUN: %clang_cc1 -Wauto-import -fmodule-cache-path %t -fmodules -F %S/Inputs -F %S/Inputs/DependsOnModule.framework/Frameworks %s -verify
 // RUN: %clang_cc1 -x objective-c++ -Wauto-import -fmodule-cache-path %t -fmodules -F %S/Inputs -F %S/Inputs/DependsOnModule.framework/Frameworks %s -verify
 
-@import DependsOnModule;
+@__experimental_modules_import DependsOnModule;
 
 void testSubFramework() {
   float *sf1 = sub_framework; // expected-error{{use of undeclared identifier 'sub_framework'}}
 }
 
-@import DependsOnModule.SubFramework;
+@__experimental_modules_import DependsOnModule.SubFramework;
 
 void testSubFrameworkAgain() {
   float *sf2 = sub_framework;
@@ -16,7 +16,7 @@ void testSubFrameworkAgain() {
 }
 
 #ifdef __cplusplus
-@import DependsOnModule.CXX;
+@__experimental_modules_import DependsOnModule.CXX;
 
 CXXOnly cxxonly;
 #endif
index 7d218b13593e31b3d527ddb2a5bb26680ec54a75..8d6c2cd70d844098a3377824df79bcbafeaa6093 100644 (file)
@@ -2,7 +2,7 @@
 // RUN: %clang_cc1 -fmodules -x objective-c++ -Eonly -fmodule-cache-path %t -I %S/Inputs/submodules %s -verify
 // FIXME: When we have a syntax for modules in C++, use that.
 
-@import std.vector;
+@__experimental_modules_import std.vector;
 
 #ifndef HAVE_VECTOR
 #  error HAVE_VECTOR macro is not available (but should be)
@@ -16,7 +16,7 @@
 #  error HAVE_HASH_MAP macro is available (but shouldn't be)
 #endif
 
-@import std.typetraits; // expected-error{{no submodule named 'typetraits' in module 'std'; did you mean 'type_traits'?}}
+@__experimental_modules_import std.typetraits; // expected-error{{no submodule named 'typetraits' in module 'std'; did you mean 'type_traits'?}}
 
 #ifndef HAVE_VECTOR
 #  error HAVE_VECTOR macro is not available (but should be)
@@ -30,9 +30,9 @@
 #  error HAVE_HASH_MAP macro is available (but shouldn't be)
 #endif
 
-@import std.vector.compare; // expected-error{{no submodule named 'compare' in module 'std.vector'}}
+@__experimental_modules_import std.vector.compare; // expected-error{{no submodule named 'compare' in module 'std.vector'}}
 
-@import std; // import everything in 'std'
+@__experimental_modules_import std; // import everything in 'std'
 
 #ifndef HAVE_VECTOR
 #  error HAVE_VECTOR macro is not available (but should be)
@@ -46,7 +46,7 @@
 #  error HAVE_HASH_MAP macro is available (but shouldn't be)
 #endif
 
-@import std.hash_map;
+@__experimental_modules_import std.hash_map;
 
 #ifndef HAVE_VECTOR
 #  error HAVE_VECTOR macro is not available (but should be)
index 1417446416cdc2d91623efc6c3724cc879640009..60d5ae0c22f4de140cecac0a8b28cc94ed037133 100644 (file)
@@ -2,7 +2,7 @@
 // RUN: %clang_cc1 -x objective-c++ -fmodule-cache-path %t -fmodules -I %S/Inputs/submodules %s -verify
 // FIXME: When we have a syntax for modules in C++, use that.
 
-@import std.vector;
+@__experimental_modules_import std.vector;
 
 vector<int> vi;
 
@@ -10,20 +10,20 @@ vector<int> vi;
 remove_reference<int&>::type *int_ptr = 0; // expected-error{{unknown type name 'remove_reference'}} \
 // expected-error{{expected unqualified-id}}
 
-@import std.typetraits; // expected-error{{no submodule named 'typetraits' in module 'std'; did you mean 'type_traits'?}}
+@__experimental_modules_import std.typetraits; // expected-error{{no submodule named 'typetraits' in module 'std'; did you mean 'type_traits'?}}
 
 vector<float> vf;
 remove_reference<int&>::type *int_ptr2 = 0;
 
-@import std.vector.compare; // expected-error{{no submodule named 'compare' in module 'std.vector'}}
+@__experimental_modules_import std.vector.compare; // expected-error{{no submodule named 'compare' in module 'std.vector'}}
 
-@import std; // import everything in 'std'
+@__experimental_modules_import std; // import everything in 'std'
 
 // hash_map still isn't available.
 hash_map<int, float> ints_to_floats; // expected-error{{unknown type name 'hash_map'}} \
 // expected-error{{expected unqualified-id}}
 
-@import std.hash_map;
+@__experimental_modules_import std.hash_map;
 
 hash_map<int, float> ints_to_floats2;
 
index 908a4785e8e4063a6fe1e5770f179bc21be0d74d..e014bead73b24638acddc62f7eb602291e35a6a5 100644 (file)
@@ -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.Sub;
+@__experimental_modules_import Module.Sub;
 
 int getValue() { 
   return *Module_Sub + *Module_Sub2;
index 00d95716512ce401c3353073871eb8ac23a12a32..6b4f02c6f2366650e99aaff753baea9e44d66f4f 100644 (file)
@@ -2,7 +2,7 @@
 // RUN: %clang_cc1 -x objective-c++ -fmodule-cache-path %t -fmodules -I %S/Inputs/wildcard-submodule-exports %s -verify
 // FIXME: When we have a syntax for modules in C++, use that.
 
-@import C.One;
+@__experimental_modules_import C.One;
 
 void test_C_One() {
   int *A1_ptr = A1;
@@ -10,7 +10,7 @@ void test_C_One() {
   (void)B1; // expected-error{{use of undeclared identifier 'B1'}}
 }
 
-@import C.Two;
+@__experimental_modules_import C.Two;
 
 void test_C_Two() {
   unsigned int *A2_ptr = A2;
@@ -18,7 +18,7 @@ void test_C_Two() {
   unsigned long *C2_ptr = C2;
 }
 
-@import B.One;
+@__experimental_modules_import B.One;
 
 void test_B_One() {
   short *B1_ptr = B1;