diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-12-11 22:11:52 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-12-11 22:11:52 +0000 |
commit | 1b257afbae854c6817f26b7d61c4fed8ff7aebad (patch) | |
tree | b55dde41e149b05234a21023307864c49b380144 | |
parent | bd5da3ca593fbf354fd19c2894eee50694c96788 (diff) |
Use @import rather than @__experimental_modules_import, since the
latter is rather a mess to type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169919 91177308-0d34-0410-b5e6-96231b3b80d8
70 files changed, 131 insertions, 131 deletions
diff --git a/include/clang/AST/Decl.h b/include/clang/AST/Decl.h index 88adbeb6e1..e00779844c 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 9ad3f49bde..34e2346820 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 25e8d5a635..f02ba6438b 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 857a26621b..5cef00f187 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 58c33bba8a..49cd0ac615 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 7b5df9c314..5f95260ea8 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 2341c01647..4f0b189c8b 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 84d0b22d4d..3b252d083e 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 8f4fa9f3ad..f96ed99368 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 3423f2b40d..ba5b8257ef 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 b82430db9d..a8737216e2 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 212923f94b..8d93c1ae06 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 0af4e37f3c..54b77d1d5f 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 5142f56e60..156c22604f 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 8a3cc338c2..be3facd70e 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 b53d9c30d6..ab4c01c314 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 736fa43269..05e2a1b96c 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 1bb5a91cbd..2c3f4794c2 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 812a840782..3c83624c76 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 15b5290061..1990b45b5f 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 b45fa936d1..2a0a84e3d7 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 cc406ab389..fce2e48882 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 2ba1d77441..fa408ea5ba 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 cd05693891..a8aac75a2f 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 e16a64b50a..445f579cf6 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 d253fed7c1..7e9002aea8 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 7e7286e10b..b18aeb4478 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 cfea7dc87d..28ea20c55d 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 5f48883bf1..79c4d620be 100644 --- a/test/Modules/Inputs/redecl-merge-left-left.h +++ b/test/Modules/Inputs/redecl-merge-left-left.h @@ -1,4 +1,4 @@ -@__experimental_m |