Revert "Recommitted r261633 "Supporting all entities declared in lexical scope in LLVM debug info." After fixing PR26715 at r263379."

This reverts commit r263424. Breaks self-host.

llvm-svn: 263437
diff --git a/llvm/test/DebugInfo/Generic/2010-04-06-NestedFnDbgInfo.ll b/llvm/test/DebugInfo/Generic/2010-04-06-NestedFnDbgInfo.ll
index 3eaedd8..610b55c 100644
--- a/llvm/test/DebugInfo/Generic/2010-04-06-NestedFnDbgInfo.ll
+++ b/llvm/test/DebugInfo/Generic/2010-04-06-NestedFnDbgInfo.ll
@@ -74,7 +74,7 @@
 !1 = distinct !DILexicalBlock(line: 15, column: 12, file: !38, scope: !2)
 !2 = distinct !DISubprogram(name: "main", linkageName: "main", line: 15, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 15, file: !38, scope: !3, type: !5)
 !3 = !DIFile(filename: "one.cc", directory: "/tmp")
-!4 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang 1.5", isOptimized: false, emissionKind: 0, file: !38, enums: !39, retainedTypes: !41, subprograms: !37, imports:  null)
+!4 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang 1.5", isOptimized: false, emissionKind: 0, file: !38, enums: !39, retainedTypes: !39, subprograms: !37, imports:  null)
 !5 = !DISubroutineType(types: !6)
 !6 = !{!7}
 !7 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
@@ -112,4 +112,3 @@
 !38 = !DIFile(filename: "one.cc", directory: "/tmp")
 !39 = !{}
 !40 = !{i32 1, !"Debug Info Version", i32 3}
-!41 = !{!21}
\ No newline at end of file
diff --git a/llvm/test/DebugInfo/Generic/2010-06-29-InlinedFnLocalVar.ll b/llvm/test/DebugInfo/Generic/2010-06-29-InlinedFnLocalVar.ll
index 10bc50c..f01cf6d 100644
--- a/llvm/test/DebugInfo/Generic/2010-06-29-InlinedFnLocalVar.ll
+++ b/llvm/test/DebugInfo/Generic/2010-06-29-InlinedFnLocalVar.ll
@@ -27,7 +27,7 @@
 
 !0 = distinct !DISubprogram(name: "foo", line: 9, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 9, file: !27, scope: !1, type: !3, variables: !24)
 !1 = !DIFile(filename: "bar.c", directory: "/tmp/")
-!2 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, emissionKind: 0, file: !27, enums: !20, retainedTypes: !61, subprograms: !25, globals: !26, imports:  !20)
+!2 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, emissionKind: 0, file: !27, enums: !20, retainedTypes: !20, subprograms: !25, globals: !26, imports:  !20)
 !3 = !DISubroutineType(types: !4)
 !4 = !{!5, !5}
 !5 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
@@ -39,7 +39,6 @@
 
 !59 = !DILocalVariable(name: "j", line: 9, arg: 1, scope: !0, file: !1, type: !5)
 !60 = !DILocalVariable(name: "xyz", line: 10, scope: !11, file: !1, type: !12)
-!61 = !{!12}
 
 !11 = distinct !DILexicalBlock(line: 9, column: 0, file: !1, scope: !0)
 !12 = !DICompositeType(tag: DW_TAG_structure_type, name: "X", line: 10, size: 64, align: 32, file: !27, scope: !0, elements: !13)
diff --git a/llvm/test/DebugInfo/Generic/cross-cu-linkonce-distinct.ll b/llvm/test/DebugInfo/Generic/cross-cu-linkonce-distinct.ll
index cbe1920..1713ea1 100644
--- a/llvm/test/DebugInfo/Generic/cross-cu-linkonce-distinct.ll
+++ b/llvm/test/DebugInfo/Generic/cross-cu-linkonce-distinct.ll
@@ -32,7 +32,7 @@
 ; CHECK:     DW_AT_name {{.*}} "func"
 ; CHECK: DW_TAG_compile_unit
 
-; Check that the subprogram is dropped in this CU - since the function was
+; FIXME: Maybe we should drop the subprogram here - since the function was
 ; emitted in one CU, due to linkonce_odr uniquing. We certainly don't emit the
 ; subprogram here if the source location for this definition is the same (see
 ; test/DebugInfo/cross-cu-linkonce.ll), though it's very easy to tickle that
@@ -43,7 +43,7 @@
 ; directory of the source file even though the file name is absolute, not
 ; relative)
 
-; CHECK-NOT: DW_TAG_subprogram
+; CHECK: DW_TAG_subprogram
 
 @x = global i32 (i32)* @_Z4funci, align 8
 @y = global i32 (i32)* @_Z4funci, align 8
@@ -64,7 +64,7 @@
 attributes #0 = { inlinehint nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
 attributes #1 = { nounwind readnone }
 
-!llvm.dbg.cu = !{!0, !12}
+!llvm.dbg.cu = !{!12, !0}
 !llvm.module.flags = !{!19, !20}
 !llvm.ident = !{!21, !21}
 
diff --git a/llvm/test/DebugInfo/Generic/namespace.ll b/llvm/test/DebugInfo/Generic/namespace.ll
index e176975..e446806 100644
--- a/llvm/test/DebugInfo/Generic/namespace.ll
+++ b/llvm/test/DebugInfo/Generic/namespace.ll
@@ -23,11 +23,6 @@
 ; CHECK-NOT: NULL
 ; CHECK: [[BAR:0x[0-9a-f]*]]:{{ *}}DW_TAG_structure_type
 ; CHECK-NEXT: DW_AT_name{{.*}}= "bar"
-; CHECK: DW_TAG_subprogram
-; CHECK-NOT: DW_TAG
-; CHECK: DW_AT_MIPS_linkage_name
-; CHECK-NOT: DW_TAG
-; CHECK: DW_AT_name{{.*}}= "f1"
 ; CHECK: [[FUNC1:.*]]: DW_TAG_subprogram
 ; CHECK-NOT: DW_TAG
 ; CHECK: DW_AT_MIPS_linkage_name
@@ -50,6 +45,11 @@
 ; CHECK-NOT: DW_TAG
 ; CHECK: DW_AT_name{{.*}}= "func_fwd"
 ; CHECK-NOT: DW_AT_declaration
+; CHECK: DW_TAG_subprogram
+; CHECK-NOT: DW_TAG
+; CHECK: DW_AT_MIPS_linkage_name
+; CHECK-NOT: DW_TAG
+; CHECK: DW_AT_name{{.*}}= "f1"
 ; CHECK: NULL
 
 ; CHECK-NOT: NULL
@@ -71,23 +71,10 @@
 
 ; CHECK: DW_TAG_subprogram
 ; CHECK-NOT: DW_TAG
-; CHECK: DW_AT_name{{.*}}= "__cxx_global_var_init"
-; CHECK-NOT: DW_TAG
-
-; CHECK: DW_TAG_subprogram
-; CHECK-NOT: DW_TAG
 ; CHECK: DW_AT_MIPS_linkage_name
 ; CHECK-NOT: DW_TAG
 ; CHECK: DW_AT_name{{.*}}= "func"
 ; CHECK-NOT: NULL
-; CHECK: DW_TAG_lexical_block
-; CHECK-NOT: NULL
-; CHECK: DW_TAG_imported_module
-; CHECK-NEXT: DW_AT_decl_file{{.*}}([[F2]])
-; CHECK-NEXT: DW_AT_decl_line{{.*}}(23)
-; CHECK-NEXT: DW_AT_import{{.*}}=>
-; CHECK: NULL
-; CHECK-NOT: NULL
 ; CHECK: DW_TAG_imported_module
 ; CHECK-NEXT: DW_AT_decl_file{{.*}}([[F2]])
 ; CHECK-NEXT: DW_AT_decl_line{{.*}}(26)
@@ -147,6 +134,13 @@
 ; CHECK-NEXT: DW_AT_decl_line{{.*}}(37)
 ; CHECK-NEXT: DW_AT_import{{.*}}=> {[[FUNC_FWD]]})
 
+; CHECK: DW_TAG_lexical_block
+; CHECK-NOT: NULL
+; CHECK: DW_TAG_imported_module
+; CHECK-NEXT: DW_AT_decl_file{{.*}}([[F2]])
+; CHECK-NEXT: DW_AT_decl_line{{.*}}(23)
+; CHECK-NEXT: DW_AT_import{{.*}}=>
+; CHECK: NULL
 ; CHECK: NULL
 ; CHECK: NULL
 
diff --git a/llvm/test/DebugInfo/Generic/nodebug.ll b/llvm/test/DebugInfo/Generic/nodebug.ll
index 7aafc8d..6f20aec 100644
--- a/llvm/test/DebugInfo/Generic/nodebug.ll
+++ b/llvm/test/DebugInfo/Generic/nodebug.ll
@@ -16,8 +16,10 @@
 ;   f1();
 ; }
 
-; Check that there is no DW_TAG_subprogram, nothing for the 'f2' function.
-; Note: No debug info was emitted for 'f1' function because it has no code.
+; Check that there's only one DW_TAG_subprogram, nothing for the 'f2' function.
+; CHECK: DW_TAG_subprogram
+; CHECK-NOT: DW_TAG
+; CHECK:   DW_AT_name {{.*}} "f1"
 ; CHECK-NOT: DW_TAG_subprogram
 
 @i = external global i32