[cfe-commits] r156923 - in /cfe/trunk: lib/Serialization/ASTReaderDecl.cpp test/Modules/Inputs/import-decl.h test/Modules/Inputs/module.map test/Modules/import-decl.cpp

Douglas Gregor dgregor at apple.com
Wed May 16 09:31:59 PDT 2012


Author: dgregor
Date: Wed May 16 11:31:58 2012
New Revision: 156923

URL: http://llvm.org/viewvc/llvm-project?rev=156923&view=rev
Log:
Fix ASTReader handling of ImportDecls, from Meador Inge!

Added:
    cfe/trunk/test/Modules/Inputs/import-decl.h   (with props)
    cfe/trunk/test/Modules/import-decl.cpp   (with props)
Modified:
    cfe/trunk/lib/Serialization/ASTReaderDecl.cpp
    cfe/trunk/test/Modules/Inputs/module.map

Modified: cfe/trunk/lib/Serialization/ASTReaderDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReaderDecl.cpp?rev=156923&r1=156922&r2=156923&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTReaderDecl.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTReaderDecl.cpp Wed May 16 11:31:58 2012
@@ -1249,7 +1249,6 @@
   SourceLocation *StoredLocs = reinterpret_cast<SourceLocation *>(D + 1);
   for (unsigned I = 0, N = Record.back(); I != N; ++I)
     StoredLocs[I] = ReadSourceLocation(Record, Idx);
-  ++Idx;
 }
 
 void ASTDeclReader::VisitAccessSpecDecl(AccessSpecDecl *D) {

Added: cfe/trunk/test/Modules/Inputs/import-decl.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/import-decl.h?rev=156923&view=auto
==============================================================================
--- cfe/trunk/test/Modules/Inputs/import-decl.h (added)
+++ cfe/trunk/test/Modules/Inputs/import-decl.h Wed May 16 11:31:58 2012
@@ -0,0 +1 @@
+struct T {};

Propchange: cfe/trunk/test/Modules/Inputs/import-decl.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cfe/trunk/test/Modules/Inputs/import-decl.h
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cfe/trunk/test/Modules/Inputs/import-decl.h
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: cfe/trunk/test/Modules/Inputs/module.map
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/module.map?rev=156923&r1=156922&r2=156923&view=diff
==============================================================================
--- cfe/trunk/test/Modules/Inputs/module.map (original)
+++ cfe/trunk/test/Modules/Inputs/module.map Wed May 16 11:31:58 2012
@@ -84,3 +84,6 @@
 module MethodPoolB {
   header "MethodPoolB.h"
 }
+module import_decl {
+  header "import-decl.h"
+}

Added: cfe/trunk/test/Modules/import-decl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/import-decl.cpp?rev=156923&view=auto
==============================================================================
--- cfe/trunk/test/Modules/import-decl.cpp (added)
+++ cfe/trunk/test/Modules/import-decl.cpp Wed May 16 11:31:58 2012
@@ -0,0 +1,10 @@
+// RUN: rm -rf %t
+// 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
+
+ at __experimental_modules_import import_decl;
+// CHECK: struct T
+
+int main() {
+  return 0;
+}

Propchange: cfe/trunk/test/Modules/import-decl.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cfe/trunk/test/Modules/import-decl.cpp
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cfe/trunk/test/Modules/import-decl.cpp
------------------------------------------------------------------------------
    svn:mime-type = text/plain





More information about the cfe-commits mailing list