// Copyright (c) 2016 Google 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 "source/opt/ir_loader.h" #include <utility> #include "DebugInfo.h" #include "OpenCLDebugInfo100.h" #include "source/ext_inst.h" #include "source/opt/ir_context.h" #include "source/opt/log.h" #include "source/opt/reflect.h" #include "source/util/make_unique.h" namespace spvtools { namespace opt { namespace { constexpr uint32_t kExtInstSetIndex = …; constexpr uint32_t kLexicalScopeIndex = …; constexpr uint32_t kInlinedAtIndex = …; } // namespace IrLoader::IrLoader(const MessageConsumer& consumer, Module* m) : … { … } bool IsLineInst(const spv_parsed_instruction_t* inst) { … } bool IrLoader::AddInstruction(const spv_parsed_instruction_t* inst) { … } // Resolves internal references among the module, functions, basic blocks, etc. // This function should be called after adding all instructions. void IrLoader::EndModule() { … } } // namespace opt } // namespace spvtools