diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-01-03 18:04:46 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-01-03 18:04:46 +0000 |
commit | 5948ae1021122164b22f74353bb7fe325a64f616 (patch) | |
tree | b10150c1440f0bd3dd2e91cb551228dd191ed587 /lib/Sema/SemaDecl.cpp | |
parent | 674949fe3fdd796fc643f0e7660cb973da1dd383 (diff) |
Introduce a non-uglified syntax for module imports in Objective-C:
@import identifier [. identifier]* ;
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147452 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index a1ccf946d6..9583ab6327 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -9896,7 +9896,9 @@ Decl *Sema::ActOnFileScopeAsmDecl(Expr *expr, return New; } -DeclResult Sema::ActOnModuleImport(SourceLocation ImportLoc, ModuleIdPath Path) { +DeclResult Sema::ActOnModuleImport(SourceLocation AtLoc, + SourceLocation ImportLoc, + ModuleIdPath Path) { Module *Mod = PP.getModuleLoader().loadModule(ImportLoc, Path, Module::AllVisible, /*IsIncludeDirective=*/false); @@ -9917,8 +9919,8 @@ DeclResult Sema::ActOnModuleImport(SourceLocation ImportLoc, ModuleIdPath Path) ImportDecl *Import = ImportDecl::Create(Context, Context.getTranslationUnitDecl(), - ImportLoc, Mod, - IdentifierLocs); + AtLoc.isValid()? AtLoc : ImportLoc, + Mod, IdentifierLocs); Context.getTranslationUnitDecl()->addDecl(Import); return Import; } |