From e84d473fc3b4ccf0e91952598b6f0858758ee93b Mon Sep 17 00:00:00 2001 From: Jonas Hahnfeld Date: Tue, 4 Apr 2017 06:02:32 +0000 Subject: [PATCH] Align all scalar numbers to LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR Otherwise, yamlize in YAMLTraits.h might be wrongly defined. This makes some AMDGPU tests fail when LLVM_LINK_LLVM_DYLIB is set. Differential Revision: https://reviews.llvm.org/D30508 llvm-svn: 299415 --- include/llvm/IR/ModuleSummaryIndexYAML.h | 2 +- include/llvm/ObjectYAML/DWARFYAML.h | 2 +- include/llvm/ObjectYAML/MachOYAML.h | 2 +- include/llvm/ObjectYAML/WasmYAML.h | 2 +- test/ObjectYAML/MachO/DWARF-debug_line.yaml | 28 ++----------------- test/ObjectYAML/wasm/elem_section.yaml | 6 ++-- test/ObjectYAML/wasm/function_section.yaml | 4 +-- .../Transforms/LowerTypeTests/import-unsat.ll | 3 +- .../export-unsuccessful-checked.ll | 4 +-- .../WholeProgramDevirt/import-indir.ll | 8 ++---- unittests/Support/YAMLIOTest.cpp | 16 +++++------ 11 files changed, 21 insertions(+), 56 deletions(-) diff --git a/include/llvm/IR/ModuleSummaryIndexYAML.h b/include/llvm/IR/ModuleSummaryIndexYAML.h index e74bc48b1a6..80719c69693 100644 --- a/include/llvm/IR/ModuleSummaryIndexYAML.h +++ b/include/llvm/IR/ModuleSummaryIndexYAML.h @@ -138,7 +138,7 @@ struct FunctionSummaryYaml { } // End yaml namespace } // End llvm namespace -LLVM_YAML_IS_SEQUENCE_VECTOR(uint64_t) +LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(uint64_t) namespace llvm { namespace yaml { diff --git a/include/llvm/ObjectYAML/DWARFYAML.h b/include/llvm/ObjectYAML/DWARFYAML.h index 55beb821a21..ec34de1f088 100644 --- a/include/llvm/ObjectYAML/DWARFYAML.h +++ b/include/llvm/ObjectYAML/DWARFYAML.h @@ -161,7 +161,7 @@ struct Data { } // namespace llvm::DWARFYAML } // namespace llvm -LLVM_YAML_IS_SEQUENCE_VECTOR(uint8_t) +LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(uint8_t) LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::yaml::Hex64) LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::StringRef) LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::yaml::Hex8) diff --git a/include/llvm/ObjectYAML/MachOYAML.h b/include/llvm/ObjectYAML/MachOYAML.h index f69aa1515d5..ae858c8f4aa 100644 --- a/include/llvm/ObjectYAML/MachOYAML.h +++ b/include/llvm/ObjectYAML/MachOYAML.h @@ -140,7 +140,7 @@ struct UniversalBinary { LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::MachOYAML::LoadCommand) LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::MachOYAML::Section) -LLVM_YAML_IS_SEQUENCE_VECTOR(int64_t) +LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(int64_t) LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::MachOYAML::RebaseOpcode) LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::MachOYAML::BindOpcode) LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::MachOYAML::ExportEntry) diff --git a/include/llvm/ObjectYAML/WasmYAML.h b/include/llvm/ObjectYAML/WasmYAML.h index 0bcdb558aa0..b1af8bbdfa6 100644 --- a/include/llvm/ObjectYAML/WasmYAML.h +++ b/include/llvm/ObjectYAML/WasmYAML.h @@ -244,7 +244,7 @@ LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::WasmYAML::Global) LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::WasmYAML::Function) LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::WasmYAML::LocalDecl) LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::WasmYAML::Relocation) -LLVM_YAML_IS_SEQUENCE_VECTOR(uint32_t) +LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(uint32_t) namespace llvm { namespace yaml { diff --git a/test/ObjectYAML/MachO/DWARF-debug_line.yaml b/test/ObjectYAML/MachO/DWARF-debug_line.yaml index 692b5014428..6d87ea68cdc 100644 --- a/test/ObjectYAML/MachO/DWARF-debug_line.yaml +++ b/test/ObjectYAML/MachO/DWARF-debug_line.yaml @@ -502,19 +502,7 @@ DWARF: LineBase: 251 LineRange: 14 OpcodeBase: 13 - StandardOpcodeLengths: - - 0 - - 1 - - 1 - - 1 - - 1 - - 0 - - 0 - - 0 - - 1 - - 0 - - 0 - - 1 + StandardOpcodeLengths: [ 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1 ] IncludeDirs: Files: - Name: hello_world.c @@ -556,19 +544,7 @@ DWARF: #CHECK: LineBase: 251 #CHECK: LineRange: 14 #CHECK: OpcodeBase: 13 -#CHECK: StandardOpcodeLengths: -#CHECK: - 0 -#CHECK: - 1 -#CHECK: - 1 -#CHECK: - 1 -#CHECK: - 1 -#CHECK: - 0 -#CHECK: - 0 -#CHECK: - 0 -#CHECK: - 1 -#CHECK: - 0 -#CHECK: - 0 -#CHECK: - 1 +#CHECK: StandardOpcodeLengths: [ 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1 ] #CHECK: IncludeDirs: #CHECK: Files: #CHECK: - Name: hello_world.c diff --git a/test/ObjectYAML/wasm/elem_section.yaml b/test/ObjectYAML/wasm/elem_section.yaml index 67de7095b5f..498c9aa93ea 100644 --- a/test/ObjectYAML/wasm/elem_section.yaml +++ b/test/ObjectYAML/wasm/elem_section.yaml @@ -32,11 +32,9 @@ Sections: # CHECK: - Offset: # CHECK: Opcode: I32_CONST # CHECK: Value: 3 -# CHECK: Functions: -# CHECK: - 1 +# CHECK: Functions: [ 1 ] # CHECK: - Offset: # CHECK: Opcode: I32_CONST # CHECK: Value: 5 -# CHECK: Functions: -# CHECK: - 4 +# CHECK: Functions: [ 4 ] # CHECK: ... diff --git a/test/ObjectYAML/wasm/function_section.yaml b/test/ObjectYAML/wasm/function_section.yaml index 6aaf9d4b513..39e6b75d5cd 100644 --- a/test/ObjectYAML/wasm/function_section.yaml +++ b/test/ObjectYAML/wasm/function_section.yaml @@ -13,7 +13,5 @@ Sections: # CHECK: Version: 0x00000001 # CHECK: Sections: # CHECK: - Type: FUNCTION -# CHECK: FunctionTypes: -# CHECK: - 1 -# CHECK: - 0 +# CHECK: FunctionTypes: [ 1, 0 ] # CHECK: ... diff --git a/test/Transforms/LowerTypeTests/import-unsat.ll b/test/Transforms/LowerTypeTests/import-unsat.ll index 7410bc4b4d8..76b24400198 100644 --- a/test/Transforms/LowerTypeTests/import-unsat.ll +++ b/test/Transforms/LowerTypeTests/import-unsat.ll @@ -4,8 +4,7 @@ ; SUMMARY: GlobalValueMap: ; SUMMARY-NEXT: 42: -; SUMMARY-NEXT: - TypeTests: -; SUMMARY-NEXT: - 123 +; SUMMARY-NEXT: - TypeTests: [ 123 ] ; SUMMARY-NEXT: TypeIdMap: ; SUMMARY-NEXT: typeid1: ; SUMMARY-NEXT: TTRes: diff --git a/test/Transforms/WholeProgramDevirt/export-unsuccessful-checked.ll b/test/Transforms/WholeProgramDevirt/export-unsuccessful-checked.ll index 607c89a6e87..0785ade2857 100644 --- a/test/Transforms/WholeProgramDevirt/export-unsuccessful-checked.ll +++ b/test/Transforms/WholeProgramDevirt/export-unsuccessful-checked.ll @@ -1,9 +1,7 @@ ; RUN: opt -wholeprogramdevirt -wholeprogramdevirt-summary-action=export -wholeprogramdevirt-read-summary=%S/Inputs/export.yaml -wholeprogramdevirt-write-summary=%t -o /dev/null %s ; RUN: FileCheck %s < %t -; CHECK: - TypeTests: -; CHECK-NEXT: - 15427464259790519041 -; CHECK-NEXT: - 17525413373118030901 +; CHECK: - TypeTests: [ 15427464259790519041, 17525413373118030901 ] ; CHECK-NEXT: TypeTestAssumeVCalls: @vt1a = constant void (i8*)* @vf1a, !type !0 diff --git a/test/Transforms/WholeProgramDevirt/import-indir.ll b/test/Transforms/WholeProgramDevirt/import-indir.ll index dcd1f7f41f4..1de9352eeb2 100644 --- a/test/Transforms/WholeProgramDevirt/import-indir.ll +++ b/test/Transforms/WholeProgramDevirt/import-indir.ll @@ -19,16 +19,12 @@ ; SUMMARY-NEXT: - VFunc: ; SUMMARY-NEXT: GUID: 123 ; SUMMARY-NEXT: Offset: 4 -; SUMMARY-NEXT: Args: -; SUMMARY-NEXT: - 12 -; SUMMARY-NEXT: - 24 +; SUMMARY-NEXT: Args: [ 12, 24 ] ; SUMMARY-NEXT: TypeCheckedLoadConstVCalls: ; SUMMARY-NEXT: - VFunc: ; SUMMARY-NEXT: GUID: 456 ; SUMMARY-NEXT: Offset: 8 -; SUMMARY-NEXT: Args: -; SUMMARY-NEXT: - 24 -; SUMMARY-NEXT: - 12 +; SUMMARY-NEXT: Args: [ 24, 12 ] ; SUMMARY-NEXT: TypeIdMap: ; SUMMARY-NEXT: typeid1: ; SUMMARY-NEXT: TTRes: diff --git a/unittests/Support/YAMLIOTest.cpp b/unittests/Support/YAMLIOTest.cpp index dc7c5d47cba..5a0280c8ca5 100644 --- a/unittests/Support/YAMLIOTest.cpp +++ b/unittests/Support/YAMLIOTest.cpp @@ -1740,7 +1740,7 @@ TEST(YAMLIO, TestFlagsReadError) { // // Test error handling reading built-in uint8_t type // -LLVM_YAML_IS_SEQUENCE_VECTOR(uint8_t) +LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(uint8_t) TEST(YAMLIO, TestReadBuiltInTypesUint8Error) { std::vector seq; Input yin("---\n" @@ -1759,7 +1759,7 @@ TEST(YAMLIO, TestReadBuiltInTypesUint8Error) { // // Test error handling reading built-in uint16_t type // -LLVM_YAML_IS_SEQUENCE_VECTOR(uint16_t) +LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(uint16_t) TEST(YAMLIO, TestReadBuiltInTypesUint16Error) { std::vector seq; Input yin("---\n" @@ -1778,7 +1778,7 @@ TEST(YAMLIO, TestReadBuiltInTypesUint16Error) { // // Test error handling reading built-in uint32_t type // -LLVM_YAML_IS_SEQUENCE_VECTOR(uint32_t) +LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(uint32_t) TEST(YAMLIO, TestReadBuiltInTypesUint32Error) { std::vector seq; Input yin("---\n" @@ -1797,7 +1797,7 @@ TEST(YAMLIO, TestReadBuiltInTypesUint32Error) { // // Test error handling reading built-in uint64_t type // -LLVM_YAML_IS_SEQUENCE_VECTOR(uint64_t) +LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(uint64_t) TEST(YAMLIO, TestReadBuiltInTypesUint64Error) { std::vector seq; Input yin("---\n" @@ -1816,7 +1816,7 @@ TEST(YAMLIO, TestReadBuiltInTypesUint64Error) { // // Test error handling reading built-in int8_t type // -LLVM_YAML_IS_SEQUENCE_VECTOR(int8_t) +LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(int8_t) TEST(YAMLIO, TestReadBuiltInTypesint8OverError) { std::vector seq; Input yin("---\n" @@ -1854,7 +1854,7 @@ TEST(YAMLIO, TestReadBuiltInTypesint8UnderError) { // // Test error handling reading built-in int16_t type // -LLVM_YAML_IS_SEQUENCE_VECTOR(int16_t) +LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(int16_t) TEST(YAMLIO, TestReadBuiltInTypesint16UnderError) { std::vector seq; Input yin("---\n" @@ -1893,7 +1893,7 @@ TEST(YAMLIO, TestReadBuiltInTypesint16OverError) { // // Test error handling reading built-in int32_t type // -LLVM_YAML_IS_SEQUENCE_VECTOR(int32_t) +LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(int32_t) TEST(YAMLIO, TestReadBuiltInTypesint32UnderError) { std::vector seq; Input yin("---\n" @@ -1931,7 +1931,7 @@ TEST(YAMLIO, TestReadBuiltInTypesint32OverError) { // // Test error handling reading built-in int64_t type // -LLVM_YAML_IS_SEQUENCE_VECTOR(int64_t) +LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(int64_t) TEST(YAMLIO, TestReadBuiltInTypesint64UnderError) { std::vector seq; Input yin("---\n"