From bf190ec8393eadc4876de7306eef951956455ab1 Mon Sep 17 00:00:00 2001 From: David Neto Date: Thu, 27 Oct 2016 22:47:20 -0400 Subject: [PATCH] Remove source/instruction.cpp Avoids linker problems on Windows and OSX with duplicate object file names. Avoids collision with source/val/instruction.cpp Fixes https://github.com/KhronosGroup/SPIRV-Tools/issues/451 --- source/CMakeLists.txt | 1 - source/instruction.cpp | 20 -------------------- source/instruction.h | 4 +++- 3 files changed, 3 insertions(+), 22 deletions(-) delete mode 100644 source/instruction.cpp diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 0324aea9..4b9c52d9 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -142,7 +142,6 @@ set(SPIRV_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/diagnostic.cpp ${CMAKE_CURRENT_SOURCE_DIR}/disassemble.cpp ${CMAKE_CURRENT_SOURCE_DIR}/ext_inst.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/instruction.cpp ${CMAKE_CURRENT_SOURCE_DIR}/libspirv.cpp ${CMAKE_CURRENT_SOURCE_DIR}/message.cpp ${CMAKE_CURRENT_SOURCE_DIR}/name_mapper.cpp diff --git a/source/instruction.cpp b/source/instruction.cpp deleted file mode 100644 index 8436fdca..00000000 --- a/source/instruction.cpp +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "instruction.h" - -void spvInstructionAddWord(spv_instruction_t* inst, uint32_t value) { - inst->words.push_back(value); -} - diff --git a/source/instruction.h b/source/instruction.h index ff735e71..5dd4d139 100644 --- a/source/instruction.h +++ b/source/instruction.h @@ -42,6 +42,8 @@ struct spv_instruction_t { }; // Appends a word to an instruction, without checking for overflow. -void spvInstructionAddWord(spv_instruction_t* inst, uint32_t value); +inline void spvInstructionAddWord(spv_instruction_t* inst, uint32_t value) { + inst->words.push_back(value); +} #endif // LIBSPIRV_INSTRUCTION_H_