diff --git a/include/clang/AST/Decl.h b/include/clang/AST/Decl.h index 88adbeb6e11a6f70b11c6e3cdd901b97024097ba..e00779844c1913ebb42ca093f0b5b1cfa6edebbd 100644 --- a/include/clang/AST/Decl.h +++ b/include/clang/AST/Decl.h @@ -3218,7 +3218,7 @@ public: /// /// An import declaration imports the named module (or submodule). For example: /// \code -/// @__experimental_modules_import std.vector; +/// @import std.vector; /// \endcode /// /// Import declarations can also be implicitly generated from diff --git a/include/clang/Basic/IdentifierTable.h b/include/clang/Basic/IdentifierTable.h index 9ad3f49bde07ade2594e031485d42bbe61b0553e..34e2346820a117360ef5fd23c7e26bfd4f752a75 100644 --- a/include/clang/Basic/IdentifierTable.h +++ b/include/clang/Basic/IdentifierTable.h @@ -297,11 +297,11 @@ public: } /// \brief Determine whether this is the contextual keyword - /// '__experimental_modules_import'. + /// 'import'. bool isModulesImport() const { return IsModulesImport; } /// \brief Set whether this identifier is the contextual keyword - /// '__experimental_modules_import'. + /// 'import'. void setModulesImport(bool I) { IsModulesImport = I; if (I) diff --git a/include/clang/Basic/TokenKinds.def b/include/clang/Basic/TokenKinds.def index 25e8d5a635c7b48ef76ba3fdeb70cbc22ba771ec..f02ba6438bdf9db9700c19b0a6dc21ec1e2b2f67 100644 --- a/include/clang/Basic/TokenKinds.def +++ b/include/clang/Basic/TokenKinds.def @@ -566,7 +566,7 @@ OBJC2_AT_KEYWORD(required) OBJC2_AT_KEYWORD(optional) OBJC2_AT_KEYWORD(synthesize) OBJC2_AT_KEYWORD(dynamic) -OBJC2_AT_KEYWORD(__experimental_modules_import) +OBJC2_AT_KEYWORD(import) // TODO: What to do about context-sensitive keywords like: // bycopy/byref/in/inout/oneway/out? diff --git a/lib/AST/DeclPrinter.cpp b/lib/AST/DeclPrinter.cpp index 857a26621b8fc44553d562a324cd277d2a7abeb3..5cef00f187406a058918e664f12c729cf4878f41 100644 --- a/lib/AST/DeclPrinter.cpp +++ b/lib/AST/DeclPrinter.cpp @@ -686,7 +686,7 @@ void DeclPrinter::VisitFileScopeAsmDecl(FileScopeAsmDecl *D) { } void DeclPrinter::VisitImportDecl(ImportDecl *D) { - Out << "@__experimental_modules_import " << D->getImportedModule()->getFullModuleName() + Out << "@import " << D->getImportedModule()->getFullModuleName() << ";\n"; } diff --git a/lib/Basic/IdentifierTable.cpp b/lib/Basic/IdentifierTable.cpp index 58c33bba8a3a27a21fa86b97b5ecf572209a3592..49cd0ac615a3c399c6c6e5f540c69a05766900f1 100644 --- a/lib/Basic/IdentifierTable.cpp +++ b/lib/Basic/IdentifierTable.cpp @@ -82,7 +82,7 @@ IdentifierTable::IdentifierTable(const LangOptions &LangOpts, // Add the '_experimental_modules_import' contextual keyword. - get("__experimental_modules_import").setModulesImport(true); + get("import").setModulesImport(true); } //===----------------------------------------------------------------------===// diff --git a/lib/Lex/PPDirectives.cpp b/lib/Lex/PPDirectives.cpp index 7b5df9c314875a0f5d130bea668f20aa63650fa0..5f95260ea8079cdec391c8935c4dd3893caafc34 100644 --- a/lib/Lex/PPDirectives.cpp +++ b/lib/Lex/PPDirectives.cpp @@ -1476,7 +1476,7 @@ void Preprocessor::HandleIncludeDirective(SourceLocation HashLoc, Diag(HashLoc, diag::warn_auto_module_import) << IncludeKind << PathString << FixItHint::CreateReplacement(ReplaceRange, - "@__experimental_modules_import " + PathString.str().str() + ";"); + "@import " + PathString.str().str() + ";"); } // Load the module. diff --git a/lib/Lex/Preprocessor.cpp b/lib/Lex/Preprocessor.cpp index 2341c01647d038f37cf85c808754e0e7c5021931..4f0b189c8b060a8d6ba4ab3f5ef3bf8a87712dbf 100644 --- a/lib/Lex/Preprocessor.cpp +++ b/lib/Lex/Preprocessor.cpp @@ -631,10 +631,10 @@ void Preprocessor::HandleIdentifier(Token &Identifier) { if (II.isExtensionToken() && !DisableMacroExpansion) Diag(Identifier, diag::ext_token_used); - // If this is the '__experimental_modules_import' contextual keyword, note + // If this is the 'import' contextual keyword, note // that the next token indicates a module name. // - // Note that we do not treat '__experimental_modules_import' as a contextual + // 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.isModulesImport() && !InMacroArgs && !DisableMacroExpansion && diff --git a/lib/Parse/ParseObjc.cpp b/lib/Parse/ParseObjc.cpp index 84d0b22d4d7d120f2fc8a86267331d56318aa229..3b252d083e765536e7e346396aa949c9993b53c8 100644 --- a/lib/Parse/ParseObjc.cpp +++ b/lib/Parse/ParseObjc.cpp @@ -65,7 +65,7 @@ Parser::DeclGroupPtrTy Parser::ParseObjCAtDirectives() { case tok::objc_dynamic: SingleDecl = ParseObjCPropertyDynamic(AtLoc); break; - case tok::objc___experimental_modules_import: + case tok::objc_import: if (getLangOpts().Modules) return ParseModuleImport(AtLoc); diff --git a/lib/Parse/Parser.cpp b/lib/Parse/Parser.cpp index 8f4fa9f3ad9691790445ab8d5de6a497b6902222..f96ed99368c734a4e174455a8b805c8bed5c2e02 100644 --- a/lib/Parse/Parser.cpp +++ b/lib/Parse/Parser.cpp @@ -1845,7 +1845,7 @@ void Parser::ParseMicrosoftIfExistsExternalDeclaration() { } Parser::DeclGroupPtrTy Parser::ParseModuleImport(SourceLocation AtLoc) { - assert(Tok.isObjCAtKeyword(tok::objc___experimental_modules_import) && + assert(Tok.isObjCAtKeyword(tok::objc_import) && "Improper start to module import"); SourceLocation ImportLoc = ConsumeToken(); diff --git a/test/Index/annotate-module.m b/test/Index/annotate-module.m index 3423f2b40d818f28d677419c1947f7acbb1ddd68..ba5b8257efcfdfe562b622ae2e3c4182b1448dae 100644 --- a/test/Index/annotate-module.m +++ b/test/Index/annotate-module.m @@ -1,6 +1,6 @@ #include <DependsOnModule/DependsOnModule.h> -@__experimental_modules_import DependsOnModule; +@import DependsOnModule; int glob; // RUN: rm -rf %t.cache @@ -17,9 +17,9 @@ int glob; // CHECK-NEXT: Identifier: "h" [2:43 - 2:44] inclusion directive=[[INC_DIR]] // CHECK-NEXT: Punctuation: ">" [2:44 - 2:45] inclusion directive=[[INC_DIR]] // CHECK-NEXT: Punctuation: "@" [3:1 - 3:2] ModuleImport=DependsOnModule:3:1 -// CHECK-NEXT: Keyword: "__experimental_modules_import" [3:2 - 3:31] ModuleImport=DependsOnModule:3:1 -// CHECK-NEXT: Identifier: "DependsOnModule" [3:32 - 3:47] ModuleImport=DependsOnModule:3:1 -// CHECK-NEXT: Punctuation: ";" [3:47 - 3:48] +// CHECK-NEXT: Keyword: "import" [3:2 - 3:8] ModuleImport=DependsOnModule:3:1 +// CHECK-NEXT: Identifier: "DependsOnModule" [3:9 - 3:24] ModuleImport=DependsOnModule:3:1 +// CHECK-NEXT: Punctuation: ";" [3:24 - 3:25] // CHECK-NEXT: Keyword: "int" [4:1 - 4:4] VarDecl=glob:4:5 // CHECK-NEXT: Identifier: "glob" [4:5 - 4:9] VarDecl=glob:4:5 // CHECK-NEXT: Punctuation: ";" [4:9 - 4:10] diff --git a/test/Index/complete-modules.m b/test/Index/complete-modules.m index b82430db9dbb79e414359c53b32dfa28121fc4f5..a8737216e2127df4791aa411acb0b5cc9c1f4c11 100644 --- a/test/Index/complete-modules.m +++ b/test/Index/complete-modules.m @@ -1,14 +1,14 @@ // Note: the run lines follow their respective tests, since line/column // matter in this test. -@__experimental_modules_import LibA.Extensions; +@import LibA.Extensions; // RUN: rm -rf %t -// 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 +// 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 // 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:37 -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:14 -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) diff --git a/test/Index/crash-recovery-modules.m b/test/Index/crash-recovery-modules.m index 212923f94be615431159cb1fcecdce674f452358..8d93c1ae06d2409e102ffe2dc77716f25cce0296 100644 --- a/test/Index/crash-recovery-modules.m +++ b/test/Index/crash-recovery-modules.m @@ -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:32:{16:2-16:37}: fatal error: could not build module 'Crash' +// CHECK-CRASH: crash-recovery-modules.m:16:9:{16:2-16:14}: 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 -@__experimental_modules_import Crash; +@import Crash; void test() { const char* error = getCrashString(); diff --git a/test/Index/index-module.m b/test/Index/index-module.m index 0af4e37f3c3d18609ef0ae75386b45b2f99f57ef..54b77d1d5f05c44382f1697c68e3db7725628662 100644 --- a/test/Index/index-module.m +++ b/test/Index/index-module.m @@ -1,6 +1,6 @@ #include <DependsOnModule/DependsOnModule.h> -@__experimental_modules_import DependsOnModule; +@import DependsOnModule; int glob; // RUN: rm -rf %t.cache diff --git a/test/Modules/Inputs/MutuallyRecursive1.framework/Headers/MutuallyRecursive1.h b/test/Modules/Inputs/MutuallyRecursive1.framework/Headers/MutuallyRecursive1.h index 5142f56e6015b8bb20b677ed482a861183a2758c..156c22604f5ac8b2766742c41f5d8234be8c8c05 100644 --- a/test/Modules/Inputs/MutuallyRecursive1.framework/Headers/MutuallyRecursive1.h +++ b/test/Modules/Inputs/MutuallyRecursive1.framework/Headers/MutuallyRecursive1.h @@ -1,3 +1,3 @@ -@__experimental_modules_import MutuallyRecursive2; +@import MutuallyRecursive2; diff --git a/test/Modules/Inputs/MutuallyRecursive2.framework/Headers/MutuallyRecursive2.h b/test/Modules/Inputs/MutuallyRecursive2.framework/Headers/MutuallyRecursive2.h index 8a3cc338c222f0c84423fd4916764f4796d5a558..be3facd70eccb62bdb76f7ad96e83330d617e255 100644 --- a/test/Modules/Inputs/MutuallyRecursive2.framework/Headers/MutuallyRecursive2.h +++ b/test/Modules/Inputs/MutuallyRecursive2.framework/Headers/MutuallyRecursive2.h @@ -1,6 +1,6 @@ -@__experimental_modules_import MutuallyRecursive1; +@import MutuallyRecursive1; diff --git a/test/Modules/Inputs/category_bottom.h b/test/Modules/Inputs/category_bottom.h index b53d9c30d6f60be6c929e3987f5d10492a2e7a2e..ab4c01c3149cdca6dfd65e01139138d061388b8d 100644 --- a/test/Modules/Inputs/category_bottom.h +++ b/test/Modules/Inputs/category_bottom.h @@ -1,10 +1,10 @@ -@__experimental_modules_import category_left; +@import category_left; @interface Foo(Bottom) -(void)bottom; @end -@__experimental_modules_import category_right; +@import category_right; @interface LeftFoo(Bottom) -(void)bottom; diff --git a/test/Modules/Inputs/category_left.h b/test/Modules/Inputs/category_left.h index 736fa432690802d401c15be04bd161f68411f24d..05e2a1b96c525b37895925a70bd27a308d2667fb 100644 --- a/test/Modules/Inputs/category_left.h +++ b/test/Modules/Inputs/category_left.h @@ -1,4 +1,4 @@ -@__experimental_modules_import category_top; +@import category_top; @interface Foo(Left) -(void)left; diff --git a/test/Modules/Inputs/category_other.h b/test/Modules/Inputs/category_other.h index 1bb5a91cbd781e7b253f8469371783246cc81e6f..2c3f4794c2a71e694d12c6ffbcbc6c478085d813 100644 --- a/test/Modules/Inputs/category_other.h +++ b/test/Modules/Inputs/category_other.h @@ -1,4 +1,4 @@ -@__experimental_modules_import category_top; +@import category_top; @interface Foo(Other) -(void)other; diff --git a/test/Modules/Inputs/category_right.h b/test/Modules/Inputs/category_right.h index 812a840782497b7a54cd2abd55dbc02f8d210a77..3c83624c761654e579715a0a11f2f0d492192f01 100644 --- a/test/Modules/Inputs/category_right.h +++ b/test/Modules/Inputs/category_right.h @@ -1,4 +1,4 @@ -@__experimental_modules_import category_top; +@import category_top; @interface Foo(Right1) -(void)right1; diff --git a/test/Modules/Inputs/diamond.h b/test/Modules/Inputs/diamond.h index 15b529006160efecfdd346413b141ce595acd8fe..1990b45b5f856bd06176574638e8aaae9b36f5f3 100644 --- a/test/Modules/Inputs/diamond.h +++ b/test/Modules/Inputs/diamond.h @@ -1 +1 @@ -@__experimental_modules_import diamond_bottom; +@import diamond_bottom; diff --git a/test/Modules/Inputs/diamond_bottom.h b/test/Modules/Inputs/diamond_bottom.h index b45fa936d1e97e65ab57ac0030feae352bbe05dc..2a0a84e3d7b3ec44de04b61ae4adcc1f536d917a 100644 --- a/test/Modules/Inputs/diamond_bottom.h +++ b/test/Modules/Inputs/diamond_bottom.h @@ -1,4 +1,4 @@ -@__experimental_modules_import diamond_left; -@__experimental_modules_import diamond_right; +@import diamond_left; +@import diamond_right; char bottom(char *x); diff --git a/test/Modules/Inputs/diamond_left.h b/test/Modules/Inputs/diamond_left.h index cc406ab3891f383491d7d9dd7d241d2cff7a12dd..fce2e48882f8f0acb691ca35262684779d302196 100644 --- a/test/Modules/Inputs/diamond_left.h +++ b/test/Modules/Inputs/diamond_left.h @@ -1,4 +1,4 @@ -@__experimental_modules_import diamond_top; +@import diamond_top; float left(float *); diff --git a/test/Modules/Inputs/diamond_right.h b/test/Modules/Inputs/diamond_right.h index 2ba1d7744134e3417f89d2938e17e8b4bfd311f8..fa408ea5ba7f1359e2ce7f22765c33a05d0e971a 100644 --- a/test/Modules/Inputs/diamond_right.h +++ b/test/Modules/Inputs/diamond_right.h @@ -1,4 +1,4 @@ -@__experimental_modules_import diamond_top; +@import diamond_top; double right(double *); diff --git a/test/Modules/Inputs/macros_left.h b/test/Modules/Inputs/macros_left.h index cd0569389189d7dbbbb42d6a0d6536895a06b928..a8aac75a2fda0cf850619fe13adb4269937f80a0 100644 --- a/test/Modules/Inputs/macros_left.h +++ b/test/Modules/Inputs/macros_left.h @@ -1,4 +1,4 @@ -@__experimental_modules_import macros_top; +@import macros_top; #define LEFT unsigned long #undef TOP_LEFT_UNDEF diff --git a/test/Modules/Inputs/macros_right.h b/test/Modules/Inputs/macros_right.h index e16a64b50ad31362b2abe4fc5034d2813fa13f21..445f579cf6d03da28b2b39c692f57c550a2a440d 100644 --- a/test/Modules/Inputs/macros_right.h +++ b/test/Modules/Inputs/macros_right.h @@ -1,4 +1,4 @@ -@__experimental_modules_import macros_top; +@import macros_top; #define RIGHT unsigned short diff --git a/test/Modules/Inputs/namespaces-left.h b/test/Modules/Inputs/namespaces-left.h index d253fed7c1b2eda0ba9f9a802880ed7a61a599b7..7e9002aea8cdd2c0b50d8c6c531749cdaff0fd79 100644 --- a/test/Modules/Inputs/namespaces-left.h +++ b/test/Modules/Inputs/namespaces-left.h @@ -1,4 +1,4 @@ -@__experimental_modules_import namespaces_top; +@import namespaces_top; namespace N1 { } diff --git a/test/Modules/Inputs/namespaces-right.h b/test/Modules/Inputs/namespaces-right.h index 7e7286e10b29ff3abf71943e9c730477d743b8dc..b18aeb44786b5a5f7582e0d55b7aa88e99678d10 100644 --- a/test/Modules/Inputs/namespaces-right.h +++ b/test/Modules/Inputs/namespaces-right.h @@ -1,4 +1,4 @@ -@__experimental_modules_import namespaces_top; +@import namespaces_top; namespace N2 { } diff --git a/test/Modules/Inputs/redecl-merge-bottom.h b/test/Modules/Inputs/redecl-merge-bottom.h index cfea7dc87da5838c996461a4aac1d0b0f9fbf501..28ea20c55de944243627c113f430379812cfef65 100644 --- a/test/Modules/Inputs/redecl-merge-bottom.h +++ b/test/Modules/Inputs/redecl-merge-bottom.h @@ -1,11 +1,11 @@ -@__experimental_modules_import redecl_merge_left; +@import redecl_merge_left; @class C4; @class C4; @protocol P4; @protocol P4; @protocol P4; -@__experimental_modules_import redecl_merge_right; +@import redecl_merge_right; @class B; diff --git a/test/Modules/Inputs/redecl-merge-left-left.h b/test/Modules/Inputs/redecl-merge-left-left.h index 5f48883bf15f6c3562137232ea1dbf7441453d04..79c4d620bee9f7f720b0a2c0896347dc45d9f9ba 100644 --- a/test/Modules/Inputs/redecl-merge-left-left.h +++ b/test/Modules/Inputs/redecl-merge-left-left.h @@ -1,4 +1,4 @@ -@__experimental_modules_import redecl_merge_left; +@import redecl_merge_left; @class C4; void accept_a_C4(C4*); diff --git a/test/Modules/Inputs/redecl-merge-left.h b/test/Modules/Inputs/redecl-merge-left.h index 5e6d2e512b0090dd66e361cff912cd0c4d89099f..973d594a304275cb3126c6ed4e1d223177258885 100644 --- a/test/Modules/Inputs/redecl-merge-left.h +++ b/test/Modules/Inputs/redecl-merge-left.h @@ -1,4 +1,4 @@ -@__experimental_modules_import redecl_merge_top; +@import redecl_merge_top; @class A; diff --git a/test/Modules/Inputs/redecl-merge-right.h b/test/Modules/Inputs/redecl-merge-right.h index 20223083c31aacdde122574283ab651201d253ac..b664ae9a720499f5d0d4c6e9872e3ea372053040 100644 --- a/test/Modules/Inputs/redecl-merge-right.h +++ b/test/Modules/Inputs/redecl-merge-right.h @@ -1,4 +1,4 @@ -@__experimental_modules_import redecl_merge_top; +@import redecl_merge_top; @interface Super @end @@ -79,7 +79,7 @@ extern int var2; static double var3; int ONE; -@__experimental_modules_import redecl_merge_top.Explicit; +@import redecl_merge_top.Explicit; const int one = ONE; @interface ClassWithDef diff --git a/test/Modules/Inputs/templates-left.h b/test/Modules/Inputs/templates-left.h index 57a8c85bf602ba1251ffc04c03be0eec9828cb01..7451420c7482fd796ca12b9e7b556f035ca014fc 100644 --- a/test/Modules/Inputs/templates-left.h +++ b/test/Modules/Inputs/templates-left.h @@ -1,4 +1,4 @@ -@__experimental_modules_import templates_top; +@import templates_top; template<typename T> class Vector; diff --git a/test/Modules/Inputs/templates-right.h b/test/Modules/Inputs/templates-right.h index 4ef4a32e8e276584539c34a1720fe9fff91d3489..d3524d34769bd0679f72669ae6c6f346516047f3 100644 --- a/test/Modules/Inputs/templates-right.h +++ b/test/Modules/Inputs/templates-right.h @@ -1,4 +1,4 @@ -@__experimental_modules_import templates_top; +@import templates_top; template<typename T> class Vector { public: diff --git a/test/Modules/Inputs/wildcard-submodule-exports/C_one.h b/test/Modules/Inputs/wildcard-submodule-exports/C_one.h index fb1c7de845bcce06dee9c823e2eb26dcf7cb13f6..e3b7593b80c8c1e9453783b2673e553665fa058c 100644 --- a/test/Modules/Inputs/wildcard-submodule-exports/C_one.h +++ b/test/Modules/Inputs/wildcard-submodule-exports/C_one.h @@ -1,4 +1,4 @@ -@__experimental_modules_import A.One; -@__experimental_modules_import B.One; +@import A.One; +@import B.One; long *C1; diff --git a/test/Modules/Inputs/wildcard-submodule-exports/C_two.h b/test/Modules/Inputs/wildcard-submodule-exports/C_two.h index 050a8f3e88554153165c8e0a710ed91596da9891..b65dcf612ebc7b366f1684998fc7856e0c7ca604 100644 --- a/test/Modules/Inputs/wildcard-submodule-exports/C_two.h +++ b/test/Modules/Inputs/wildcard-submodule-exports/C_two.h @@ -1,4 +1,4 @@ -@__experimental_modules_import A.Two; -@__experimental_modules_import B.Two; +@import A.Two; +@import B.Two; unsigned long *C2; diff --git a/test/Modules/build-fail-notes.m b/test/Modules/build-fail-notes.m index af817f9bca88a9c8e02fd8024307f2f3e6b86260..93809daca35e5f9e698dbfaf5352ad11e2c1456c 100644 --- a/test/Modules/build-fail-notes.m +++ b/test/Modules/build-fail-notes.m @@ -1,7 +1,7 @@ // RUN: rm -rf %t // RUN: %clang_cc1 -fmodule-cache-path %t -fmodules -F %S/Inputs -DgetModuleVersion="epic fail" %s 2>&1 | FileCheck %s -@__experimental_modules_import DependsOnModule; +@import DependsOnModule; // CHECK: While building module 'DependsOnModule' imported from // CHECK: While building module 'Module' imported from @@ -22,10 +22,10 @@ extern int Module; // RUN: c-index-test -read-diagnostics %t/tmp.diag 2>&1 | FileCheck -check-prefix=CHECK-SDIAG %s // CHECK-SDIAG: Module.h:9:13: error: expected ';' after top level declarator -// CHECK-SDIAG: build-fail-notes.m:4:32: note: while building module 'DependsOnModule' imported from +// CHECK-SDIAG: build-fail-notes.m:4:9: note: while building module 'DependsOnModule' imported from // CHECK-SDIAG: DependsOnModule.h:1:10: note: while building module 'Module' imported from // CHECK-SDIAG: note: expanded from here // CHECK-SDIAG: warning: umbrella header does not include header 'NotInModule.h' [-Wincomplete-umbrella] // CHECK-SDIAG: DependsOnModule.h:1:10: fatal: could not build module 'Module' -// CHECK-SDIAG: build-fail-notes.m:4:32: note: while building module 'DependsOnModule' imported from +// CHECK-SDIAG: build-fail-notes.m:4:9: note: while building module 'DependsOnModule' imported from diff --git a/test/Modules/compiler_builtins.m b/test/Modules/compiler_builtins.m index dfa46c8a34f5c3c579ececeff6895184c0b189a6..bd4309d4dadc15b3b43e78e5339b77a0bd8049d6 100644 --- a/test/Modules/compiler_builtins.m +++ b/test/Modules/compiler_builtins.m @@ -4,9 +4,9 @@ // expected-no-diagnostics #ifdef __SSE__ -@__experimental_modules_import _Builtin_intrinsics.intel.sse; +@import _Builtin_intrinsics.intel.sse; #endif #ifdef __AVX2__ -@__experimental_modules_import _Builtin_intrinsics.intel.avx2; +@import _Builtin_intrinsics.intel.avx2; #endif diff --git a/test/Modules/cstd.m b/test/Modules/cstd.m index e262c7e1442989cee12839bb7df12d2384f85499..928748570c474081d8dfba22c231cef598d80343 100644 --- a/test/Modules/cstd.m +++ b/test/Modules/cstd.m @@ -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. -@__experimental_modules_import cstd.float_constants; +@import cstd.float_constants; float getFltMax() { return FLT_MAX; } // Supplied by the "/usr/include" module map. -@__experimental_modules_import cstd.stdio; +@import cstd.stdio; void test_fprintf(FILE *file) { fprintf(file, "Hello, modules\n"); } // Supplied by compiler, which forwards to the "/usr/include" version. -@__experimental_modules_import cstd.stdint; +@import cstd.stdint; my_awesome_nonstandard_integer_type value; // Supplied by the compiler; that version wins. -@__experimental_modules_import cstd.stdbool; +@import cstd.stdbool; #ifndef bool # error "bool was not defined!" diff --git a/test/Modules/cycles.c b/test/Modules/cycles.c index 5fcb41ec1f64d5459424105548f7ffcffea60011..ea893ee6dae15571ee1596ba19677751a17c4323 100644 --- a/test/Modules/cycles.c +++ b/test/Modules/cycles.c @@ -1,13 +1,13 @@ // 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. -@__experimental_modules_import MutuallyRecursive1; +@import MutuallyRecursive1; // CHECK: While building module 'MutuallyRecursive1' imported from // CHECK: While building module 'MutuallyRecursive2' imported from -// CHECK: MutuallyRecursive2.h:3:32: fatal error: cyclic dependency in module 'MutuallyRecursive1': MutuallyRecursive1 -> MutuallyRecursive2 -> MutuallyRecursive1 +// CHECK: MutuallyRecursive2.h:3:9: fatal error: cyclic dependency in module 'MutuallyRecursive1': MutuallyRecursive1 -> MutuallyRecursive2 -> MutuallyRecursive1 // CHECK: While building module 'MutuallyRecursive1' imported from -// CHECK: MutuallyRecursive1.h:2:32: fatal error: could not build module 'MutuallyRecursive2' -// CHECK: cycles.c:4:32: fatal error: could not build module '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-NOT: error: diff --git a/test/Modules/decldef.mm b/test/Modules/decldef.mm index 64a66d59d0e622af536621089a8709bdefb824ba..c99fdea0d84ee0f646313beaa716f9a5660a4e9b 100644 --- a/test/Modules/decldef.mm +++ b/test/Modules/decldef.mm @@ -10,10 +10,10 @@ // in other file: expected-note{{previous definition is here}} -@__experimental_modules_import decldef; +@import decldef; A *a1; // expected-error{{unknown type name 'A'}} B *b1; // expected-error{{unknown type name 'B'}} -@__experimental_modules_import decldef.Decl; +@import decldef.Decl; A *a2; B *b; diff --git a/test/Modules/diamond.c b/test/Modules/diamond.c index 076eec4bf268fdbad58ae534c3c49e15a397d884..1d8902101ee4b615bf39a9db7f519cae7c23032b 100644 --- a/test/Modules/diamond.c +++ b/test/Modules/diamond.c @@ -3,7 +3,7 @@ // in diamond-bottom.h: expected-note{{passing argument to parameter 'x' here}} -@__experimental_modules_import diamond_bottom; +@import diamond_bottom; void test_diamond(int i, float f, double d, char c) { top(&i); diff --git a/test/Modules/epic-fail.m b/test/Modules/epic-fail.m index 7c3faaf63fefe9700ea4159626de3c031d50f5bb..ef0aa5a0e722ef2d0377f37400b7d91845b9ad2d 100644 --- a/test/Modules/epic-fail.m +++ b/test/Modules/epic-fail.m @@ -1,8 +1,8 @@ // RUN: rm -rf %t // RUN: %clang_cc1 -fmodule-cache-path %t -fmodules -F %S/Inputs -DgetModuleVersion="epic fail" %s 2>&1 | FileCheck %s -@__experimental_modules_import Module; -@__experimental_modules_import DependsOnModule; +@import Module; +@import DependsOnModule; // CHECK: While building module 'Module' imported from // CHECK: error: expected ';' after top level declarator diff --git a/test/Modules/header-import.m b/test/Modules/header-import.m index 49549d0c671a81491a3831feafe567104f64b5bb..60d2889dc9fce3cc7374188ea97e6c94aa7cef6e 100644 --- a/test/Modules/header-import.m +++ b/test/Modules/header-import.m @@ -3,6 +3,6 @@ // expected-no-diagnostics #import "point.h" -@__experimental_modules_import Module; +@import Module; #import "point.h" diff --git a/test/Modules/import-decl.cpp b/test/Modules/import-decl.cpp index 0f05f92708bc8fc85a926cc79fe747ab68be13f9..781e19fde806be9b0ab1b65e452ae2e15c6dd0ad 100644 --- a/test/Modules/import-decl.cpp +++ b/test/Modules/import-decl.cpp @@ -2,7 +2,7 @@ // RUN: %clang -fmodule-cache-path %t -fmodules -x objective-c -I %S/Inputs -emit-ast -o %t.ast %s // RUN: %clang_cc1 -ast-print -x ast - < %t.ast | FileCheck %s -@__experimental_modules_import import_decl; +@import import_decl; // CHECK: struct T int main() { diff --git a/test/Modules/inferred-frameworks.m b/test/Modules/inferred-frameworks.m index 916c900b6457fb9aa7d2deb0b912813bc94ad712..56854d80c82c6690d6aad67a85ecb05c126b4538 100644 --- a/test/Modules/inferred-frameworks.m +++ b/test/Modules/inferred-frameworks.m @@ -3,6 +3,6 @@ #include <NotAModule/NotAModule.h> -@__experimental_modules_import NotAModule; // expected-error{{module 'NotAModule' not found}} +@import NotAModule; // expected-error{{module 'NotAModule' not found}} diff --git a/test/Modules/inferred-submodules.m b/test/Modules/inferred-submodules.m index 8c61bc081c2da1efbff7080ebd820c783d50a6e8..9c8b81536ee94e9ca117dd95e2502a67e3d75192 100644 --- a/test/Modules/inferred-submodules.m +++ b/test/Modules/inferred-submodules.m @@ -2,13 +2,13 @@ // RUN: %clang_cc1 -x objective-c -Wauto-import -fmodule-cache-path %t -fmodules -F %S/Inputs %s -verify // expected-no-diagnostics -@__experimental_modules_import Module.Sub; +@import Module.Sub; void test_Module_Sub() { int *ip = Module_Sub; } -@__experimental_modules_import Module.Buried.Treasure; +@import Module.Buried.Treasure; void dig() { unsigned *up = Buried_Treasure; diff --git a/test/Modules/irgen.c b/test/Modules/irgen.c index 4a080db5b2eb4699f936d285324bcd73f76b219d..8f4c299a7efbc02b185bd5855589a33ce28d3939 100644 --- a/test/Modules/irgen.c +++ b/test/Modules/irgen.c @@ -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. -@__experimental_modules_import irgen; +@import irgen; // CHECK: define void @triple_value void triple_value(int *px) { diff --git a/test/Modules/load_failure.c b/test/Modules/load_failure.c index 3a963012b19009d80b74ae6d7a3415767efb7758..bc0b42631598d976bf0e06e922b3a0e1eb919774 100644 --- a/test/Modules/load_failure.c +++ b/test/Modules/load_failure.c @@ -1,15 +1,15 @@ #ifdef NONEXISTENT -@__experimental_modules_import load_nonexistent; +@import load_nonexistent; #endif #ifdef FAILURE -@__experimental_modules_import load_failure; +@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:32: fatal error: module 'load_nonexistent' not found +// CHECK-NONEXISTENT: load_failure.c:2:9: 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 diff --git a/test/Modules/lookup.cpp b/test/Modules/lookup.cpp index 70d210750d94e6eda6355cebdc296787d021e987..76e1f6aae2eba9a7f610cd7c7f34d040420026fe 100644 --- a/test/Modules/lookup.cpp +++ b/test/Modules/lookup.cpp @@ -1,8 +1,8 @@ -#define import @__experimental_modules_import +#define import @import import lookup_left_cxx; #undef import -#define IMPORT(X) @__experimental_modules_import X +#define IMPORT(X) @import X IMPORT(lookup_right_cxx); // in lookup_left.hpp: expected-warning@3 {{weak identifier 'weak_identifier' never declared}} diff --git a/test/Modules/lookup.m b/test/Modules/lookup.m index c82503f79035eb302ec0c8163b03ea64a46066dd..7ca0c23a46529a3bdd29f1bfbbe122485dd88f49 100644 --- a/test/Modules/lookup.m +++ b/test/Modules/lookup.m @@ -1,8 +1,8 @@ // lookup_left.h: expected-note{{using}} // lookup_right.h: expected-note{{also found}} -@__experimental_modules_import lookup_left_objc; -@__experimental_modules_import lookup_right_objc; +@import lookup_left_objc; +@import lookup_right_objc; void test(id x) { [x method]; // expected-warning{{multiple methods named 'method' found}} diff --git a/test/Modules/macros.c b/test/Modules/macros.c index 8db3915f24a9cc190ff9ff9056d6e1ea2de29737..f6b47442c4cdae933bdfffae0946b133098c0cd8 100644 --- a/test/Modules/macros.c +++ b/test/Modules/macros.c @@ -16,7 +16,7 @@ // expected-note{{other definition of 'TOP_RIGHT_REDEF'}} -@__experimental_modules_import macros; +@import macros; #ifndef INTEGER # error INTEGER macro should be visible @@ -65,7 +65,7 @@ void f() { #endif // Import left module (which also imports top) -@__experimental_modules_import macros_left; +@import macros_left; #ifndef LEFT # error LEFT should be visible @@ -91,7 +91,7 @@ void test1() { #define LEFT_RIGHT_DIFFERENT2 double // FIXME: expected-warning{{'LEFT_RIGHT_DIFFERENT2' macro redefined}} // Import right module (which also imports top) -@__experimental_modules_import macros_right; +@import macros_right; #undef LEFT_RIGHT_DIFFERENT3 @@ -130,7 +130,7 @@ void test3() { # error TOP_RIGHT_UNDEF should still be defined #endif -@__experimental_modules_import macros_right.undef; +@import macros_right.undef; #ifdef TOP_RIGHT_UNDEF # error TOP_RIGHT_UNDEF should not be defined diff --git a/test/Modules/method_pool.m b/test/Modules/method_pool.m index 25582caec3a353554e9491abcba6010f30e71768..9574caa15285fce5cb512ce62080fe5420181d6f 100644 --- a/test/Modules/method_pool.m +++ b/test/Modules/method_pool.m @@ -1,7 +1,7 @@ // RUN: rm -rf %t // RUN: %clang_cc1 -fmodule-cache-path %t -fmodules -I %S/Inputs %s -verify -@__experimental_modules_import MethodPoolA; +@import MethodPoolA; // in other file: // expected-note{{using}} @@ -19,7 +19,7 @@ void testMethod2(id object) { [object method2:1]; } -@__experimental_modules_import MethodPoolB; +@import MethodPoolB; void testMethod1Again(id object) { [object method1]; diff --git a/test/Modules/modify-module.m b/test/Modules/modify-module.m index b630ac105874593e531238e3e24659802c4939f0..422d3c3e97c35d4e70a6b6368ca881a582ad1b94 100644 --- a/test/Modules/modify-module.m +++ b/test/Modules/modify-module.m @@ -13,7 +13,7 @@ // RUN: echo 'int getA(); int getA2();' > %t/include/A.h // RUN: %clang_cc1 -fmodule-cache-path %t/cache -fmodules -I %t/include %s -verify -@__experimental_modules_import B; +@import B; int getValue() { return getA() + getB(); } diff --git a/test/Modules/module-private.cpp b/test/Modules/module-private.cpp index 31a3410a03f80eda21cbf9f31c34826edb828123..b2905a1f764b59a4e09367914db12b3e5023d12d 100644 --- a/test/Modules/module-private.cpp +++ b/test/Modules/module-private.cpp @@ -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. -@__experimental_modules_import module_private_left; -@__experimental_modules_import module_private_right; +@import module_private_left; +@import module_private_right; void test() { int &ir = f0(1.0); // okay: f0() from 'right' is not visible diff --git a/test/Modules/namespaces.cpp b/test/Modules/namespaces.cpp index 19e0c5a991f95e72aedae77ac2e6c2a636d10e7a..871ae793d316d8a9d5c6233104c73ef328862ee6 100644 --- a/test/Modules/namespaces.cpp +++ b/test/Modules/namespaces.cpp @@ -11,8 +11,8 @@ namespace N6 { namespace N8 { } -@__experimental_modules_import namespaces_left; -@__experimental_modules_import namespaces_right; +@import namespaces_left; +@import namespaces_right; void test() { int &ir1 = N1::f(1); diff --git a/test/Modules/normal-module-map.cpp b/test/Modules/normal-module-map.cpp index 07ca5ed9330a1a8c8f3c52b91df33cab53690bf4..6509a6d023d5f1214a5f86b07bf79b160e3065e9 100644 --- a/test/Modules/normal-module-map.cpp +++ b/test/Modules/normal-module-map.cpp @@ -8,7 +8,7 @@ int getUmbrella() { return umbrella + umbrella_sub; } -@__experimental_modules_import Umbrella2; +@import Umbrella2; #include "a1.h" #include "b1.h" @@ -18,7 +18,7 @@ int test() { return a1 + b1 + nested2; } -@__experimental_modules_import nested_umbrella.a; +@import nested_umbrella.a; int testNestedUmbrellaA() { return nested_umbrella_a; @@ -28,17 +28,17 @@ int testNestedUmbrellaBFail() { return nested_umbrella_b; // expected-error{{use of undeclared identifier 'nested_umbrella_b'; did you mean 'nested_umbrella_a'?}} } -@__experimental_modules_import nested_umbrella.b; +@import nested_umbrella.b; int testNestedUmbrellaB() { return nested_umbrella_b; } -@__experimental_modules_import nested_umbrella.a_extras; +@import nested_umbrella.a_extras; -@__experimental_modules_import nested_umbrella._1; +@import nested_umbrella._1; -@__experimental_modules_import nested_umbrella.decltype_; +@import nested_umbrella.decltype_; int testSanitizedName() { return extra_a + one + decltype_val; diff --git a/test/Modules/objc-categories.m b/test/Modules/objc-categories.m index b26759239ddab02d3ab71c4b0f819c297f56251e..f19dc7efcf0523b4b4ae7ece3c29888775883c28 100644 --- a/test/Modules/objc-categories.m +++ b/test/Modules/objc-categories.m @@ -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 -@__experimental_modules_import category_bottom; +@import category_bottom; @@ -34,7 +34,7 @@ void test(Foo *foo, LeftFoo *leftFoo) { // Load another module that also adds categories to Foo, verify that // we see those categories. -@__experimental_modules_import category_other; +@import category_other; void test_other(Foo *foo) { [foo other]; diff --git a/test/Modules/on-demand-build-warnings.m b/test/Modules/on-demand-build-warnings.m index 24975c01b781fb62738cd2974ae73903b20ab855..7116f01d381ba50536dfebc867b94aad285bb8f5 100644 --- a/test/Modules/on-demand-build-warnings.m +++ b/test/Modules/on-demand-build-warnings.m @@ -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 -@__experimental_modules_import Module; // expected-warning{{building module 'Module' from source}} +@import Module; // expected-warning{{building module 'Module' from source}} diff --git a/test/Modules/on-demand-build.m b/test/Modules/on-demand-build.m index 4ee6b58d96b4c59c5f32e36885d3a71ce39365e9..32bdc37206bb109bbe5a745b711313302649b2ea 100644 --- a/test/Modules/on-demand-build.m +++ b/test/Modules/on-demand-build.m @@ -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 -@__experimental_modules_import Module; +@import Module; @interface OtherClass @end @@ -19,6 +19,6 @@ void test_getModuleVersion() { # error MODULE_SUBFRAMEWORK_H should be hidden #endif -@__experimental_modules_import subdir; +@import subdir; const char *getSubdirTest() { return getSubdir(); } diff --git a/test/Modules/on-demand-macros.m b/test/Modules/on-demand-macros.m index 8b50529f1a28f064f353b22f4eb35b76fec6c395..208bb567edac4b8e150fb60d1416188f053fb309 100644 --- a/test/Modules/on-demand-macros.m +++ b/test/Modules/on-demand-macros.m @@ -3,7 +3,7 @@ // RUN: %clang_cc1 -fmodules -fmodule-cache-path %t -F %S/Inputs -verify %s // expected-no-diagnostics -@__experimental_modules_import CmdLine; +@import CmdLine; void test() { #ifdef FOO_RETURNS_INT_PTR diff --git a/test/Modules/redecl-merge.m b/test/Modules/redecl-merge.m index d7224149a28298a435313723344dc4d372b30e13..52c4511bdc53cfca602aa7470b1667de3fccc974 100644 --- a/test/Modules/redecl-merge.m +++ b/test/Modules/redecl-merge.m @@ -3,12 +3,12 @@ @class C2; @class C3; @class C3; -@__experimental_modules_import redecl_merge_left; +@import redecl_merge_left; typedef struct my_struct_type *my_struct_ref; @protocol P4; @class C3; @class C3; -@__experimental_modules_import redecl_merge_right; +@import redecl_merge_right; @implementation A - (Super*)init { return self; } @@ -112,7 +112,7 @@ C4 *global_C4; ClassWithDef *cwd1; -@__experimental_modules_import redecl_merge_left_left; +@import redecl_merge_left_left; void test_C4a(C4 *c4) { global_C4 = c4 = get_a_C4(); @@ -123,7 +123,7 @@ void test_ClassWithDef(ClassWithDef *cwd) { [cwd method]; } -@__experimental_modules_import redecl_merge_bottom; +@import redecl_merge_bottom; void test_C4b() { if (&refers_to_C4) { diff --git a/test/Modules/redecl-namespaces.mm b/test/Modules/redecl-namespaces.mm index e338821564822dc9cf0650073253a54887785a19..978875738304c657980b75c1e596e88e43bce4fd 100644 --- a/test/Modules/redecl-namespaces.mm +++ b/test/Modules/redecl-namespaces.mm @@ -1,5 +1,5 @@ -@__experimental_modules_import redecl_namespaces_left; -@__experimental_modules_import redecl_namespaces_right; +@import redecl_namespaces_left; +@import redecl_namespaces_right; void test() { A::i; diff --git a/test/Modules/redeclarations.m b/test/Modules/redeclarations.m index 221e154cb2742cedaaa1ca1e4e7d4679b08578d3..b4b01347c6e7d2f42fda97c9da9915c88dbf90c5 100644 --- a/test/Modules/redeclarations.m +++ b/test/Modules/redeclarations.m @@ -1,5 +1,5 @@ -@__experimental_modules_import redeclarations_left; -@__experimental_modules_import redeclarations_right; +@import redeclarations_left; +@import redeclarations_right; @interface MyObject : NSObject @end diff --git a/test/Modules/requires.m b/test/Modules/requires.m index ce2537c78b73756ca67168c52f77db2f13d3da38..70d6160b0f3cfffcb9520f6fc028f3c82563d2b0 100644 --- a/test/Modules/requires.m +++ b/test/Modules/requires.m @@ -1,5 +1,5 @@ // RUN: rm -rf %t // RUN: %clang_cc1 -Wauto-import -fmodule-cache-path %t -fmodules -F %S/Inputs %s -verify -@__experimental_modules_import DependsOnModule.CXX; // expected-error{{module 'DependsOnModule.CXX' requires feature 'cplusplus'}} +@import DependsOnModule.CXX; // expected-error{{module 'DependsOnModule.CXX' requires feature 'cplusplus'}} diff --git a/test/Modules/subframeworks.m b/test/Modules/subframeworks.m index 09298c49395889a4b0d2a7a5423113f82e9775a7..e87bc6bac33a53b0fcf49c583998d6657464405b 100644 --- a/test/Modules/subframeworks.m +++ b/test/Modules/subframeworks.m @@ -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 -@__experimental_modules_import DependsOnModule; +@import DependsOnModule; void testSubFramework() { float *sf1 = sub_framework; // expected-error{{use of undeclared identifier 'sub_framework'}} } -@__experimental_modules_import DependsOnModule.SubFramework; +@import DependsOnModule.SubFramework; void testSubFrameworkAgain() { float *sf2 = sub_framework; @@ -16,7 +16,7 @@ void testSubFrameworkAgain() { } #ifdef __cplusplus -@__experimental_modules_import DependsOnModule.CXX; +@import DependsOnModule.CXX; CXXOnly cxxonly; #endif diff --git a/test/Modules/submodules-preprocess.cpp b/test/Modules/submodules-preprocess.cpp index 8d6c2cd70d844098a3377824df79bcbafeaa6093..7d218b13593e31b3d527ddb2a5bb26680ec54a75 100644 --- a/test/Modules/submodules-preprocess.cpp +++ b/test/Modules/submodules-preprocess.cpp @@ -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. -@__experimental_modules_import std.vector; +@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 -@__experimental_modules_import std.typetraits; // expected-error{{no submodule named 'typetraits' in module 'std'; did you mean 'type_traits'?}} +@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 -@__experimental_modules_import std.vector.compare; // expected-error{{no submodule named 'compare' in module 'std.vector'}} +@import std.vector.compare; // expected-error{{no submodule named 'compare' in module 'std.vector'}} -@__experimental_modules_import std; // import everything in 'std' +@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 -@__experimental_modules_import std.hash_map; +@import std.hash_map; #ifndef HAVE_VECTOR # error HAVE_VECTOR macro is not available (but should be) diff --git a/test/Modules/submodules.cpp b/test/Modules/submodules.cpp index 60d5ae0c22f4de140cecac0a8b28cc94ed037133..1417446416cdc2d91623efc6c3724cc879640009 100644 --- a/test/Modules/submodules.cpp +++ b/test/Modules/submodules.cpp @@ -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. -@__experimental_modules_import std.vector; +@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}} -@__experimental_modules_import std.typetraits; // expected-error{{no submodule named 'typetraits' in module 'std'; did you mean 'type_traits'?}} +@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; -@__experimental_modules_import std.vector.compare; // expected-error{{no submodule named 'compare' in module 'std.vector'}} +@import std.vector.compare; // expected-error{{no submodule named 'compare' in module 'std.vector'}} -@__experimental_modules_import std; // import everything in 'std' +@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}} -@__experimental_modules_import std.hash_map; +@import std.hash_map; hash_map<int, float> ints_to_floats2; diff --git a/test/Modules/submodules.m b/test/Modules/submodules.m index a758abc248dd2ed9ae54ca31c752f126cce3f6a7..bf2d52947e920612f4c645fcb1e930d4d982c908 100644 --- a/test/Modules/submodules.m +++ b/test/Modules/submodules.m @@ -4,7 +4,7 @@ // expected-no-diagnostics // Note: transitively imports Module.Sub2. -@__experimental_modules_import Module.Sub; +@import Module.Sub; int getValue() { return *Module_Sub + *Module_Sub2; diff --git a/test/Modules/templates.mm b/test/Modules/templates.mm index 45417401d86fd26c72c05e00be4279c5b9de682c..22f94caea61a0408e4d9a9a5595e73e8938b7e15 100644 --- a/test/Modules/templates.mm +++ b/test/Modules/templates.mm @@ -3,8 +3,8 @@ // RUN: %clang_cc1 -x objective-c++ -fmodules -fmodule-cache-path %t -I %S/Inputs -emit-llvm %s -o - -Wno-objc-root-class | grep Emit | FileCheck %s // expected-no-diagnostics -@__experimental_modules_import templates_left; -@__experimental_modules_import templates_right; +@import templates_left; +@import templates_right; void testTemplateClasses() { diff --git a/test/Modules/wildcard-submodule-exports.cpp b/test/Modules/wildcard-submodule-exports.cpp index 6b4f02c6f2366650e99aaff753baea9e44d66f4f..00d95716512ce401c3353073871eb8ac23a12a32 100644 --- a/test/Modules/wildcard-submodule-exports.cpp +++ b/test/Modules/wildcard-submodule-exports.cpp @@ -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. -@__experimental_modules_import C.One; +@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'}} } -@__experimental_modules_import C.Two; +@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; } -@__experimental_modules_import B.One; +@import B.One; void test_B_One() { short *B1_ptr = B1;