From 67d23ac060b4206e4f69b5062d90ec2d18c7dbaf Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Fri, 4 Sep 2020 17:19:52 -0700 Subject: [PATCH] Revert "[IRGen] Use the lexical decl context for VarDecls." --- lib/IRGen/GenClangDecl.cpp | 5 ----- test/IRGen/Inputs/local_extern.h | 21 --------------------- test/IRGen/local_extern.swift | 10 ---------- 3 files changed, 36 deletions(-) delete mode 100644 test/IRGen/Inputs/local_extern.h delete mode 100644 test/IRGen/local_extern.swift diff --git a/lib/IRGen/GenClangDecl.cpp b/lib/IRGen/GenClangDecl.cpp index 7679773935bf4..577307ce502d9 100644 --- a/lib/IRGen/GenClangDecl.cpp +++ b/lib/IRGen/GenClangDecl.cpp @@ -98,11 +98,6 @@ void IRGenModule::emitClangDecl(const clang::Decl *decl) { refFinder.TraverseDecl(executableDecl); next = executableDecl; } - - if (auto var = dyn_cast(next)) - if (!var->isFileVarDecl()) - continue; - ClangCodeGen->HandleTopLevelDecl(clang::DeclGroupRef(next)); } } diff --git a/test/IRGen/Inputs/local_extern.h b/test/IRGen/Inputs/local_extern.h deleted file mode 100644 index de84f094bee45..0000000000000 --- a/test/IRGen/Inputs/local_extern.h +++ /dev/null @@ -1,21 +0,0 @@ -static inline int _no_prior_var() { - extern int var; - return var; -} - -static inline int _no_prior_func() { - extern int func(); - return func(); -} - -static int prior_var = 1; -static inline int _prior_var() { - extern int prior_var; - return prior_var; -} - -static inline int prior_func() { return 1; } -static inline int _prior_func() { - extern int prior_func(); - return prior_func(); -} diff --git a/test/IRGen/local_extern.swift b/test/IRGen/local_extern.swift deleted file mode 100644 index 4ce7554681491..0000000000000 --- a/test/IRGen/local_extern.swift +++ /dev/null @@ -1,10 +0,0 @@ -// RUN: %target-swift-frontend -import-objc-header %S/Inputs/local_extern.h %s -emit-ir | %FileCheck %s -// CHECK: @var = external global i32 -// CHECK: @prior_var = internal global i32 -// CHECK: declare i32 @func -// CHECK: define internal i32 @prior_func - -print("\(_no_prior_var())") -print("\(_no_prior_func())") -print("\(_prior_var())") -print("\(_prior_func())")