Skip to content

Commit

Permalink
Fix various source comment (doxygen) typos (KhronosGroup#4680)
Browse files Browse the repository at this point in the history
Found via `codespell -q 3 -L fo,lod,parm
  • Loading branch information
luzpaz authored Jan 26, 2022
1 parent ff91b1c commit 65ecfd1
Show file tree
Hide file tree
Showing 137 changed files with 232 additions and 232 deletions.
6 changes: 3 additions & 3 deletions include/spirv-tools/libspirv.h
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ SPIRV_TOOLS_EXPORT bool spvParseVulkanEnv(uint32_t vulkan_ver,
// Creates a context object for most of the SPIRV-Tools API.
// Returns null if env is invalid.
//
// See specific API calls for how the target environment is interpeted
// See specific API calls for how the target environment is interpreted
// (particularly assembly and validation).
SPIRV_TOOLS_EXPORT spv_context spvContextCreate(spv_target_env env);

Expand Down Expand Up @@ -612,7 +612,7 @@ SPIRV_TOOLS_EXPORT void spvValidatorOptionsSetRelaxLogicalPointer(
// set that option.
// 2) Pointers that are pass as parameters to function calls do not have to
// match the storage class of the formal parameter.
// 3) Pointers that are actaul parameters on function calls do not have to point
// 3) Pointers that are actual parameters on function calls do not have to point
// to the same type pointed as the formal parameter. The types just need to
// logically match.
// 4) GLSLstd450 Interpolate* instructions can have a load of an interpolant
Expand All @@ -638,7 +638,7 @@ SPIRV_TOOLS_EXPORT void spvValidatorOptionsSetUniformBufferStandardLayout(
// Records whether the validator should use "scalar" block layout rules.
// Scalar layout rules are more permissive than relaxed block layout.
//
// See Vulkan extnesion VK_EXT_scalar_block_layout. The scalar alignment is
// See Vulkan extension VK_EXT_scalar_block_layout. The scalar alignment is
// defined as follows:
// - scalar alignment of a scalar is the scalar size
// - scalar alignment of a vector is the scalar alignment of its component
Expand Down
4 changes: 2 additions & 2 deletions include/spirv-tools/libspirv.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Context {
public:
// Constructs a context targeting the given environment |env|.
//
// See specific API calls for how the target environment is interpeted
// See specific API calls for how the target environment is interpreted
// (particularly assembly and validation).
//
// The constructed instance will have an empty message consumer, which just
Expand Down Expand Up @@ -139,7 +139,7 @@ class ValidatorOptions {
// set that option.
// 2) Pointers that are pass as parameters to function calls do not have to
// match the storage class of the formal parameter.
// 3) Pointers that are actaul parameters on function calls do not have to
// 3) Pointers that are actual parameters on function calls do not have to
// point to the same type pointed as the formal parameter. The types just
// need to logically match.
// 4) GLSLstd450 Interpolate* instructions can have a load of an interpolant
Expand Down
22 changes: 11 additions & 11 deletions include/spirv-tools/optimizer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Optimizer {
// consumed by the RegisterPass() method. Tokens are one-time objects that
// only support move; copying is not allowed.
struct PassToken {
struct Impl; // Opaque struct for holding inernal data.
struct Impl; // Opaque struct for holding internal data.

PassToken(std::unique_ptr<Impl>);

Expand Down Expand Up @@ -296,11 +296,11 @@ Optimizer::PassToken CreateFreezeSpecConstantValuePass();
// and can be changed in future. A spec constant is foldable if all of its
// value(s) can be determined from the module. E.g., an integer spec constant
// defined with OpSpecConstantOp instruction can be folded if its value won't
// change later. This pass will replace the original OpSpecContantOp instruction
// with an OpConstant instruction. When folding composite spec constants,
// new instructions may be inserted to define the components of the composite
// constant first, then the original spec constants will be replaced by
// OpConstantComposite instructions.
// change later. This pass will replace the original OpSpecConstantOp
// instruction with an OpConstant instruction. When folding composite spec
// constants, new instructions may be inserted to define the components of the
// composite constant first, then the original spec constants will be replaced
// by OpConstantComposite instructions.
//
// There are some operations not supported yet:
// OpSConvert, OpFConvert, OpQuantizeToF16 and
Expand All @@ -326,7 +326,7 @@ Optimizer::PassToken CreateUnifyConstantPass();

// Creates a eliminate-dead-constant pass.
// A eliminate-dead-constant pass removes dead constants, including normal
// contants defined by OpConstant, OpConstantComposite, OpConstantTrue, or
// constants defined by OpConstant, OpConstantComposite, OpConstantTrue, or
// OpConstantFalse and spec constants defined by OpSpecConstant,
// OpSpecConstantComposite, OpSpecConstantTrue, OpSpecConstantFalse or
// OpSpecConstantOp.
Expand Down Expand Up @@ -390,7 +390,7 @@ Optimizer::PassToken CreateInlineOpaquePass();
// Only modules with relaxed logical addressing (see opt/instruction.h) are
// currently processed.
//
// This pass is most effective if preceeded by Inlining and
// This pass is most effective if preceded by Inlining and
// LocalAccessChainConvert. This pass will reduce the work needed to be done
// by LocalSingleStoreElim and LocalMultiStoreElim.
//
Expand All @@ -408,7 +408,7 @@ Optimizer::PassToken CreateLocalSingleBlockLoadStoreElimPass();
// Note that some branches and blocks may be left to avoid creating invalid
// control flow. Improving this is left to future work.
//
// This pass is most effective when preceeded by passes which eliminate
// This pass is most effective when preceded by passes which eliminate
// local loads and stores, effectively propagating constant values where
// possible.
Optimizer::PassToken CreateDeadBranchElimPass();
Expand All @@ -425,7 +425,7 @@ Optimizer::PassToken CreateDeadBranchElimPass();
// are currently processed. Currently modules with any extensions enabled are
// not processed. This is left for future work.
//
// This pass is most effective if preceeded by Inlining and
// This pass is most effective if preceded by Inlining and
// LocalAccessChainConvert. LocalSingleStoreElim and LocalSingleBlockElim
// will reduce the work that this pass has to do.
Optimizer::PassToken CreateLocalMultiStoreElimPass();
Expand Down Expand Up @@ -630,7 +630,7 @@ Optimizer::PassToken CreateRedundancyEliminationPass();
Optimizer::PassToken CreateScalarReplacementPass(uint32_t size_limit = 100);

// Create a private to local pass.
// This pass looks for variables delcared in the private storage class that are
// This pass looks for variables declared in the private storage class that are
// used in only one function. Those variables are moved to the function storage
// class in the function that they are used.
Optimizer::PassToken CreatePrivateToLocalPass();
Expand Down
2 changes: 1 addition & 1 deletion source/binary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ class Parser {
size_t word_index; // The current position in words.
size_t instruction_count; // The count of processed instructions
spv_endianness_t endian; // The endianness of the binary.
// Is the SPIR-V binary in a different endiannes from the host native
// Is the SPIR-V binary in a different endianness from the host native
// endianness?
bool requires_endian_conversion;

Expand Down
4 changes: 2 additions & 2 deletions source/ext_inst.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ bool spvExtInstIsNonSemantic(const spv_ext_inst_type_t type);
// Returns true if the extended instruction set is debug info
bool spvExtInstIsDebugInfo(const spv_ext_inst_type_t type);

// Finds the named extented instruction of the given type in the given extended
// Finds the named extended instruction of the given type in the given extended
// instruction table. On success, returns SPV_SUCCESS and writes a handle of
// the instruction entry into *entry.
spv_result_t spvExtInstTableNameLookup(const spv_ext_inst_table table,
const spv_ext_inst_type_t type,
const char* name,
spv_ext_inst_desc* entry);

// Finds the extented instruction of the given type in the given extended
// Finds the extended instruction of the given type in the given extended
// instruction table by value. On success, returns SPV_SUCCESS and writes a
// handle of the instruction entry into *entry.
spv_result_t spvExtInstTableValueLookup(const spv_ext_inst_table table,
Expand Down
8 changes: 4 additions & 4 deletions source/fuzz/fact_manager/fact_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class FactManager {
std::vector<const protobufs::DataDescriptor*> GetSynonymsForDataDescriptor(
const protobufs::DataDescriptor& data_descriptor) const;

// Returns true if and ony if |data_descriptor1| and |data_descriptor2| are
// Returns true if and only if |data_descriptor1| and |data_descriptor2| are
// known to be synonymous.
bool IsSynonymous(const protobufs::DataDescriptor& data_descriptor1,
const protobufs::DataDescriptor& data_descriptor2) const;
Expand All @@ -174,7 +174,7 @@ class FactManager {
//==============================
// Querying facts about dead blocks

// Returns true if and ony if |block_id| is the id of a block known to be
// Returns true if and only if |block_id| is the id of a block known to be
// dynamically unreachable.
bool BlockIsDead(uint32_t block_id) const;

Expand All @@ -184,7 +184,7 @@ class FactManager {
//==============================
// Querying facts about livesafe function

// Returns true if and ony if |function_id| is the id of a function known
// Returns true if and only if |function_id| is the id of a function known
// to be livesafe.
bool FunctionIsLivesafe(uint32_t function_id) const;

Expand All @@ -194,7 +194,7 @@ class FactManager {
//==============================
// Querying facts about irrelevant values

// Returns true if and ony if the value of the pointee associated with
// Returns true if and only if the value of the pointee associated with
// |pointer_id| is irrelevant.
bool PointeeValueIsIrrelevant(uint32_t pointer_id) const;

Expand Down
2 changes: 1 addition & 1 deletion source/fuzz/fuzzer_pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ uint32_t FuzzerPass::FindOrCreateFloatType(uint32_t width) {

uint32_t FuzzerPass::FindOrCreateFunctionType(
uint32_t return_type_id, const std::vector<uint32_t>& argument_id) {
// FindFunctionType has a sigle argument for OpTypeFunction operands
// FindFunctionType has a single argument for OpTypeFunction operands
// so we will have to copy them all in this vector
std::vector<uint32_t> type_ids(argument_id.size() + 1);
type_ids[0] = return_type_id;
Expand Down
2 changes: 1 addition & 1 deletion source/fuzz/fuzzer_pass_donate_modules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ void FuzzerPassDonateModules::HandleTypeOrValue(
"should have been donated.");

// It is OK to have duplicate constant composite definitions, so add
// this to the module using remapped versions of all consituent ids and
// this to the module using remapped versions of all constituent ids and
// the result type.
new_result_id = GetFuzzerContext()->GetFreshId();
std::vector<uint32_t> constituent_ids;
Expand Down
6 changes: 3 additions & 3 deletions source/fuzz/protobufs/spvtoolsfuzz.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1961,10 +1961,10 @@ message TransformationReplaceBooleanConstantWithConstantBinary {
// A descriptor for the boolean constant id we would like to replace
IdUseDescriptor id_use_descriptor = 1;

// Id for the constant to be used on the LHS of the comparision
// Id for the constant to be used on the LHS of the comparison
uint32 lhs_id = 2;

// Id for the constant to be used on the RHS of the comparision
// Id for the constant to be used on the RHS of the comparison
uint32 rhs_id = 3;

// Opcode for binary operator
Expand Down Expand Up @@ -2403,7 +2403,7 @@ message TransformationWrapVectorSynonym {
// va = vector(..., a, ...)
// vb = vector(..., b, ...)
//
// where a and b are in the same position i in each of their correponding vector
// where a and b are in the same position i in each of their corresponding vector
// and a is synonymous with va[i] and b is synonymous with vb[i].
//
// The transformation then add an instruction vc = va op vb where c is synonymous
Expand Down
2 changes: 1 addition & 1 deletion source/fuzz/transformation_add_constant_composite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ bool TransformationAddConstantComposite::IsApplicable(
// We do not create constants of structs decorated with Block nor
// BufferBlock. The SPIR-V spec does not explicitly disallow this, but it
// seems like a strange thing to do, so we disallow it to avoid triggering
// low priorty edge case issues related to it.
// low priority edge case issues related to it.
if (fuzzerutil::HasBlockOrBufferBlockDecoration(
ir_context, composite_type_instruction->result_id())) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ void TransformationDuplicateRegionWithSelection::Apply(
std::map<uint32_t, uint32_t> original_id_to_phi_id =
fuzzerutil::RepeatedUInt32PairToMap(message_.original_id_to_phi_id());

// Use oveflow ids to fill in any required ids that are missing from these
// Use overflow ids to fill in any required ids that are missing from these
// maps.
for (auto block : region_blocks) {
if (original_label_to_duplicate_label.count(block->id()) == 0) {
Expand Down
2 changes: 1 addition & 1 deletion source/fuzz/transformation_replace_id_with_synonym.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class TransformationReplaceIdWithSynonym : public Transformation {
protobufs::IdUseDescriptor id_use_descriptor, uint32_t synonymous_id);

// - The fact manager must know that the id identified by
// |message_.id_use_descriptor| is synonomous with |message_.synonymous_id|.
// |message_.id_use_descriptor| is synonymous with |message_.synonymous_id|.
// - Replacing the id in |message_.id_use_descriptor| by
// |message_.synonymous_id| must respect SPIR-V's rules about uses being
// dominated by their definitions.
Expand Down
2 changes: 1 addition & 1 deletion source/link/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ target_include_directories(SPIRV-Tools-link
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PRIVATE ${spirv-tools_BINARY_DIR}
)
# We need the IR functionnalities from the optimizer
# We need the IR functionalities from the optimizer
target_link_libraries(SPIRV-Tools-link
PUBLIC SPIRV-Tools-opt)

Expand Down
2 changes: 1 addition & 1 deletion source/link/linker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ spv_result_t CheckImportExportCompatibility(const MessageConsumer& consumer,

// Remove linkage specific instructions, such as prototypes of imported
// functions, declarations of imported variables, import (and export if
// necessary) linkage attribtes.
// necessary) linkage attributes.
//
// |linked_context| and |decoration_manager| should not be null, and the
// 'RemoveDuplicatePass' should be run first.
Expand Down
4 changes: 2 additions & 2 deletions source/opcode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ struct OpcodeDescPtrLen {
static const spv_opcode_table_t kOpcodeTable = {ARRAY_SIZE(kOpcodeTableEntries),
kOpcodeTableEntries};

// Represents a vendor tool entry in the SPIR-V XML Regsitry.
// Represents a vendor tool entry in the SPIR-V XML Registry.
struct VendorTool {
uint32_t value;
const char* vendor;
const char* tool; // Might be empty string.
const char* vendor_tool; // Combiantion of vendor and tool.
const char* vendor_tool; // Combination of vendor and tool.
};

const VendorTool vendor_tools[] = {
Expand Down
2 changes: 1 addition & 1 deletion source/opt/amd_ext_to_khr.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace spvtools {
namespace opt {

// Replaces the extensions VK_AMD_shader_ballot, VK_AMD_gcn_shader, and
// VK_AMD_shader_trinary_minmax with equivalant code using core instructions and
// VK_AMD_shader_trinary_minmax with equivalent code using core instructions and
// capabilities.
class AmdExtensionToKhrPass : public Pass {
public:
Expand Down
2 changes: 1 addition & 1 deletion source/opt/basic_block.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class BasicBlock {
const Instruction* GetMergeInst() const;
Instruction* GetMergeInst();

// Returns the OpLoopMerge instruciton in this basic block, if it exists.
// Returns the OpLoopMerge instruction in this basic block, if it exists.
// Otherwise return null. May be used whenever tail() can be used.
const Instruction* GetLoopMergeInst() const;
Instruction* GetLoopMergeInst();
Expand Down
2 changes: 1 addition & 1 deletion source/opt/cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class CFG {
public:
explicit CFG(Module* module);

// Return the list of predecesors for basic block with label |blkid|.
// Return the list of predecessors for basic block with label |blkid|.
// TODO(dnovillo): Move this to BasicBlock.
const std::vector<uint32_t>& preds(uint32_t blk_id) const {
assert(label2preds_.count(blk_id));
Expand Down
4 changes: 2 additions & 2 deletions source/opt/const_folding_rules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ ConstantFoldingRule FoldFAdd() { return FoldFPBinaryOp(FOLD_FPARITH_OP(+)); }
ConstantFoldingRule FoldFMul() { return FoldFPBinaryOp(FOLD_FPARITH_OP(*)); }

// Returns the constant that results from evaluating |numerator| / 0.0. Returns
// |nullptr| if the result could not be evalutated.
// |nullptr| if the result could not be evaluated.
const analysis::Constant* FoldFPScalarDivideByZero(
const analysis::Type* result_type, const analysis::Constant* numerator,
analysis::ConstantManager* const_mgr) {
Expand Down Expand Up @@ -1346,7 +1346,7 @@ void ConstantFoldingRules::AddFoldingRules() {
FoldFPUnaryOp(FoldFTranscendentalUnary(std::log)));

#ifdef __ANDROID__
// Android NDK r15c tageting ABI 15 doesn't have full support for C++11
// Android NDK r15c targeting ABI 15 doesn't have full support for C++11
// (no std::exp2/log2). ::exp2 is available from C99 but ::log2 isn't
// available up until ABI 18 so we use a shim
auto log2_shim = [](double v) -> double { return log(v) / log(2.0); };
Expand Down
2 changes: 1 addition & 1 deletion source/opt/constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ class ConstantManager {
// instruction at the end of the current module's types section.
//
// |type_id| is an optional argument for disambiguating equivalent types. If
// |type_id| is specified, the contant returned will have that type id.
// |type_id| is specified, the constant returned will have that type id.
Instruction* GetDefiningInstruction(const Constant* c, uint32_t type_id = 0,
Module::inst_iterator* pos = nullptr);

Expand Down
2 changes: 1 addition & 1 deletion source/opt/convert_to_half_pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ bool ConvertToHalfPass::ProcessPhi(Instruction* inst, uint32_t from_width,
uint32_t to_width) {
// Add converts of any float operands to to_width if they are of from_width.
// If converting to 16, change type of phi to float16 equivalent and remember
// result id. Converts need to be added to preceeding blocks.
// result id. Converts need to be added to preceding blocks.
uint32_t ocnt = 0;
uint32_t* prev_idp;
bool modified = false;
Expand Down
2 changes: 1 addition & 1 deletion source/opt/dead_branch_elim_pass.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ class DeadBranchElimPass : public MemPass {
uint32_t cont_id, uint32_t header_id, uint32_t merge_id,
std::unordered_set<BasicBlock*>* blocks_with_back_edges);

// Returns true if there is a brach to the merge node of the selection
// Returns true if there is a branch to the merge node of the selection
// construct |switch_header_id| that is inside a nested selection construct or
// in the header of the nested selection construct.
bool SwitchHasNestedBreak(uint32_t switch_header_id);
Expand Down
2 changes: 1 addition & 1 deletion source/opt/debug_info_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ void DebugInfoManager::RegisterDbgDeclare(uint32_t var_id,
// Create new constant directly into global value area, bypassing the
// Constant manager. This is used when the DefUse or Constant managers
// are invalid and cannot be regenerated due to the module being in an
// inconsistant state e.g. in the middle of significant modification
// inconsistent state e.g. in the middle of significant modification
// such as inlining. Invalidate Constant and DefUse managers if used.
uint32_t AddNewConstInGlobals(IRContext* context, uint32_t const_value) {
uint32_t id = context->TakeNextId();
Expand Down
4 changes: 2 additions & 2 deletions source/opt/def_use_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ class DefUseManager {
// Returns the annotation instrunctions which are a direct use of the given
// |id|. This means when the decorations are applied through decoration
// group(s), this function will just return the OpGroupDecorate
// instrcution(s) which refer to the given id as an operand. The OpDecorate
// instruction(s) which refer to the given id as an operand. The OpDecorate
// instructions which decorate the decoration group will not be returned.
std::vector<Instruction*> GetAnnotations(uint32_t id) const;

Expand All @@ -210,7 +210,7 @@ class DefUseManager {
friend bool CompareAndPrintDifferences(const DefUseManager&,
const DefUseManager&);

// If |inst| has not already been analysed, then analyses its defintion and
// If |inst| has not already been analysed, then analyses its definition and
// uses.
void UpdateDefUse(Instruction* inst);

Expand Down
Loading

0 comments on commit 65ecfd1

Please sign in to comment.