Customizable Compiler Attributes for Code Checking

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing compilers lack the ability to access and utilize additional information provided by programmers about programming constructs, which can be valuable for code checking and optimization, due to limitations in the programming language syntax and potential changes to the compiled code.

Innovation Solution

The introduction of customizable compiler attributes and logic within the source code allows programmers to provide additional information to the compiler, enabling code checking and optimization at compile time without altering the compiled code, using built-in compiler functions to evaluate and process these attributes.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Loss of information

If the compiler uses only standard programming language syntax to access information about programming constructs, then the compiled code remains unchanged and compatible, but the compiler cannot access additional valuable information provided by programmers

Engineering Contradiction:
Improveinformation accessVSAvoidcompiler functionality
Core Design Contradiction:
Loss of informationVSDevice complexity

Solution Approach 1:

The patent introduces compiler attributes as an intermediary mechanism that allows programmers to provide additional information about programming constructs without changing the compiled code. These attributes serve as a mediator between the programmer's intent and the compiler's analysis capabilities, enabling the compiler to access valuable information (such as target types of descriptors) that would otherwise be unavailable through standard syntax alone.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Reliability

If the compiler performs code checking and optimization using additional programmer-provided information, then code quality and optimization improve, but the complexity of the compiler increases

Engineering Contradiction:
Improvecode checking accuracyVSAvoidcompiler complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent applies preliminary action by having programmers pre-attach compiler attributes to programming constructs during code writing. This preliminary provision of information allows the compiler to perform more accurate code checking and optimization without needing to implement complex analysis mechanisms, as the necessary information is already prepared and organized for the compiler to process.

Inventive Principle:
Principle #10Preliminary action

3Loss of time

If the compiler evaluates programmer-provided information at compile time, then logic errors are detected early and optimization is improved, but the compiler requires additional processing capabilities

Engineering Contradiction:
Improveerror detection timingVSAvoidcompiler processing capability
Core Design Contradiction:
Loss of timeVSDevice complexity

Solution Approach 1:

The patent implements self-service by enabling the compiler to automatically evaluate and process the programmer-provided attributes during compilation without requiring external tools or additional processing systems. The compiler uses built-in functions to analyze the attributes, detect logic errors, and perform optimizations, making the system self-sufficient and reducing the need for complex external infrastructure.

Inventive Principle:
Principle #25Self-service

Data Source

PatentUS11941382B2User customizable compiler attributes for code checking
Publication Date: 2024.03.26 RED HAT LLC
  • US11941382B2 patent drawing
  • US11941382B2 patent drawing
  • US11941382B2 patent drawing

AI summary

Disclosed herein is technology to use customized compiler attributes to check source code. An example method may include: accessing, by a processing device executing a compiler, a source code that comprises a compiler attribute associated with a programming construct, wherein the compiler attribute is defined in the source code; executing, by the processing device, a function of the compiler to check the programming construct at a location in the source code, wherein the function checks the programming construct by evaluating the compiler attribute associated with the programming construct; determining, by the processing device executing the compiler, whether to generate a message indicating a status of the check; and generating, by the processing device executing the compiler, object code based on the source code that comprises the compiler attribute.