From 6729027a3a70ad29169d0886b7bd9e1c07034534 Mon Sep 17 00:00:00 2001 From: Timur Saglam Date: Mon, 19 Jun 2023 10:43:22 +0200 Subject: [PATCH 001/232] Adapt Java language to map all loop types to the same token types. --- .../main/java/de/jplag/java/JavaTokenType.java | 8 ++------ .../jplag/java/TokenGeneratingTreeScanner.java | 18 +++++++++--------- .../jplag/java/AbstractJavaLanguageTest.java | 4 ++-- 3 files changed, 13 insertions(+), 17 deletions(-) diff --git a/languages/java/src/main/java/de/jplag/java/JavaTokenType.java b/languages/java/src/main/java/de/jplag/java/JavaTokenType.java index cfad295ab..698ece84f 100644 --- a/languages/java/src/main/java/de/jplag/java/JavaTokenType.java +++ b/languages/java/src/main/java/de/jplag/java/JavaTokenType.java @@ -12,12 +12,8 @@ public enum JavaTokenType implements TokenType { J_VARDEF("VARDEF"), // check J_SYNC_BEGIN("SYNC{"), // check J_SYNC_END("}SYNC"), // check - J_DO_BEGIN("DO{"), // check - J_DO_END("}DO"), // check - J_WHILE_BEGIN("WHILE{"), // check - J_WHILE_END("}WHILE"), // check - J_FOR_BEGIN("FOR{"), // check - J_FOR_END("}FOR"), // check + J_LOOP_BEGIN("LOOP{"), // check + J_LOOP_END("}LOOP"), // check J_SWITCH_BEGIN("SWITCH{"), // check J_SWITCH_END("}SWITCH"), // check J_CASE("CASE"), // check diff --git a/languages/java/src/main/java/de/jplag/java/TokenGeneratingTreeScanner.java b/languages/java/src/main/java/de/jplag/java/TokenGeneratingTreeScanner.java index 6dfca328a..255dbb3b5 100644 --- a/languages/java/src/main/java/de/jplag/java/TokenGeneratingTreeScanner.java +++ b/languages/java/src/main/java/de/jplag/java/TokenGeneratingTreeScanner.java @@ -216,10 +216,10 @@ public Void visitSynchronized(SynchronizedTree node, Void unused) { @Override public Void visitDoWhileLoop(DoWhileLoopTree node, Void unused) { long start = positions.getStartPosition(ast, node); - long end = positions.getEndPosition(ast, node) - 1; - addToken(JavaTokenType.J_DO_BEGIN, start, 2, CodeSemantics.createLoopBegin()); + long end = positions.getEndPosition(ast, node.getStatement()) - 1; + addToken(JavaTokenType.J_LOOP_BEGIN, start, 2, CodeSemantics.createLoopBegin()); scan(node.getStatement(), null); - addToken(JavaTokenType.J_DO_END, end, 1, CodeSemantics.createLoopEnd()); + addToken(JavaTokenType.J_LOOP_END, end, 1, CodeSemantics.createLoopEnd()); scan(node.getCondition(), null); return null; } @@ -228,9 +228,9 @@ public Void visitDoWhileLoop(DoWhileLoopTree node, Void unused) { public Void visitWhileLoop(WhileLoopTree node, Void unused) { long start = positions.getStartPosition(ast, node); long end = positions.getEndPosition(ast, node) - 1; - addToken(JavaTokenType.J_WHILE_BEGIN, start, 5, CodeSemantics.createLoopBegin()); + addToken(JavaTokenType.J_LOOP_BEGIN, start, 5, CodeSemantics.createLoopBegin()); super.visitWhileLoop(node, null); - addToken(JavaTokenType.J_WHILE_END, end, 1, CodeSemantics.createLoopEnd()); + addToken(JavaTokenType.J_LOOP_END, end, 1, CodeSemantics.createLoopEnd()); return null; } @@ -239,9 +239,9 @@ public Void visitForLoop(ForLoopTree node, Void unused) { variableRegistry.enterLocalScope(); long start = positions.getStartPosition(ast, node); long end = positions.getEndPosition(ast, node) - 1; - addToken(JavaTokenType.J_FOR_BEGIN, start, 3, CodeSemantics.createLoopBegin()); + addToken(JavaTokenType.J_LOOP_BEGIN, start, 3, CodeSemantics.createLoopBegin()); super.visitForLoop(node, null); - addToken(JavaTokenType.J_FOR_END, end, 1, CodeSemantics.createLoopEnd()); + addToken(JavaTokenType.J_LOOP_END, end, 1, CodeSemantics.createLoopEnd()); variableRegistry.exitLocalScope(); return null; } @@ -251,9 +251,9 @@ public Void visitEnhancedForLoop(EnhancedForLoopTree node, Void unused) { variableRegistry.enterLocalScope(); long start = positions.getStartPosition(ast, node); long end = positions.getEndPosition(ast, node) - 1; - addToken(JavaTokenType.J_FOR_BEGIN, start, 3, CodeSemantics.createLoopBegin()); + addToken(JavaTokenType.J_LOOP_BEGIN, start, 3, CodeSemantics.createLoopBegin()); super.visitEnhancedForLoop(node, null); - addToken(JavaTokenType.J_FOR_END, end, 1, CodeSemantics.createLoopEnd()); + addToken(JavaTokenType.J_LOOP_END, end, 1, CodeSemantics.createLoopEnd()); variableRegistry.exitLocalScope(); return null; } diff --git a/languages/java/src/test/java/de/jplag/java/AbstractJavaLanguageTest.java b/languages/java/src/test/java/de/jplag/java/AbstractJavaLanguageTest.java index a5b02418f..a702f7fa2 100644 --- a/languages/java/src/test/java/de/jplag/java/AbstractJavaLanguageTest.java +++ b/languages/java/src/test/java/de/jplag/java/AbstractJavaLanguageTest.java @@ -43,12 +43,12 @@ void setUp() { * @return the token types. * @throws ParsingException if parsing fails. */ - protected List parseJavaFile(String fileName) throws ParsingException { + protected List parseJavaFile(String fileName) throws ParsingException { List parsedTokens = language.parse(Set.of(new File(baseDirectory, fileName))); List tokenTypes = parsedTokens.stream().map(Token::getType).toList(); logger.info(LOG_MESSAGE, fileName, tokenTypes); logger.info(TokenPrinter.printTokens(parsedTokens, BASE_PATH.toAbsolutePath().toFile())); - return tokenTypes; + return tokenTypes.stream().map(Object::toString).toList(); } } \ No newline at end of file From 15b3fb176cded0fb22cd19b56a35bb666eb2d0bd Mon Sep 17 00:00:00 2001 From: Niklas Heneka <93838730+NiklasHeneka@users.noreply.github.com> Date: Sat, 1 Jul 2023 16:05:56 +0200 Subject: [PATCH 002/232] Add llvmir language module structure. --- languages/llvmir/README.md | 24 + languages/llvmir/pom.xml | 34 + .../antlr4/de/jplag/llvmir/grammar/LLVMIR.g4 | 1436 ++++++++ .../de/jplag/llvmir/JPlagLLVMListener.java | 3219 +++++++++++++++++ .../de/jplag/llvmir/LLVMParserAdapter.java | 77 + .../java/de/jplag/llvmir/LLVMTokenType.java | 17 + .../main/java/de/jplag/llvmir/Language.java | 52 + languages/pom.xml | 1 + 8 files changed, 4860 insertions(+) create mode 100644 languages/llvmir/README.md create mode 100644 languages/llvmir/pom.xml create mode 100644 languages/llvmir/src/main/antlr4/de/jplag/llvmir/grammar/LLVMIR.g4 create mode 100644 languages/llvmir/src/main/java/de/jplag/llvmir/JPlagLLVMListener.java create mode 100644 languages/llvmir/src/main/java/de/jplag/llvmir/LLVMParserAdapter.java create mode 100644 languages/llvmir/src/main/java/de/jplag/llvmir/LLVMTokenType.java create mode 100644 languages/llvmir/src/main/java/de/jplag/llvmir/Language.java diff --git a/languages/llvmir/README.md b/languages/llvmir/README.md new file mode 100644 index 000000000..2e8fbb75a --- /dev/null +++ b/languages/llvmir/README.md @@ -0,0 +1,24 @@ +# JPlag LLVM IR language module + +The JPlag LLVM IR module allows the use of JPlag with submissions in the LLVM IR.
+It is based on the [LLVMIR ANTLR4 grammar](https://github.com/antlr/grammars-v4/tree/master/llvm-ir), licensed under MIT. + +### LLVM IR specification compatibility + +The grammar definition targets LLVM 15. + +If the grammar is updated to a more recent1 syntax definition, this module should surely be updated as well. + + +### Token Extraction + +TODO + +### Usage + +To use the LLVM IR module, add the `-l llvmir` flag in the CLI, or use a `JPlagOption` object with `new de.jplag.llvmir.Language()` as `language` in the Java API as described in the usage information in the [readme of the main project](https://github.com/jplag/JPlag#usage) and [in the wiki](https://github.com/jplag/JPlag/wiki/1.-How-to-Use-JPlag). + +
+ +#### Footnotes +
1 The grammar files are taken from grammar-v4, with the most recent modification in commit 9644ff9 from March 2023.
\ No newline at end of file diff --git a/languages/llvmir/pom.xml b/languages/llvmir/pom.xml new file mode 100644 index 000000000..7f376eae7 --- /dev/null +++ b/languages/llvmir/pom.xml @@ -0,0 +1,34 @@ + + + 4.0.0 + + + de.jplag + languages + ${revision} + + llvmir + + + + org.antlr + antlr4-runtime + + + + + + + org.antlr + antlr4-maven-plugin + + + + antlr4 + + + + + + + diff --git a/languages/llvmir/src/main/antlr4/de/jplag/llvmir/grammar/LLVMIR.g4 b/languages/llvmir/src/main/antlr4/de/jplag/llvmir/grammar/LLVMIR.g4 new file mode 100644 index 000000000..466266603 --- /dev/null +++ b/languages/llvmir/src/main/antlr4/de/jplag/llvmir/grammar/LLVMIR.g4 @@ -0,0 +1,1436 @@ +/* + MIT License + + Copyright (c) 2023 邱维东 + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + */ + +grammar LLVMIR; + +compilationUnit: topLevelEntity* EOF; + +targetDef: targetDataLayout | targetTriple; +sourceFilename: 'source_filename' '=' StringLit; +targetDataLayout: 'target' 'datalayout' '=' StringLit; +targetTriple: 'target' 'triple' '=' StringLit; + +topLevelEntity: + sourceFilename + | targetDef + | moduleAsm + | typeDef + | comdatDef + | globalDecl + | globalDef + | indirectSymbolDef + | funcDecl + | funcDef + | attrGroupDef + | namedMetadataDef + | metadataDef + | useListOrder + | useListOrderBB; +moduleAsm: 'module' 'asm' StringLit; +typeDef: LocalIdent '=' 'type' type; +comdatDef: + ComdatName '=' 'comdat' selectionKind = ( + 'any' + | 'exactmatch' + | 'largest' + | 'nodeduplicate' + | 'samesize' + ); +globalDecl: + GlobalIdent '=' externalLinkage preemption? visibility? dllStorageClass? threadLocal? + unnamedAddr? addrSpace? externallyInitialized? immutable type ( + ',' globalField + )* (',' metadataAttachment)* funcAttribute*; +globalDef: + GlobalIdent '=' internalLinkage? preemption? visibility? dllStorageClass? threadLocal? + unnamedAddr? addrSpace? externallyInitialized? immutable type constant ( + ',' globalField + )* (',' metadataAttachment)* funcAttribute*; + +indirectSymbolDef: + GlobalIdent '=' linkage? preemption? visibility? dllStorageClass? threadLocal? unnamedAddr? + indirectSymbolKind = ('alias' | 'ifunc') type ',' indirectSymbol ( + ',' partition + )*; + +funcDecl: 'declare' metadataAttachment* funcHeader; +funcDef: 'define' funcHeader metadataAttachment* funcBody; +attrGroupDef: + 'attributes' AttrGroupId '=' '{' funcAttribute* '}'; +namedMetadataDef: + MetadataName '=' '!' '{' (metadataNode (',' metadataNode)*)? '}'; +metadataDef: + MetadataId '=' distinct? (mdTuple | specializedMDNode); +useListOrder: + 'uselistorder' typeValue ',' '{' IntLit (',' IntLit)* '}'; +useListOrderBB: + 'uselistorder_bb' GlobalIdent ',' LocalIdent ',' '{' IntLit ( + ',' IntLit + )* '}'; + +funcHeader: + linkage? preemption? visibility? dllStorageClass? callingConv? returnAttribute* type GlobalIdent + '(' params ')' unnamedAddr? addrSpace? funcHdrField*; +indirectSymbol: + typeConst + | bitCastExpr + | getElementPtrExpr + | addrSpaceCastExpr + | intToPtrExpr; +callingConv: callingConvEnum | callingConvInt; +callingConvInt: 'cc' IntLit; +funcHdrField: + funcAttribute + | section + | partition + | comdat + | align + | gc + | prefix + | prologue + | personality; +gc: 'gc' StringLit; +prefix: 'prefix' typeConst; +prologue: 'prologue' typeConst; +personality: 'personality' typeConst; +returnAttribute: returnAttr | dereferenceable; +funcBody: '{' basicBlock+ useListOrder* '}'; +basicBlock: LabelIdent? instruction* terminator; +instruction: // Instructions producing values. + localDefInst + | valueInstruction + // Instructions not producing values. + | storeInst + | fenceInst; +terminator: + // Terminators producing values. + localDefTerm + | valueTerminator + // Terminators not producing values. + | retTerm + | brTerm + | condBrTerm + | switchTerm + | indirectBrTerm + | resumeTerm + | catchRetTerm + | cleanupRetTerm + | unreachableTerm; +localDefTerm: LocalIdent '=' valueTerminator; +valueTerminator: invokeTerm | callBrTerm | catchSwitchTerm; +retTerm: + 'ret' 'void' (',' metadataAttachment)* + // Value return. + | 'ret' concreteType value (',' metadataAttachment)*; +brTerm: 'br' label (',' metadataAttachment)*; +condBrTerm: + 'br' IntType value ',' label ',' label ( + ',' metadataAttachment + )*; +switchTerm: + 'switch' typeValue ',' label '[' case* ']' ( + ',' metadataAttachment + )*; +indirectBrTerm: + 'indirectbr' typeValue ',' '[' (label (',' label)?)? ']' ( + ',' metadataAttachment + )*; +resumeTerm: 'resume' typeValue (',' metadataAttachment)*; +catchRetTerm: + 'catchret' 'from' value 'to' label (',' metadataAttachment)*; +cleanupRetTerm: + 'cleanupret' 'from' value 'unwind' unwindTarget ( + ',' metadataAttachment + )*; +unreachableTerm: 'unreachable' (',' metadataAttachment)*; +invokeTerm: + 'invoke' callingConv? returnAttribute* addrSpace? type value '(' args ')' funcAttribute* ( + '[' (operandBundle ',')+ ']' + )? 'to' label 'unwind' label (',' metadataAttachment)*; +callBrTerm: + 'callbr' callingConv? returnAttribute* addrSpace? type value '(' args ')' funcAttribute* ( + '[' (operandBundle ',')+ ']' + )? 'to' label '[' (label (',' label)*)? ']' ( + ',' metadataAttachment + )*; +catchSwitchTerm: + 'catchswitch' 'within' exceptionPad '[' handlers ']' 'unwind' unwindTarget ( + ',' metadataAttachment + )*; +label: 'label' LocalIdent; +case: typeConst ',' label; +unwindTarget: 'to' 'caller' | label; +handlers: label (',' label)*; +metadataNode: + MetadataId + // Parse DIExpressions inline as a special case. They are still MDNodes, so they can still + // appear in named metadata. Remove this logic if they become plain Metadata. + | diExpression; +diExpression: + '!DIExpression' '(' ( + diExpressionField (',' diExpressionField)* + )? ')'; +diExpressionField: IntLit | DwarfAttEncoding | DwarfOp; + +globalField: + section + | partition + | comdat + | align + | sanitizerKind = ( + 'no_sanitize_address' + | 'no_sanitize_hwaddress' + | 'sanitize_address_dyninit' + | 'sanitize_memtag' + ); +section: 'section' StringLit; +comdat: 'comdat' ('(' ComdatName ')')?; +partition: 'partition' StringLit; + +constant: + boolConst + | intConst + | floatConst + | nullConst + | noneConst + | structConst + | arrayConst + | vectorConst + | zeroInitializerConst + // @42 @foo + | GlobalIdent + | undefConst + | poisonConst + | blockAddressConst + | dsoLocalEquivalentConst + | noCFIConst + | constantExpr; +boolConst: 'true' | 'false'; +intConst: IntLit; +floatConst: FloatLit; +nullConst: 'null'; +noneConst: 'none'; +structConst: + '{' (typeConst (',' typeConst)*)? '}' + | '<' '{' ( typeConst (',' typeConst)*)? '}' '>'; +arrayConst: + 'c' StringLit + | '[' (typeConst (',' typeConst)*)? ']'; +vectorConst: '<' (typeConst (',' typeConst)*)? '>'; +zeroInitializerConst: 'zeroinitializer'; +undefConst: 'undef'; +poisonConst: 'poison'; +blockAddressConst: + 'blockaddress' '(' GlobalIdent ',' LocalIdent ')'; +dsoLocalEquivalentConst: 'dso_local_equivalent' GlobalIdent; +noCFIConst: 'no_cfi' GlobalIdent; +constantExpr: + // Unary expressions + fNegExpr + // Binary expressions + | addExpr + | subExpr + | mulExpr + // Bitwise expressions + | shlExpr + | lShrExpr + | aShrExpr + | andExpr + | orExpr + | xorExpr + // Vector expressions + | extractElementExpr + | insertElementExpr + | shuffleVectorExpr + // Memory expressions + | getElementPtrExpr + // Conversion expressions + | truncExpr + | zExtExpr + | sExtExpr + | fpTruncExpr + | fpExtExpr + | fpToUiExpr + | fpToSiExpr + | uiToFpExpr + | siToFpExpr + | ptrToIntExpr + | intToPtrExpr + | bitCastExpr + | addrSpaceCastExpr + // Other expressions + | iCmpExpr + | fCmpExpr + | selectExpr; +typeConst: firstClassType constant; + +metadataAttachment: MetadataName mdNode; +mdNode: + mdTuple + // !42 + | MetadataId + //!{ ... } + | specializedMDNode; +mdTuple: '!' '{' (mdField (',' mdField)*)? '}'; +// metadataID: MetadataId; +metadata: + typeValue + | mdString + // !{ ... } + | mdTuple + // !7 + | MetadataId + | diArgList + | specializedMDNode; +diArgList: '!DIArgList' '(' (typeValue (',' typeValue)*)? ')'; +typeValue: firstClassType value; +value: + constant + // %42 %foo + | LocalIdent + // TODO: Move InlineAsm from Value to Callee and Invokee? Inline assembler expressions may only + // be used as the callee operand of a call or an invoke instruction. + | inlineAsm; +inlineAsm: + 'asm' sideEffect = 'sideeffect'? alignStackTok = 'alignstack'? intelDialect = 'inteldialect'? + unwind = 'unwind'? StringLit ',' StringLit; +mdString: '!' StringLit; +mdFieldOrInt: IntLit | mdField; +diSPFlag: IntLit | DispFlag; +funcAttribute: + attrString + | attrPair + // not used in attribute groups. + | AttrGroupId + // used in functions. | align # NOTE: removed to resolve reduce/reduce conflict, see above. used + // in attribute groups. + | alignPair + | alignStack + | alignStackPair + | allocKind + | allocSize + | funcAttr + | preallocated + | unwindTable + | vectorScaleRange; +type: + 'void' + | 'opaque' + | type '(' params ')' + | intType + | floatType + | type addrSpace? '*' + | opaquePointerType + | vectorType + | labelType + | arrayType + | structType + | namedType + | mmxType + | tokenType + | metadataType; +params: + ellipsis = '...'? + | param (',' param)* (',' ellipsis = '...')?; +param: type paramAttribute* LocalIdent?; +paramAttribute: + attrString + | attrPair + | align + | alignStack + | byRefAttr + | byval + | dereferenceable + | elementType + | inAlloca + | paramAttr + | preallocated + | structRetAttr; +attrString: StringLit; +attrPair: StringLit '=' StringLit; +align: 'align' IntLit | 'align' '(' IntLit ')'; +alignPair: 'align' '=' IntLit; +alignStack: 'alignstack' '(' IntLit ')'; +alignStackPair: 'alignstack' '=' IntLit; +allocKind: 'allockind' '(' StringLit ')'; +allocSize: 'allocsize' '(' IntLit (',' IntLit)? ')'; +unwindTable: + 'uwtable' + | 'uwtable' '(' unwindTableKind = ('async' | 'sync') ')'; +vectorScaleRange: + 'vscale_range' ('(' (IntLit | IntLit ',' IntLit) ')')?; +byRefAttr: 'byref' '(' type ')'; +byval: 'byval' ( '(' type ')')?; +dereferenceable: + 'dereferenceable' '(' IntLit ')' + | 'dereferenceable_or_null' '(' IntLit ')'; +elementType: 'elementtype' '(' type ')'; +inAlloca: 'inalloca' '(' type ')'; +paramAttr: + 'allocalign' + | 'allocptr' + | 'immarg' + | 'inreg' + | 'nest' + | 'noalias' + | 'nocapture' + | 'nofree' + | 'nonnull' + | 'noundef' + | 'readnone' + | 'readonly' + | 'returned' + | 'signext' + | 'swiftasync' + | 'swifterror' + | 'swiftself' + | 'writeonly' + | 'zeroext'; +preallocated: 'preallocated' '(' type ')'; +structRetAttr: 'sret' '(' type ')'; + +// funcType: type '(' params ')'; +firstClassType: concreteType | metadataType; +concreteType: + intType + | floatType + | pointerType + | vectorType + | labelType + | arrayType + | structType + | namedType + | mmxType + | tokenType; + +intType: IntType; +floatType: floatKind; +pointerType: type addrSpace? '*' | opaquePointerType; +vectorType: + '<' IntLit 'x' type '>' + | '<' 'vscale' 'x' IntLit 'x' type '>'; +labelType: 'label'; +arrayType: '[' IntLit 'x' type ']'; +structType: + '{' (type (',' type)*)? '}' + | '<' '{' (type (',' type)*)? '}' '>'; +namedType: LocalIdent; +mmxType: 'x86_mmx'; +tokenType: 'token'; + +opaquePointerType: 'ptr' addrSpace?; +addrSpace: 'addrspace' '(' IntLit ')'; +threadLocal: 'thread_local' ('(' tlsModel ')')?; +metadataType: 'metadata'; + +// expr +bitCastExpr: 'bitcast' '(' typeConst 'to' type ')'; +getElementPtrExpr: + 'getelementptr' inBounds? '(' type ',' typeConst ( + ',' gepIndex + )* ')'; +gepIndex: inRange = 'inrange'? typeConst; +addrSpaceCastExpr: 'addrspacecast' '(' typeConst 'to' type ')'; +intToPtrExpr: 'inttoptr' '(' typeConst 'to' type ')'; +iCmpExpr: 'icmp' iPred '(' typeConst ',' typeConst ')'; +fCmpExpr: 'fcmp' fPred '(' typeConst ',' typeConst ')'; +selectExpr: + 'select' '(' typeConst ',' typeConst ',' typeConst ')'; + +truncExpr: 'trunc' '(' typeConst 'to' type ')'; +zExtExpr: 'zext' '(' typeConst 'to' type ')'; +sExtExpr: 'sext' '(' typeConst 'to' type ')'; +fpTruncExpr: 'fptrunc' '(' typeConst 'to' type ')'; +fpExtExpr: 'fpext' '(' typeConst 'to' type ')'; +fpToUiExpr: 'fptoui' '(' typeConst 'to' type ')'; +fpToSiExpr: 'fptosi' '(' typeConst 'to' type ')'; +uiToFpExpr: 'uitofp' '(' typeConst 'to' type ')'; +siToFpExpr: 'sitofp' '(' typeConst 'to' type ')'; +ptrToIntExpr: 'ptrtoint' '(' typeConst 'to' type ')'; +extractElementExpr: + 'extractelement' '(' typeConst ',' typeConst ')'; +insertElementExpr: + 'insertelement' '(' typeConst ',' typeConst ',' typeConst ')'; +shuffleVectorExpr: + 'shufflevector' '(' typeConst ',' typeConst ',' typeConst ')'; +shlExpr: 'shl' overflowFlag* '(' typeConst ',' typeConst ')'; +lShrExpr: + 'lshr' exact = 'exact'? '(' typeConst ',' typeConst ')'; +aShrExpr: + 'ashr' exact = 'exact'? '(' typeConst ',' typeConst ')'; +andExpr: 'and' '(' typeConst ',' typeConst ')'; +orExpr: 'or' '(' typeConst ',' typeConst ')'; +xorExpr: 'xor' '(' typeConst ',' typeConst ')'; +addExpr: 'add' overflowFlag* '(' typeConst ',' typeConst ')'; +subExpr: 'sub' overflowFlag* '(' typeConst ',' typeConst ')'; +mulExpr: 'mul' overflowFlag* '(' typeConst ',' typeConst ')'; +fNegExpr: 'fneg' '(' typeConst ')'; + +// instructions +localDefInst: LocalIdent '=' valueInstruction; +valueInstruction: + // Unary instructions + fNegInst + // Binary instructions + | addInst + | fAddInst + | subInst + | fSubInst + | mulInst + | fMulInst + | uDivInst + | sDivInst + | fDivInst + | uRemInst + | sRemInst + | fRemInst + // Bitwise instructions + | shlInst + | lShrInst + | aShrInst + | andInst + | orInst + | xorInst + // Vector instructions + | extractElementInst + | insertElementInst + | shuffleVectorInst + // Aggregate instructions + | extractValueInst + | insertValueInst + // Memory instructions + | allocaInst + | loadInst + | cmpXchgInst + | atomicRMWInst + | getElementPtrInst + // Conversion instructions + | truncInst + | zExtInst + | sExtInst + | fpTruncInst + | fpExtInst + | fpToUiInst + | fpToSiInst + | uiToFpInst + | siToFpInst + | ptrToIntInst + | intToPtrInst + | bitCastInst + | addrSpaceCastInst + // Other instructions + | iCmpInst + | fCmpInst + | phiInst + | selectInst + | freezeInst + | callInst + | vaargInst + | landingPadInst + | catchPadInst + | cleanupPadInst; +storeInst: + // Store. + 'store' volatile = 'volatile'? typeValue ',' typeValue ( + ',' align + )? (',' metadataAttachment)* + // atomic='atomic' store. + | 'store' atomic = 'atomic' volatile = 'volatile'? typeValue ',' typeValue syncScope? + atomicOrdering (',' align)? (',' metadataAttachment)*; + +syncScope: 'syncscope' '(' StringLit ')'; + +fenceInst: + 'fence' syncScope? atomicOrdering (',' metadataAttachment)*; +fNegInst: + 'fneg' fastMathFlag* typeValue (',' metadataAttachment)*; +addInst: + 'add' overflowFlag* typeValue ',' value ( + ',' metadataAttachment + )*; +fAddInst: + 'fadd' fastMathFlag* typeValue ',' value ( + ',' metadataAttachment + )*; +subInst: + 'sub' overflowFlag* typeValue ',' value ( + ',' metadataAttachment + )*; +fSubInst: + 'fsub' fastMathFlag* typeValue ',' value ( + ',' metadataAttachment + )*; +mulInst: + 'mul' overflowFlag* typeValue ',' value ( + ',' metadataAttachment + )*; +fMulInst: + 'fmul' fastMathFlag* typeValue ',' value ( + ',' metadataAttachment + )*; +uDivInst: + 'udiv' exact = 'exact'? typeValue ',' value ( + ',' metadataAttachment + )*; +sDivInst: + 'sdiv' exact = 'exact'? typeValue ',' value ( + ',' metadataAttachment + )*; +fDivInst: + 'fdiv' fastMathFlag* typeValue ',' value ( + ',' metadataAttachment + )*; +uRemInst: 'urem' typeValue ',' value ( ',' metadataAttachment)*; +sRemInst: 'srem' typeValue ',' value ( ',' metadataAttachment)*; +fRemInst: + 'frem' fastMathFlag* typeValue ',' value ( + ',' metadataAttachment + )*; +shlInst: + 'shl' overflowFlag* typeValue ',' value ( + ',' metadataAttachment + )*; +lShrInst: + 'lshr' exact = 'exact'? typeValue ',' value ( + ',' metadataAttachment + )*; +aShrInst: + 'ashr' exact = 'exact'? typeValue ',' value ( + ',' metadataAttachment + )*; +andInst: 'and' typeValue ',' value ( ',' metadataAttachment)*; +orInst: 'or' typeValue ',' value ( ',' metadataAttachment)*; +xorInst: 'xor' typeValue ',' value ( ',' metadataAttachment)*; +extractElementInst: + 'extractelement' typeValue ',' typeValue ( + ',' metadataAttachment + )*; +insertElementInst: + 'insertelement' typeValue ',' typeValue ',' typeValue ( + ',' metadataAttachment + )*; +shuffleVectorInst: + 'shufflevector' typeValue ',' typeValue ',' typeValue ( + ',' metadataAttachment + )*; +extractValueInst: + 'extractvalue' typeValue (',' IntLit)+ ( + ',' metadataAttachment + )*; +insertValueInst: + 'insertvalue' typeValue ',' typeValue (',' IntLit)+ ( + ',' metadataAttachment + )*; +allocaInst: + 'alloca' inAllocaTok = 'inalloca'? swiftError = 'swifterror'? type ( + ',' typeValue + )? (',' align)? (',' addrSpace)? (',' metadataAttachment)*; +loadInst: + // Load. + 'load' volatile = 'volatile'? type ',' typeValue (',' align)? ( + ',' metadataAttachment + )* + // atomic='atomic' load. + | 'load' atomic = 'atomic' volatile = 'volatile'? type ',' typeValue syncScope? atomicOrdering ( + ',' align + )? (',' metadataAttachment)*; +cmpXchgInst: + 'cmpxchg' weak = 'weak'? volatile = 'volatile'? typeValue ',' typeValue ',' typeValue syncScope? + atomicOrdering atomicOrdering (',' align)? ( + ',' metadataAttachment + )*; +atomicRMWInst: + 'atomicrmw' volatile = 'volatile'? atomicOp typeValue ',' typeValue syncScope? atomicOrdering ( + ',' align + )? (',' metadataAttachment)*; +getElementPtrInst: + 'getelementptr' inBounds? type ',' typeValue (',' typeValue)* ( + ',' metadataAttachment + )*; +truncInst: + 'trunc' typeValue 'to' type (',' metadataAttachment)*; +zExtInst: 'zext' typeValue 'to' type ( ',' metadataAttachment)*; +sExtInst: 'sext' typeValue 'to' type ( ',' metadataAttachment)*; +fpTruncInst: + 'fptrunc' typeValue 'to' type (',' metadataAttachment)*; +fpExtInst: + 'fpext' typeValue 'to' type (',' metadataAttachment)*; +fpToUiInst: + 'fptoui' typeValue 'to' type (',' metadataAttachment)*; +fpToSiInst: + 'fptosi' typeValue 'to' type (',' metadataAttachment)*; +uiToFpInst: + 'uitofp' typeValue 'to' type (',' metadataAttachment)*; +siToFpInst: + 'sitofp' typeValue 'to' type (',' metadataAttachment)*; +ptrToIntInst: + 'ptrtoint' typeValue 'to' type (',' metadataAttachment)*; +intToPtrInst: + 'inttoptr' typeValue 'to' type (',' metadataAttachment)*; +bitCastInst: + 'bitcast' typeValue 'to' type (',' metadataAttachment)*; +addrSpaceCastInst: + 'addrspacecast' typeValue 'to' type (',' metadataAttachment)*; +iCmpInst: + 'icmp' iPred typeValue ',' value (',' metadataAttachment)*; +fCmpInst: + 'fcmp' fastMathFlag* fPred typeValue ',' value ( + ',' metadataAttachment + )*; +phiInst: + 'phi' fastMathFlag* type (inc (',' inc)*) ( + ',' metadataAttachment + )*; +selectInst: + 'select' fastMathFlag* typeValue ',' typeValue ',' typeValue ( + ',' metadataAttachment + )*; +freezeInst: 'freeze' typeValue; +callInst: + tail = ('musttail' | 'notail' | 'tail')? 'call' fastMathFlag* callingConv? returnAttribute* + addrSpace? type value '(' args ')' funcAttribute* ( + '[' operandBundle (',' operandBundle)* ']' + )? (',' metadataAttachment)*; +vaargInst: + 'va_arg' typeValue ',' type (',' metadataAttachment)*; +landingPadInst: + 'landingpad' type cleanUp = 'cleanup'? clause* ( + ',' metadataAttachment + )*; +catchPadInst: + 'catchpad' 'within' LocalIdent '[' ( + exceptionArg (',' exceptionArg)* + )? ']' (',' metadataAttachment)*; +cleanupPadInst: + 'cleanuppad' 'within' exceptionPad '[' ( + exceptionArg (',' exceptionArg)* + )? ']' (',' metadataAttachment)*; + +inc: '[' value ',' LocalIdent ']'; + +operandBundle: StringLit '(' (typeValue (',' typeValue)*)? ')'; +clause: clauseType = ('catch' | 'filter') typeValue; + +args: + ellipsis = '...'? + | arg (',' arg)* (',' ellipsis = '...')?; +arg: concreteType paramAttribute* value | metadataType metadata; + +exceptionArg: concreteType value | metadataType metadata; +exceptionPad: noneConst | LocalIdent; + +externalLinkage: 'extern_weak' | 'external'; +internalLinkage: + 'appending' + | 'available_externally' + | 'common' + | 'internal' + | 'linkonce' + | 'linkonce_odr' + | 'private' + | 'weak' + | 'weak_odr'; +linkage: internalLinkage | externalLinkage; +preemption: 'dso_local' | 'dso_preemptable'; +visibility: 'default' | 'hidden' | 'protected'; +dllStorageClass: 'dllexport' | 'dllimport'; +tlsModel: 'initialexec' | 'localdynamic' | 'localexec'; +unnamedAddr: 'local_unnamed_addr' | 'unnamed_addr'; +externallyInitialized: 'externally_initialized'; +immutable: 'constant' | 'global'; +funcAttr: + 'alwaysinline' + | 'argmemonly' + | 'builtin' + | 'cold' + | 'convergent' + | 'disable_sanitizer_instrumentation' + | 'fn_ret_thunk_extern' + | 'hot' + | 'inaccessiblemem_or_argmemonly' + | 'inaccessiblememonly' + | 'inlinehint' + | 'jumptable' + | 'minsize' + | 'mustprogress' + | 'naked' + | 'nobuiltin' + | 'nocallback' + | 'nocf_check' + | 'noduplicate' + | 'nofree' + | 'noimplicitfloat' + | 'noinline' + | 'nomerge' + | 'nonlazybind' + | 'noprofile' + | 'norecurse' + | 'noredzone' + | 'noreturn' + | 'nosanitize_bounds' + | 'nosanitize_coverage' + | 'nosync' + | 'nounwind' + | 'null_pointer_is_valid' + | 'optforfuzzing' + | 'optnone' + | 'optsize' + | 'presplitcoroutine' + | 'readnone' + | 'readonly' + | 'returns_twice' + | 'safestack' + | 'sanitize_address' + | 'sanitize_hwaddress' + | 'sanitize_memory' + | 'sanitize_memtag' + | 'sanitize_thread' + | 'shadowcallstack' + | 'speculatable' + | 'speculative_load_hardening' + | 'ssp' + | 'sspreq' + | 'sspstrong' + | 'strictfp' + | 'willreturn' + | 'writeonly'; +distinct: 'distinct'; +inBounds: 'inbounds'; +returnAttr: + 'inreg' + | 'noalias' + | 'nonnull' + | 'noundef' + | 'signext' + | 'zeroext'; +overflowFlag: 'nsw' | 'nuw'; +iPred: + 'eq' + | 'ne' + | 'sge' + | 'sgt' + | 'sle' + | 'slt' + | 'uge' + | 'ugt' + | 'ule' + | 'ult'; +fPred: + 'false' + | 'oeq' + | 'oge' + | 'ogt' + | 'ole' + | 'olt' + | 'one' + | 'ord' + | 'true' + | 'ueq' + | 'uge' + | 'ugt' + | 'ule' + | 'ult' + | 'une' + | 'uno'; +atomicOrdering: + 'acq_rel' + | 'acquire' + | 'monotonic' + | 'release' + | 'seq_cst' + | 'unordered'; +callingConvEnum: + 'aarch64_sve_vector_pcs' + | 'aarch64_vector_pcs' + | 'amdgpu_cs' + | 'amdgpu_es' + | 'amdgpu_gfx' + | 'amdgpu_gs' + | 'amdgpu_hs' + | 'amdgpu_kernel' + | 'amdgpu_ls' + | 'amdgpu_ps' + | 'amdgpu_vs' + | 'anyregcc' + | 'arm_aapcs_vfpcc' + | 'arm_aapcscc' + | 'arm_apcscc' + | 'avr_intrcc' + | 'avr_signalcc' + | 'ccc' + | 'cfguard_checkcc' + | 'coldcc' + | 'cxx_fast_tlscc' + | 'fastcc' + | 'ghccc' + | 'hhvm_ccc' + | 'hhvmcc' + | 'intel_ocl_bicc' + | 'msp430_intrcc' + | 'preserve_allcc' + | 'preserve_mostcc' + | 'ptx_device' + | 'ptx_kernel' + | 'spir_func' + | 'spir_kernel' + | 'swiftcc' + | 'swifttailcc' + | 'tailcc' + | 'webkit_jscc' + | 'win64cc' + | 'x86_64_sysvcc' + | 'x86_fastcallcc' + | 'x86_intrcc' + | 'x86_regcallcc' + | 'x86_stdcallcc' + | 'x86_thiscallcc' + | 'x86_vectorcallcc'; + +fastMathFlag: + 'afn' + | 'arcp' + | 'contract' + | 'fast' + | 'ninf' + | 'nnan' + | 'nsz' + | 'reassoc'; +atomicOp: + 'add' + | 'and' + | 'fadd' + | 'fmax' + | 'fmin' + | 'fsub' + | 'max' + | 'min' + | 'nand' + | 'or' + | 'sub' + | 'umax' + | 'umin' + | 'xchg' + | 'xor'; +floatKind: + 'half' + | 'bfloat' + | 'float' + | 'double' + | 'x86_fp80' + | 'fp128' + | 'ppc_fp128'; +/*看不懂,直接抄过来的 */ +specializedMDNode: + diBasicType + | diCommonBlock // not in spec as of 2019-12-05 + | diCompileUnit + | diCompositeType + | diDerivedType + | diEnumerator + | diExpression + | diFile + | diGlobalVariable + | diGlobalVariableExpression + | diImportedEntity + | diLabel // not in spec as of 2018-10-14, still not in spec as of 2019-12-05 + | diLexicalBlock + | diLexicalBlockFile + | diLocalVariable + | diLocation + | diMacro + | diMacroFile + | diModule // not in spec as of 2018-02-21, still not in spec as of 2019-12-05 + | diNamespace + | diObjCProperty + | diStringType + | diSubprogram + | diSubrange + | diSubroutineType + | diTemplateTypeParameter + | diTemplateValueParameter + | genericDiNode; // not in spec as of 2018-02-21, still not in spec as of 2019-12-05 + +diBasicType: + '!DIBasicType' '(' (diBasicTypeField (',' diBasicTypeField)*)? ')'; +diCommonBlock: + '!DICommonBlock' '(' ( + diCommonBlockField (',' diCommonBlockField)* + )? ')'; +diCompileUnit: + '!DICompileUnit' '(' ( + diCompileUnitField (',' diCompileUnitField)* + )? ')'; +diCompositeType: + '!DICompositeType' '(' ( + diCompositeTypeField (',' diCompositeTypeField)* + )? ')'; +diCompositeTypeField: + tagField + | nameField + | scopeField + | fileField + | lineField + | baseTypeField + | sizeField + | alignField + | offsetField + | flagsField + | elementsField + | runtimeLangField + | vtableHolderField + | templateParamsField + | identifierField + | discriminatorField + | dataLocationField + | associatedField + | allocatedField + | rankField + | annotationsField; +diDerivedType: + '!DIDerivedType' '(' ( + diDerivedTypeField (',' diDerivedTypeField)* + )? ')'; +diDerivedTypeField: + tagField + | nameField + | scopeField + | fileField + | lineField + | baseTypeField + | sizeField + | alignField + | offsetField + | flagsField + | extraDataField + | dwarfAddressSpaceField + | annotationsField; +diEnumerator: + '!DIEnumerator' '(' ( + diEnumeratorField (',' diEnumeratorField)* + )? ')'; +diEnumeratorField: nameField | valueIntField | isUnsignedField; +diFile: '!DIFile' '(' (diFileField (',' diFileField)*)? ')'; +diFileField: + filenameField + | directoryField + | checksumkindField + | checksumField + | sourceField; +diGlobalVariable: + '!DIGlobalVariable' '(' ( + diGlobalVariableField (',' diGlobalVariableField)* + )? ')'; +diGlobalVariableField: + nameField + | scopeField + | linkageNameField + | fileField + | lineField + | typeField + | isLocalField + | isDefinitionField + | templateParamsField + | declarationField + | alignField + | annotationsField; +diGlobalVariableExpression: + '!DIGlobalVariableExpression' '(' ( + diGlobalVariableExpressionField ( + ',' diGlobalVariableExpressionField + )* + )? ')'; +diGlobalVariableExpressionField: varField | exprField; +diImportedEntity: + '!DIImportedEntity' '(' ( + diImportedEntityField (',' diImportedEntityField)* + )? ')'; +diImportedEntityField: + tagField + | scopeField + | entityField + | fileField + | lineField + | nameField + | elementsField; + +diLabel: '!DILabel' '(' (diLabelField (',' diLabelField)*)? ')'; +diLabelField: scopeField | nameField | fileField | lineField; +diLexicalBlock: + '!DILexicalBlock' '(' ( + diLexicalBlockField (',' diLexicalBlockField)* + )? ')'; +diLexicalBlockField: + scopeField + | fileField + | lineField + | columnField; +diLexicalBlockFile: + '!DILexicalBlockFile' '(' ( + diLexicalBlockFileField (',' diLexicalBlockFileField)* + )? ')'; +diLexicalBlockFileField: + scopeField + | fileField + | discriminatorIntField; +diLocalVariable: + '!DILocalVariable' '(' ( + diLocalVariableField (',' diLocalVariableField)* + )? ')'; +diLocalVariableField: + scopeField + | nameField + | argField + | fileField + | lineField + | typeField + | flagsField + | alignField + | annotationsField; +diLocation: + '!DILocation' '(' (diLocationField (',' diLocationField)*)? ')'; +diLocationField: + lineField + | columnField + | scopeField + | inlinedAtField + | isImplicitCodeField; +diMacro: '!DIMacro' '(' (diMacroField (',' diMacroField)*)? ')'; +diMacroField: + typeMacinfoField + | lineField + | nameField + | valueStringField; +diMacroFile: + '!DIMacroFile' '(' (diMacroFileField (',' diMacroFileField)*)? ')'; +diMacroFileField: + typeMacinfoField + | lineField + | fileField + | nodesField; +diModule: + '!DIModule' '(' (diModuleField (',' diModuleField)*)? ')'; +diModuleField: + scopeField + | nameField + | configMacrosField + | includePathField + | apiNotesField + | fileField + | lineField + | isDeclField; +diNamespace: + '!DINamespace' '(' (diNamespaceField (',' diNamespaceField)*)? ')'; +diNamespaceField: scopeField | nameField | exportSymbolsField; +diObjCProperty: + '!DIObjCProperty' '(' ( + diObjCPropertyField (',' diObjCPropertyField)* + )? ')'; +diObjCPropertyField: + nameField + | fileField + | lineField + | setterField + | getterField + | attributesField + | typeField; +diStringType: + '!DIStringType' '(' ( + diStringTypeField (',' diStringTypeField)* + )? ')'; +diStringTypeField: + tagField + | nameField + | stringLengthField + | stringLengthExpressionField + | stringLocationExpressionField + | sizeField + | alignField + | encodingField; +diSubprogram: + '!DISubprogram' '(' ( + diSubprogramField (',' diSubprogramField)* + )? ')'; +diSubprogramField: + scopeField + | nameField + | linkageNameField + | fileField + | lineField + | typeField + | isLocalField + | isDefinitionField + | scopeLineField + | containingTypeField + | virtualityField + | virtualIndexField + | thisAdjustmentField + | flagsField + | spFlagsField + | isOptimizedField + | unitField + | templateParamsField + | declarationField + | retainedNodesField + | thrownTypesField + | annotationsField + | targetFuncNameField; +diSubrange: + '!DISubrange' '(' (diSubrangeField (',' diSubrangeField)*)? ')'; +diSubrangeField: + countField + | lowerBoundField + | upperBoundField + | strideField; +diSubroutineType: + '!DISubroutineType' '(' ( + diSubroutineTypeField (',' diSubroutineTypeField)* + )? ')'; +diTemplateTypeParameter: + '!DITemplateTypeParameter' '(' ( + diTemplateTypeParameterField ( + ',' diTemplateTypeParameterField + )* + )? ')'; +diTemplateValueParameter: + '!DITemplateValueParameter' '(' ( + diTemplateValueParameterField ( + ',' diTemplateValueParameterField + ) + )? ')'; +genericDiNode: + '!GenericDINode' '(' ( + genericDINodeField (',' genericDINodeField)* + )? ')'; + +diTemplateTypeParameterField: + nameField + | typeField + | defaultedField; +diCompileUnitField: + languageField + | fileField + | producerField + | isOptimizedField + | flagsStringField + | runtimeVersionField + | splitDebugFilenameField + | emissionKindField + | enumsField + | retainedTypesField + | globalsField + | importsField + | macrosField + | dwoIdField + | splitDebugInliningField + | debugInfoForProfilingField + | nameTableKindField + | rangesBaseAddressField + | sysrootField + | sdkField; +diCommonBlockField: + scopeField + | declarationField + | nameField + | fileField + | lineField; +diBasicTypeField: + tagField + | nameField + | sizeField + | alignField + | encodingField + | flagsField; +genericDINodeField: tagField | headerField | operandsField; +tagField: 'tag:' DwarfTag; +headerField: 'header:' StringLit; +operandsField: 'operands:' '{' (mdField (',' mdField)*)? '}'; +diTemplateValueParameterField: + tagField + | nameField + | typeField + | defaultedField + | valueField; +nameField: 'name:' StringLit; +typeField: 'type:' mdField; +defaultedField: 'defaulted:' boolConst; +valueField: 'value:' mdField; +mdField: nullConst | metadata; +diSubroutineTypeField: flagsField | ccField | typesField; +flagsField: 'flags:' diFlags; +diFlags: DiFlag ('|' DiFlag)*; +ccField: 'cc:' DwarfCc | IntLit; +alignField: 'align:' IntLit; +allocatedField: 'allocated:' mdField; +annotationsField: 'annotations:' mdField; +argField: 'arg:' IntLit; +associatedField: 'associated:' mdField; +attributesField: 'attributes:' IntLit; +baseTypeField: 'baseType:' mdField; +checksumField: 'checksum:' StringLit; +checksumkindField: 'checksumkind:' ChecksumKind; +columnField: 'column:' IntLit; +configMacrosField: 'configMacros:' StringLit; +containingTypeField: 'containingType:' mdField; +countField: 'count:' mdFieldOrInt; +debugInfoForProfilingField: 'debugInfoForProfiling:' boolConst; +declarationField: 'declaration:' mdField; +directoryField: 'directory:' StringLit; +discriminatorField: 'discriminator:' mdField; +dataLocationField: 'dataLocation:' mdField; +discriminatorIntField: 'discriminator:' IntLit; +dwarfAddressSpaceField: 'dwarfAddressSpace:' IntLit; +dwoIdField: 'dwoId:' IntLit; +elementsField: 'elements:' mdField; +emissionKindField: + 'emissionKind:' emissionKind = ( + 'DebugDirectivesOnly' + | 'FullDebug' + | 'LineTablesOnly' + | 'NoDebug' + ); +encodingField: 'encoding:' (IntLit | DwarfAttEncoding); +entityField: 'entity:' mdField; +enumsField: 'enums:' mdField; +exportSymbolsField: 'exportSymbols:' boolConst; +exprField: 'expr:' mdField; +extraDataField: 'extraData:' mdField; +fileField: 'file:' mdField; +filenameField: 'filename:' StringLit; +flagsStringField: 'flags:' StringLit; +getterField: 'getter:' StringLit; +globalsField: 'globals:' mdField; +identifierField: 'identifier:' StringLit; +importsField: 'imports:' mdField; +includePathField: 'includePath:' StringLit; +inlinedAtField: 'inlinedAt:' mdField; +isDeclField: 'isDecl:' boolConst; +isDefinitionField: 'isDefinition:' boolConst; +isImplicitCodeField: 'isImplicitCode:' boolConst; +isLocalField: 'isLocal:' boolConst; +isOptimizedField: 'isOptimized:' boolConst; +isUnsignedField: 'isUnsigned:' boolConst; +apiNotesField: 'apinotes:' StringLit; +languageField: 'language:' DwarfLang; +lineField: 'line:' IntLit; +linkageNameField: 'linkageName:' StringLit; +lowerBoundField: 'lowerBound:' mdFieldOrInt; +macrosField: 'macros:' mdField; +nameTableKindField: + 'nameTableKind:' nameTableKind = ('GNU' | 'None' | 'Default'); +nodesField: 'nodes:' mdField; +offsetField: + // TODO: rename OffsetField= attribute to Offset= when inspirer/textmapper#13 is resolved + 'offset:' IntLit; +producerField: 'producer:' StringLit; +rangesBaseAddressField: 'rangesBaseAddress:' boolConst; +rankField: 'rank:' mdFieldOrInt; +retainedNodesField: 'retainedNodes:' mdField; +retainedTypesField: 'retainedTypes:' mdField; +runtimeLangField: 'runtimeLang:' DwarfLang; +runtimeVersionField: 'runtimeVersion:' IntLit; +scopeField: 'scope:' mdField; +scopeLineField: 'scopeLine:' IntLit; +sdkField: 'sdk:' StringLit; +setterField: 'setter:' StringLit; +sizeField: 'size:' IntLit; +sourceField: 'source:' StringLit; +spFlagsField: 'spFlags:' (diSPFlag ('|' diSPFlag)*); +splitDebugFilenameField: 'splitDebugFilename:' StringLit; +splitDebugInliningField: 'splitDebugInlining:' boolConst; +strideField: 'stride:' mdFieldOrInt; +stringLengthField: 'stringLength:' mdField; +stringLengthExpressionField: 'stringLengthExpression:' mdField; +stringLocationExpressionField: + 'stringLocationExpression:' mdField; +sysrootField: 'sysroot:' StringLit; +targetFuncNameField: 'targetFuncName:' StringLit; +templateParamsField: 'templateParams:' mdField; +thisAdjustmentField: 'thisAdjustment:' IntLit; +thrownTypesField: 'thrownTypes:' mdField; +typeMacinfoField: 'type:' DwarfMacinfo; +typesField: 'types:' mdField; +unitField: 'unit:' mdField; +upperBoundField: 'upperBound:' mdFieldOrInt; +valueIntField: 'value:' IntLit; +valueStringField: 'value:' StringLit; +varField: 'var:' mdField; +virtualIndexField: 'virtualIndex:' IntLit; +virtualityField: 'virtuality:' DwarfVirtuality; +vtableHolderField: 'vtableHolder:' mdField; + +fragment AsciiLetter: [A-Za-z]; +fragment Letter: AsciiLetter | [-$._]; +fragment EscapeLetter: Letter | '\\'; +fragment DecimalDigit: [0-9]; +fragment HexDigit: [A-Fa-f] | DecimalDigit; +fragment Decimals: DecimalDigit+; +fragment Name: Letter (Letter | DecimalDigit)*; +fragment EscapeName: + EscapeLetter (EscapeLetter | DecimalDigit)*; +fragment Id: Decimals; +fragment IntHexLit: [us] '0x' HexDigit+; +// 浮点型常量 +fragment Sign: [+-]; +fragment FracLit: Sign? Decimals '.' DecimalDigit*; +fragment SciLit: FracLit [eE] Sign? Decimals; +/* + HexFPConstant 0x{_hex_digit}+ // 16 hex digits + HexFP80Constant 0xK{_hex_digit}+ // 20 hex digits + HexFP128Constant 0xL{_hex_digit}+ // 32 hex digits + HexPPC128Constant 0xM{_hex_digit}+ // 32 hex + digits + HexHalfConstant 0xH{_hex_digit}+ // 4 hex digits + HexBFloatConstant 0xR{_hex_digit}+ // 4 + hex digits + */ +fragment FloatHexLit: '0x' [KLMHR]? HexDigit+; +fragment GlobalName: '@' (Name | QuotedString); +fragment GlobalId: '@' Id; +fragment LocalName: '%' (Name | QuotedString); +fragment LocalId: '%' Id; +fragment QuotedString: '"' (~["\r\n])* '"'; +Comment: ';' .*? '\r'? '\n' -> channel(HIDDEN); +WhiteSpace: [ \t\n\r]+ -> skip; +IntLit: '-'? DecimalDigit+ | IntHexLit; +FloatLit: FracLit | SciLit | FloatHexLit; +StringLit: QuotedString; +GlobalIdent: GlobalName | GlobalId; +LocalIdent: LocalName | LocalId; +LabelIdent: (Letter | DecimalDigit)+ ':' | QuotedString ':'; +AttrGroupId: '#' Id; +ComdatName: '$' (Name | QuotedString); +MetadataName: '!' EscapeName; +MetadataId: '!' Id; +IntType: 'i' DecimalDigit+; +DwarfTag: 'DW_TAG_' (AsciiLetter | DecimalDigit | '_')*; +DwarfAttEncoding: 'DW_ATE_' (AsciiLetter | DecimalDigit | '_')*; +DiFlag: 'DIFlag' (AsciiLetter | DecimalDigit | '_')*; +DispFlag: 'DISPFlag' (AsciiLetter | DecimalDigit | '_')*; +DwarfLang: 'DW_LANG_' (AsciiLetter | DecimalDigit | '_')*; +DwarfCc: 'DW_CC_' (AsciiLetter | DecimalDigit | '_')*; +ChecksumKind: 'CSK_' (AsciiLetter | DecimalDigit | '_')*; +DwarfVirtuality: + 'DW_VIRTUALITY_' (AsciiLetter | DecimalDigit | '_')*; +DwarfMacinfo: 'DW_MACINFO_' (AsciiLetter | DecimalDigit | '_')*; +DwarfOp: 'DW_OP_' (AsciiLetter | DecimalDigit | '_')*; \ No newline at end of file diff --git a/languages/llvmir/src/main/java/de/jplag/llvmir/JPlagLLVMListener.java b/languages/llvmir/src/main/java/de/jplag/llvmir/JPlagLLVMListener.java new file mode 100644 index 000000000..469d1656b --- /dev/null +++ b/languages/llvmir/src/main/java/de/jplag/llvmir/JPlagLLVMListener.java @@ -0,0 +1,3219 @@ +package de.jplag.llvmir; + +import org.antlr.v4.runtime.Token; + +import de.jplag.kotlin.grammar.LLVMIRParser; + +public class JPlagLLVMListener extends LLVMParserBaseListener { + + private final LLVMParserAdapter parserAdapter; + + public JPlagLLVMListener(LLVMParserAdapter parserAdapter) { + this.parserAdapter = parserAdapter; + } + + /** + * Passes a token of the given tokenType to the parserAdapter, representing the grammar's token given by token. + * @param tokenType the custom token type that occurred. + * @param token the corresponding grammar's token + */ + private void transformToken(LLVMTokenType tokenType, Token token) { + parserAdapter.addToken(tokenType, token.getLine(), token.getCharPositionInLine() + 1, token.getText().length()); + } + + /** + * Passes a token of the given tokenType to the parserAdapter, representing the current grammatical context given by + * start and end. + * @param tokenType the custom token type that occurred. + * @param start the first Token of the context + * @param end the last Token of the context + */ + private void transformToken(LLVMTokenType tokenType, Token start, Token end) { + parserAdapter.addToken(tokenType, start.getLine(), start.getCharPositionInLine() + 1, end.getStopIndex() - start.getStartIndex() + 1); + } + + @Override + public void enterCompilationUnit(LLVMIRParser.CompilationUnitContext ctx) { + } + + @Override + public void exitCompilationUnit(LLVMIRParser.CompilationUnitContext ctx) { + } + + @Override + public void enterTargetDef(LLVMIRParser.TargetDefContext ctx) { + } + + @Override + public void exitTargetDef(LLVMIRParser.TargetDefContext ctx) { + } + + @Override + public void enterSourceFilename(LLVMIRParser.SourceFilenameContext ctx) { + } + + @Override + public void exitSourceFilename(LLVMIRParser.SourceFilenameContext ctx) { + } + + @Override + public void enterTargetDataLayout(LLVMIRParser.TargetDataLayoutContext ctx) { + } + + @Override + public void exitTargetDataLayout(LLVMIRParser.TargetDataLayoutContext ctx) { + } + + @Override + public void enterTargetTriple(LLVMIRParser.TargetTripleContext ctx) { + } + + @Override + public void exitTargetTriple(LLVMIRParser.TargetTripleContext ctx) { + } + + @Override + public void enterTopLevelEntity(LLVMIRParser.TopLevelEntityContext ctx) { + } + + @Override + public void exitTopLevelEntity(LLVMIRParser.TopLevelEntityContext ctx) { + } + + @Override + public void enterModuleAsm(LLVMIRParser.ModuleAsmContext ctx) { + } + + @Override + public void exitModuleAsm(LLVMIRParser.ModuleAsmContext ctx) { + } + + @Override + public void enterTypeDef(LLVMIRParser.TypeDefContext ctx) { + } + + @Override + public void exitTypeDef(LLVMIRParser.TypeDefContext ctx) { + } + + @Override + public void enterComdatDef(LLVMIRParser.ComdatDefContext ctx) { + } + + @Override + public void exitComdatDef(LLVMIRParser.ComdatDefContext ctx) { + } + + @Override + public void enterGlobalDecl(LLVMIRParser.GlobalDeclContext ctx) { + } + + @Override + public void exitGlobalDecl(LLVMIRParser.GlobalDeclContext ctx) { + } + + @Override + public void enterGlobalDef(LLVMIRParser.GlobalDefContext ctx) { + } + + @Override + public void exitGlobalDef(LLVMIRParser.GlobalDefContext ctx) { + } + + @Override + public void enterIndirectSymbolDef(LLVMIRParser.IndirectSymbolDefContext ctx) { + } + + @Override + public void exitIndirectSymbolDef(LLVMIRParser.IndirectSymbolDefContext ctx) { + } + + @Override + public void enterFuncDecl(LLVMIRParser.FuncDeclContext ctx) { + } + + @Override + public void exitFuncDecl(LLVMIRParser.FuncDeclContext ctx) { + } + + @Override + public void enterFuncDef(LLVMIRParser.FuncDefContext ctx) { + } + + @Override + public void exitFuncDef(LLVMIRParser.FuncDefContext ctx) { + } + + @Override + public void enterAttrGroupDef(LLVMIRParser.AttrGroupDefContext ctx) { + } + + @Override + public void exitAttrGroupDef(LLVMIRParser.AttrGroupDefContext ctx) { + } + + @Override + public void enterNamedMetadataDef(LLVMIRParser.NamedMetadataDefContext ctx) { + } + + @Override + public void exitNamedMetadataDef(LLVMIRParser.NamedMetadataDefContext ctx) { + } + + @Override + public void enterMetadataDef(LLVMIRParser.MetadataDefContext ctx) { + } + + @Override + public void exitMetadataDef(LLVMIRParser.MetadataDefContext ctx) { + } + + @Override + public void enterUseListOrder(LLVMIRParser.UseListOrderContext ctx) { + } + + @Override + public void exitUseListOrder(LLVMIRParser.UseListOrderContext ctx) { + } + + @Override + public void enterUseListOrderBB(LLVMIRParser.UseListOrderBBContext ctx) { + } + + @Override + public void exitUseListOrderBB(LLVMIRParser.UseListOrderBBContext ctx) { + } + + @Override + public void enterFuncHeader(LLVMIRParser.FuncHeaderContext ctx) { + } + + @Override + public void exitFuncHeader(LLVMIRParser.FuncHeaderContext ctx) { + } + + @Override + public void enterIndirectSymbol(LLVMIRParser.IndirectSymbolContext ctx) { + } + + @Override + public void exitIndirectSymbol(LLVMIRParser.IndirectSymbolContext ctx) { + } + + @Override + public void enterCallingConv(LLVMIRParser.CallingConvContext ctx) { + } + + @Override + public void exitCallingConv(LLVMIRParser.CallingConvContext ctx) { + } + + @Override + public void enterCallingConvInt(LLVMIRParser.CallingConvIntContext ctx) { + } + + @Override + public void exitCallingConvInt(LLVMIRParser.CallingConvIntContext ctx) { + } + + @Override + public void enterFuncHdrField(LLVMIRParser.FuncHdrFieldContext ctx) { + } + + @Override + public void exitFuncHdrField(LLVMIRParser.FuncHdrFieldContext ctx) { + } + + @Override + public void enterGc(LLVMIRParser.GcContext ctx) { + } + + @Override + public void exitGc(LLVMIRParser.GcContext ctx) { + } + + @Override + public void enterPrefix(LLVMIRParser.PrefixContext ctx) { + } + + @Override + public void exitPrefix(LLVMIRParser.PrefixContext ctx) { + } + + @Override + public void enterPrologue(LLVMIRParser.PrologueContext ctx) { + } + + @Override + public void exitPrologue(LLVMIRParser.PrologueContext ctx) { + } + + @Override + public void enterPersonality(LLVMIRParser.PersonalityContext ctx) { + } + + @Override + public void exitPersonality(LLVMIRParser.PersonalityContext ctx) { + } + + @Override + public void enterReturnAttribute(LLVMIRParser.ReturnAttributeContext ctx) { + } + + @Override + public void exitReturnAttribute(LLVMIRParser.ReturnAttributeContext ctx) { + } + + @Override + public void enterFuncBody(LLVMIRParser.FuncBodyContext ctx) { + } + + @Override + public void exitFuncBody(LLVMIRParser.FuncBodyContext ctx) { + } + + @Override + public void enterBasicBlock(LLVMIRParser.BasicBlockContext ctx) { + } + + @Override + public void exitBasicBlock(LLVMIRParser.BasicBlockContext ctx) { + } + + @Override + public void enterInstruction(LLVMIRParser.InstructionContext ctx) { + } + + @Override + public void exitInstruction(LLVMIRParser.InstructionContext ctx) { + } + + @Override + public void enterTerminator(LLVMIRParser.TerminatorContext ctx) { + } + + @Override + public void exitTerminator(LLVMIRParser.TerminatorContext ctx) { + } + + @Override + public void enterLocalDefTerm(LLVMIRParser.LocalDefTermContext ctx) { + } + + @Override + public void exitLocalDefTerm(LLVMIRParser.LocalDefTermContext ctx) { + } + + @Override + public void enterValueTerminator(LLVMIRParser.ValueTerminatorContext ctx) { + } + + @Override + public void exitValueTerminator(LLVMIRParser.ValueTerminatorContext ctx) { + } + + @Override + public void enterRetTerm(LLVMIRParser.RetTermContext ctx) { + } + + @Override + public void exitRetTerm(LLVMIRParser.RetTermContext ctx) { + } + + @Override + public void enterBrTerm(LLVMIRParser.BrTermContext ctx) { + } + + @Override + public void exitBrTerm(LLVMIRParser.BrTermContext ctx) { + } + + @Override + public void enterCondBrTerm(LLVMIRParser.CondBrTermContext ctx) { + } + + @Override + public void exitCondBrTerm(LLVMIRParser.CondBrTermContext ctx) { + } + + @Override + public void enterSwitchTerm(LLVMIRParser.SwitchTermContext ctx) { + } + + @Override + public void exitSwitchTerm(LLVMIRParser.SwitchTermContext ctx) { + } + + @Override + public void enterIndirectBrTerm(LLVMIRParser.IndirectBrTermContext ctx) { + } + + @Override + public void exitIndirectBrTerm(LLVMIRParser.IndirectBrTermContext ctx) { + } + + @Override + public void enterResumeTerm(LLVMIRParser.ResumeTermContext ctx) { + } + + @Override + public void exitResumeTerm(LLVMIRParser.ResumeTermContext ctx) { + } + + @Override + public void enterCatchRetTerm(LLVMIRParser.CatchRetTermContext ctx) { + } + + @Override + public void exitCatchRetTerm(LLVMIRParser.CatchRetTermContext ctx) { + } + + @Override + public void enterCleanupRetTerm(LLVMIRParser.CleanupRetTermContext ctx) { + } + + @Override + public void exitCleanupRetTerm(LLVMIRParser.CleanupRetTermContext ctx) { + } + + @Override + public void enterUnreachableTerm(LLVMIRParser.UnreachableTermContext ctx) { + } + + @Override + public void exitUnreachableTerm(LLVMIRParser.UnreachableTermContext ctx) { + } + + @Override + public void enterInvokeTerm(LLVMIRParser.InvokeTermContext ctx) { + } + + @Override + public void exitInvokeTerm(LLVMIRParser.InvokeTermContext ctx) { + } + + @Override + public void enterCallBrTerm(LLVMIRParser.CallBrTermContext ctx) { + } + + @Override + public void exitCallBrTerm(LLVMIRParser.CallBrTermContext ctx) { + } + + @Override + public void enterCatchSwitchTerm(LLVMIRParser.CatchSwitchTermContext ctx) { + } + + @Override + public void exitCatchSwitchTerm(LLVMIRParser.CatchSwitchTermContext ctx) { + } + + @Override + public void enterLabel(LLVMIRParser.LabelContext ctx) { + } + + @Override + public void exitLabel(LLVMIRParser.LabelContext ctx) { + } + + @Override + public void enterCase(LLVMIRParser.CaseContext ctx) { + } + + @Override + public void exitCase(LLVMIRParser.CaseContext ctx) { + } + + @Override + public void enterUnwindTarget(LLVMIRParser.UnwindTargetContext ctx) { + } + + @Override + public void exitUnwindTarget(LLVMIRParser.UnwindTargetContext ctx) { + } + + @Override + public void enterHandlers(LLVMIRParser.HandlersContext ctx) { + } + + @Override + public void exitHandlers(LLVMIRParser.HandlersContext ctx) { + } + + @Override + public void enterMetadataNode(LLVMIRParser.MetadataNodeContext ctx) { + } + + @Override + public void exitMetadataNode(LLVMIRParser.MetadataNodeContext ctx) { + } + + @Override + public void enterDiExpression(LLVMIRParser.DiExpressionContext ctx) { + } + + @Override + public void exitDiExpression(LLVMIRParser.DiExpressionContext ctx) { + } + + @Override + public void enterDiExpressionField(LLVMIRParser.DiExpressionFieldContext ctx) { + } + + @Override + public void exitDiExpressionField(LLVMIRParser.DiExpressionFieldContext ctx) { + } + + @Override + public void enterGlobalField(LLVMIRParser.GlobalFieldContext ctx) { + } + + @Override + public void exitGlobalField(LLVMIRParser.GlobalFieldContext ctx) { + } + + @Override + public void enterSection(LLVMIRParser.SectionContext ctx) { + } + + @Override + public void exitSection(LLVMIRParser.SectionContext ctx) { + } + + @Override + public void enterComdat(LLVMIRParser.ComdatContext ctx) { + } + + @Override + public void exitComdat(LLVMIRParser.ComdatContext ctx) { + } + + @Override + public void enterPartition(LLVMIRParser.PartitionContext ctx) { + } + + @Override + public void exitPartition(LLVMIRParser.PartitionContext ctx) { + } + + @Override + public void enterConstant(LLVMIRParser.ConstantContext ctx) { + } + + @Override + public void exitConstant(LLVMIRParser.ConstantContext ctx) { + } + + @Override + public void enterBoolConst(LLVMIRParser.BoolConstContext ctx) { + } + + @Override + public void exitBoolConst(LLVMIRParser.BoolConstContext ctx) { + } + + @Override + public void enterIntConst(LLVMIRParser.IntConstContext ctx) { + } + + @Override + public void exitIntConst(LLVMIRParser.IntConstContext ctx) { + } + + @Override + public void enterFloatConst(LLVMIRParser.FloatConstContext ctx) { + } + + @Override + public void exitFloatConst(LLVMIRParser.FloatConstContext ctx) { + } + + @Override + public void enterNullConst(LLVMIRParser.NullConstContext ctx) { + } + + @Override + public void exitNullConst(LLVMIRParser.NullConstContext ctx) { + } + + @Override + public void enterNoneConst(LLVMIRParser.NoneConstContext ctx) { + } + + @Override + public void exitNoneConst(LLVMIRParser.NoneConstContext ctx) { + } + + @Override + public void enterStructConst(LLVMIRParser.StructConstContext ctx) { + } + + @Override + public void exitStructConst(LLVMIRParser.StructConstContext ctx) { + } + + @Override + public void enterArrayConst(LLVMIRParser.ArrayConstContext ctx) { + } + + @Override + public void exitArrayConst(LLVMIRParser.ArrayConstContext ctx) { + } + + @Override + public void enterVectorConst(LLVMIRParser.VectorConstContext ctx) { + } + + @Override + public void exitVectorConst(LLVMIRParser.VectorConstContext ctx) { + } + + @Override + public void enterZeroInitializerConst(LLVMIRParser.ZeroInitializerConstContext ctx) { + } + + @Override + public void exitZeroInitializerConst(LLVMIRParser.ZeroInitializerConstContext ctx) { + } + + @Override + public void enterUndefConst(LLVMIRParser.UndefConstContext ctx) { + } + + @Override + public void exitUndefConst(LLVMIRParser.UndefConstContext ctx) { + } + + @Override + public void enterPoisonConst(LLVMIRParser.PoisonConstContext ctx) { + } + + @Override + public void exitPoisonConst(LLVMIRParser.PoisonConstContext ctx) { + } + + @Override + public void enterBlockAddressConst(LLVMIRParser.BlockAddressConstContext ctx) { + } + + @Override + public void exitBlockAddressConst(LLVMIRParser.BlockAddressConstContext ctx) { + } + + @Override + public void enterDsoLocalEquivalentConst(LLVMIRParser.DsoLocalEquivalentConstContext ctx) { + } + + @Override + public void exitDsoLocalEquivalentConst(LLVMIRParser.DsoLocalEquivalentConstContext ctx) { + } + + @Override + public void enterNoCFIConst(LLVMIRParser.NoCFIConstContext ctx) { + } + + @Override + public void exitNoCFIConst(LLVMIRParser.NoCFIConstContext ctx) { + } + + @Override + public void enterConstantExpr(LLVMIRParser.ConstantExprContext ctx) { + } + + @Override + public void exitConstantExpr(LLVMIRParser.ConstantExprContext ctx) { + } + + @Override + public void enterTypeConst(LLVMIRParser.TypeConstContext ctx) { + } + + @Override + public void exitTypeConst(LLVMIRParser.TypeConstContext ctx) { + } + + @Override + public void enterMetadataAttachment(LLVMIRParser.MetadataAttachmentContext ctx) { + } + + @Override + public void exitMetadataAttachment(LLVMIRParser.MetadataAttachmentContext ctx) { + } + + @Override + public void enterMdNode(LLVMIRParser.MdNodeContext ctx) { + } + + @Override + public void exitMdNode(LLVMIRParser.MdNodeContext ctx) { + } + + @Override + public void enterMdTuple(LLVMIRParser.MdTupleContext ctx) { + } + + @Override + public void exitMdTuple(LLVMIRParser.MdTupleContext ctx) { + } + + @Override + public void enterMetadata(LLVMIRParser.MetadataContext ctx) { + } + + @Override + public void exitMetadata(LLVMIRParser.MetadataContext ctx) { + } + + @Override + public void enterDiArgList(LLVMIRParser.DiArgListContext ctx) { + } + + @Override + public void exitDiArgList(LLVMIRParser.DiArgListContext ctx) { + } + + @Override + public void enterTypeValue(LLVMIRParser.TypeValueContext ctx) { + } + + @Override + public void exitTypeValue(LLVMIRParser.TypeValueContext ctx) { + } + + @Override + public void enterValue(LLVMIRParser.ValueContext ctx) { + } + + @Override + public void exitValue(LLVMIRParser.ValueContext ctx) { + } + + @Override + public void enterInlineAsm(LLVMIRParser.InlineAsmContext ctx) { + } + + @Override + public void exitInlineAsm(LLVMIRParser.InlineAsmContext ctx) { + } + + @Override + public void enterMdString(LLVMIRParser.MdStringContext ctx) { + } + + @Override + public void exitMdString(LLVMIRParser.MdStringContext ctx) { + } + + @Override + public void enterMdFieldOrInt(LLVMIRParser.MdFieldOrIntContext ctx) { + } + + @Override + public void exitMdFieldOrInt(LLVMIRParser.MdFieldOrIntContext ctx) { + } + + @Override + public void enterDiSPFlag(LLVMIRParser.DiSPFlagContext ctx) { + } + + @Override + public void exitDiSPFlag(LLVMIRParser.DiSPFlagContext ctx) { + } + + @Override + public void enterFuncAttribute(LLVMIRParser.FuncAttributeContext ctx) { + } + + @Override + public void exitFuncAttribute(LLVMIRParser.FuncAttributeContext ctx) { + } + + @Override + public void enterType(LLVMIRParser.TypeContext ctx) { + } + + @Override + public void exitType(LLVMIRParser.TypeContext ctx) { + } + + @Override + public void enterParams(LLVMIRParser.ParamsContext ctx) { + } + + @Override + public void exitParams(LLVMIRParser.ParamsContext ctx) { + } + + @Override + public void enterParam(LLVMIRParser.ParamContext ctx) { + } + + @Override + public void exitParam(LLVMIRParser.ParamContext ctx) { + } + + @Override + public void enterParamAttribute(LLVMIRParser.ParamAttributeContext ctx) { + } + + @Override + public void exitParamAttribute(LLVMIRParser.ParamAttributeContext ctx) { + } + + @Override + public void enterAttrString(LLVMIRParser.AttrStringContext ctx) { + } + + @Override + public void exitAttrString(LLVMIRParser.AttrStringContext ctx) { + } + + @Override + public void enterAttrPair(LLVMIRParser.AttrPairContext ctx) { + } + + @Override + public void exitAttrPair(LLVMIRParser.AttrPairContext ctx) { + } + + @Override + public void enterAlign(LLVMIRParser.AlignContext ctx) { + } + + @Override + public void exitAlign(LLVMIRParser.AlignContext ctx) { + } + + @Override + public void enterAlignPair(LLVMIRParser.AlignPairContext ctx) { + } + + @Override + public void exitAlignPair(LLVMIRParser.AlignPairContext ctx) { + } + + @Override + public void enterAlignStack(LLVMIRParser.AlignStackContext ctx) { + } + + @Override + public void exitAlignStack(LLVMIRParser.AlignStackContext ctx) { + } + + @Override + public void enterAlignStackPair(LLVMIRParser.AlignStackPairContext ctx) { + } + + @Override + public void exitAlignStackPair(LLVMIRParser.AlignStackPairContext ctx) { + } + + @Override + public void enterAllocKind(LLVMIRParser.AllocKindContext ctx) { + } + + @Override + public void exitAllocKind(LLVMIRParser.AllocKindContext ctx) { + } + + @Override + public void enterAllocSize(LLVMIRParser.AllocSizeContext ctx) { + } + + @Override + public void exitAllocSize(LLVMIRParser.AllocSizeContext ctx) { + } + + @Override + public void enterUnwindTable(LLVMIRParser.UnwindTableContext ctx) { + } + + @Override + public void exitUnwindTable(LLVMIRParser.UnwindTableContext ctx) { + } + + @Override + public void enterVectorScaleRange(LLVMIRParser.VectorScaleRangeContext ctx) { + } + + @Override + public void exitVectorScaleRange(LLVMIRParser.VectorScaleRangeContext ctx) { + } + + @Override + public void enterByRefAttr(LLVMIRParser.ByRefAttrContext ctx) { + } + + @Override + public void exitByRefAttr(LLVMIRParser.ByRefAttrContext ctx) { + } + + @Override + public void enterByval(LLVMIRParser.ByvalContext ctx) { + } + + @Override + public void exitByval(LLVMIRParser.ByvalContext ctx) { + } + + @Override + public void enterDereferenceable(LLVMIRParser.DereferenceableContext ctx) { + } + + @Override + public void exitDereferenceable(LLVMIRParser.DereferenceableContext ctx) { + } + + @Override + public void enterElementType(LLVMIRParser.ElementTypeContext ctx) { + } + + @Override + public void exitElementType(LLVMIRParser.ElementTypeContext ctx) { + } + + @Override + public void enterInAlloca(LLVMIRParser.InAllocaContext ctx) { + } + + @Override + public void exitInAlloca(LLVMIRParser.InAllocaContext ctx) { + } + + @Override + public void enterParamAttr(LLVMIRParser.ParamAttrContext ctx) { + } + + @Override + public void exitParamAttr(LLVMIRParser.ParamAttrContext ctx) { + } + + @Override + public void enterPreallocated(LLVMIRParser.PreallocatedContext ctx) { + } + + @Override + public void exitPreallocated(LLVMIRParser.PreallocatedContext ctx) { + } + + @Override + public void enterStructRetAttr(LLVMIRParser.StructRetAttrContext ctx) { + } + + @Override + public void exitStructRetAttr(LLVMIRParser.StructRetAttrContext ctx) { + } + + @Override + public void enterFirstClassType(LLVMIRParser.FirstClassTypeContext ctx) { + } + + @Override + public void exitFirstClassType(LLVMIRParser.FirstClassTypeContext ctx) { + } + + @Override + public void enterConcreteType(LLVMIRParser.ConcreteTypeContext ctx) { + } + + @Override + public void exitConcreteType(LLVMIRParser.ConcreteTypeContext ctx) { + } + + @Override + public void enterIntType(LLVMIRParser.IntTypeContext ctx) { + } + + @Override + public void exitIntType(LLVMIRParser.IntTypeContext ctx) { + } + + @Override + public void enterFloatType(LLVMIRParser.FloatTypeContext ctx) { + } + + @Override + public void exitFloatType(LLVMIRParser.FloatTypeContext ctx) { + } + + @Override + public void enterPointerType(LLVMIRParser.PointerTypeContext ctx) { + } + + @Override + public void exitPointerType(LLVMIRParser.PointerTypeContext ctx) { + } + + @Override + public void enterVectorType(LLVMIRParser.VectorTypeContext ctx) { + } + + @Override + public void exitVectorType(LLVMIRParser.VectorTypeContext ctx) { + } + + @Override + public void enterLabelType(LLVMIRParser.LabelTypeContext ctx) { + } + + @Override + public void exitLabelType(LLVMIRParser.LabelTypeContext ctx) { + } + + @Override + public void enterArrayType(LLVMIRParser.ArrayTypeContext ctx) { + } + + @Override + public void exitArrayType(LLVMIRParser.ArrayTypeContext ctx) { + } + + @Override + public void enterStructType(LLVMIRParser.StructTypeContext ctx) { + } + + @Override + public void exitStructType(LLVMIRParser.StructTypeContext ctx) { + } + + @Override + public void enterNamedType(LLVMIRParser.NamedTypeContext ctx) { + } + + @Override + public void exitNamedType(LLVMIRParser.NamedTypeContext ctx) { + } + + @Override + public void enterMmxType(LLVMIRParser.MmxTypeContext ctx) { + } + + @Override + public void exitMmxType(LLVMIRParser.MmxTypeContext ctx) { + } + + @Override + public void enterTokenType(LLVMIRParser.TokenTypeContext ctx) { + } + + @Override + public void exitTokenType(LLVMIRParser.TokenTypeContext ctx) { + } + + @Override + public void enterOpaquePointerType(LLVMIRParser.OpaquePointerTypeContext ctx) { + } + + @Override + public void exitOpaquePointerType(LLVMIRParser.OpaquePointerTypeContext ctx) { + } + + @Override + public void enterAddrSpace(LLVMIRParser.AddrSpaceContext ctx) { + } + + @Override + public void exitAddrSpace(LLVMIRParser.AddrSpaceContext ctx) { + } + + @Override + public void enterThreadLocal(LLVMIRParser.ThreadLocalContext ctx) { + } + + @Override + public void exitThreadLocal(LLVMIRParser.ThreadLocalContext ctx) { + } + + @Override + public void enterMetadataType(LLVMIRParser.MetadataTypeContext ctx) { + } + + @Override + public void exitMetadataType(LLVMIRParser.MetadataTypeContext ctx) { + } + + @Override + public void enterBitCastExpr(LLVMIRParser.BitCastExprContext ctx) { + } + + @Override + public void exitBitCastExpr(LLVMIRParser.BitCastExprContext ctx) { + } + + @Override + public void enterGetElementPtrExpr(LLVMIRParser.GetElementPtrExprContext ctx) { + } + + @Override + public void exitGetElementPtrExpr(LLVMIRParser.GetElementPtrExprContext ctx) { + } + + @Override + public void enterGepIndex(LLVMIRParser.GepIndexContext ctx) { + } + + @Override + public void exitGepIndex(LLVMIRParser.GepIndexContext ctx) { + } + + @Override + public void enterAddrSpaceCastExpr(LLVMIRParser.AddrSpaceCastExprContext ctx) { + } + + @Override + public void exitAddrSpaceCastExpr(LLVMIRParser.AddrSpaceCastExprContext ctx) { + } + + @Override + public void enterIntToPtrExpr(LLVMIRParser.IntToPtrExprContext ctx) { + } + + @Override + public void exitIntToPtrExpr(LLVMIRParser.IntToPtrExprContext ctx) { + } + + @Override + public void enterICmpExpr(LLVMIRParser.ICmpExprContext ctx) { + } + + @Override + public void exitICmpExpr(LLVMIRParser.ICmpExprContext ctx) { + } + + @Override + public void enterFCmpExpr(LLVMIRParser.FCmpExprContext ctx) { + } + + @Override + public void exitFCmpExpr(LLVMIRParser.FCmpExprContext ctx) { + } + + @Override + public void enterSelectExpr(LLVMIRParser.SelectExprContext ctx) { + } + + @Override + public void exitSelectExpr(LLVMIRParser.SelectExprContext ctx) { + } + + @Override + public void enterTruncExpr(LLVMIRParser.TruncExprContext ctx) { + } + + @Override + public void exitTruncExpr(LLVMIRParser.TruncExprContext ctx) { + } + + @Override + public void enterZExtExpr(LLVMIRParser.ZExtExprContext ctx) { + } + + @Override + public void exitZExtExpr(LLVMIRParser.ZExtExprContext ctx) { + } + + @Override + public void enterSExtExpr(LLVMIRParser.SExtExprContext ctx) { + } + + @Override + public void exitSExtExpr(LLVMIRParser.SExtExprContext ctx) { + } + + @Override + public void enterFpTruncExpr(LLVMIRParser.FpTruncExprContext ctx) { + } + + @Override + public void exitFpTruncExpr(LLVMIRParser.FpTruncExprContext ctx) { + } + + @Override + public void enterFpExtExpr(LLVMIRParser.FpExtExprContext ctx) { + } + + @Override + public void exitFpExtExpr(LLVMIRParser.FpExtExprContext ctx) { + } + + @Override + public void enterFpToUiExpr(LLVMIRParser.FpToUiExprContext ctx) { + } + + @Override + public void exitFpToUiExpr(LLVMIRParser.FpToUiExprContext ctx) { + } + + @Override + public void enterFpToSiExpr(LLVMIRParser.FpToSiExprContext ctx) { + } + + @Override + public void exitFpToSiExpr(LLVMIRParser.FpToSiExprContext ctx) { + } + + @Override + public void enterUiToFpExpr(LLVMIRParser.UiToFpExprContext ctx) { + } + + @Override + public void exitUiToFpExpr(LLVMIRParser.UiToFpExprContext ctx) { + } + + @Override + public void enterSiToFpExpr(LLVMIRParser.SiToFpExprContext ctx) { + } + + @Override + public void exitSiToFpExpr(LLVMIRParser.SiToFpExprContext ctx) { + } + + @Override + public void enterPtrToIntExpr(LLVMIRParser.PtrToIntExprContext ctx) { + } + + @Override + public void exitPtrToIntExpr(LLVMIRParser.PtrToIntExprContext ctx) { + } + + @Override + public void enterExtractElementExpr(LLVMIRParser.ExtractElementExprContext ctx) { + } + + @Override + public void exitExtractElementExpr(LLVMIRParser.ExtractElementExprContext ctx) { + } + + @Override + public void enterInsertElementExpr(LLVMIRParser.InsertElementExprContext ctx) { + } + + @Override + public void exitInsertElementExpr(LLVMIRParser.InsertElementExprContext ctx) { + } + + @Override + public void enterShuffleVectorExpr(LLVMIRParser.ShuffleVectorExprContext ctx) { + } + + @Override + public void exitShuffleVectorExpr(LLVMIRParser.ShuffleVectorExprContext ctx) { + } + + @Override + public void enterShlExpr(LLVMIRParser.ShlExprContext ctx) { + } + + @Override + public void exitShlExpr(LLVMIRParser.ShlExprContext ctx) { + } + + @Override + public void enterLShrExpr(LLVMIRParser.LShrExprContext ctx) { + } + + @Override + public void exitLShrExpr(LLVMIRParser.LShrExprContext ctx) { + } + + @Override + public void enterAShrExpr(LLVMIRParser.AShrExprContext ctx) { + } + + @Override + public void exitAShrExpr(LLVMIRParser.AShrExprContext ctx) { + } + + @Override + public void enterAndExpr(LLVMIRParser.AndExprContext ctx) { + } + + @Override + public void exitAndExpr(LLVMIRParser.AndExprContext ctx) { + } + + @Override + public void enterOrExpr(LLVMIRParser.OrExprContext ctx) { + } + + @Override + public void exitOrExpr(LLVMIRParser.OrExprContext ctx) { + } + + @Override + public void enterXorExpr(LLVMIRParser.XorExprContext ctx) { + } + + @Override + public void exitXorExpr(LLVMIRParser.XorExprContext ctx) { + } + + @Override + public void enterAddExpr(LLVMIRParser.AddExprContext ctx) { + } + + @Override + public void exitAddExpr(LLVMIRParser.AddExprContext ctx) { + } + + @Override + public void enterSubExpr(LLVMIRParser.SubExprContext ctx) { + } + + @Override + public void exitSubExpr(LLVMIRParser.SubExprContext ctx) { + } + + @Override + public void enterMulExpr(LLVMIRParser.MulExprContext ctx) { + } + + @Override + public void exitMulExpr(LLVMIRParser.MulExprContext ctx) { + } + + @Override + public void enterFNegExpr(LLVMIRParser.FNegExprContext ctx) { + } + + @Override + public void exitFNegExpr(LLVMIRParser.FNegExprContext ctx) { + } + + @Override + public void enterLocalDefInst(LLVMIRParser.LocalDefInstContext ctx) { + } + + @Override + public void exitLocalDefInst(LLVMIRParser.LocalDefInstContext ctx) { + } + + @Override + public void enterValueInstruction(LLVMIRParser.ValueInstructionContext ctx) { + } + + @Override + public void exitValueInstruction(LLVMIRParser.ValueInstructionContext ctx) { + } + + @Override + public void enterStoreInst(LLVMIRParser.StoreInstContext ctx) { + } + + @Override + public void exitStoreInst(LLVMIRParser.StoreInstContext ctx) { + } + + @Override + public void enterSyncScope(LLVMIRParser.SyncScopeContext ctx) { + } + + @Override + public void exitSyncScope(LLVMIRParser.SyncScopeContext ctx) { + } + + @Override + public void enterFenceInst(LLVMIRParser.FenceInstContext ctx) { + } + + @Override + public void exitFenceInst(LLVMIRParser.FenceInstContext ctx) { + } + + @Override + public void enterFNegInst(LLVMIRParser.FNegInstContext ctx) { + } + + @Override + public void exitFNegInst(LLVMIRParser.FNegInstContext ctx) { + } + + @Override + public void enterAddInst(LLVMIRParser.AddInstContext ctx) { + } + + @Override + public void exitAddInst(LLVMIRParser.AddInstContext ctx) { + } + + @Override + public void enterFAddInst(LLVMIRParser.FAddInstContext ctx) { + } + + @Override + public void exitFAddInst(LLVMIRParser.FAddInstContext ctx) { + } + + @Override + public void enterSubInst(LLVMIRParser.SubInstContext ctx) { + } + + @Override + public void exitSubInst(LLVMIRParser.SubInstContext ctx) { + } + + @Override + public void enterFSubInst(LLVMIRParser.FSubInstContext ctx) { + } + + @Override + public void exitFSubInst(LLVMIRParser.FSubInstContext ctx) { + } + + @Override + public void enterMulInst(LLVMIRParser.MulInstContext ctx) { + } + + @Override + public void exitMulInst(LLVMIRParser.MulInstContext ctx) { + } + + @Override + public void enterFMulInst(LLVMIRParser.FMulInstContext ctx) { + } + + @Override + public void exitFMulInst(LLVMIRParser.FMulInstContext ctx) { + } + + @Override + public void enterUDivInst(LLVMIRParser.UDivInstContext ctx) { + } + + @Override + public void exitUDivInst(LLVMIRParser.UDivInstContext ctx) { + } + + @Override + public void enterSDivInst(LLVMIRParser.SDivInstContext ctx) { + } + + @Override + public void exitSDivInst(LLVMIRParser.SDivInstContext ctx) { + } + + @Override + public void enterFDivInst(LLVMIRParser.FDivInstContext ctx) { + } + + @Override + public void exitFDivInst(LLVMIRParser.FDivInstContext ctx) { + } + + @Override + public void enterURemInst(LLVMIRParser.URemInstContext ctx) { + } + + @Override + public void exitURemInst(LLVMIRParser.URemInstContext ctx) { + } + + @Override + public void enterSRemInst(LLVMIRParser.SRemInstContext ctx) { + } + + @Override + public void exitSRemInst(LLVMIRParser.SRemInstContext ctx) { + } + + @Override + public void enterFRemInst(LLVMIRParser.FRemInstContext ctx) { + } + + @Override + public void exitFRemInst(LLVMIRParser.FRemInstContext ctx) { + } + + @Override + public void enterShlInst(LLVMIRParser.ShlInstContext ctx) { + } + + @Override + public void exitShlInst(LLVMIRParser.ShlInstContext ctx) { + } + + @Override + public void enterLShrInst(LLVMIRParser.LShrInstContext ctx) { + } + + @Override + public void exitLShrInst(LLVMIRParser.LShrInstContext ctx) { + } + + @Override + public void enterAShrInst(LLVMIRParser.AShrInstContext ctx) { + } + + @Override + public void exitAShrInst(LLVMIRParser.AShrInstContext ctx) { + } + + @Override + public void enterAndInst(LLVMIRParser.AndInstContext ctx) { + } + + @Override + public void exitAndInst(LLVMIRParser.AndInstContext ctx) { + } + + @Override + public void enterOrInst(LLVMIRParser.OrInstContext ctx) { + } + + @Override + public void exitOrInst(LLVMIRParser.OrInstContext ctx) { + } + + @Override + public void enterXorInst(LLVMIRParser.XorInstContext ctx) { + } + + @Override + public void exitXorInst(LLVMIRParser.XorInstContext ctx) { + } + + @Override + public void enterExtractElementInst(LLVMIRParser.ExtractElementInstContext ctx) { + } + + @Override + public void exitExtractElementInst(LLVMIRParser.ExtractElementInstContext ctx) { + } + + @Override + public void enterInsertElementInst(LLVMIRParser.InsertElementInstContext ctx) { + } + + @Override + public void exitInsertElementInst(LLVMIRParser.InsertElementInstContext ctx) { + } + + @Override + public void enterShuffleVectorInst(LLVMIRParser.ShuffleVectorInstContext ctx) { + } + + @Override + public void exitShuffleVectorInst(LLVMIRParser.ShuffleVectorInstContext ctx) { + } + + @Override + public void enterExtractValueInst(LLVMIRParser.ExtractValueInstContext ctx) { + } + + @Override + public void exitExtractValueInst(LLVMIRParser.ExtractValueInstContext ctx) { + } + + @Override + public void enterInsertValueInst(LLVMIRParser.InsertValueInstContext ctx) { + } + + @Override + public void exitInsertValueInst(LLVMIRParser.InsertValueInstContext ctx) { + } + + @Override + public void enterAllocaInst(LLVMIRParser.AllocaInstContext ctx) { + } + + @Override + public void exitAllocaInst(LLVMIRParser.AllocaInstContext ctx) { + } + + @Override + public void enterLoadInst(LLVMIRParser.LoadInstContext ctx) { + } + + @Override + public void exitLoadInst(LLVMIRParser.LoadInstContext ctx) { + } + + @Override + public void enterCmpXchgInst(LLVMIRParser.CmpXchgInstContext ctx) { + } + + @Override + public void exitCmpXchgInst(LLVMIRParser.CmpXchgInstContext ctx) { + } + + @Override + public void enterAtomicRMWInst(LLVMIRParser.AtomicRMWInstContext ctx) { + } + + @Override + public void exitAtomicRMWInst(LLVMIRParser.AtomicRMWInstContext ctx) { + } + + @Override + public void enterGetElementPtrInst(LLVMIRParser.GetElementPtrInstContext ctx) { + } + + @Override + public void exitGetElementPtrInst(LLVMIRParser.GetElementPtrInstContext ctx) { + } + + @Override + public void enterTruncInst(LLVMIRParser.TruncInstContext ctx) { + } + + @Override + public void exitTruncInst(LLVMIRParser.TruncInstContext ctx) { + } + + @Override + public void enterZExtInst(LLVMIRParser.ZExtInstContext ctx) { + } + + @Override + public void exitZExtInst(LLVMIRParser.ZExtInstContext ctx) { + } + + @Override + public void enterSExtInst(LLVMIRParser.SExtInstContext ctx) { + } + + @Override + public void exitSExtInst(LLVMIRParser.SExtInstContext ctx) { + } + + @Override + public void enterFpTruncInst(LLVMIRParser.FpTruncInstContext ctx) { + } + + @Override + public void exitFpTruncInst(LLVMIRParser.FpTruncInstContext ctx) { + } + + @Override + public void enterFpExtInst(LLVMIRParser.FpExtInstContext ctx) { + } + + @Override + public void exitFpExtInst(LLVMIRParser.FpExtInstContext ctx) { + } + + @Override + public void enterFpToUiInst(LLVMIRParser.FpToUiInstContext ctx) { + } + + @Override + public void exitFpToUiInst(LLVMIRParser.FpToUiInstContext ctx) { + } + + @Override + public void enterFpToSiInst(LLVMIRParser.FpToSiInstContext ctx) { + } + + @Override + public void exitFpToSiInst(LLVMIRParser.FpToSiInstContext ctx) { + } + + @Override + public void enterUiToFpInst(LLVMIRParser.UiToFpInstContext ctx) { + } + + @Override + public void exitUiToFpInst(LLVMIRParser.UiToFpInstContext ctx) { + } + + @Override + public void enterSiToFpInst(LLVMIRParser.SiToFpInstContext ctx) { + } + + @Override + public void exitSiToFpInst(LLVMIRParser.SiToFpInstContext ctx) { + } + + @Override + public void enterPtrToIntInst(LLVMIRParser.PtrToIntInstContext ctx) { + } + + @Override + public void exitPtrToIntInst(LLVMIRParser.PtrToIntInstContext ctx) { + } + + @Override + public void enterIntToPtrInst(LLVMIRParser.IntToPtrInstContext ctx) { + } + + @Override + public void exitIntToPtrInst(LLVMIRParser.IntToPtrInstContext ctx) { + } + + @Override + public void enterBitCastInst(LLVMIRParser.BitCastInstContext ctx) { + } + + @Override + public void exitBitCastInst(LLVMIRParser.BitCastInstContext ctx) { + } + + @Override + public void enterAddrSpaceCastInst(LLVMIRParser.AddrSpaceCastInstContext ctx) { + } + + @Override + public void exitAddrSpaceCastInst(LLVMIRParser.AddrSpaceCastInstContext ctx) { + } + + @Override + public void enterICmpInst(LLVMIRParser.ICmpInstContext ctx) { + } + + @Override + public void exitICmpInst(LLVMIRParser.ICmpInstContext ctx) { + } + + @Override + public void enterFCmpInst(LLVMIRParser.FCmpInstContext ctx) { + } + + @Override + public void exitFCmpInst(LLVMIRParser.FCmpInstContext ctx) { + } + + @Override + public void enterPhiInst(LLVMIRParser.PhiInstContext ctx) { + } + + @Override + public void exitPhiInst(LLVMIRParser.PhiInstContext ctx) { + } + + @Override + public void enterSelectInst(LLVMIRParser.SelectInstContext ctx) { + } + + @Override + public void exitSelectInst(LLVMIRParser.SelectInstContext ctx) { + } + + @Override + public void enterFreezeInst(LLVMIRParser.FreezeInstContext ctx) { + } + + @Override + public void exitFreezeInst(LLVMIRParser.FreezeInstContext ctx) { + } + + @Override + public void enterCallInst(LLVMIRParser.CallInstContext ctx) { + } + + @Override + public void exitCallInst(LLVMIRParser.CallInstContext ctx) { + } + + @Override + public void enterVaargInst(LLVMIRParser.VaargInstContext ctx) { + } + + @Override + public void exitVaargInst(LLVMIRParser.VaargInstContext ctx) { + } + + @Override + public void enterLandingPadInst(LLVMIRParser.LandingPadInstContext ctx) { + } + + @Override + public void exitLandingPadInst(LLVMIRParser.LandingPadInstContext ctx) { + } + + @Override + public void enterCatchPadInst(LLVMIRParser.CatchPadInstContext ctx) { + } + + @Override + public void exitCatchPadInst(LLVMIRParser.CatchPadInstContext ctx) { + } + + @Override + public void enterCleanupPadInst(LLVMIRParser.CleanupPadInstContext ctx) { + } + + @Override + public void exitCleanupPadInst(LLVMIRParser.CleanupPadInstContext ctx) { + } + + @Override + public void enterInc(LLVMIRParser.IncContext ctx) { + } + + @Override + public void exitInc(LLVMIRParser.IncContext ctx) { + } + + @Override + public void enterOperandBundle(LLVMIRParser.OperandBundleContext ctx) { + } + + @Override + public void exitOperandBundle(LLVMIRParser.OperandBundleContext ctx) { + } + + @Override + public void enterClause(LLVMIRParser.ClauseContext ctx) { + } + + @Override + public void exitClause(LLVMIRParser.ClauseContext ctx) { + } + + @Override + public void enterArgs(LLVMIRParser.ArgsContext ctx) { + } + + @Override + public void exitArgs(LLVMIRParser.ArgsContext ctx) { + } + + @Override + public void enterArg(LLVMIRParser.ArgContext ctx) { + } + + @Override + public void exitArg(LLVMIRParser.ArgContext ctx) { + } + + @Override + public void enterExceptionArg(LLVMIRParser.ExceptionArgContext ctx) { + } + + @Override + public void exitExceptionArg(LLVMIRParser.ExceptionArgContext ctx) { + } + + @Override + public void enterExceptionPad(LLVMIRParser.ExceptionPadContext ctx) { + } + + @Override + public void exitExceptionPad(LLVMIRParser.ExceptionPadContext ctx) { + } + + @Override + public void enterExternalLinkage(LLVMIRParser.ExternalLinkageContext ctx) { + } + + @Override + public void exitExternalLinkage(LLVMIRParser.ExternalLinkageContext ctx) { + } + + @Override + public void enterInternalLinkage(LLVMIRParser.InternalLinkageContext ctx) { + } + + @Override + public void exitInternalLinkage(LLVMIRParser.InternalLinkageContext ctx) { + } + + @Override + public void enterLinkage(LLVMIRParser.LinkageContext ctx) { + } + + @Override + public void exitLinkage(LLVMIRParser.LinkageContext ctx) { + } + + @Override + public void enterPreemption(LLVMIRParser.PreemptionContext ctx) { + } + + @Override + public void exitPreemption(LLVMIRParser.PreemptionContext ctx) { + } + + @Override + public void enterVisibility(LLVMIRParser.VisibilityContext ctx) { + } + + @Override + public void exitVisibility(LLVMIRParser.VisibilityContext ctx) { + } + + @Override + public void enterDllStorageClass(LLVMIRParser.DllStorageClassContext ctx) { + } + + @Override + public void exitDllStorageClass(LLVMIRParser.DllStorageClassContext ctx) { + } + + @Override + public void enterTlsModel(LLVMIRParser.TlsModelContext ctx) { + } + + @Override + public void exitTlsModel(LLVMIRParser.TlsModelContext ctx) { + } + + @Override + public void enterUnnamedAddr(LLVMIRParser.UnnamedAddrContext ctx) { + } + + @Override + public void exitUnnamedAddr(LLVMIRParser.UnnamedAddrContext ctx) { + } + + @Override + public void enterExternallyInitialized(LLVMIRParser.ExternallyInitializedContext ctx) { + } + + @Override + public void exitExternallyInitialized(LLVMIRParser.ExternallyInitializedContext ctx) { + } + + @Override + public void enterImmutable(LLVMIRParser.ImmutableContext ctx) { + } + + @Override + public void exitImmutable(LLVMIRParser.ImmutableContext ctx) { + } + + @Override + public void enterFuncAttr(LLVMIRParser.FuncAttrContext ctx) { + } + + @Override + public void exitFuncAttr(LLVMIRParser.FuncAttrContext ctx) { + } + + @Override + public void enterDistinct(LLVMIRParser.DistinctContext ctx) { + } + + @Override + public void exitDistinct(LLVMIRParser.DistinctContext ctx) { + } + + @Override + public void enterInBounds(LLVMIRParser.InBoundsContext ctx) { + } + + @Override + public void exitInBounds(LLVMIRParser.InBoundsContext ctx) { + } + + @Override + public void enterReturnAttr(LLVMIRParser.ReturnAttrContext ctx) { + } + + @Override + public void exitReturnAttr(LLVMIRParser.ReturnAttrContext ctx) { + } + + @Override + public void enterOverflowFlag(LLVMIRParser.OverflowFlagContext ctx) { + } + + @Override + public void exitOverflowFlag(LLVMIRParser.OverflowFlagContext ctx) { + } + + @Override + public void enterIPred(LLVMIRParser.IPredContext ctx) { + } + + @Override + public void exitIPred(LLVMIRParser.IPredContext ctx) { + } + + @Override + public void enterFPred(LLVMIRParser.FPredContext ctx) { + } + + @Override + public void exitFPred(LLVMIRParser.FPredContext ctx) { + } + + @Override + public void enterAtomicOrdering(LLVMIRParser.AtomicOrderingContext ctx) { + } + + @Override + public void exitAtomicOrdering(LLVMIRParser.AtomicOrderingContext ctx) { + } + + @Override + public void enterCallingConvEnum(LLVMIRParser.CallingConvEnumContext ctx) { + } + + @Override + public void exitCallingConvEnum(LLVMIRParser.CallingConvEnumContext ctx) { + } + + @Override + public void enterFastMathFlag(LLVMIRParser.FastMathFlagContext ctx) { + } + + @Override + public void exitFastMathFlag(LLVMIRParser.FastMathFlagContext ctx) { + } + + @Override + public void enterAtomicOp(LLVMIRParser.AtomicOpContext ctx) { + } + + @Override + public void exitAtomicOp(LLVMIRParser.AtomicOpContext ctx) { + } + + @Override + public void enterFloatKind(LLVMIRParser.FloatKindContext ctx) { + } + + @Override + public void exitFloatKind(LLVMIRParser.FloatKindContext ctx) { + } + + @Override + public void enterSpecializedMDNode(LLVMIRParser.SpecializedMDNodeContext ctx) { + } + + @Override + public void exitSpecializedMDNode(LLVMIRParser.SpecializedMDNodeContext ctx) { + } + + @Override + public void enterDiBasicType(LLVMIRParser.DiBasicTypeContext ctx) { + } + + @Override + public void exitDiBasicType(LLVMIRParser.DiBasicTypeContext ctx) { + } + + @Override + public void enterDiCommonBlock(LLVMIRParser.DiCommonBlockContext ctx) { + } + + @Override + public void exitDiCommonBlock(LLVMIRParser.DiCommonBlockContext ctx) { + } + + @Override + public void enterDiCompileUnit(LLVMIRParser.DiCompileUnitContext ctx) { + } + + @Override + public void exitDiCompileUnit(LLVMIRParser.DiCompileUnitContext ctx) { + } + + @Override + public void enterDiCompositeType(LLVMIRParser.DiCompositeTypeContext ctx) { + } + + @Override + public void exitDiCompositeType(LLVMIRParser.DiCompositeTypeContext ctx) { + } + + @Override + public void enterDiCompositeTypeField(LLVMIRParser.DiCompositeTypeFieldContext ctx) { + } + + @Override + public void exitDiCompositeTypeField(LLVMIRParser.DiCompositeTypeFieldContext ctx) { + } + + @Override + public void enterDiDerivedType(LLVMIRParser.DiDerivedTypeContext ctx) { + } + + @Override + public void exitDiDerivedType(LLVMIRParser.DiDerivedTypeContext ctx) { + } + + @Override + public void enterDiDerivedTypeField(LLVMIRParser.DiDerivedTypeFieldContext ctx) { + } + + @Override + public void exitDiDerivedTypeField(LLVMIRParser.DiDerivedTypeFieldContext ctx) { + } + + @Override + public void enterDiEnumerator(LLVMIRParser.DiEnumeratorContext ctx) { + } + + @Override + public void exitDiEnumerator(LLVMIRParser.DiEnumeratorContext ctx) { + } + + @Override + public void enterDiEnumeratorField(LLVMIRParser.DiEnumeratorFieldContext ctx) { + } + + @Override + public void exitDiEnumeratorField(LLVMIRParser.DiEnumeratorFieldContext ctx) { + } + + @Override + public void enterDiFile(LLVMIRParser.DiFileContext ctx) { + } + + @Override + public void exitDiFile(LLVMIRParser.DiFileContext ctx) { + } + + @Override + public void enterDiFileField(LLVMIRParser.DiFileFieldContext ctx) { + } + + @Override + public void exitDiFileField(LLVMIRParser.DiFileFieldContext ctx) { + } + + @Override + public void enterDiGlobalVariable(LLVMIRParser.DiGlobalVariableContext ctx) { + } + + @Override + public void exitDiGlobalVariable(LLVMIRParser.DiGlobalVariableContext ctx) { + } + + @Override + public void enterDiGlobalVariableField(LLVMIRParser.DiGlobalVariableFieldContext ctx) { + } + + @Override + public void exitDiGlobalVariableField(LLVMIRParser.DiGlobalVariableFieldContext ctx) { + } + + @Override + public void enterDiGlobalVariableExpression(LLVMIRParser.DiGlobalVariableExpressionContext ctx) { + } + + @Override + public void exitDiGlobalVariableExpression(LLVMIRParser.DiGlobalVariableExpressionContext ctx) { + } + + @Override + public void enterDiGlobalVariableExpressionField(LLVMIRParser.DiGlobalVariableExpressionFieldContext ctx) { + } + + @Override + public void exitDiGlobalVariableExpressionField(LLVMIRParser.DiGlobalVariableExpressionFieldContext ctx) { + } + + @Override + public void enterDiImportedEntity(LLVMIRParser.DiImportedEntityContext ctx) { + } + + @Override + public void exitDiImportedEntity(LLVMIRParser.DiImportedEntityContext ctx) { + } + + @Override + public void enterDiImportedEntityField(LLVMIRParser.DiImportedEntityFieldContext ctx) { + } + + @Override + public void exitDiImportedEntityField(LLVMIRParser.DiImportedEntityFieldContext ctx) { + } + + @Override + public void enterDiLabel(LLVMIRParser.DiLabelContext ctx) { + } + + @Override + public void exitDiLabel(LLVMIRParser.DiLabelContext ctx) { + } + + @Override + public void enterDiLabelField(LLVMIRParser.DiLabelFieldContext ctx) { + } + + @Override + public void exitDiLabelField(LLVMIRParser.DiLabelFieldContext ctx) { + } + + @Override + public void enterDiLexicalBlock(LLVMIRParser.DiLexicalBlockContext ctx) { + } + + @Override + public void exitDiLexicalBlock(LLVMIRParser.DiLexicalBlockContext ctx) { + } + + @Override + public void enterDiLexicalBlockField(LLVMIRParser.DiLexicalBlockFieldContext ctx) { + } + + @Override + public void exitDiLexicalBlockField(LLVMIRParser.DiLexicalBlockFieldContext ctx) { + } + + @Override + public void enterDiLexicalBlockFile(LLVMIRParser.DiLexicalBlockFileContext ctx) { + } + + @Override + public void exitDiLexicalBlockFile(LLVMIRParser.DiLexicalBlockFileContext ctx) { + } + + @Override + public void enterDiLexicalBlockFileField(LLVMIRParser.DiLexicalBlockFileFieldContext ctx) { + } + + @Override + public void exitDiLexicalBlockFileField(LLVMIRParser.DiLexicalBlockFileFieldContext ctx) { + } + + @Override + public void enterDiLocalVariable(LLVMIRParser.DiLocalVariableContext ctx) { + } + + @Override + public void exitDiLocalVariable(LLVMIRParser.DiLocalVariableContext ctx) { + } + + @Override + public void enterDiLocalVariableField(LLVMIRParser.DiLocalVariableFieldContext ctx) { + } + + @Override + public void exitDiLocalVariableField(LLVMIRParser.DiLocalVariableFieldContext ctx) { + } + + @Override + public void enterDiLocation(LLVMIRParser.DiLocationContext ctx) { + } + + @Override + public void exitDiLocation(LLVMIRParser.DiLocationContext ctx) { + } + + @Override + public void enterDiLocationField(LLVMIRParser.DiLocationFieldContext ctx) { + } + + @Override + public void exitDiLocationField(LLVMIRParser.DiLocationFieldContext ctx) { + } + + @Override + public void enterDiMacro(LLVMIRParser.DiMacroContext ctx) { + } + + @Override + public void exitDiMacro(LLVMIRParser.DiMacroContext ctx) { + } + + @Override + public void enterDiMacroField(LLVMIRParser.DiMacroFieldContext ctx) { + } + + @Override + public void exitDiMacroField(LLVMIRParser.DiMacroFieldContext ctx) { + } + + @Override + public void enterDiMacroFile(LLVMIRParser.DiMacroFileContext ctx) { + } + + @Override + public void exitDiMacroFile(LLVMIRParser.DiMacroFileContext ctx) { + } + + @Override + public void enterDiMacroFileField(LLVMIRParser.DiMacroFileFieldContext ctx) { + } + + @Override + public void exitDiMacroFileField(LLVMIRParser.DiMacroFileFieldContext ctx) { + } + + @Override + public void enterDiModule(LLVMIRParser.DiModuleContext ctx) { + } + + @Override + public void exitDiModule(LLVMIRParser.DiModuleContext ctx) { + } + + @Override + public void enterDiModuleField(LLVMIRParser.DiModuleFieldContext ctx) { + } + + @Override + public void exitDiModuleField(LLVMIRParser.DiModuleFieldContext ctx) { + } + + @Override + public void enterDiNamespace(LLVMIRParser.DiNamespaceContext ctx) { + } + + @Override + public void exitDiNamespace(LLVMIRParser.DiNamespaceContext ctx) { + } + + @Override + public void enterDiNamespaceField(LLVMIRParser.DiNamespaceFieldContext ctx) { + } + + @Override + public void exitDiNamespaceField(LLVMIRParser.DiNamespaceFieldContext ctx) { + } + + @Override + public void enterDiObjCProperty(LLVMIRParser.DiObjCPropertyContext ctx) { + } + + @Override + public void exitDiObjCProperty(LLVMIRParser.DiObjCPropertyContext ctx) { + } + + @Override + public void enterDiObjCPropertyField(LLVMIRParser.DiObjCPropertyFieldContext ctx) { + } + + @Override + public void exitDiObjCPropertyField(LLVMIRParser.DiObjCPropertyFieldContext ctx) { + } + + @Override + public void enterDiStringType(LLVMIRParser.DiStringTypeContext ctx) { + } + + @Override + public void exitDiStringType(LLVMIRParser.DiStringTypeContext ctx) { + } + + @Override + public void enterDiStringTypeField(LLVMIRParser.DiStringTypeFieldContext ctx) { + } + + @Override + public void exitDiStringTypeField(LLVMIRParser.DiStringTypeFieldContext ctx) { + } + + @Override + public void enterDiSubprogram(LLVMIRParser.DiSubprogramContext ctx) { + } + + @Override + public void exitDiSubprogram(LLVMIRParser.DiSubprogramContext ctx) { + } + + @Override + public void enterDiSubprogramField(LLVMIRParser.DiSubprogramFieldContext ctx) { + } + + @Override + public void exitDiSubprogramField(LLVMIRParser.DiSubprogramFieldContext ctx) { + } + + @Override + public void enterDiSubrange(LLVMIRParser.DiSubrangeContext ctx) { + } + + @Override + public void exitDiSubrange(LLVMIRParser.DiSubrangeContext ctx) { + } + + @Override + public void enterDiSubrangeField(LLVMIRParser.DiSubrangeFieldContext ctx) { + } + + @Override + public void exitDiSubrangeField(LLVMIRParser.DiSubrangeFieldContext ctx) { + } + + @Override + public void enterDiSubroutineType(LLVMIRParser.DiSubroutineTypeContext ctx) { + } + + @Override + public void exitDiSubroutineType(LLVMIRParser.DiSubroutineTypeContext ctx) { + } + + @Override + public void enterDiTemplateTypeParameter(LLVMIRParser.DiTemplateTypeParameterContext ctx) { + } + + @Override + public void exitDiTemplateTypeParameter(LLVMIRParser.DiTemplateTypeParameterContext ctx) { + } + + @Override + public void enterDiTemplateValueParameter(LLVMIRParser.DiTemplateValueParameterContext ctx) { + } + + @Override + public void exitDiTemplateValueParameter(LLVMIRParser.DiTemplateValueParameterContext ctx) { + } + + @Override + public void enterGenericDiNode(LLVMIRParser.GenericDiNodeContext ctx) { + } + + @Override + public void exitGenericDiNode(LLVMIRParser.GenericDiNodeContext ctx) { + } + + @Override + public void enterDiTemplateTypeParameterField(LLVMIRParser.DiTemplateTypeParameterFieldContext ctx) { + } + + @Override + public void exitDiTemplateTypeParameterField(LLVMIRParser.DiTemplateTypeParameterFieldContext ctx) { + } + + @Override + public void enterDiCompileUnitField(LLVMIRParser.DiCompileUnitFieldContext ctx) { + } + + @Override + public void exitDiCompileUnitField(LLVMIRParser.DiCompileUnitFieldContext ctx) { + } + + @Override + public void enterDiCommonBlockField(LLVMIRParser.DiCommonBlockFieldContext ctx) { + } + + @Override + public void exitDiCommonBlockField(LLVMIRParser.DiCommonBlockFieldContext ctx) { + } + + @Override + public void enterDiBasicTypeField(LLVMIRParser.DiBasicTypeFieldContext ctx) { + } + + @Override + public void exitDiBasicTypeField(LLVMIRParser.DiBasicTypeFieldContext ctx) { + } + + @Override + public void enterGenericDINodeField(LLVMIRParser.GenericDINodeFieldContext ctx) { + } + + @Override + public void exitGenericDINodeField(LLVMIRParser.GenericDINodeFieldContext ctx) { + } + + @Override + public void enterTagField(LLVMIRParser.TagFieldContext ctx) { + } + + @Override + public void exitTagField(LLVMIRParser.TagFieldContext ctx) { + } + + @Override + public void enterHeaderField(LLVMIRParser.HeaderFieldContext ctx) { + } + + @Override + public void exitHeaderField(LLVMIRParser.HeaderFieldContext ctx) { + } + + @Override + public void enterOperandsField(LLVMIRParser.OperandsFieldContext ctx) { + } + + @Override + public void exitOperandsField(LLVMIRParser.OperandsFieldContext ctx) { + } + + @Override + public void enterDiTemplateValueParameterField(LLVMIRParser.DiTemplateValueParameterFieldContext ctx) { + } + + @Override + public void exitDiTemplateValueParameterField(LLVMIRParser.DiTemplateValueParameterFieldContext ctx) { + } + + @Override + public void enterNameField(LLVMIRParser.NameFieldContext ctx) { + } + + @Override + public void exitNameField(LLVMIRParser.NameFieldContext ctx) { + } + + @Override + public void enterTypeField(LLVMIRParser.TypeFieldContext ctx) { + } + + @Override + public void exitTypeField(LLVMIRParser.TypeFieldContext ctx) { + } + + @Override + public void enterDefaultedField(LLVMIRParser.DefaultedFieldContext ctx) { + } + + @Override + public void exitDefaultedField(LLVMIRParser.DefaultedFieldContext ctx) { + } + + @Override + public void enterValueField(LLVMIRParser.ValueFieldContext ctx) { + } + + @Override + public void exitValueField(LLVMIRParser.ValueFieldContext ctx) { + } + + @Override + public void enterMdField(LLVMIRParser.MdFieldContext ctx) { + } + + @Override + public void exitMdField(LLVMIRParser.MdFieldContext ctx) { + } + + @Override + public void enterDiSubroutineTypeField(LLVMIRParser.DiSubroutineTypeFieldContext ctx) { + } + + @Override + public void exitDiSubroutineTypeField(LLVMIRParser.DiSubroutineTypeFieldContext ctx) { + } + + @Override + public void enterFlagsField(LLVMIRParser.FlagsFieldContext ctx) { + } + + @Override + public void exitFlagsField(LLVMIRParser.FlagsFieldContext ctx) { + } + + @Override + public void enterDiFlags(LLVMIRParser.DiFlagsContext ctx) { + } + + @Override + public void exitDiFlags(LLVMIRParser.DiFlagsContext ctx) { + } + + @Override + public void enterCcField(LLVMIRParser.CcFieldContext ctx) { + } + + @Override + public void exitCcField(LLVMIRParser.CcFieldContext ctx) { + } + + @Override + public void enterAlignField(LLVMIRParser.AlignFieldContext ctx) { + } + + @Override + public void exitAlignField(LLVMIRParser.AlignFieldContext ctx) { + } + + @Override + public void enterAllocatedField(LLVMIRParser.AllocatedFieldContext ctx) { + } + + @Override + public void exitAllocatedField(LLVMIRParser.AllocatedFieldContext ctx) { + } + + @Override + public void enterAnnotationsField(LLVMIRParser.AnnotationsFieldContext ctx) { + } + + @Override + public void exitAnnotationsField(LLVMIRParser.AnnotationsFieldContext ctx) { + } + + @Override + public void enterArgField(LLVMIRParser.ArgFieldContext ctx) { + } + + @Override + public void exitArgField(LLVMIRParser.ArgFieldContext ctx) { + } + + @Override + public void enterAssociatedField(LLVMIRParser.AssociatedFieldContext ctx) { + } + + @Override + public void exitAssociatedField(LLVMIRParser.AssociatedFieldContext ctx) { + } + + @Override + public void enterAttributesField(LLVMIRParser.AttributesFieldContext ctx) { + } + + @Override + public void exitAttributesField(LLVMIRParser.AttributesFieldContext ctx) { + } + + @Override + public void enterBaseTypeField(LLVMIRParser.BaseTypeFieldContext ctx) { + } + + @Override + public void exitBaseTypeField(LLVMIRParser.BaseTypeFieldContext ctx) { + } + + @Override + public void enterChecksumField(LLVMIRParser.ChecksumFieldContext ctx) { + } + + @Override + public void exitChecksumField(LLVMIRParser.ChecksumFieldContext ctx) { + } + + @Override + public void enterChecksumkindField(LLVMIRParser.ChecksumkindFieldContext ctx) { + } + + @Override + public void exitChecksumkindField(LLVMIRParser.ChecksumkindFieldContext ctx) { + } + + @Override + public void enterColumnField(LLVMIRParser.ColumnFieldContext ctx) { + } + + @Override + public void exitColumnField(LLVMIRParser.ColumnFieldContext ctx) { + } + + @Override + public void enterConfigMacrosField(LLVMIRParser.ConfigMacrosFieldContext ctx) { + } + + @Override + public void exitConfigMacrosField(LLVMIRParser.ConfigMacrosFieldContext ctx) { + } + + @Override + public void enterContainingTypeField(LLVMIRParser.ContainingTypeFieldContext ctx) { + } + + @Override + public void exitContainingTypeField(LLVMIRParser.ContainingTypeFieldContext ctx) { + } + + @Override + public void enterCountField(LLVMIRParser.CountFieldContext ctx) { + } + + @Override + public void exitCountField(LLVMIRParser.CountFieldContext ctx) { + } + + @Override + public void enterDebugInfoForProfilingField(LLVMIRParser.DebugInfoForProfilingFieldContext ctx) { + } + + @Override + public void exitDebugInfoForProfilingField(LLVMIRParser.DebugInfoForProfilingFieldContext ctx) { + } + + @Override + public void enterDeclarationField(LLVMIRParser.DeclarationFieldContext ctx) { + } + + @Override + public void exitDeclarationField(LLVMIRParser.DeclarationFieldContext ctx) { + } + + @Override + public void enterDirectoryField(LLVMIRParser.DirectoryFieldContext ctx) { + } + + @Override + public void exitDirectoryField(LLVMIRParser.DirectoryFieldContext ctx) { + } + + @Override + public void enterDiscriminatorField(LLVMIRParser.DiscriminatorFieldContext ctx) { + } + + @Override + public void exitDiscriminatorField(LLVMIRParser.DiscriminatorFieldContext ctx) { + } + + @Override + public void enterDataLocationField(LLVMIRParser.DataLocationFieldContext ctx) { + } + + @Override + public void exitDataLocationField(LLVMIRParser.DataLocationFieldContext ctx) { + } + + @Override + public void enterDiscriminatorIntField(LLVMIRParser.DiscriminatorIntFieldContext ctx) { + } + + @Override + public void exitDiscriminatorIntField(LLVMIRParser.DiscriminatorIntFieldContext ctx) { + } + + @Override + public void enterDwarfAddressSpaceField(LLVMIRParser.DwarfAddressSpaceFieldContext ctx) { + } + + @Override + public void exitDwarfAddressSpaceField(LLVMIRParser.DwarfAddressSpaceFieldContext ctx) { + } + + @Override + public void enterDwoIdField(LLVMIRParser.DwoIdFieldContext ctx) { + } + + @Override + public void exitDwoIdField(LLVMIRParser.DwoIdFieldContext ctx) { + } + + @Override + public void enterElementsField(LLVMIRParser.ElementsFieldContext ctx) { + } + + @Override + public void exitElementsField(LLVMIRParser.ElementsFieldContext ctx) { + } + + @Override + public void enterEmissionKindField(LLVMIRParser.EmissionKindFieldContext ctx) { + } + + @Override + public void exitEmissionKindField(LLVMIRParser.EmissionKindFieldContext ctx) { + } + + @Override + public void enterEncodingField(LLVMIRParser.EncodingFieldContext ctx) { + } + + @Override + public void exitEncodingField(LLVMIRParser.EncodingFieldContext ctx) { + } + + @Override + public void enterEntityField(LLVMIRParser.EntityFieldContext ctx) { + } + + @Override + public void exitEntityField(LLVMIRParser.EntityFieldContext ctx) { + } + + @Override + public void enterEnumsField(LLVMIRParser.EnumsFieldContext ctx) { + } + + @Override + public void exitEnumsField(LLVMIRParser.EnumsFieldContext ctx) { + } + + @Override + public void enterExportSymbolsField(LLVMIRParser.ExportSymbolsFieldContext ctx) { + } + + @Override + public void exitExportSymbolsField(LLVMIRParser.ExportSymbolsFieldContext ctx) { + } + + @Override + public void enterExprField(LLVMIRParser.ExprFieldContext ctx) { + } + + @Override + public void exitExprField(LLVMIRParser.ExprFieldContext ctx) { + } + + @Override + public void enterExtraDataField(LLVMIRParser.ExtraDataFieldContext ctx) { + } + + @Override + public void exitExtraDataField(LLVMIRParser.ExtraDataFieldContext ctx) { + } + + @Override + public void enterFileField(LLVMIRParser.FileFieldContext ctx) { + } + + @Override + public void exitFileField(LLVMIRParser.FileFieldContext ctx) { + } + + @Override + public void enterFilenameField(LLVMIRParser.FilenameFieldContext ctx) { + } + + @Override + public void exitFilenameField(LLVMIRParser.FilenameFieldContext ctx) { + } + + @Override + public void enterFlagsStringField(LLVMIRParser.FlagsStringFieldContext ctx) { + } + + @Override + public void exitFlagsStringField(LLVMIRParser.FlagsStringFieldContext ctx) { + } + + @Override + public void enterGetterField(LLVMIRParser.GetterFieldContext ctx) { + } + + @Override + public void exitGetterField(LLVMIRParser.GetterFieldContext ctx) { + } + + @Override + public void enterGlobalsField(LLVMIRParser.GlobalsFieldContext ctx) { + } + + @Override + public void exitGlobalsField(LLVMIRParser.GlobalsFieldContext ctx) { + } + + @Override + public void enterIdentifierField(LLVMIRParser.IdentifierFieldContext ctx) { + } + + @Override + public void exitIdentifierField(LLVMIRParser.IdentifierFieldContext ctx) { + } + + @Override + public void enterImportsField(LLVMIRParser.ImportsFieldContext ctx) { + } + + @Override + public void exitImportsField(LLVMIRParser.ImportsFieldContext ctx) { + } + + @Override + public void enterIncludePathField(LLVMIRParser.IncludePathFieldContext ctx) { + } + + @Override + public void exitIncludePathField(LLVMIRParser.IncludePathFieldContext ctx) { + } + + @Override + public void enterInlinedAtField(LLVMIRParser.InlinedAtFieldContext ctx) { + } + + @Override + public void exitInlinedAtField(LLVMIRParser.InlinedAtFieldContext ctx) { + } + + @Override + public void enterIsDeclField(LLVMIRParser.IsDeclFieldContext ctx) { + } + + @Override + public void exitIsDeclField(LLVMIRParser.IsDeclFieldContext ctx) { + } + + @Override + public void enterIsDefinitionField(LLVMIRParser.IsDefinitionFieldContext ctx) { + } + + @Override + public void exitIsDefinitionField(LLVMIRParser.IsDefinitionFieldContext ctx) { + } + + @Override + public void enterIsImplicitCodeField(LLVMIRParser.IsImplicitCodeFieldContext ctx) { + } + + @Override + public void exitIsImplicitCodeField(LLVMIRParser.IsImplicitCodeFieldContext ctx) { + } + + @Override + public void enterIsLocalField(LLVMIRParser.IsLocalFieldContext ctx) { + } + + @Override + public void exitIsLocalField(LLVMIRParser.IsLocalFieldContext ctx) { + } + + @Override + public void enterIsOptimizedField(LLVMIRParser.IsOptimizedFieldContext ctx) { + } + + @Override + public void exitIsOptimizedField(LLVMIRParser.IsOptimizedFieldContext ctx) { + } + + @Override + public void enterIsUnsignedField(LLVMIRParser.IsUnsignedFieldContext ctx) { + } + + @Override + public void exitIsUnsignedField(LLVMIRParser.IsUnsignedFieldContext ctx) { + } + + @Override + public void enterApiNotesField(LLVMIRParser.ApiNotesFieldContext ctx) { + } + + @Override + public void exitApiNotesField(LLVMIRParser.ApiNotesFieldContext ctx) { + } + + @Override + public void enterLanguageField(LLVMIRParser.LanguageFieldContext ctx) { + } + + @Override + public void exitLanguageField(LLVMIRParser.LanguageFieldContext ctx) { + } + + @Override + public void enterLineField(LLVMIRParser.LineFieldContext ctx) { + } + + @Override + public void exitLineField(LLVMIRParser.LineFieldContext ctx) { + } + + @Override + public void enterLinkageNameField(LLVMIRParser.LinkageNameFieldContext ctx) { + } + + @Override + public void exitLinkageNameField(LLVMIRParser.LinkageNameFieldContext ctx) { + } + + @Override + public void enterLowerBoundField(LLVMIRParser.LowerBoundFieldContext ctx) { + } + + @Override + public void exitLowerBoundField(LLVMIRParser.LowerBoundFieldContext ctx) { + } + + @Override + public void enterMacrosField(LLVMIRParser.MacrosFieldContext ctx) { + } + + @Override + public void exitMacrosField(LLVMIRParser.MacrosFieldContext ctx) { + } + + @Override + public void enterNameTableKindField(LLVMIRParser.NameTableKindFieldContext ctx) { + } + + @Override + public void exitNameTableKindField(LLVMIRParser.NameTableKindFieldContext ctx) { + } + + @Override + public void enterNodesField(LLVMIRParser.NodesFieldContext ctx) { + } + + @Override + public void exitNodesField(LLVMIRParser.NodesFieldContext ctx) { + } + + @Override + public void enterOffsetField(LLVMIRParser.OffsetFieldContext ctx) { + } + + @Override + public void exitOffsetField(LLVMIRParser.OffsetFieldContext ctx) { + } + + @Override + public void enterProducerField(LLVMIRParser.ProducerFieldContext ctx) { + } + + @Override + public void exitProducerField(LLVMIRParser.ProducerFieldContext ctx) { + } + + @Override + public void enterRangesBaseAddressField(LLVMIRParser.RangesBaseAddressFieldContext ctx) { + } + + @Override + public void exitRangesBaseAddressField(LLVMIRParser.RangesBaseAddressFieldContext ctx) { + } + + @Override + public void enterRankField(LLVMIRParser.RankFieldContext ctx) { + } + + @Override + public void exitRankField(LLVMIRParser.RankFieldContext ctx) { + } + + @Override + public void enterRetainedNodesField(LLVMIRParser.RetainedNodesFieldContext ctx) { + } + + @Override + public void exitRetainedNodesField(LLVMIRParser.RetainedNodesFieldContext ctx) { + } + + @Override + public void enterRetainedTypesField(LLVMIRParser.RetainedTypesFieldContext ctx) { + } + + @Override + public void exitRetainedTypesField(LLVMIRParser.RetainedTypesFieldContext ctx) { + } + + @Override + public void enterRuntimeLangField(LLVMIRParser.RuntimeLangFieldContext ctx) { + } + + @Override + public void exitRuntimeLangField(LLVMIRParser.RuntimeLangFieldContext ctx) { + } + + @Override + public void enterRuntimeVersionField(LLVMIRParser.RuntimeVersionFieldContext ctx) { + } + + @Override + public void exitRuntimeVersionField(LLVMIRParser.RuntimeVersionFieldContext ctx) { + } + + @Override + public void enterScopeField(LLVMIRParser.ScopeFieldContext ctx) { + } + + @Override + public void exitScopeField(LLVMIRParser.ScopeFieldContext ctx) { + } + + @Override + public void enterScopeLineField(LLVMIRParser.ScopeLineFieldContext ctx) { + } + + @Override + public void exitScopeLineField(LLVMIRParser.ScopeLineFieldContext ctx) { + } + + @Override + public void enterSdkField(LLVMIRParser.SdkFieldContext ctx) { + } + + @Override + public void exitSdkField(LLVMIRParser.SdkFieldContext ctx) { + } + + @Override + public void enterSetterField(LLVMIRParser.SetterFieldContext ctx) { + } + + @Override + public void exitSetterField(LLVMIRParser.SetterFieldContext ctx) { + } + + @Override + public void enterSizeField(LLVMIRParser.SizeFieldContext ctx) { + } + + @Override + public void exitSizeField(LLVMIRParser.SizeFieldContext ctx) { + } + + @Override + public void enterSourceField(LLVMIRParser.SourceFieldContext ctx) { + } + + @Override + public void exitSourceField(LLVMIRParser.SourceFieldContext ctx) { + } + + @Override + public void enterSpFlagsField(LLVMIRParser.SpFlagsFieldContext ctx) { + } + + @Override + public void exitSpFlagsField(LLVMIRParser.SpFlagsFieldContext ctx) { + } + + @Override + public void enterSplitDebugFilenameField(LLVMIRParser.SplitDebugFilenameFieldContext ctx) { + } + + @Override + public void exitSplitDebugFilenameField(LLVMIRParser.SplitDebugFilenameFieldContext ctx) { + } + + @Override + public void enterSplitDebugInliningField(LLVMIRParser.SplitDebugInliningFieldContext ctx) { + } + + @Override + public void exitSplitDebugInliningField(LLVMIRParser.SplitDebugInliningFieldContext ctx) { + } + + @Override + public void enterStrideField(LLVMIRParser.StrideFieldContext ctx) { + } + + @Override + public void exitStrideField(LLVMIRParser.StrideFieldContext ctx) { + } + + @Override + public void enterStringLengthField(LLVMIRParser.StringLengthFieldContext ctx) { + } + + @Override + public void exitStringLengthField(LLVMIRParser.StringLengthFieldContext ctx) { + } + + @Override + public void enterStringLengthExpressionField(LLVMIRParser.StringLengthExpressionFieldContext ctx) { + } + + @Override + public void exitStringLengthExpressionField(LLVMIRParser.StringLengthExpressionFieldContext ctx) { + } + + @Override + public void enterStringLocationExpressionField(LLVMIRParser.StringLocationExpressionFieldContext ctx) { + } + + @Override + public void exitStringLocationExpressionField(LLVMIRParser.StringLocationExpressionFieldContext ctx) { + } + + @Override + public void enterSysrootField(LLVMIRParser.SysrootFieldContext ctx) { + } + + @Override + public void exitSysrootField(LLVMIRParser.SysrootFieldContext ctx) { + } + + @Override + public void enterTargetFuncNameField(LLVMIRParser.TargetFuncNameFieldContext ctx) { + } + + @Override + public void exitTargetFuncNameField(LLVMIRParser.TargetFuncNameFieldContext ctx) { + } + + @Override + public void enterTemplateParamsField(LLVMIRParser.TemplateParamsFieldContext ctx) { + } + + @Override + public void exitTemplateParamsField(LLVMIRParser.TemplateParamsFieldContext ctx) { + } + + @Override + public void enterThisAdjustmentField(LLVMIRParser.ThisAdjustmentFieldContext ctx) { + } + + @Override + public void exitThisAdjustmentField(LLVMIRParser.ThisAdjustmentFieldContext ctx) { + } + + @Override + public void enterThrownTypesField(LLVMIRParser.ThrownTypesFieldContext ctx) { + } + + @Override + public void exitThrownTypesField(LLVMIRParser.ThrownTypesFieldContext ctx) { + } + + @Override + public void enterTypeMacinfoField(LLVMIRParser.TypeMacinfoFieldContext ctx) { + } + + @Override + public void exitTypeMacinfoField(LLVMIRParser.TypeMacinfoFieldContext ctx) { + } + + @Override + public void enterTypesField(LLVMIRParser.TypesFieldContext ctx) { + } + + @Override + public void exitTypesField(LLVMIRParser.TypesFieldContext ctx) { + } + + @Override + public void enterUnitField(LLVMIRParser.UnitFieldContext ctx) { + } + + @Override + public void exitUnitField(LLVMIRParser.UnitFieldContext ctx) { + } + + @Override + public void enterUpperBoundField(LLVMIRParser.UpperBoundFieldContext ctx) { + } + + @Override + public void exitUpperBoundField(LLVMIRParser.UpperBoundFieldContext ctx) { + } + + @Override + public void enterValueIntField(LLVMIRParser.ValueIntFieldContext ctx) { + } + + @Override + public void exitValueIntField(LLVMIRParser.ValueIntFieldContext ctx) { + } + + @Override + public void enterValueStringField(LLVMIRParser.ValueStringFieldContext ctx) { + } + + @Override + public void exitValueStringField(LLVMIRParser.ValueStringFieldContext ctx) { + } + + @Override + public void enterVarField(LLVMIRParser.VarFieldContext ctx) { + } + + @Override + public void exitVarField(LLVMIRParser.VarFieldContext ctx) { + } + + @Override + public void enterVirtualIndexField(LLVMIRParser.VirtualIndexFieldContext ctx) { + } + + @Override + public void exitVirtualIndexField(LLVMIRParser.VirtualIndexFieldContext ctx) { + } + + @Override + public void enterVirtualityField(LLVMIRParser.VirtualityFieldContext ctx) { + } + + @Override + public void exitVirtualityField(LLVMIRParser.VirtualityFieldContext ctx) { + } + + @Override + public void enterVtableHolderField(LLVMIRParser.VtableHolderFieldContext ctx) { + } + + @Override + public void exitVtableHolderField(LLVMIRParser.VtableHolderFieldContext ctx) { + } + + @Override + public void enterEveryRule(ParserRuleContext ctx) { + } + + @Override + public void exitEveryRule(ParserRuleContext ctx) { + } + + @Override + public void visitTerminal(TerminalNode node) { + } + + @Override + public void visitErrorNode(ErrorNode node) { + } + +} diff --git a/languages/llvmir/src/main/java/de/jplag/llvmir/LLVMParserAdapter.java b/languages/llvmir/src/main/java/de/jplag/llvmir/LLVMParserAdapter.java new file mode 100644 index 000000000..c00e14c57 --- /dev/null +++ b/languages/llvmir/src/main/java/de/jplag/llvmir/LLVMParserAdapter.java @@ -0,0 +1,77 @@ +package de.jplag.llvmir; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; + +import org.antlr.v4.runtime.CharStreams; +import org.antlr.v4.runtime.CommonTokenStream; +import org.antlr.v4.runtime.ParserRuleContext; +import org.antlr.v4.runtime.tree.ParseTree; +import org.antlr.v4.runtime.tree.ParseTreeWalker; + +import de.jplag.AbstractParser; +import de.jplag.ParsingException; +import de.jplag.Token; + +public class LLVMParserAdapter extends AbstractParser { + + private File currentFile; + private List tokens; + + /** + * Creates the LLVMParserAdapter + */ + public LLVMParserAdapter() { + super(); + } + + /** + * Parsers a set of files into a single list of {@link Token}s. + * @param files the set of files. + * @return a list containing all tokens of all files. + */ + public List parse(Set files) throws ParsingException { + tokens = new ArrayList<>(); + for (File file : files) { + parseFile(file); + tokens.add(Token.fileEnd(file)); + } + return tokens; + } + + private void parseFile(File file) throws ParsingException { + try (FileInputStream inputStream = new FileInputStream(file)) { + currentFile = file; + + LLVMLexer lexer = new LLVMLexer(CharStreams.fromStream(inputStream)); + CommonTokenStream tokenStream = new CommonTokenStream(lexer); + LLVMParser parser = new LLVMParser(tokenStream); + + ParserRuleContext entryContext = parser.llvmFile(); + ParseTreeWalker treeWalker = new ParseTreeWalker(); + + JPlagLLVMListener listener = new JPlagLLVMListener(this); + for (int i = 0; i < entryContext.getChildCount(); i++) { + ParseTree parseTree = entryContext.getChild(i); + treeWalker.walk(listener, parseTree); + } + } catch (IOException exception) { + throw new ParsingException(file, exception.getMessage(), exception); + } + } + + /** + * Adds a new {@link Token} to the current token list. + * @param tokenType the type of the new {@link Token} + * @param line the line of the Token in the current file + * @param column the start column of the Token in the line + * @param length the length of the Token + */ + /* package-private */ void addToken(LLVMTokenType tokenType, int line, int column, int length) { + tokens.add(new Token(tokenType, currentFile, line, column, length)); + } +} diff --git a/languages/llvmir/src/main/java/de/jplag/llvmir/LLVMTokenType.java b/languages/llvmir/src/main/java/de/jplag/llvmir/LLVMTokenType.java new file mode 100644 index 000000000..e778089b9 --- /dev/null +++ b/languages/llvmir/src/main/java/de/jplag/llvmir/LLVMTokenType.java @@ -0,0 +1,17 @@ +package de.jplag.llvmir; + +import de.jplag.TokenType; + +public enum LLVMTokenType implements TokenType { + ; + + private final String description; + + public String getDescription() { + return description; + } + + LLVMTokenType(String description) { + this.description = description; + } +} diff --git a/languages/llvmir/src/main/java/de/jplag/llvmir/Language.java b/languages/llvmir/src/main/java/de/jplag/llvmir/Language.java new file mode 100644 index 000000000..58e45443e --- /dev/null +++ b/languages/llvmir/src/main/java/de/jplag/llvmir/Language.java @@ -0,0 +1,52 @@ +package de.jplag.llvmir; + +import java.io.File; +import java.util.List; +import java.util.Set; + +import org.kohsuke.MetaInfServices; + +import de.jplag.ParsingException; +import de.jplag.Token; + +/** + * This represents the LLVMIR language as a language supported by JPlag. + */ +@MetaInfServices(de.jplag.Language.class) +public class Language implements de.jplag.Language { + + private static final String NAME = "LLVMIR Parser"; + private static final String IDENTIFIER = "llvmir"; + private static final int DEFAULT_MIN_TOKEN_MATCH = 10; + private static final String[] FILE_EXTENSIONS = {".ll"}; + private final LLVMParserAdapter parserAdapter; + + public Language() { + this.parserAdapter = new LLVMParserAdapter(); + } + + @Override + public String[] suffixes() { + return FILE_EXTENSIONS; + } + + @Override + public String getName() { + return NAME; + } + + @Override + public String getIdentifier() { + return IDENTIFIER; + } + + @Override + public int minimumTokenMatch() { + return DEFAULT_MIN_TOKEN_MATCH; + } + + @Override + public List parse(Set files) throws ParsingException { + return parserAdapter.parse(files); + } +} diff --git a/languages/pom.xml b/languages/pom.xml index 48acb72c6..8c1ac4e88 100644 --- a/languages/pom.xml +++ b/languages/pom.xml @@ -24,6 +24,7 @@ scheme swift text + llvmir From b0057217d14df88f8a99782dc7d01ed26abe5a6b Mon Sep 17 00:00:00 2001 From: Niklas Heneka <93838730+NiklasHeneka@users.noreply.github.com> Date: Wed, 5 Jul 2023 18:14:30 +0200 Subject: [PATCH 003/232] Add first draft of the simple version of the LLVM IR language module. --- .../de/jplag/llvmir/JPlagLLVMListener.java | 120 ++++++++++++++++++ .../java/de/jplag/llvmir/LLVMTokenType.java | 23 +++- 2 files changed, 142 insertions(+), 1 deletion(-) diff --git a/languages/llvmir/src/main/java/de/jplag/llvmir/JPlagLLVMListener.java b/languages/llvmir/src/main/java/de/jplag/llvmir/JPlagLLVMListener.java index 469d1656b..f4c9c193e 100644 --- a/languages/llvmir/src/main/java/de/jplag/llvmir/JPlagLLVMListener.java +++ b/languages/llvmir/src/main/java/de/jplag/llvmir/JPlagLLVMListener.java @@ -130,6 +130,8 @@ public void exitIndirectSymbolDef(LLVMIRParser.IndirectSymbolDefContext ctx) { @Override public void enterFuncDecl(LLVMIRParser.FuncDeclContext ctx) { + transformToken(LLVMTokenType.FUNCTION_DECL, ctx.getStart(), ctx.getStop()); + super.enterFuncDecl(ctx); } @Override @@ -138,6 +140,8 @@ public void exitFuncDecl(LLVMIRParser.FuncDeclContext ctx) { @Override public void enterFuncDef(LLVMIRParser.FuncDefContext ctx) { + transformToken(LLVMTokenType.FUNCTION_DEF, ctx.getStart(), ctx.getStop()); + super.enterFuncDef(ctx); } @Override @@ -266,10 +270,14 @@ public void exitReturnAttribute(LLVMIRParser.ReturnAttributeContext ctx) { @Override public void enterFuncBody(LLVMIRParser.FuncBodyContext ctx) { + transformToken(LLVMTokenType.FUNCTION_BODY_BEGIN, ctx.getStart(), ctx.getStop()); + super.enterFuncBody(ctx); } @Override public void exitFuncBody(LLVMIRParser.FuncBodyContext ctx) { + transformToken(LLVMTokenType.FUNCTION_BODY_END, ctx.getStart(), ctx.getStop()); + super.exitFuncBody(ctx); } @Override @@ -314,6 +322,8 @@ public void exitValueTerminator(LLVMIRParser.ValueTerminatorContext ctx) { @Override public void enterRetTerm(LLVMIRParser.RetTermContext ctx) { + transformToken(LLVMTokenType.RETURN, ctx.getStart(), ctx.getStop()); + super.enterRetTerm(ctx); } @Override @@ -322,6 +332,8 @@ public void exitRetTerm(LLVMIRParser.RetTermContext ctx) { @Override public void enterBrTerm(LLVMIRParser.BrTermContext ctx) { + transformToken(LLVMTokenType.BRANCH, ctx.getStart(), ctx.getStop()); + super.enterBrTerm(ctx); } @Override @@ -330,6 +342,8 @@ public void exitBrTerm(LLVMIRParser.BrTermContext ctx) { @Override public void enterCondBrTerm(LLVMIRParser.CondBrTermContext ctx) { + transformToken(LLVMTokenType.BRANCH, ctx.getStart(), ctx.getStop()); + super.enterCondBrTerm(ctx); } @Override @@ -338,6 +352,8 @@ public void exitCondBrTerm(LLVMIRParser.CondBrTermContext ctx) { @Override public void enterSwitchTerm(LLVMIRParser.SwitchTermContext ctx) { + transformToken(LLVMTokenType.BRANCH, ctx.getStart(), ctx.getStop()); + super.enterSwitchTerm(ctx); } @Override @@ -346,6 +362,8 @@ public void exitSwitchTerm(LLVMIRParser.SwitchTermContext ctx) { @Override public void enterIndirectBrTerm(LLVMIRParser.IndirectBrTermContext ctx) { + transformToken(LLVMTokenType.BRANCH, ctx.getStart(), ctx.getStop()); + super.enterIndirectBrTerm(ctx); } @Override @@ -354,6 +372,8 @@ public void exitIndirectBrTerm(LLVMIRParser.IndirectBrTermContext ctx) { @Override public void enterResumeTerm(LLVMIRParser.ResumeTermContext ctx) { + transformToken(LLVMTokenType.RESUME, ctx.getStart(), ctx.getStop()); + super.enterResumeTerm(ctx); } @Override @@ -362,6 +382,8 @@ public void exitResumeTerm(LLVMIRParser.ResumeTermContext ctx) { @Override public void enterCatchRetTerm(LLVMIRParser.CatchRetTermContext ctx) { + transformToken(LLVMTokenType.CATCH_RETURN, ctx.getStart(), ctx.getStop()); + super.enterCatchRetTerm(ctx); } @Override @@ -370,6 +392,8 @@ public void exitCatchRetTerm(LLVMIRParser.CatchRetTermContext ctx) { @Override public void enterCleanupRetTerm(LLVMIRParser.CleanupRetTermContext ctx) { + transformToken(LLVMTokenType.CLEAN_UP_RETURN, ctx.getStart(), ctx.getStop()); + super.enterCleanupRetTerm(ctx); } @Override @@ -386,6 +410,8 @@ public void exitUnreachableTerm(LLVMIRParser.UnreachableTermContext ctx) { @Override public void enterInvokeTerm(LLVMIRParser.InvokeTermContext ctx) { + transformToken(LLVMTokenType.INVOKE, ctx.getStart(), ctx.getStop()); + super.enterInvokeTerm(ctx); } @Override @@ -394,6 +420,8 @@ public void exitInvokeTerm(LLVMIRParser.InvokeTermContext ctx) { @Override public void enterCallBrTerm(LLVMIRParser.CallBrTermContext ctx) { + transformToken(LLVMTokenType.CALL_BRANCH, ctx.getStart(), ctx.getStop()); + super.enterCallBrTerm(ctx); } @Override @@ -402,6 +430,8 @@ public void exitCallBrTerm(LLVMIRParser.CallBrTermContext ctx) { @Override public void enterCatchSwitchTerm(LLVMIRParser.CatchSwitchTermContext ctx) { + transformToken(LLVMTokenType.CATCH_SWITCH, ctx.getStart(), ctx.getStop()); + super.enterCatchSwitchTerm(ctx); } @Override @@ -1298,6 +1328,8 @@ public void exitValueInstruction(LLVMIRParser.ValueInstructionContext ctx) { @Override public void enterStoreInst(LLVMIRParser.StoreInstContext ctx) { + transformToken(LLVMTokenType.STORE, ctx.getStart(), ctx.getStop()); + super.enterStoreInst(ctx); } @Override @@ -1322,6 +1354,8 @@ public void exitFenceInst(LLVMIRParser.FenceInstContext ctx) { @Override public void enterFNegInst(LLVMIRParser.FNegInstContext ctx) { + transformToken(LLVMTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + super.enterFNegInst(ctx); } @Override @@ -1330,6 +1364,8 @@ public void exitFNegInst(LLVMIRParser.FNegInstContext ctx) { @Override public void enterAddInst(LLVMIRParser.AddInstContext ctx) { + transformToken(LLVMTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + super.enterAddInst(ctx); } @Override @@ -1338,6 +1374,8 @@ public void exitAddInst(LLVMIRParser.AddInstContext ctx) { @Override public void enterFAddInst(LLVMIRParser.FAddInstContext ctx) { + transformToken(LLVMTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + super.enterFAddInst(ctx); } @Override @@ -1346,6 +1384,8 @@ public void exitFAddInst(LLVMIRParser.FAddInstContext ctx) { @Override public void enterSubInst(LLVMIRParser.SubInstContext ctx) { + transformToken(LLVMTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + super.enterSubInst(ctx); } @Override @@ -1354,6 +1394,8 @@ public void exitSubInst(LLVMIRParser.SubInstContext ctx) { @Override public void enterFSubInst(LLVMIRParser.FSubInstContext ctx) { + transformToken(LLVMTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + super.enterFSubInst(ctx); } @Override @@ -1362,6 +1404,8 @@ public void exitFSubInst(LLVMIRParser.FSubInstContext ctx) { @Override public void enterMulInst(LLVMIRParser.MulInstContext ctx) { + transformToken(LLVMTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + super.enterMulInst(ctx); } @Override @@ -1370,6 +1414,8 @@ public void exitMulInst(LLVMIRParser.MulInstContext ctx) { @Override public void enterFMulInst(LLVMIRParser.FMulInstContext ctx) { + transformToken(LLVMTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + super.enterFMulInst(ctx); } @Override @@ -1378,6 +1424,8 @@ public void exitFMulInst(LLVMIRParser.FMulInstContext ctx) { @Override public void enterUDivInst(LLVMIRParser.UDivInstContext ctx) { + transformToken(LLVMTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + super.enterUDivInst(ctx); } @Override @@ -1386,6 +1434,8 @@ public void exitUDivInst(LLVMIRParser.UDivInstContext ctx) { @Override public void enterSDivInst(LLVMIRParser.SDivInstContext ctx) { + transformToken(LLVMTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + super.enterSDivInst(ctx); } @Override @@ -1394,6 +1444,8 @@ public void exitSDivInst(LLVMIRParser.SDivInstContext ctx) { @Override public void enterFDivInst(LLVMIRParser.FDivInstContext ctx) { + transformToken(LLVMTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + super.enterFDivInst(ctx); } @Override @@ -1402,6 +1454,8 @@ public void exitFDivInst(LLVMIRParser.FDivInstContext ctx) { @Override public void enterURemInst(LLVMIRParser.URemInstContext ctx) { + transformToken(LLVMTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + super.enterURemInst(ctx); } @Override @@ -1410,6 +1464,8 @@ public void exitURemInst(LLVMIRParser.URemInstContext ctx) { @Override public void enterSRemInst(LLVMIRParser.SRemInstContext ctx) { + transformToken(LLVMTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + super.enterSRemInst(ctx); } @Override @@ -1418,6 +1474,8 @@ public void exitSRemInst(LLVMIRParser.SRemInstContext ctx) { @Override public void enterFRemInst(LLVMIRParser.FRemInstContext ctx) { + transformToken(LLVMTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + super.enterFRemInst(ctx); } @Override @@ -1426,6 +1484,8 @@ public void exitFRemInst(LLVMIRParser.FRemInstContext ctx) { @Override public void enterShlInst(LLVMIRParser.ShlInstContext ctx) { + transformToken(LLVMTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + super.enterShlInst(ctx); } @Override @@ -1434,6 +1494,8 @@ public void exitShlInst(LLVMIRParser.ShlInstContext ctx) { @Override public void enterLShrInst(LLVMIRParser.LShrInstContext ctx) { + transformToken(LLVMTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + super.enterLShrInst(ctx); } @Override @@ -1442,6 +1504,8 @@ public void exitLShrInst(LLVMIRParser.LShrInstContext ctx) { @Override public void enterAShrInst(LLVMIRParser.AShrInstContext ctx) { + transformToken(LLVMTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + super.enterAShrInst(ctx); } @Override @@ -1450,6 +1514,8 @@ public void exitAShrInst(LLVMIRParser.AShrInstContext ctx) { @Override public void enterAndInst(LLVMIRParser.AndInstContext ctx) { + transformToken(LLVMTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + super.enterAndInst(ctx); } @Override @@ -1458,6 +1524,8 @@ public void exitAndInst(LLVMIRParser.AndInstContext ctx) { @Override public void enterOrInst(LLVMIRParser.OrInstContext ctx) { + transformToken(LLVMTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + super.enterOrInst(ctx); } @Override @@ -1466,6 +1534,8 @@ public void exitOrInst(LLVMIRParser.OrInstContext ctx) { @Override public void enterXorInst(LLVMIRParser.XorInstContext ctx) { + transformToken(LLVMTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + super.enterXorInst(ctx); } @Override @@ -1474,6 +1544,8 @@ public void exitXorInst(LLVMIRParser.XorInstContext ctx) { @Override public void enterExtractElementInst(LLVMIRParser.ExtractElementInstContext ctx) { + transformToken(LLVMTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + super.enterExtractElementInst(ctx); } @Override @@ -1482,6 +1554,8 @@ public void exitExtractElementInst(LLVMIRParser.ExtractElementInstContext ctx) { @Override public void enterInsertElementInst(LLVMIRParser.InsertElementInstContext ctx) { + transformToken(LLVMTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + super.enterInsertElementInst(ctx); } @Override @@ -1490,6 +1564,8 @@ public void exitInsertElementInst(LLVMIRParser.InsertElementInstContext ctx) { @Override public void enterShuffleVectorInst(LLVMIRParser.ShuffleVectorInstContext ctx) { + transformToken(LLVMTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + super.enterShuffleVectorInst(ctx); } @Override @@ -1498,6 +1574,8 @@ public void exitShuffleVectorInst(LLVMIRParser.ShuffleVectorInstContext ctx) { @Override public void enterExtractValueInst(LLVMIRParser.ExtractValueInstContext ctx) { + transformToken(LLVMTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + super.enterExtractValueInst(ctx); } @Override @@ -1506,6 +1584,8 @@ public void exitExtractValueInst(LLVMIRParser.ExtractValueInstContext ctx) { @Override public void enterInsertValueInst(LLVMIRParser.InsertValueInstContext ctx) { + transformToken(LLVMTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + super.enterInsertValueInst(ctx); } @Override @@ -1514,6 +1594,8 @@ public void exitInsertValueInst(LLVMIRParser.InsertValueInstContext ctx) { @Override public void enterAllocaInst(LLVMIRParser.AllocaInstContext ctx) { + transformToken(LLVMTokenType.ALLOCATION, ctx.getStart(), ctx.getStop()); + super.enterAllocaInst(ctx); } @Override @@ -1522,6 +1604,8 @@ public void exitAllocaInst(LLVMIRParser.AllocaInstContext ctx) { @Override public void enterLoadInst(LLVMIRParser.LoadInstContext ctx) { + transformToken(LLVMTokenType.LOAD, ctx.getStart(), ctx.getStop()); + super.enterLoadInst(ctx); } @Override @@ -1546,6 +1630,8 @@ public void exitAtomicRMWInst(LLVMIRParser.AtomicRMWInstContext ctx) { @Override public void enterGetElementPtrInst(LLVMIRParser.GetElementPtrInstContext ctx) { + transformToken(LLVMTokenType.GET_ELEMENT_POINTER, ctx.getStart(), ctx.getStop()); + super.enterGetElementPtrInst(ctx); } @Override @@ -1554,6 +1640,8 @@ public void exitGetElementPtrInst(LLVMIRParser.GetElementPtrInstContext ctx) { @Override public void enterTruncInst(LLVMIRParser.TruncInstContext ctx) { + transformToken(LLVMTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + super.enterTruncInst(ctx); } @Override @@ -1562,6 +1650,8 @@ public void exitTruncInst(LLVMIRParser.TruncInstContext ctx) { @Override public void enterZExtInst(LLVMIRParser.ZExtInstContext ctx) { + transformToken(LLVMTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + super.enterZExtInst(ctx); } @Override @@ -1570,6 +1660,8 @@ public void exitZExtInst(LLVMIRParser.ZExtInstContext ctx) { @Override public void enterSExtInst(LLVMIRParser.SExtInstContext ctx) { + transformToken(LLVMTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + super.enterSExtInst(ctx); } @Override @@ -1578,6 +1670,8 @@ public void exitSExtInst(LLVMIRParser.SExtInstContext ctx) { @Override public void enterFpTruncInst(LLVMIRParser.FpTruncInstContext ctx) { + transformToken(LLVMTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + super.enterFpTruncInst(ctx); } @Override @@ -1586,6 +1680,8 @@ public void exitFpTruncInst(LLVMIRParser.FpTruncInstContext ctx) { @Override public void enterFpExtInst(LLVMIRParser.FpExtInstContext ctx) { + transformToken(LLVMTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + super.enterFpExtInst(ctx); } @Override @@ -1594,6 +1690,8 @@ public void exitFpExtInst(LLVMIRParser.FpExtInstContext ctx) { @Override public void enterFpToUiInst(LLVMIRParser.FpToUiInstContext ctx) { + transformToken(LLVMTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + super.enterFpToUiInst(ctx); } @Override @@ -1602,6 +1700,8 @@ public void exitFpToUiInst(LLVMIRParser.FpToUiInstContext ctx) { @Override public void enterFpToSiInst(LLVMIRParser.FpToSiInstContext ctx) { + transformToken(LLVMTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + super.enterFpToSiInst(ctx); } @Override @@ -1610,6 +1710,8 @@ public void exitFpToSiInst(LLVMIRParser.FpToSiInstContext ctx) { @Override public void enterUiToFpInst(LLVMIRParser.UiToFpInstContext ctx) { + transformToken(LLVMTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + super.enterUiToFpInst(ctx); } @Override @@ -1618,6 +1720,8 @@ public void exitUiToFpInst(LLVMIRParser.UiToFpInstContext ctx) { @Override public void enterSiToFpInst(LLVMIRParser.SiToFpInstContext ctx) { + transformToken(LLVMTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + super.enterSiToFpInst(ctx); } @Override @@ -1626,6 +1730,8 @@ public void exitSiToFpInst(LLVMIRParser.SiToFpInstContext ctx) { @Override public void enterPtrToIntInst(LLVMIRParser.PtrToIntInstContext ctx) { + transformToken(LLVMTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + super.enterPtrToIntInst(ctx); } @Override @@ -1634,6 +1740,8 @@ public void exitPtrToIntInst(LLVMIRParser.PtrToIntInstContext ctx) { @Override public void enterIntToPtrInst(LLVMIRParser.IntToPtrInstContext ctx) { + transformToken(LLVMTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + super.enterIntToPtrInst(ctx); } @Override @@ -1642,6 +1750,8 @@ public void exitIntToPtrInst(LLVMIRParser.IntToPtrInstContext ctx) { @Override public void enterBitCastInst(LLVMIRParser.BitCastInstContext ctx) { + transformToken(LLVMTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + super.enterBitCastInst(ctx); } @Override @@ -1650,6 +1760,8 @@ public void exitBitCastInst(LLVMIRParser.BitCastInstContext ctx) { @Override public void enterAddrSpaceCastInst(LLVMIRParser.AddrSpaceCastInstContext ctx) { + transformToken(LLVMTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + super.enterAddrSpaceCastInst(ctx); } @Override @@ -1658,6 +1770,8 @@ public void exitAddrSpaceCastInst(LLVMIRParser.AddrSpaceCastInstContext ctx) { @Override public void enterICmpInst(LLVMIRParser.ICmpInstContext ctx) { + transformToken(LLVMTokenType.COMPARISON, ctx.getStart(), ctx.getStop()); + super.enterICmpInst(ctx); } @Override @@ -1666,6 +1780,8 @@ public void exitICmpInst(LLVMIRParser.ICmpInstContext ctx) { @Override public void enterFCmpInst(LLVMIRParser.FCmpInstContext ctx) { + transformToken(LLVMTokenType.COMPARISON, ctx.getStart(), ctx.getStop()); + super.enterFCmpInst(ctx); } @Override @@ -1674,6 +1790,8 @@ public void exitFCmpInst(LLVMIRParser.FCmpInstContext ctx) { @Override public void enterPhiInst(LLVMIRParser.PhiInstContext ctx) { + transformToken(LLVMTokenType.PHI, ctx.getStart(), ctx.getStop()); + super.enterPhiInst(ctx); } @Override @@ -1698,6 +1816,8 @@ public void exitFreezeInst(LLVMIRParser.FreezeInstContext ctx) { @Override public void enterCallInst(LLVMIRParser.CallInstContext ctx) { + transformToken(LLVMTokenType.CALL, ctx.getStart(), ctx.getStop()); + super.enterCallInst(ctx); } @Override diff --git a/languages/llvmir/src/main/java/de/jplag/llvmir/LLVMTokenType.java b/languages/llvmir/src/main/java/de/jplag/llvmir/LLVMTokenType.java index e778089b9..f9c6bb37f 100644 --- a/languages/llvmir/src/main/java/de/jplag/llvmir/LLVMTokenType.java +++ b/languages/llvmir/src/main/java/de/jplag/llvmir/LLVMTokenType.java @@ -3,7 +3,28 @@ import de.jplag.TokenType; public enum LLVMTokenType implements TokenType { - ; + + FUNCTION_BODY_BEGIN("FUNC{"), + FUNCTION_BODY_END("}FUNC"), + FUNCTION_DECL("FUNC_DECL"), + FUNCTION_DEF("FUNC_DEF"), + RETURN("RET"), + BRANCH("BR"), + INVOKE("INVOKE"), + CALL_BRANCH("CALL_BR"), + RESUME("RESUME"), + CATCH_SWITCH("CATCH"), + CATCH_RETURN("CATCH_RET"), + CLEAN_UP_RETURN("CLEAN_UP_RET"), + OPERATION("OP"), + ALLOCATION("ALLOC"), + LOAD("LOAD"), + STORE("STORE"), + GET_ELEMENT_POINTER("GET_ELEMENT_PTR"), + CONVERSION("CONV"), + COMPARISON("COMP"), + PHI("PHI"), + CALL("CALL"); private final String description; From cf112c888273d97aee55201b720c959379300087 Mon Sep 17 00:00:00 2001 From: Niklas Heneka <93838730+NiklasHeneka@users.noreply.github.com> Date: Thu, 6 Jul 2023 21:25:02 +0200 Subject: [PATCH 004/232] Refactor LLVM IR module and fix several issues. --- coverage-report/pom.xml | 5 + ...Listener.java => JPlagLLVMIRListener.java} | 136 +++++++++--------- ...rAdapter.java => LLVMIRParserAdapter.java} | 16 ++- ...LVMTokenType.java => LLVMIRTokenType.java} | 4 +- .../main/java/de/jplag/llvmir/Language.java | 4 +- pom.xml | 13 -- 6 files changed, 88 insertions(+), 90 deletions(-) rename languages/llvmir/src/main/java/de/jplag/llvmir/{JPlagLLVMListener.java => JPlagLLVMIRListener.java} (93%) rename languages/llvmir/src/main/java/de/jplag/llvmir/{LLVMParserAdapter.java => LLVMIRParserAdapter.java} (78%) rename languages/llvmir/src/main/java/de/jplag/llvmir/{LLVMTokenType.java => LLVMIRTokenType.java} (89%) diff --git a/coverage-report/pom.xml b/coverage-report/pom.xml index 223bed320..8a10f5315 100644 --- a/coverage-report/pom.xml +++ b/coverage-report/pom.xml @@ -96,6 +96,11 @@ emf-metamodel ${revision} + + de.jplag + llvmir + ${revision} + diff --git a/languages/llvmir/src/main/java/de/jplag/llvmir/JPlagLLVMListener.java b/languages/llvmir/src/main/java/de/jplag/llvmir/JPlagLLVMIRListener.java similarity index 93% rename from languages/llvmir/src/main/java/de/jplag/llvmir/JPlagLLVMListener.java rename to languages/llvmir/src/main/java/de/jplag/llvmir/JPlagLLVMIRListener.java index f4c9c193e..ae53f42bd 100644 --- a/languages/llvmir/src/main/java/de/jplag/llvmir/JPlagLLVMListener.java +++ b/languages/llvmir/src/main/java/de/jplag/llvmir/JPlagLLVMIRListener.java @@ -1,14 +1,18 @@ package de.jplag.llvmir; +import org.antlr.v4.runtime.ParserRuleContext; import org.antlr.v4.runtime.Token; +import org.antlr.v4.runtime.tree.ErrorNode; +import org.antlr.v4.runtime.tree.TerminalNode; -import de.jplag.kotlin.grammar.LLVMIRParser; +import de.jplag.llvmir.grammar.LLVMIRBaseListener; +import de.jplag.llvmir.grammar.LLVMIRParser; -public class JPlagLLVMListener extends LLVMParserBaseListener { +public class JPlagLLVMIRListener extends LLVMIRBaseListener { - private final LLVMParserAdapter parserAdapter; + private final LLVMIRParserAdapter parserAdapter; - public JPlagLLVMListener(LLVMParserAdapter parserAdapter) { + public JPlagLLVMIRListener(LLVMIRParserAdapter parserAdapter) { this.parserAdapter = parserAdapter; } @@ -17,7 +21,7 @@ public JPlagLLVMListener(LLVMParserAdapter parserAdapter) { * @param tokenType the custom token type that occurred. * @param token the corresponding grammar's token */ - private void transformToken(LLVMTokenType tokenType, Token token) { + private void transformToken(LLVMIRTokenType tokenType, Token token) { parserAdapter.addToken(tokenType, token.getLine(), token.getCharPositionInLine() + 1, token.getText().length()); } @@ -28,7 +32,7 @@ private void transformToken(LLVMTokenType tokenType, Token token) { * @param start the first Token of the context * @param end the last Token of the context */ - private void transformToken(LLVMTokenType tokenType, Token start, Token end) { + private void transformToken(LLVMIRTokenType tokenType, Token start, Token end) { parserAdapter.addToken(tokenType, start.getLine(), start.getCharPositionInLine() + 1, end.getStopIndex() - start.getStartIndex() + 1); } @@ -130,7 +134,7 @@ public void exitIndirectSymbolDef(LLVMIRParser.IndirectSymbolDefContext ctx) { @Override public void enterFuncDecl(LLVMIRParser.FuncDeclContext ctx) { - transformToken(LLVMTokenType.FUNCTION_DECL, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.FUNCTION_DECL, ctx.getStart(), ctx.getStop()); super.enterFuncDecl(ctx); } @@ -140,7 +144,7 @@ public void exitFuncDecl(LLVMIRParser.FuncDeclContext ctx) { @Override public void enterFuncDef(LLVMIRParser.FuncDefContext ctx) { - transformToken(LLVMTokenType.FUNCTION_DEF, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.FUNCTION_DEF, ctx.getStart(), ctx.getStop()); super.enterFuncDef(ctx); } @@ -270,13 +274,13 @@ public void exitReturnAttribute(LLVMIRParser.ReturnAttributeContext ctx) { @Override public void enterFuncBody(LLVMIRParser.FuncBodyContext ctx) { - transformToken(LLVMTokenType.FUNCTION_BODY_BEGIN, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.FUNCTION_BODY_BEGIN, ctx.getStart(), ctx.getStop()); super.enterFuncBody(ctx); } @Override public void exitFuncBody(LLVMIRParser.FuncBodyContext ctx) { - transformToken(LLVMTokenType.FUNCTION_BODY_END, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.FUNCTION_BODY_END, ctx.getStart(), ctx.getStop()); super.exitFuncBody(ctx); } @@ -322,7 +326,7 @@ public void exitValueTerminator(LLVMIRParser.ValueTerminatorContext ctx) { @Override public void enterRetTerm(LLVMIRParser.RetTermContext ctx) { - transformToken(LLVMTokenType.RETURN, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.RETURN, ctx.getStart(), ctx.getStop()); super.enterRetTerm(ctx); } @@ -332,7 +336,7 @@ public void exitRetTerm(LLVMIRParser.RetTermContext ctx) { @Override public void enterBrTerm(LLVMIRParser.BrTermContext ctx) { - transformToken(LLVMTokenType.BRANCH, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.BRANCH, ctx.getStart(), ctx.getStop()); super.enterBrTerm(ctx); } @@ -342,7 +346,7 @@ public void exitBrTerm(LLVMIRParser.BrTermContext ctx) { @Override public void enterCondBrTerm(LLVMIRParser.CondBrTermContext ctx) { - transformToken(LLVMTokenType.BRANCH, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.BRANCH, ctx.getStart(), ctx.getStop()); super.enterCondBrTerm(ctx); } @@ -352,7 +356,7 @@ public void exitCondBrTerm(LLVMIRParser.CondBrTermContext ctx) { @Override public void enterSwitchTerm(LLVMIRParser.SwitchTermContext ctx) { - transformToken(LLVMTokenType.BRANCH, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.BRANCH, ctx.getStart(), ctx.getStop()); super.enterSwitchTerm(ctx); } @@ -362,7 +366,7 @@ public void exitSwitchTerm(LLVMIRParser.SwitchTermContext ctx) { @Override public void enterIndirectBrTerm(LLVMIRParser.IndirectBrTermContext ctx) { - transformToken(LLVMTokenType.BRANCH, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.BRANCH, ctx.getStart(), ctx.getStop()); super.enterIndirectBrTerm(ctx); } @@ -372,7 +376,7 @@ public void exitIndirectBrTerm(LLVMIRParser.IndirectBrTermContext ctx) { @Override public void enterResumeTerm(LLVMIRParser.ResumeTermContext ctx) { - transformToken(LLVMTokenType.RESUME, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.RESUME, ctx.getStart(), ctx.getStop()); super.enterResumeTerm(ctx); } @@ -382,7 +386,7 @@ public void exitResumeTerm(LLVMIRParser.ResumeTermContext ctx) { @Override public void enterCatchRetTerm(LLVMIRParser.CatchRetTermContext ctx) { - transformToken(LLVMTokenType.CATCH_RETURN, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.CATCH_RETURN, ctx.getStart(), ctx.getStop()); super.enterCatchRetTerm(ctx); } @@ -392,7 +396,7 @@ public void exitCatchRetTerm(LLVMIRParser.CatchRetTermContext ctx) { @Override public void enterCleanupRetTerm(LLVMIRParser.CleanupRetTermContext ctx) { - transformToken(LLVMTokenType.CLEAN_UP_RETURN, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.CLEAN_UP_RETURN, ctx.getStart(), ctx.getStop()); super.enterCleanupRetTerm(ctx); } @@ -410,7 +414,7 @@ public void exitUnreachableTerm(LLVMIRParser.UnreachableTermContext ctx) { @Override public void enterInvokeTerm(LLVMIRParser.InvokeTermContext ctx) { - transformToken(LLVMTokenType.INVOKE, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.INVOKE, ctx.getStart(), ctx.getStop()); super.enterInvokeTerm(ctx); } @@ -420,7 +424,7 @@ public void exitInvokeTerm(LLVMIRParser.InvokeTermContext ctx) { @Override public void enterCallBrTerm(LLVMIRParser.CallBrTermContext ctx) { - transformToken(LLVMTokenType.CALL_BRANCH, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.CALL_BRANCH, ctx.getStart(), ctx.getStop()); super.enterCallBrTerm(ctx); } @@ -430,7 +434,7 @@ public void exitCallBrTerm(LLVMIRParser.CallBrTermContext ctx) { @Override public void enterCatchSwitchTerm(LLVMIRParser.CatchSwitchTermContext ctx) { - transformToken(LLVMTokenType.CATCH_SWITCH, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.CATCH_SWITCH, ctx.getStart(), ctx.getStop()); super.enterCatchSwitchTerm(ctx); } @@ -1328,7 +1332,7 @@ public void exitValueInstruction(LLVMIRParser.ValueInstructionContext ctx) { @Override public void enterStoreInst(LLVMIRParser.StoreInstContext ctx) { - transformToken(LLVMTokenType.STORE, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.STORE, ctx.getStart(), ctx.getStop()); super.enterStoreInst(ctx); } @@ -1354,7 +1358,7 @@ public void exitFenceInst(LLVMIRParser.FenceInstContext ctx) { @Override public void enterFNegInst(LLVMIRParser.FNegInstContext ctx) { - transformToken(LLVMTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.OPERATION, ctx.getStart(), ctx.getStop()); super.enterFNegInst(ctx); } @@ -1364,7 +1368,7 @@ public void exitFNegInst(LLVMIRParser.FNegInstContext ctx) { @Override public void enterAddInst(LLVMIRParser.AddInstContext ctx) { - transformToken(LLVMTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.OPERATION, ctx.getStart(), ctx.getStop()); super.enterAddInst(ctx); } @@ -1374,7 +1378,7 @@ public void exitAddInst(LLVMIRParser.AddInstContext ctx) { @Override public void enterFAddInst(LLVMIRParser.FAddInstContext ctx) { - transformToken(LLVMTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.OPERATION, ctx.getStart(), ctx.getStop()); super.enterFAddInst(ctx); } @@ -1384,7 +1388,7 @@ public void exitFAddInst(LLVMIRParser.FAddInstContext ctx) { @Override public void enterSubInst(LLVMIRParser.SubInstContext ctx) { - transformToken(LLVMTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.OPERATION, ctx.getStart(), ctx.getStop()); super.enterSubInst(ctx); } @@ -1394,7 +1398,7 @@ public void exitSubInst(LLVMIRParser.SubInstContext ctx) { @Override public void enterFSubInst(LLVMIRParser.FSubInstContext ctx) { - transformToken(LLVMTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.OPERATION, ctx.getStart(), ctx.getStop()); super.enterFSubInst(ctx); } @@ -1404,7 +1408,7 @@ public void exitFSubInst(LLVMIRParser.FSubInstContext ctx) { @Override public void enterMulInst(LLVMIRParser.MulInstContext ctx) { - transformToken(LLVMTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.OPERATION, ctx.getStart(), ctx.getStop()); super.enterMulInst(ctx); } @@ -1414,7 +1418,7 @@ public void exitMulInst(LLVMIRParser.MulInstContext ctx) { @Override public void enterFMulInst(LLVMIRParser.FMulInstContext ctx) { - transformToken(LLVMTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.OPERATION, ctx.getStart(), ctx.getStop()); super.enterFMulInst(ctx); } @@ -1424,7 +1428,7 @@ public void exitFMulInst(LLVMIRParser.FMulInstContext ctx) { @Override public void enterUDivInst(LLVMIRParser.UDivInstContext ctx) { - transformToken(LLVMTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.OPERATION, ctx.getStart(), ctx.getStop()); super.enterUDivInst(ctx); } @@ -1434,7 +1438,7 @@ public void exitUDivInst(LLVMIRParser.UDivInstContext ctx) { @Override public void enterSDivInst(LLVMIRParser.SDivInstContext ctx) { - transformToken(LLVMTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.OPERATION, ctx.getStart(), ctx.getStop()); super.enterSDivInst(ctx); } @@ -1444,7 +1448,7 @@ public void exitSDivInst(LLVMIRParser.SDivInstContext ctx) { @Override public void enterFDivInst(LLVMIRParser.FDivInstContext ctx) { - transformToken(LLVMTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.OPERATION, ctx.getStart(), ctx.getStop()); super.enterFDivInst(ctx); } @@ -1454,7 +1458,7 @@ public void exitFDivInst(LLVMIRParser.FDivInstContext ctx) { @Override public void enterURemInst(LLVMIRParser.URemInstContext ctx) { - transformToken(LLVMTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.OPERATION, ctx.getStart(), ctx.getStop()); super.enterURemInst(ctx); } @@ -1464,7 +1468,7 @@ public void exitURemInst(LLVMIRParser.URemInstContext ctx) { @Override public void enterSRemInst(LLVMIRParser.SRemInstContext ctx) { - transformToken(LLVMTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.OPERATION, ctx.getStart(), ctx.getStop()); super.enterSRemInst(ctx); } @@ -1474,7 +1478,7 @@ public void exitSRemInst(LLVMIRParser.SRemInstContext ctx) { @Override public void enterFRemInst(LLVMIRParser.FRemInstContext ctx) { - transformToken(LLVMTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.OPERATION, ctx.getStart(), ctx.getStop()); super.enterFRemInst(ctx); } @@ -1484,7 +1488,7 @@ public void exitFRemInst(LLVMIRParser.FRemInstContext ctx) { @Override public void enterShlInst(LLVMIRParser.ShlInstContext ctx) { - transformToken(LLVMTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.OPERATION, ctx.getStart(), ctx.getStop()); super.enterShlInst(ctx); } @@ -1494,7 +1498,7 @@ public void exitShlInst(LLVMIRParser.ShlInstContext ctx) { @Override public void enterLShrInst(LLVMIRParser.LShrInstContext ctx) { - transformToken(LLVMTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.OPERATION, ctx.getStart(), ctx.getStop()); super.enterLShrInst(ctx); } @@ -1504,7 +1508,7 @@ public void exitLShrInst(LLVMIRParser.LShrInstContext ctx) { @Override public void enterAShrInst(LLVMIRParser.AShrInstContext ctx) { - transformToken(LLVMTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.OPERATION, ctx.getStart(), ctx.getStop()); super.enterAShrInst(ctx); } @@ -1514,7 +1518,7 @@ public void exitAShrInst(LLVMIRParser.AShrInstContext ctx) { @Override public void enterAndInst(LLVMIRParser.AndInstContext ctx) { - transformToken(LLVMTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.OPERATION, ctx.getStart(), ctx.getStop()); super.enterAndInst(ctx); } @@ -1524,7 +1528,7 @@ public void exitAndInst(LLVMIRParser.AndInstContext ctx) { @Override public void enterOrInst(LLVMIRParser.OrInstContext ctx) { - transformToken(LLVMTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.OPERATION, ctx.getStart(), ctx.getStop()); super.enterOrInst(ctx); } @@ -1534,7 +1538,7 @@ public void exitOrInst(LLVMIRParser.OrInstContext ctx) { @Override public void enterXorInst(LLVMIRParser.XorInstContext ctx) { - transformToken(LLVMTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.OPERATION, ctx.getStart(), ctx.getStop()); super.enterXorInst(ctx); } @@ -1544,7 +1548,7 @@ public void exitXorInst(LLVMIRParser.XorInstContext ctx) { @Override public void enterExtractElementInst(LLVMIRParser.ExtractElementInstContext ctx) { - transformToken(LLVMTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.OPERATION, ctx.getStart(), ctx.getStop()); super.enterExtractElementInst(ctx); } @@ -1554,7 +1558,7 @@ public void exitExtractElementInst(LLVMIRParser.ExtractElementInstContext ctx) { @Override public void enterInsertElementInst(LLVMIRParser.InsertElementInstContext ctx) { - transformToken(LLVMTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.OPERATION, ctx.getStart(), ctx.getStop()); super.enterInsertElementInst(ctx); } @@ -1564,7 +1568,7 @@ public void exitInsertElementInst(LLVMIRParser.InsertElementInstContext ctx) { @Override public void enterShuffleVectorInst(LLVMIRParser.ShuffleVectorInstContext ctx) { - transformToken(LLVMTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.OPERATION, ctx.getStart(), ctx.getStop()); super.enterShuffleVectorInst(ctx); } @@ -1574,7 +1578,7 @@ public void exitShuffleVectorInst(LLVMIRParser.ShuffleVectorInstContext ctx) { @Override public void enterExtractValueInst(LLVMIRParser.ExtractValueInstContext ctx) { - transformToken(LLVMTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.OPERATION, ctx.getStart(), ctx.getStop()); super.enterExtractValueInst(ctx); } @@ -1584,7 +1588,7 @@ public void exitExtractValueInst(LLVMIRParser.ExtractValueInstContext ctx) { @Override public void enterInsertValueInst(LLVMIRParser.InsertValueInstContext ctx) { - transformToken(LLVMTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.OPERATION, ctx.getStart(), ctx.getStop()); super.enterInsertValueInst(ctx); } @@ -1594,7 +1598,7 @@ public void exitInsertValueInst(LLVMIRParser.InsertValueInstContext ctx) { @Override public void enterAllocaInst(LLVMIRParser.AllocaInstContext ctx) { - transformToken(LLVMTokenType.ALLOCATION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.ALLOCATION, ctx.getStart(), ctx.getStop()); super.enterAllocaInst(ctx); } @@ -1604,7 +1608,7 @@ public void exitAllocaInst(LLVMIRParser.AllocaInstContext ctx) { @Override public void enterLoadInst(LLVMIRParser.LoadInstContext ctx) { - transformToken(LLVMTokenType.LOAD, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.LOAD, ctx.getStart(), ctx.getStop()); super.enterLoadInst(ctx); } @@ -1630,7 +1634,7 @@ public void exitAtomicRMWInst(LLVMIRParser.AtomicRMWInstContext ctx) { @Override public void enterGetElementPtrInst(LLVMIRParser.GetElementPtrInstContext ctx) { - transformToken(LLVMTokenType.GET_ELEMENT_POINTER, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.GET_ELEMENT_POINTER, ctx.getStart(), ctx.getStop()); super.enterGetElementPtrInst(ctx); } @@ -1640,7 +1644,7 @@ public void exitGetElementPtrInst(LLVMIRParser.GetElementPtrInstContext ctx) { @Override public void enterTruncInst(LLVMIRParser.TruncInstContext ctx) { - transformToken(LLVMTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); super.enterTruncInst(ctx); } @@ -1650,7 +1654,7 @@ public void exitTruncInst(LLVMIRParser.TruncInstContext ctx) { @Override public void enterZExtInst(LLVMIRParser.ZExtInstContext ctx) { - transformToken(LLVMTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); super.enterZExtInst(ctx); } @@ -1660,7 +1664,7 @@ public void exitZExtInst(LLVMIRParser.ZExtInstContext ctx) { @Override public void enterSExtInst(LLVMIRParser.SExtInstContext ctx) { - transformToken(LLVMTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); super.enterSExtInst(ctx); } @@ -1670,7 +1674,7 @@ public void exitSExtInst(LLVMIRParser.SExtInstContext ctx) { @Override public void enterFpTruncInst(LLVMIRParser.FpTruncInstContext ctx) { - transformToken(LLVMTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); super.enterFpTruncInst(ctx); } @@ -1680,7 +1684,7 @@ public void exitFpTruncInst(LLVMIRParser.FpTruncInstContext ctx) { @Override public void enterFpExtInst(LLVMIRParser.FpExtInstContext ctx) { - transformToken(LLVMTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); super.enterFpExtInst(ctx); } @@ -1690,7 +1694,7 @@ public void exitFpExtInst(LLVMIRParser.FpExtInstContext ctx) { @Override public void enterFpToUiInst(LLVMIRParser.FpToUiInstContext ctx) { - transformToken(LLVMTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); super.enterFpToUiInst(ctx); } @@ -1700,7 +1704,7 @@ public void exitFpToUiInst(LLVMIRParser.FpToUiInstContext ctx) { @Override public void enterFpToSiInst(LLVMIRParser.FpToSiInstContext ctx) { - transformToken(LLVMTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); super.enterFpToSiInst(ctx); } @@ -1710,7 +1714,7 @@ public void exitFpToSiInst(LLVMIRParser.FpToSiInstContext ctx) { @Override public void enterUiToFpInst(LLVMIRParser.UiToFpInstContext ctx) { - transformToken(LLVMTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); super.enterUiToFpInst(ctx); } @@ -1720,7 +1724,7 @@ public void exitUiToFpInst(LLVMIRParser.UiToFpInstContext ctx) { @Override public void enterSiToFpInst(LLVMIRParser.SiToFpInstContext ctx) { - transformToken(LLVMTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); super.enterSiToFpInst(ctx); } @@ -1730,7 +1734,7 @@ public void exitSiToFpInst(LLVMIRParser.SiToFpInstContext ctx) { @Override public void enterPtrToIntInst(LLVMIRParser.PtrToIntInstContext ctx) { - transformToken(LLVMTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); super.enterPtrToIntInst(ctx); } @@ -1740,7 +1744,7 @@ public void exitPtrToIntInst(LLVMIRParser.PtrToIntInstContext ctx) { @Override public void enterIntToPtrInst(LLVMIRParser.IntToPtrInstContext ctx) { - transformToken(LLVMTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); super.enterIntToPtrInst(ctx); } @@ -1750,7 +1754,7 @@ public void exitIntToPtrInst(LLVMIRParser.IntToPtrInstContext ctx) { @Override public void enterBitCastInst(LLVMIRParser.BitCastInstContext ctx) { - transformToken(LLVMTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); super.enterBitCastInst(ctx); } @@ -1760,7 +1764,7 @@ public void exitBitCastInst(LLVMIRParser.BitCastInstContext ctx) { @Override public void enterAddrSpaceCastInst(LLVMIRParser.AddrSpaceCastInstContext ctx) { - transformToken(LLVMTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); super.enterAddrSpaceCastInst(ctx); } @@ -1770,7 +1774,7 @@ public void exitAddrSpaceCastInst(LLVMIRParser.AddrSpaceCastInstContext ctx) { @Override public void enterICmpInst(LLVMIRParser.ICmpInstContext ctx) { - transformToken(LLVMTokenType.COMPARISON, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.COMPARISON, ctx.getStart(), ctx.getStop()); super.enterICmpInst(ctx); } @@ -1780,7 +1784,7 @@ public void exitICmpInst(LLVMIRParser.ICmpInstContext ctx) { @Override public void enterFCmpInst(LLVMIRParser.FCmpInstContext ctx) { - transformToken(LLVMTokenType.COMPARISON, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.COMPARISON, ctx.getStart(), ctx.getStop()); super.enterFCmpInst(ctx); } @@ -1790,7 +1794,7 @@ public void exitFCmpInst(LLVMIRParser.FCmpInstContext ctx) { @Override public void enterPhiInst(LLVMIRParser.PhiInstContext ctx) { - transformToken(LLVMTokenType.PHI, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.PHI, ctx.getStart(), ctx.getStop()); super.enterPhiInst(ctx); } @@ -1816,7 +1820,7 @@ public void exitFreezeInst(LLVMIRParser.FreezeInstContext ctx) { @Override public void enterCallInst(LLVMIRParser.CallInstContext ctx) { - transformToken(LLVMTokenType.CALL, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.CALL, ctx.getStart(), ctx.getStop()); super.enterCallInst(ctx); } diff --git a/languages/llvmir/src/main/java/de/jplag/llvmir/LLVMParserAdapter.java b/languages/llvmir/src/main/java/de/jplag/llvmir/LLVMIRParserAdapter.java similarity index 78% rename from languages/llvmir/src/main/java/de/jplag/llvmir/LLVMParserAdapter.java rename to languages/llvmir/src/main/java/de/jplag/llvmir/LLVMIRParserAdapter.java index c00e14c57..4ea49bed1 100644 --- a/languages/llvmir/src/main/java/de/jplag/llvmir/LLVMParserAdapter.java +++ b/languages/llvmir/src/main/java/de/jplag/llvmir/LLVMIRParserAdapter.java @@ -16,8 +16,10 @@ import de.jplag.AbstractParser; import de.jplag.ParsingException; import de.jplag.Token; +import de.jplag.llvmir.grammar.LLVMIRLexer; +import de.jplag.llvmir.grammar.LLVMIRParser; -public class LLVMParserAdapter extends AbstractParser { +public class LLVMIRParserAdapter extends AbstractParser { private File currentFile; private List tokens; @@ -25,7 +27,7 @@ public class LLVMParserAdapter extends AbstractParser { /** * Creates the LLVMParserAdapter */ - public LLVMParserAdapter() { + public LLVMIRParserAdapter() { super(); } @@ -47,14 +49,14 @@ private void parseFile(File file) throws ParsingException { try (FileInputStream inputStream = new FileInputStream(file)) { currentFile = file; - LLVMLexer lexer = new LLVMLexer(CharStreams.fromStream(inputStream)); + LLVMIRLexer lexer = new LLVMIRLexer(CharStreams.fromStream(inputStream)); CommonTokenStream tokenStream = new CommonTokenStream(lexer); - LLVMParser parser = new LLVMParser(tokenStream); + LLVMIRParser parser = new LLVMIRParser(tokenStream); - ParserRuleContext entryContext = parser.llvmFile(); + ParserRuleContext entryContext = parser.compilationUnit(); ParseTreeWalker treeWalker = new ParseTreeWalker(); - JPlagLLVMListener listener = new JPlagLLVMListener(this); + JPlagLLVMIRListener listener = new JPlagLLVMIRListener(this); for (int i = 0; i < entryContext.getChildCount(); i++) { ParseTree parseTree = entryContext.getChild(i); treeWalker.walk(listener, parseTree); @@ -71,7 +73,7 @@ private void parseFile(File file) throws ParsingException { * @param column the start column of the Token in the line * @param length the length of the Token */ - /* package-private */ void addToken(LLVMTokenType tokenType, int line, int column, int length) { + /* package-private */ void addToken(LLVMIRTokenType tokenType, int line, int column, int length) { tokens.add(new Token(tokenType, currentFile, line, column, length)); } } diff --git a/languages/llvmir/src/main/java/de/jplag/llvmir/LLVMTokenType.java b/languages/llvmir/src/main/java/de/jplag/llvmir/LLVMIRTokenType.java similarity index 89% rename from languages/llvmir/src/main/java/de/jplag/llvmir/LLVMTokenType.java rename to languages/llvmir/src/main/java/de/jplag/llvmir/LLVMIRTokenType.java index f9c6bb37f..e0d2ee84b 100644 --- a/languages/llvmir/src/main/java/de/jplag/llvmir/LLVMTokenType.java +++ b/languages/llvmir/src/main/java/de/jplag/llvmir/LLVMIRTokenType.java @@ -2,7 +2,7 @@ import de.jplag.TokenType; -public enum LLVMTokenType implements TokenType { +public enum LLVMIRTokenType implements TokenType { FUNCTION_BODY_BEGIN("FUNC{"), FUNCTION_BODY_END("}FUNC"), @@ -32,7 +32,7 @@ public String getDescription() { return description; } - LLVMTokenType(String description) { + LLVMIRTokenType(String description) { this.description = description; } } diff --git a/languages/llvmir/src/main/java/de/jplag/llvmir/Language.java b/languages/llvmir/src/main/java/de/jplag/llvmir/Language.java index 58e45443e..1426d9eee 100644 --- a/languages/llvmir/src/main/java/de/jplag/llvmir/Language.java +++ b/languages/llvmir/src/main/java/de/jplag/llvmir/Language.java @@ -19,10 +19,10 @@ public class Language implements de.jplag.Language { private static final String IDENTIFIER = "llvmir"; private static final int DEFAULT_MIN_TOKEN_MATCH = 10; private static final String[] FILE_EXTENSIONS = {".ll"}; - private final LLVMParserAdapter parserAdapter; + private final LLVMIRParserAdapter parserAdapter; public Language() { - this.parserAdapter = new LLVMParserAdapter(); + this.parserAdapter = new LLVMIRParserAdapter(); } @Override diff --git a/pom.xml b/pom.xml index 07d4e5ad0..76d0a334d 100644 --- a/pom.xml +++ b/pom.xml @@ -326,19 +326,6 @@ - - org.apache.maven.plugins - maven-javadoc-plugin - 3.5.0 - - - attach-javadocs - - jar - - - - org.apache.maven.plugins maven-source-plugin From 0459797085a9512d14e490d5083ab04b76c1a38e Mon Sep 17 00:00:00 2001 From: Niklas Heneka <93838730+NiklasHeneka@users.noreply.github.com> Date: Sun, 9 Jul 2023 16:28:42 +0200 Subject: [PATCH 005/232] Add new token types to the LLVM IR language module. --- .../de/jplag/llvmir/JPlagLLVMIRListener.java | 14 ++++++++++ .../java/de/jplag/llvmir/LLVMIRTokenType.java | 28 +++++++++++++++---- 2 files changed, 37 insertions(+), 5 deletions(-) diff --git a/languages/llvmir/src/main/java/de/jplag/llvmir/JPlagLLVMIRListener.java b/languages/llvmir/src/main/java/de/jplag/llvmir/JPlagLLVMIRListener.java index ae53f42bd..323f48eb9 100644 --- a/languages/llvmir/src/main/java/de/jplag/llvmir/JPlagLLVMIRListener.java +++ b/languages/llvmir/src/main/java/de/jplag/llvmir/JPlagLLVMIRListener.java @@ -1350,6 +1350,8 @@ public void exitSyncScope(LLVMIRParser.SyncScopeContext ctx) { @Override public void enterFenceInst(LLVMIRParser.FenceInstContext ctx) { + transformToken(LLVMIRTokenType.FENCE, ctx.getStart(), ctx.getStop()); + super.enterFenceInst(ctx); } @Override @@ -1618,6 +1620,8 @@ public void exitLoadInst(LLVMIRParser.LoadInstContext ctx) { @Override public void enterCmpXchgInst(LLVMIRParser.CmpXchgInstContext ctx) { + transformToken(LLVMIRTokenType.COMPARE_EXCHANGE, ctx.getStart(), ctx.getStop()); + super.enterCmpXchgInst(ctx); } @Override @@ -1626,6 +1630,8 @@ public void exitCmpXchgInst(LLVMIRParser.CmpXchgInstContext ctx) { @Override public void enterAtomicRMWInst(LLVMIRParser.AtomicRMWInstContext ctx) { + transformToken(LLVMIRTokenType.ATOMIC_CRMW, ctx.getStart(), ctx.getStop()); + super.enterAtomicRMWInst(ctx); } @Override @@ -1804,6 +1810,8 @@ public void exitPhiInst(LLVMIRParser.PhiInstContext ctx) { @Override public void enterSelectInst(LLVMIRParser.SelectInstContext ctx) { + transformToken(LLVMIRTokenType.SELECT, ctx.getStart(), ctx.getStop()); + super.enterSelectInst(ctx); } @Override @@ -1838,6 +1846,8 @@ public void exitVaargInst(LLVMIRParser.VaargInstContext ctx) { @Override public void enterLandingPadInst(LLVMIRParser.LandingPadInstContext ctx) { + transformToken(LLVMIRTokenType.LANDING_PAD, ctx.getStart(), ctx.getStop()); + super.enterLandingPadInst(ctx); } @Override @@ -1846,6 +1856,8 @@ public void exitLandingPadInst(LLVMIRParser.LandingPadInstContext ctx) { @Override public void enterCatchPadInst(LLVMIRParser.CatchPadInstContext ctx) { + transformToken(LLVMIRTokenType.CATCH_PAD, ctx.getStart(), ctx.getStop()); + super.enterCatchPadInst(ctx); } @Override @@ -1854,6 +1866,8 @@ public void exitCatchPadInst(LLVMIRParser.CatchPadInstContext ctx) { @Override public void enterCleanupPadInst(LLVMIRParser.CleanupPadInstContext ctx) { + transformToken(LLVMIRTokenType.CLEAN_UP_PAD, ctx.getStart(), ctx.getStop()); + super.enterCleanupPadInst(ctx); } @Override diff --git a/languages/llvmir/src/main/java/de/jplag/llvmir/LLVMIRTokenType.java b/languages/llvmir/src/main/java/de/jplag/llvmir/LLVMIRTokenType.java index e0d2ee84b..d2ef8fef2 100644 --- a/languages/llvmir/src/main/java/de/jplag/llvmir/LLVMIRTokenType.java +++ b/languages/llvmir/src/main/java/de/jplag/llvmir/LLVMIRTokenType.java @@ -4,27 +4,45 @@ public enum LLVMIRTokenType implements TokenType { + // Functions FUNCTION_BODY_BEGIN("FUNC{"), FUNCTION_BODY_END("}FUNC"), FUNCTION_DECL("FUNC_DECL"), FUNCTION_DEF("FUNC_DEF"), + + // Terminator Instructions RETURN("RET"), BRANCH("BR"), - INVOKE("INVOKE"), + INVOKE("TRY"), CALL_BRANCH("CALL_BR"), - RESUME("RESUME"), - CATCH_SWITCH("CATCH"), - CATCH_RETURN("CATCH_RET"), + RESUME("THROW"), + CATCH_SWITCH("CATCH_SWITCH"), + CATCH_RETURN("CATCH"), CLEAN_UP_RETURN("CLEAN_UP_RET"), + + // Operations OPERATION("OP"), + + // Memory Operations ALLOCATION("ALLOC"), LOAD("LOAD"), STORE("STORE"), + FENCE("FENCE"), + COMPARE_EXCHANGE("CMP_XCHG"), + ATOMIC_CRMW("ATOMIC_CRMW"), GET_ELEMENT_POINTER("GET_ELEMENT_PTR"), + + // Conversion Operations CONVERSION("CONV"), + + // Other Operations COMPARISON("COMP"), PHI("PHI"), - CALL("CALL"); + SELECT("SELECT"), + CALL("CALL"), + LANDING_PAD("LANDING_PAD"), + CATCH_PAD("CATCH_PAD"), + CLEAN_UP_PAD("CLEAN_UP_PAD"); private final String description; From fb852f11ca5442f6d294849fdb2b81c37568dc3e Mon Sep 17 00:00:00 2001 From: Alex | Kronox Date: Thu, 13 Jul 2023 10:09:22 +0200 Subject: [PATCH 006/232] update java part --- .../reportobject/ReportObjectFactory.java | 16 +--- .../reportobject/mapper/MetricMapper.java | 52 ++++++------- .../reportobject/model/OverviewReport.java | 4 +- .../reportobject/model/TopComparison.java | 4 +- .../reportobject/mapper/MetricMapperTest.java | 73 +++++++------------ 5 files changed, 60 insertions(+), 89 deletions(-) diff --git a/core/src/main/java/de/jplag/reporting/reportobject/ReportObjectFactory.java b/core/src/main/java/de/jplag/reporting/reportobject/ReportObjectFactory.java index 1815c55e2..0f8f142da 100644 --- a/core/src/main/java/de/jplag/reporting/reportobject/ReportObjectFactory.java +++ b/core/src/main/java/de/jplag/reporting/reportobject/ReportObjectFactory.java @@ -33,7 +33,6 @@ import de.jplag.reporting.jsonfactory.ToDiskWriter; import de.jplag.reporting.reportobject.mapper.ClusteringResultMapper; import de.jplag.reporting.reportobject.mapper.MetricMapper; -import de.jplag.reporting.reportobject.model.Metric; import de.jplag.reporting.reportobject.model.OverviewReport; import de.jplag.reporting.reportobject.model.SubmissionFileIndex; import de.jplag.reporting.reportobject.model.Version; @@ -175,7 +174,7 @@ private void writeOverview(JPlagResult result, String path) { int totalComparisons = result.getAllComparisons().size(); int numberOfMaximumComparisons = result.getOptions().maximumNumberOfComparisons(); - int shownComparisons = totalComparisons > numberOfMaximumComparisons ? numberOfMaximumComparisons : totalComparisons; + int shownComparisons = Math.min(totalComparisons, numberOfMaximumComparisons); int missingComparisons = totalComparisons > numberOfMaximumComparisons ? (totalComparisons - numberOfMaximumComparisons) : 0; logger.info("Total Comparisons: {}. Comparisons in Report: {}. Omitted Comparisons: {}.", totalComparisons, shownComparisons, missingComparisons); @@ -190,7 +189,8 @@ private void writeOverview(JPlagResult result, String path) { result.getOptions().minimumTokenMatch(), // matchSensitivity getDate(),// dateOfExecution result.getDuration(), // executionTime - getMetrics(result),// metrics + MetricMapper.getDistributions(result), // distribution + new MetricMapper(submissionToIdFunction).getTopComparisons(result),// topComparisons clusteringResultMapper.map(result), // clusters totalComparisons); // totalComparisons @@ -220,16 +220,6 @@ private Set getSubmissions(List comparisons) { return submissions; } - /** - * Gets the used metrics in a JPlag comparison. As Max Metric is included in every JPlag run, this always include Max - * Metric. - * @return A list contains Metric DTOs. - */ - private List getMetrics(JPlagResult result) { - MetricMapper metricMapper = new MetricMapper(submissionToIdFunction); - return List.of(metricMapper.getAverageMetric(result), metricMapper.getMaxMetric(result)); - } - private String getDate() { SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yy"); Date date = new Date(); diff --git a/core/src/main/java/de/jplag/reporting/reportobject/mapper/MetricMapper.java b/core/src/main/java/de/jplag/reporting/reportobject/mapper/MetricMapper.java index 0b8a819d4..c508147ba 100644 --- a/core/src/main/java/de/jplag/reporting/reportobject/mapper/MetricMapper.java +++ b/core/src/main/java/de/jplag/reporting/reportobject/mapper/MetricMapper.java @@ -3,16 +3,14 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; -import java.util.Comparator; import java.util.List; +import java.util.Map; import java.util.function.Function; import de.jplag.JPlagComparison; import de.jplag.JPlagResult; -import de.jplag.Messages; import de.jplag.Submission; import de.jplag.options.SimilarityMetric; -import de.jplag.reporting.reportobject.model.Metric; import de.jplag.reporting.reportobject.model.TopComparison; /** @@ -25,40 +23,36 @@ public MetricMapper(Function submissionToIdFunction) { this.submissionToIdFunction = submissionToIdFunction; } - public Metric getAverageMetric(JPlagResult result) { - return new Metric(SimilarityMetric.AVG.name(), convertDistribution(result.getSimilarityDistribution()), - getTopComparisons(getComparisons(result)), Messages.getString("SimilarityMetric.Avg.Description")); + /** + * Generates a map of all distributions + * @param result Result containing distributions + * @return Map with key as name of metric and value as distribution + */ + public static Map> getDistributions(JPlagResult result) { + return Map.of(SimilarityMetric.AVG.name(), convertDistribution(result.getSimilarityDistribution()), + SimilarityMetric.MAX.name(), convertDistribution(result.getMaxSimilarityDistribution())); } - public Metric getMaxMetric(JPlagResult result) { - return new Metric(SimilarityMetric.MAX.name(), convertDistribution(result.getMaxSimilarityDistribution()), - getMaxSimilarityTopComparisons(getComparisons(result)), Messages.getString("SimilarityMetric.Max.Description")); + /** + * Generates a List of the top comparisons + * @param result Result containing comparisons + * @return List of top comparisons with similarities in all metrics + */ + public List getTopComparisons(JPlagResult result) { + return result.getComparisons(result.getOptions().maximumNumberOfComparisons()).stream() + .map(comparison -> new TopComparison(submissionToIdFunction.apply(comparison.firstSubmission()), + submissionToIdFunction.apply(comparison.secondSubmission()), getComparisonMetricMap(comparison))) + .toList(); } - private List getComparisons(JPlagResult result) { - int maxNumberOfComparisons = result.getOptions().maximumNumberOfComparisons(); - return result.getComparisons(maxNumberOfComparisons); + private Map getComparisonMetricMap(JPlagComparison comparison) { + return Map.of(SimilarityMetric.AVG.name(), comparison.similarity(), + SimilarityMetric.MAX.name(), comparison.maximalSimilarity()); } - private List convertDistribution(int[] array) { + private static List convertDistribution(int[] array) { List list = new ArrayList<>(Arrays.stream(array).boxed().toList()); Collections.reverse(list); return list; } - - private List getTopComparisons(List comparisons, Function similarityExtractor) { - return comparisons.stream().sorted(Comparator.comparing(similarityExtractor).reversed()) - .map(comparison -> new TopComparison(submissionToIdFunction.apply(comparison.firstSubmission()), - submissionToIdFunction.apply(comparison.secondSubmission()), similarityExtractor.apply(comparison))) - .toList(); - } - - private List getTopComparisons(List comparisons) { - return getTopComparisons(comparisons, JPlagComparison::similarity); - } - - private List getMaxSimilarityTopComparisons(List comparisons) { - return getTopComparisons(comparisons, JPlagComparison::maximalSimilarity); - } - } diff --git a/core/src/main/java/de/jplag/reporting/reportobject/model/OverviewReport.java b/core/src/main/java/de/jplag/reporting/reportobject/model/OverviewReport.java index b4651dbe9..fa7da7673 100644 --- a/core/src/main/java/de/jplag/reporting/reportobject/model/OverviewReport.java +++ b/core/src/main/java/de/jplag/reporting/reportobject/model/OverviewReport.java @@ -31,7 +31,9 @@ public record OverviewReport( @JsonProperty("execution_time") long executionTime, - @JsonProperty("metrics") List metrics, + @JsonProperty("distributions") Map> distributions, + + @JsonProperty("top_comparisons") List topComparisons, @JsonProperty("clusters") List clusters, diff --git a/core/src/main/java/de/jplag/reporting/reportobject/model/TopComparison.java b/core/src/main/java/de/jplag/reporting/reportobject/model/TopComparison.java index 7dfa1339f..ba4a54da8 100644 --- a/core/src/main/java/de/jplag/reporting/reportobject/model/TopComparison.java +++ b/core/src/main/java/de/jplag/reporting/reportobject/model/TopComparison.java @@ -1,7 +1,9 @@ package de.jplag.reporting.reportobject.model; +import java.util.Map; + import com.fasterxml.jackson.annotation.JsonProperty; public record TopComparison(@JsonProperty("first_submission") String firstSubmission, @JsonProperty("second_submission") String secondSubmission, - @JsonProperty("similarity") double similarity) { + @JsonProperty("similarities") Map similarities) { } diff --git a/core/src/test/java/de/jplag/reporting/reportobject/mapper/MetricMapperTest.java b/core/src/test/java/de/jplag/reporting/reportobject/mapper/MetricMapperTest.java index 1aedbefa8..3f4942d65 100644 --- a/core/src/test/java/de/jplag/reporting/reportobject/mapper/MetricMapperTest.java +++ b/core/src/test/java/de/jplag/reporting/reportobject/mapper/MetricMapperTest.java @@ -7,6 +7,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; +import java.util.Map; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; @@ -18,43 +19,37 @@ import de.jplag.reporting.reportobject.model.TopComparison; public class MetricMapperTest { - private static final List EXPECTED_DISTRIBUTION = List.of(29, 23, 19, 17, 13, 11, 7, 5, 3, 2); + private static final List EXPECTED_AVG_DISTRIBUTION = List.of(29, 23, 19, 17, 13, 11, 7, 5, 3, 2); + private static final List EXPECTED_MAX_DISTRIBUTION = List.of(50, 48, 20, 13, 10, 1, 3, 1, 0, 0); private final MetricMapper metricMapper = new MetricMapper(Submission::getName); @Test - public void test_getAverageMetric() { + public void test_getDistributions() { // given - JPlagResult jPlagResult = createJPlagResult(MockMetric.AVG, distribution(EXPECTED_DISTRIBUTION), - comparison(submission("1"), submission("2"), .7), comparison(submission("3"), submission("4"), .3)); + JPlagResult jPlagResult = createJPlagResult(distribution(EXPECTED_AVG_DISTRIBUTION), distribution(EXPECTED_MAX_DISTRIBUTION), + comparison(submission("1"), submission("2"), .7, .8), comparison(submission("3"), submission("4"), .3, .9)); + // when - var result = metricMapper.getAverageMetric(jPlagResult); + Map> result = MetricMapper.getDistributions(jPlagResult); - // then - Assertions.assertEquals("AVG", result.name()); - Assertions.assertIterableEquals(EXPECTED_DISTRIBUTION, result.distribution()); - Assertions.assertEquals(List.of(new TopComparison("1", "2", .7), new TopComparison("3", "4", .3)), result.topComparisons()); - Assertions.assertEquals( - "Average of both program coverages. This is the default similarity which" - + " works in most cases: Matches with a high average similarity indicate that the programs work " + "in a very similar way.", - result.description()); + //then + Assertions.assertEquals(Map.of("AVG", EXPECTED_AVG_DISTRIBUTION, "MAX", EXPECTED_MAX_DISTRIBUTION), result); } @Test - public void test_getMaxMetric() { + public void test_getTopComparisons() { // given - JPlagResult jPlagResult = createJPlagResult(MockMetric.MAX, distribution(EXPECTED_DISTRIBUTION), - comparison(submission("00"), submission("01"), .7), comparison(submission("10"), submission("11"), .3)); + JPlagResult jPlagResult = createJPlagResult(distribution(EXPECTED_AVG_DISTRIBUTION), distribution(EXPECTED_MAX_DISTRIBUTION), + comparison(submission("1"), submission("2"), .7, .8), comparison(submission("3"), submission("4"), .3, .9)); + // when - var result = metricMapper.getMaxMetric(jPlagResult); + List result = metricMapper.getTopComparisons(jPlagResult); // then - Assertions.assertEquals("MAX", result.name()); - Assertions.assertIterableEquals(EXPECTED_DISTRIBUTION, result.distribution()); - Assertions.assertEquals(List.of(new TopComparison("00", "01", .7), new TopComparison("10", "11", .3)), result.topComparisons()); - Assertions.assertEquals( - "Maximum of both program coverages. This ranking is especially useful if the programs are very " - + "different in size. This can happen when dead code was inserted to disguise the origin of the plagiarized program.", - result.description()); + Assertions.assertEquals(List.of( + new TopComparison("1", "2", Map.of("AVG", .7, "MAX", .8)), + new TopComparison("3", "4", Map.of("AVG", .3, "MAX", .9)) + ), result); } private int[] distribution(List expectedDistribution) { @@ -67,19 +62,15 @@ private CreateSubmission submission(String name) { return new CreateSubmission(name); } - private Comparison comparison(CreateSubmission submission1, CreateSubmission submission2, double similarity) { - return new Comparison(submission1, submission2, similarity); + private Comparison comparison(CreateSubmission submission1, CreateSubmission submission2, double similarity, double maxSimilarity) { + return new Comparison(submission1, submission2, similarity, maxSimilarity); } - private JPlagResult createJPlagResult(MockMetric metricToMock, int[] distribution, Comparison... createComparisonsDto) { + private JPlagResult createJPlagResult(int[] avgDistribution, int[] maxDistribution, Comparison... createComparisonsDto) { JPlagResult jPlagResult = mock(JPlagResult.class); + doReturn(avgDistribution).when(jPlagResult).getSimilarityDistribution(); + doReturn(maxDistribution).when(jPlagResult).getMaxSimilarityDistribution(); - if (metricToMock.equals(MockMetric.AVG)) { - doReturn(distribution).when(jPlagResult).getSimilarityDistribution(); - } else if (metricToMock.equals(MockMetric.MAX)) { - doReturn(distribution).when(jPlagResult).getMaxSimilarityDistribution(); - - } JPlagOptions options = mock(JPlagOptions.class); doReturn(createComparisonsDto.length).when(options).maximumNumberOfComparisons(); @@ -95,11 +86,8 @@ private JPlagResult createJPlagResult(MockMetric metricToMock, int[] distributio JPlagComparison mockedComparison = mock(JPlagComparison.class); doReturn(submission1).when(mockedComparison).firstSubmission(); doReturn(submission2).when(mockedComparison).secondSubmission(); - if (metricToMock.equals(MockMetric.AVG)) { - doReturn(comparisonDto.similarity).when(mockedComparison).similarity(); - } else if (metricToMock.equals(MockMetric.MAX)) { - doReturn(comparisonDto.similarity).when(mockedComparison).maximalSimilarity(); - } + doReturn(comparisonDto.similarity).when(mockedComparison).similarity(); + doReturn(comparisonDto.maxSimilarity).when(mockedComparison).maximalSimilarity(); comparisonList.add(mockedComparison); } @@ -107,15 +95,10 @@ private JPlagResult createJPlagResult(MockMetric metricToMock, int[] distributio return jPlagResult; } - private enum MockMetric { - MAX, - AVG - } - - private record Comparison(CreateSubmission submission1, CreateSubmission submission2, double similarity) { + private record Comparison(CreateSubmission submission1, CreateSubmission submission2, double similarity, double maxSimilarity) { } private record CreateSubmission(String name) { } -} +} \ No newline at end of file From 3d403033ac39af836356001060d13d9db481eb99 Mon Sep 17 00:00:00 2001 From: Alex | Kronox Date: Thu, 13 Jul 2023 14:34:47 +0200 Subject: [PATCH 007/232] Redo Overview --- .../src/components/ComparisonsTable.vue | 9 +- .../src/model/ComparisonListElement.ts | 5 +- report-viewer/src/model/Metric.ts | 17 -- report-viewer/src/model/MetricType.ts | 4 +- report-viewer/src/model/Overview.ts | 20 +- .../src/model/factories/BaseFactory.ts | 49 +++++ .../src/model/factories/OverviewFactory.ts | 204 ++++++++---------- report-viewer/src/views/ClusterView.vue | 6 +- report-viewer/src/views/OverviewView.vue | 32 +-- 9 files changed, 173 insertions(+), 173 deletions(-) delete mode 100644 report-viewer/src/model/Metric.ts create mode 100644 report-viewer/src/model/factories/BaseFactory.ts diff --git a/report-viewer/src/components/ComparisonsTable.vue b/report-viewer/src/components/ComparisonsTable.vue index 400b67943..9ef0ce566 100644 --- a/report-viewer/src/components/ComparisonsTable.vue +++ b/report-viewer/src/components/ComparisonsTable.vue @@ -79,8 +79,12 @@
-
{{ (item.averageSimilarity * 100).toFixed(2) }}%
-
{{ (item.maximumSimilarity * 100).toFixed(2) }}%
+
+ {{ (item.similarities[MetricType.AVERAGE] * 100).toFixed(2) }}% +
+
+ {{ (item.similarities[MetricType.MAXIMUM] * 100).toFixed(2) }}% +
@@ -133,6 +137,7 @@ import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome' import { library } from '@fortawesome/fontawesome-svg-core' import { faUserGroup } from '@fortawesome/free-solid-svg-icons' import { generateColors } from '@/utils/ColorUtils' +import MetricType from '@/model/MetricType' library.add(faUserGroup) diff --git a/report-viewer/src/model/ComparisonListElement.ts b/report-viewer/src/model/ComparisonListElement.ts index 815e6c9c1..60f4fb483 100644 --- a/report-viewer/src/model/ComparisonListElement.ts +++ b/report-viewer/src/model/ComparisonListElement.ts @@ -1,3 +1,5 @@ +import type MetricType from './MetricType' + /** * Comparison model used by the Comparison Table in Overview. Only the needed attributes to display are included. * For full comparison model see Comparison.ts @@ -13,6 +15,5 @@ export type ComparisonListElement = { id: number firstSubmissionId: string secondSubmissionId: string - averageSimilarity: number - maximumSimilarity: number + similarities: Record } diff --git a/report-viewer/src/model/Metric.ts b/report-viewer/src/model/Metric.ts deleted file mode 100644 index b6e7d6374..000000000 --- a/report-viewer/src/model/Metric.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { ComparisonListElement } from './ComparisonListElement' - -/** - * Metric used in the Jplag Comparison - * @property metricName - Name of the metric. - * @property description - Description of the metric. - * @property metricThreshold - Threshold of the metric. - * @property distribution - Distribution of the metric. - * @property comparisons - Comparisons of the metric. - */ -export type Metric = { - metricName: string - description: string - metricThreshold: number - distribution: Array - comparisons: Array -} diff --git a/report-viewer/src/model/MetricType.ts b/report-viewer/src/model/MetricType.ts index dfb93c9f0..16f5c7439 100644 --- a/report-viewer/src/model/MetricType.ts +++ b/report-viewer/src/model/MetricType.ts @@ -2,8 +2,8 @@ * This enum maps the metric type to the index they have in the generated JSON and respectivly in the store. */ enum MetricType { - AVERAGE = 0, - MAXIMUM = 1 + AVERAGE = 'AVG', + MAXIMUM = 'MAX' } export default MetricType diff --git a/report-viewer/src/model/Overview.ts b/report-viewer/src/model/Overview.ts index a59e2ccd0..2bc1f778f 100644 --- a/report-viewer/src/model/Overview.ts +++ b/report-viewer/src/model/Overview.ts @@ -1,6 +1,7 @@ import type Distribution from './Distribution' import type { Cluster } from '@/model/Cluster' import type { ComparisonListElement } from './ComparisonListElement' +import type MetricType from './MetricType' /** * Model of the Overview file generated by JPlag @@ -11,11 +12,10 @@ export class Overview { private readonly _language: string private readonly _fileExtensions: Array private readonly _matchSensitivity: number - private readonly _submissionIdsToComparisonFileName: Map> private readonly _dateOfExecution: string private readonly _durationOfExecution: number private readonly _topComparisons: Array - private readonly _distributions: Array + private readonly _distributions: Record private readonly _clusters: Array private readonly _totalComparisons: number @@ -28,10 +28,9 @@ export class Overview { dateOfExecution: string, durationOfExecution: number, topComparisons: Array, - distributions: Array, + distributions: Record, clusters: Array, - totalComparisons: number, - submissionIdsToComparisonFileName: Map> + totalComparisons: number ) { this._submissionFolderPath = submissionFolderPath this._baseCodeFolderPath = baseCodeFolderPath @@ -42,16 +41,7 @@ export class Overview { this._durationOfExecution = durationOfExecution this._topComparisons = topComparisons this._distributions = distributions - this._clusters = clusters - this._submissionIdsToComparisonFileName = submissionIdsToComparisonFileName - this._totalComparisons = totalComparisons - } - - /** - * @return Map of submission ids to the name of the comparison file and their content - */ - get submissionIdsToComparisonFileName() { - return this._submissionIdsToComparisonFileName + ;(this._clusters = clusters), (this._totalComparisons = totalComparisons) } /** diff --git a/report-viewer/src/model/factories/BaseFactory.ts b/report-viewer/src/model/factories/BaseFactory.ts new file mode 100644 index 000000000..bfb0b5211 --- /dev/null +++ b/report-viewer/src/model/factories/BaseFactory.ts @@ -0,0 +1,49 @@ +import store from '@/stores/store' + +/** + * This class provides some basic functionality for the factories. + */ +export class BaseFactory { + /** + * Returns the content of a file through the stored loading type. + * @param path - Path to the file + * @return Content of the file + * @throws Error if the file could not be found + */ + protected static getFile(path: string): string { + if (store().state.localModeUsed) { + return this.getLocalFile(path) + } else if (store().state.zipModeUsed) { + const index = Object.keys(store().state.files).find((name) => name.endsWith(path)) + if (index != undefined) { + const file = store().state.files[index] + if (file != undefined) { + return file + } + } + throw new Error(`Could not find ${path} in zip file.`) + } else if (store().state.singleModeUsed) { + return store().state.singleFillRawContent + } + + throw new Error('No loading type specified') + } + + /** + * Returns the content of a file from the local files. + * @param path - Path to the file + * @return Content of the file + * @throws Error if the file could not be found + */ + protected static getLocalFile(path: string): string { + const request = new XMLHttpRequest() + request.open('GET', `/files/${path}`, false) + request.send() + + if (request.status == 200) { + return request.response + } else { + throw new Error(`Could not find ${path} in local files.`) + } + } +} diff --git a/report-viewer/src/model/factories/OverviewFactory.ts b/report-viewer/src/model/factories/OverviewFactory.ts index 849aa4957..f332500fd 100644 --- a/report-viewer/src/model/factories/OverviewFactory.ts +++ b/report-viewer/src/model/factories/OverviewFactory.ts @@ -5,25 +5,28 @@ import store from '@/stores/store' import type { Version } from '../Version' import versionJson from '@/version.json' import Distribution from '../Distribution' +import MetricType from '../MetricType' +import { BaseFactory } from './BaseFactory' -export class OverviewFactory { +export class OverviewFactory extends BaseFactory { static reportViewerVersion: Version = versionJson['report_viewer_version'] !== undefined ? versionJson['report_viewer_version'] : { major: -1, minor: -1, patch: -1 } + /** + * Gets the overview file based on the used mode (zip, local, single). + */ + public static getOverview(): Overview { + return this.extractOverview(JSON.parse(this.getFile('overview.json'))) + } + /** * Creates an overview object from a json object created by by JPlag * @param json the json object */ private static extractOverview(json: Record): Overview { - const versionField = json.jplag_version as Record - const jplagVersion: Version = { - major: versionField.major, - minor: versionField.minor, - patch: versionField.patch - } - + const jplagVersion = this.extractVersion(json) OverviewFactory.compareVersions(jplagVersion, this.reportViewerVersion) const submissionFolder = json.submission_folder_path as Array @@ -31,123 +34,100 @@ export class OverviewFactory { const language = json.language as string const fileExtensions = json.file_extensions as Array const matchSensitivity = json.match_sensitivity as number - const jsonSubmissions = json.submission_id_to_display_name as Map - const map = new Map(Object.entries(jsonSubmissions)) const dateOfExecution = json.date_of_execution as string const duration = json.execution_time as number as number - const clusters = [] as Array const totalComparisons = json.total_comparisons as number - const distributions = [] as Array - const averageSimilarities: Map = new Map() - const comparisons = [] as Array + this.saveIdToDisplayNameMap(json) + this.saveComparisonFilesLookup(json) - const metrics = json.metrics as Array as Array> - // Average - distributions.push(new Distribution(metrics[0].distribution as Array)) - for (const comparison of metrics[0].topComparisons as Array>) { - averageSimilarities.set( - (comparison.first_submission as string) + '-' + (comparison.second_submission as string), - comparison.similarity as number - ) + return new Overview( + submissionFolder, + baseCodeFolder, + language, + fileExtensions, + matchSensitivity, + dateOfExecution, + duration, + this.extractTopComparisons(json), + this.extractDistributions(json), + this.extractClusters(json), + totalComparisons + ) + } + + private static extractVersion(json: Record): Version { + const versionField = json.jplag_version as Record + return { + major: versionField.major, + minor: versionField.minor, + patch: versionField.patch } + } - // Max - distributions.push(new Distribution(metrics[1].distribution as Array)) + private static extractDistributions( + json: Record + ): Record { + const distributionsMap = json.distributions as Record> + const distributions = {} as Record + for (const [key, value] of Object.entries(distributionsMap)) { + distributions[key as MetricType] = new Distribution(value as Array) + } + return distributions + } + + private static extractTopComparisons( + json: Record + ): Array { + const jsonComparisons = json.top_comparisons as Array> + const comparisons = [] as Array let counter = 0 - for (const comparison of metrics[1].topComparisons as Array>) { - const avg = averageSimilarities.get( - (comparison.first_submission as string) + '-' + (comparison.second_submission as string) - ) + for (const topComparison of jsonComparisons) { comparisons.push({ sortingPlace: counter++, id: counter, - firstSubmissionId: comparison.first_submission as string, - secondSubmissionId: comparison.second_submission as string, - averageSimilarity: avg as number, - maximumSimilarity: comparison.similarity as number + firstSubmissionId: topComparison.first_submission as string, + secondSubmissionId: topComparison.second_submission as string, + similarities: topComparison.similarities as Record }) } + return comparisons + } + private static extractClusters(json: Record): Array { + if (!json.clusters) { + return [] + } - store().saveSubmissionNames(map) - - if (json.clusters) { - ;(json.clusters as Array).forEach((jsonCluster) => { - const cluster = jsonCluster as Record - const newCluster: Cluster = { - averageSimilarity: cluster.average_similarity as number, - strength: cluster.strength as number, - members: cluster.members as Array - } - clusters.push(newCluster) + const clusters = [] as Array + for (const jsonCluster of json.clusters as Array>) { + clusters.push({ + averageSimilarity: jsonCluster.average_similarity as number, + strength: jsonCluster.strength as number, + members: jsonCluster.members as Array }) } + return clusters + } - OverviewFactory.saveSubmissionsToComparisonNameMap(json) - return new Overview( - submissionFolder, - baseCodeFolder, - language, - fileExtensions, - matchSensitivity, - dateOfExecution, - duration, - comparisons, - distributions, - clusters, - totalComparisons, - new Map() - ) + private static saveIdToDisplayNameMap(json: Record) { + const jsonSubmissions = json.submission_id_to_display_name as Map + const map = new Map(Object.entries(jsonSubmissions)) + + store().saveSubmissionNames(map) } - /** - * Gets the overview file based on the used mode (zip, local, single). - */ - public static getOverview(): Overview { - console.log('Generating overview...') - let temp!: Overview - //Gets the overview file based on the used mode (zip, local, single). - if (store().state.localModeUsed) { - const request = new XMLHttpRequest() - request.open('GET', '/files/overview.json', false) - request.send() - - if (request.status == 200) { - temp = OverviewFactory.extractOverview(JSON.parse(request.response)) - } else { - throw new Error('Could not find overview.json in folder.') - } - } else if (store().state.zipModeUsed) { - console.log('Start finding overview.json in state...') - const index = Object.keys(store().state.files).find((name) => name.endsWith('overview.json')) - const overviewFile = - index != undefined - ? store().state.files[index] - : console.log('Could not find overview.json') - - if (overviewFile === undefined) { - console.log('Could not find overview.json') - return new Overview( - [], - '', - '', - [], - 0, - '', - 0, - [], - [], - [], - 0, - new Map>() - ) - } - const overviewJson = JSON.parse(overviewFile) - temp = OverviewFactory.extractOverview(overviewJson) - } else if (store().state.singleModeUsed) { - temp = OverviewFactory.extractOverview(JSON.parse(store().state.singleFillRawContent)) + private static saveComparisonFilesLookup(json: Record) { + const submissionIdsToComparisonName = json.submission_ids_to_comparison_file_name as Map< + string, + Map + > + const test: Array> = Object.entries(submissionIdsToComparisonName) + const comparisonMap = new Map>() + for (const [key, value] of test) { + comparisonMap.set(key as string, new Map(Object.entries(value as object))) } - return temp + + store().saveComparisonFileLookup(comparisonMap) } /** @@ -204,18 +184,4 @@ export class OverviewFactory { sessionStorage.setItem('versionAlert', 'true') } } - - private static saveSubmissionsToComparisonNameMap(json: Record) { - const submissionIdsToComparisonName = json.submission_ids_to_comparison_file_name as Map< - string, - Map - > - const test: Array> = Object.entries(submissionIdsToComparisonName) - const comparisonMap = new Map>() - for (const [key, value] of test) { - comparisonMap.set(key as string, new Map(Object.entries(value as object))) - } - - store().saveComparisonFileLookup(comparisonMap) - } } diff --git a/report-viewer/src/views/ClusterView.vue b/report-viewer/src/views/ClusterView.vue index b0faca718..c47cdf038 100644 --- a/report-viewer/src/views/ClusterView.vue +++ b/report-viewer/src/views/ClusterView.vue @@ -30,6 +30,7 @@ import Container from '@/components/ContainerComponent.vue' import TextInformation from '@/components/TextInformation.vue' import type { ClusterListElement, ClusterListElementMember } from '@/model/ClusterListElement' import type { ComparisonListElement } from '@/model/ComparisonListElement' +import MetricType from '@/model/MetricType' import { OverviewFactory } from '@/model/factories/OverviewFactory' const props = defineProps({ @@ -43,6 +44,7 @@ const overview = OverviewFactory.getOverview() const cluster = overview.clusters[props.clusterIndex] const comparisons = [] as Array const clusterMemberList = new Map() as ClusterListElementMember +const usedMetric = MetricType.AVERAGE function getComparisonFor(id1: string, id2: string) { return overview.topComparisons.find( @@ -62,7 +64,7 @@ for (let i = 0; i < cluster.members.length; i++) { } let counter = 0 comparisons - .sort((a, b) => b.averageSimilarity - a.averageSimilarity) + .sort((a, b) => b.similarities[usedMetric] - a.similarities[usedMetric]) .forEach((c) => { c.sortingPlace = counter++ c.id = counter @@ -75,7 +77,7 @@ for (const member of cluster.members) { .forEach((c) => { membersComparisons.push({ matchedWith: c.firstSubmissionId === member ? c.secondSubmissionId : c.firstSubmissionId, - similarity: c.averageSimilarity + similarity: c.similarities[usedMetric] }) }) clusterMemberList.set(member, membersComparisons) diff --git a/report-viewer/src/views/OverviewView.vue b/report-viewer/src/views/OverviewView.vue index 5b0334fc8..4db66e6e7 100644 --- a/report-viewer/src/views/OverviewView.vue +++ b/report-viewer/src/views/OverviewView.vue @@ -35,7 +35,9 @@ @@ -60,7 +62,9 @@ b.maximumSimilarity - a.maximumSimilarity) - } else { - comparisons.sort((a, b) => b.averageSimilarity - a.averageSimilarity) - } + comparisons.sort( + (a, b) => + b.similarities[comparisonTableSortingMetric.value] - + a.similarities[comparisonTableSortingMetric.value] + ) let index = 0 comparisons.forEach((c) => { c.sortingPlace = index++ @@ -172,12 +176,12 @@ function changeAnnoymousForAll() { const selectedDistributionDiagramMetric = ref(MetricType.AVERAGE) -/** - * Switch between metrics - * @param metric Metric to switch to - */ -function selectDistributionDiagramMetric(metric: number) { - selectedDistributionDiagramMetric.value = metric +function getMetricFromNumber(metric: number) { + if (metric == 0) { + return MetricType.AVERAGE + } else { + return MetricType.MAXIMUM + } } const hasMoreSubmissionPaths = overview.submissionFolderPath.length > 1 From 333213f48bb9949ac97fc2a0e3525da239e96bab Mon Sep 17 00:00:00 2001 From: Alex | Kronox Date: Thu, 13 Jul 2023 14:51:04 +0200 Subject: [PATCH 008/232] actually get base folder path --- report-viewer/src/model/factories/OverviewFactory.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/report-viewer/src/model/factories/OverviewFactory.ts b/report-viewer/src/model/factories/OverviewFactory.ts index f332500fd..25f61dfcf 100644 --- a/report-viewer/src/model/factories/OverviewFactory.ts +++ b/report-viewer/src/model/factories/OverviewFactory.ts @@ -30,7 +30,7 @@ export class OverviewFactory extends BaseFactory { OverviewFactory.compareVersions(jplagVersion, this.reportViewerVersion) const submissionFolder = json.submission_folder_path as Array - const baseCodeFolder = '' + const baseCodeFolder = json.base_code_folder_path as string const language = json.language as string const fileExtensions = json.file_extensions as Array const matchSensitivity = json.match_sensitivity as number From 98332bb1318578f6607f3218e6f7f7a10686429b Mon Sep 17 00:00:00 2001 From: Alex | Kronox Date: Thu, 13 Jul 2023 18:20:36 +0200 Subject: [PATCH 009/232] redo ComparisonFactory --- .../src/model/factories/ComparisonFactory.ts | 127 ++++++------------ 1 file changed, 44 insertions(+), 83 deletions(-) diff --git a/report-viewer/src/model/factories/ComparisonFactory.ts b/report-viewer/src/model/factories/ComparisonFactory.ts index a4eac9e5d..8a833b4f9 100644 --- a/report-viewer/src/model/factories/ComparisonFactory.ts +++ b/report-viewer/src/model/factories/ComparisonFactory.ts @@ -5,50 +5,19 @@ import type { MatchInSingleFile } from '../MatchInSingleFile' import store from '@/stores/store' import { generateColors } from '@/utils/ColorUtils' import slash from 'slash' +import { BaseFactory } from './BaseFactory' /** * Factory class for creating Comparison objects */ -export class ComparisonFactory { +export class ComparisonFactory extends BaseFactory { public static getComparison(id1: string, id2: string) { - console.log('Generating comparison {%s} - {%s}...', id1, id2) - let comparison = new Comparison('', '', 0) - - //getting the comparison file based on the used mode (zip, local, single) - if (store().state.localModeUsed) { - const request = new XMLHttpRequest() - request.open('GET', `/files/${store().getComparisonFileName(id1, id2)}`, false) - request.send() - - if (request.status == 200) { - ComparisonFactory.loadSubmissionFilesFromLocal(id1) - ComparisonFactory.loadSubmissionFilesFromLocal(id2) - try { - comparison = ComparisonFactory.extractComparison(JSON.parse(request.response)) - } catch (e) { - throw new Error('Comparison file not found') - } - } else { - throw new Error('Comparison file not found') - } - } else if (store().state.zipModeUsed) { - const comparisonFile = store().getComparisonFileForSubmissions(id1, id2) - if (comparisonFile) { - comparison = ComparisonFactory.extractComparison(JSON.parse(comparisonFile)) - } else { - throw new Error('Comparison file not found') - } - } else if (store().state.singleModeUsed) { - try { - comparison = ComparisonFactory.extractComparison( - JSON.parse(store().state.singleFillRawContent) - ) - } catch (e) { - store().clearStore() - throw new Error('No Comparison files given!') - } + const filePath = store().getComparisonFileName(id1, id2) + if (!filePath) { + throw new Error('Comparison file not specified') } - return comparison + + return this.extractComparison(JSON.parse(this.getFile(filePath))) } /** @@ -56,11 +25,17 @@ export class ComparisonFactory { * @param json the json object */ private static extractComparison(json: Record): Comparison { - const filesOfFirstSubmission = store().filesOfSubmission(json.id1 as string) - const filesOfSecondSubmission = store().filesOfSubmission(json.id2 as string) + const firstSubmissionId = json.id1 as string + const secondSubmissionId = json.id2 as string + if (store().state.localModeUsed) { + this.loadSubmissionFilesFromLocal(firstSubmissionId) + this.loadSubmissionFilesFromLocal(json.id2 as string) + } + const filesOfFirstSubmission = store().filesOfSubmission(firstSubmissionId) + const filesOfSecondSubmission = store().filesOfSubmission(secondSubmissionId) - const filesOfFirstConverted = this.convertToFilesByName(filesOfFirstSubmission) - const filesOfSecondConverted = this.convertToFilesByName(filesOfSecondSubmission) + const filesOfFirstConverted = this.convertToSubmissionFileList(filesOfFirstSubmission) + const filesOfSecondConverted = this.convertToSubmissionFileList(filesOfSecondSubmission) const matches = json.matches as Array> @@ -70,25 +45,22 @@ export class ComparisonFactory { const colors = generateColors(matches.length, matchSaturation, matchLightness, matchAlpha) const coloredMatches = matches.map((match, index) => this.mapMatch(match, colors[index])) - const matchesInFirst = this.groupMatchesByFileName(coloredMatches, 1) - const matchesInSecond = this.groupMatchesByFileName(coloredMatches, 2) - const comparison = new Comparison( - json.id1 as string, - json.id2 as string, + firstSubmissionId, + secondSubmissionId, json.similarity as number ) comparison.filesOfFirstSubmission = filesOfFirstConverted comparison.filesOfSecondSubmission = filesOfSecondConverted comparison.colors = colors comparison.allMatches = coloredMatches - comparison.matchesInFirstSubmission = matchesInFirst - comparison.matchesInSecondSubmissions = matchesInSecond + comparison.matchesInFirstSubmission = this.groupMatchesByFileName(coloredMatches, 1) + comparison.matchesInSecondSubmissions = this.groupMatchesByFileName(coloredMatches, 2) return comparison } - private static convertToFilesByName( + private static convertToSubmissionFileList( files: Array<{ name: string; value: string }> ): Map { const map = new Map() @@ -109,11 +81,11 @@ export class ComparisonFactory { private static groupMatchesByFileName( matches: Array, - index: number + index: 1 | 2 ): Map> { const acc = new Map>() matches.forEach((val) => { - const name = index === 1 ? (val.firstFile as string) : (val.secondFile as string) + const name = index === 1 ? val.firstFile : val.secondFile if (!acc.get(name)) { acc.set(name, []) @@ -121,22 +93,22 @@ export class ComparisonFactory { if (index === 1) { const newVal: MatchInSingleFile = { - start: val.startInFirst as number, - end: val.endInFirst as number, + start: val.startInFirst, + end: val.endInFirst, linked_panel: 2, - linked_file: val.secondFile as string, - linked_line: val.startInSecond as number, - color: val.color as string + linked_file: val.secondFile, + linked_line: val.startInSecond, + color: val.color } acc.get(name)?.push(newVal) } else { const newVal: MatchInSingleFile = { - start: val.startInSecond as number, - end: val.endInSecond as number, + start: val.startInSecond, + end: val.endInSecond, linked_panel: 1, - linked_file: val.firstFile as string, - linked_line: val.startInFirst as number, - color: val.color as string + linked_file: val.firstFile, + linked_line: val.startInFirst, + color: val.color } acc.get(name)?.push(newVal) } @@ -145,36 +117,25 @@ export class ComparisonFactory { } private static getSubmissionFileListFromLocal(submissionId: string): string[] { - const request = new XMLHttpRequest() - request.open('GET', `/files/submissionFileIndex.json`, false) - request.send() - if (request.status == 200) { - return JSON.parse(request.response).submission_file_indexes[submissionId].map( - (file: string) => slash(file) - ) - } else { - return [] - } + return JSON.parse(this.getLocalFile(`submissionFileIndex.json`)).submission_file_indexes[ + submissionId + ].map((file: string) => slash(file)) } private static loadSubmissionFilesFromLocal(submissionId: string) { - const request = new XMLHttpRequest() - const fileList = ComparisonFactory.getSubmissionFileListFromLocal(submissionId) - for (const file of fileList) { - request.open('GET', `/files/files/${file}`, false) - request.overrideMimeType('text/plain') - request.send() - if (request.status == 200) { + try { + const fileList = this.getSubmissionFileListFromLocal(submissionId) + for (const filePath of fileList) { store().saveSubmissionFile({ name: submissionId, file: { - fileName: slash(file), - data: request.response + fileName: slash(filePath), + data: this.getLocalFile(`files/${filePath}`) } }) - } else { - console.log('Error loading file: ' + file) } + } catch (e) { + console.log(e) } } From 2e1429794031fbfee2becd6d9b6173f0b41bb3f6 Mon Sep 17 00:00:00 2001 From: Alex | Kronox Date: Thu, 13 Jul 2023 19:30:14 +0200 Subject: [PATCH 010/232] apply spotless --- .../reporting/reportobject/mapper/MetricMapper.java | 7 +++---- .../reportobject/mapper/MetricMapperTest.java | 10 ++++------ 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/core/src/main/java/de/jplag/reporting/reportobject/mapper/MetricMapper.java b/core/src/main/java/de/jplag/reporting/reportobject/mapper/MetricMapper.java index c508147ba..bdad683a0 100644 --- a/core/src/main/java/de/jplag/reporting/reportobject/mapper/MetricMapper.java +++ b/core/src/main/java/de/jplag/reporting/reportobject/mapper/MetricMapper.java @@ -29,8 +29,8 @@ public MetricMapper(Function submissionToIdFunction) { * @return Map with key as name of metric and value as distribution */ public static Map> getDistributions(JPlagResult result) { - return Map.of(SimilarityMetric.AVG.name(), convertDistribution(result.getSimilarityDistribution()), - SimilarityMetric.MAX.name(), convertDistribution(result.getMaxSimilarityDistribution())); + return Map.of(SimilarityMetric.AVG.name(), convertDistribution(result.getSimilarityDistribution()), SimilarityMetric.MAX.name(), + convertDistribution(result.getMaxSimilarityDistribution())); } /** @@ -46,8 +46,7 @@ public List getTopComparisons(JPlagResult result) { } private Map getComparisonMetricMap(JPlagComparison comparison) { - return Map.of(SimilarityMetric.AVG.name(), comparison.similarity(), - SimilarityMetric.MAX.name(), comparison.maximalSimilarity()); + return Map.of(SimilarityMetric.AVG.name(), comparison.similarity(), SimilarityMetric.MAX.name(), comparison.maximalSimilarity()); } private static List convertDistribution(int[] array) { diff --git a/core/src/test/java/de/jplag/reporting/reportobject/mapper/MetricMapperTest.java b/core/src/test/java/de/jplag/reporting/reportobject/mapper/MetricMapperTest.java index 3f4942d65..4a3667896 100644 --- a/core/src/test/java/de/jplag/reporting/reportobject/mapper/MetricMapperTest.java +++ b/core/src/test/java/de/jplag/reporting/reportobject/mapper/MetricMapperTest.java @@ -32,7 +32,7 @@ public void test_getDistributions() { // when Map> result = MetricMapper.getDistributions(jPlagResult); - //then + // then Assertions.assertEquals(Map.of("AVG", EXPECTED_AVG_DISTRIBUTION, "MAX", EXPECTED_MAX_DISTRIBUTION), result); } @@ -46,10 +46,9 @@ public void test_getTopComparisons() { List result = metricMapper.getTopComparisons(jPlagResult); // then - Assertions.assertEquals(List.of( - new TopComparison("1", "2", Map.of("AVG", .7, "MAX", .8)), - new TopComparison("3", "4", Map.of("AVG", .3, "MAX", .9)) - ), result); + Assertions.assertEquals( + List.of(new TopComparison("1", "2", Map.of("AVG", .7, "MAX", .8)), new TopComparison("3", "4", Map.of("AVG", .3, "MAX", .9))), + result); } private int[] distribution(List expectedDistribution) { @@ -71,7 +70,6 @@ private JPlagResult createJPlagResult(int[] avgDistribution, int[] maxDistributi doReturn(avgDistribution).when(jPlagResult).getSimilarityDistribution(); doReturn(maxDistribution).when(jPlagResult).getMaxSimilarityDistribution(); - JPlagOptions options = mock(JPlagOptions.class); doReturn(createComparisonsDto.length).when(options).maximumNumberOfComparisons(); doReturn(options).when(jPlagResult).getOptions(); From 0c6c02773a110de896e17fd9fcb0d747bab636f8 Mon Sep 17 00:00:00 2001 From: Niklas Heneka <93838730+NiklasHeneka@users.noreply.github.com> Date: Fri, 14 Jul 2023 17:20:18 +0200 Subject: [PATCH 011/232] Change token types and extraction of the LLVMIR module. --- cli/pom.xml | 5 +++++ .../java/de/jplag/llvmir/JPlagLLVMIRListener.java | 15 +++++++-------- .../java/de/jplag/llvmir/LLVMIRTokenType.java | 5 +++++ .../src/main/java/de/jplag/llvmir/Language.java | 2 +- 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index 791736d02..a4c437935 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -92,6 +92,11 @@ emf-metamodel ${revision} + + de.jplag + llvmir + ${revision} + org.kohsuke.metainf-services diff --git a/languages/llvmir/src/main/java/de/jplag/llvmir/JPlagLLVMIRListener.java b/languages/llvmir/src/main/java/de/jplag/llvmir/JPlagLLVMIRListener.java index 323f48eb9..674be1a33 100644 --- a/languages/llvmir/src/main/java/de/jplag/llvmir/JPlagLLVMIRListener.java +++ b/languages/llvmir/src/main/java/de/jplag/llvmir/JPlagLLVMIRListener.java @@ -2,7 +2,6 @@ import org.antlr.v4.runtime.ParserRuleContext; import org.antlr.v4.runtime.Token; -import org.antlr.v4.runtime.tree.ErrorNode; import org.antlr.v4.runtime.tree.TerminalNode; import de.jplag.llvmir.grammar.LLVMIRBaseListener; @@ -346,7 +345,7 @@ public void exitBrTerm(LLVMIRParser.BrTermContext ctx) { @Override public void enterCondBrTerm(LLVMIRParser.CondBrTermContext ctx) { - transformToken(LLVMIRTokenType.BRANCH, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.COND_BRANCH, ctx.getStart(), ctx.getStop()); super.enterCondBrTerm(ctx); } @@ -356,7 +355,7 @@ public void exitCondBrTerm(LLVMIRParser.CondBrTermContext ctx) { @Override public void enterSwitchTerm(LLVMIRParser.SwitchTermContext ctx) { - transformToken(LLVMIRTokenType.BRANCH, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.SWITCH, ctx.getStart(), ctx.getStop()); super.enterSwitchTerm(ctx); } @@ -366,7 +365,7 @@ public void exitSwitchTerm(LLVMIRParser.SwitchTermContext ctx) { @Override public void enterIndirectBrTerm(LLVMIRParser.IndirectBrTermContext ctx) { - transformToken(LLVMIRTokenType.BRANCH, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.INDIRECT_BRANCH, ctx.getStart(), ctx.getStop()); super.enterIndirectBrTerm(ctx); } @@ -1820,6 +1819,8 @@ public void exitSelectInst(LLVMIRParser.SelectInstContext ctx) { @Override public void enterFreezeInst(LLVMIRParser.FreezeInstContext ctx) { + transformToken(LLVMIRTokenType.FREEZE, ctx.getStart(), ctx.getStop()); + super.exitFreezeInst(ctx); } @Override @@ -1838,6 +1839,8 @@ public void exitCallInst(LLVMIRParser.CallInstContext ctx) { @Override public void enterVaargInst(LLVMIRParser.VaargInstContext ctx) { + transformToken(LLVMIRTokenType.VA_ARG, ctx.getStart(), ctx.getStop()); + super.enterVaargInst(ctx); } @Override @@ -3350,8 +3353,4 @@ public void exitEveryRule(ParserRuleContext ctx) { public void visitTerminal(TerminalNode node) { } - @Override - public void visitErrorNode(ErrorNode node) { - } - } diff --git a/languages/llvmir/src/main/java/de/jplag/llvmir/LLVMIRTokenType.java b/languages/llvmir/src/main/java/de/jplag/llvmir/LLVMIRTokenType.java index d2ef8fef2..de44361e0 100644 --- a/languages/llvmir/src/main/java/de/jplag/llvmir/LLVMIRTokenType.java +++ b/languages/llvmir/src/main/java/de/jplag/llvmir/LLVMIRTokenType.java @@ -13,8 +13,11 @@ public enum LLVMIRTokenType implements TokenType { // Terminator Instructions RETURN("RET"), BRANCH("BR"), + COND_BRANCH("COND_BR"), INVOKE("TRY"), CALL_BRANCH("CALL_BR"), + SWITCH("SWITCH"), + INDIRECT_BRANCH("INDIRECT_BRANCH"), RESUME("THROW"), CATCH_SWITCH("CATCH_SWITCH"), CATCH_RETURN("CATCH"), @@ -39,7 +42,9 @@ public enum LLVMIRTokenType implements TokenType { COMPARISON("COMP"), PHI("PHI"), SELECT("SELECT"), + FREEZE("FREEZE"), CALL("CALL"), + VA_ARG("VA_ARG"), LANDING_PAD("LANDING_PAD"), CATCH_PAD("CATCH_PAD"), CLEAN_UP_PAD("CLEAN_UP_PAD"); diff --git a/languages/llvmir/src/main/java/de/jplag/llvmir/Language.java b/languages/llvmir/src/main/java/de/jplag/llvmir/Language.java index 1426d9eee..1e6c5bcdf 100644 --- a/languages/llvmir/src/main/java/de/jplag/llvmir/Language.java +++ b/languages/llvmir/src/main/java/de/jplag/llvmir/Language.java @@ -17,7 +17,7 @@ public class Language implements de.jplag.Language { private static final String NAME = "LLVMIR Parser"; private static final String IDENTIFIER = "llvmir"; - private static final int DEFAULT_MIN_TOKEN_MATCH = 10; + private static final int DEFAULT_MIN_TOKEN_MATCH = 15; private static final String[] FILE_EXTENSIONS = {".ll"}; private final LLVMIRParserAdapter parserAdapter; From b75caa85425dc5bd8e04aa58f381b5bf44032192 Mon Sep 17 00:00:00 2001 From: Niklas Heneka <93838730+NiklasHeneka@users.noreply.github.com> Date: Sat, 15 Jul 2023 18:37:15 +0200 Subject: [PATCH 012/232] Fix a failing test and a mistake in the LLVMIR antlr grammar. --- cli/src/test/java/de/jplag/cli/LanguageTest.java | 2 +- .../llvmir/src/main/antlr4/de/jplag/llvmir/grammar/LLVMIR.g4 | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cli/src/test/java/de/jplag/cli/LanguageTest.java b/cli/src/test/java/de/jplag/cli/LanguageTest.java index 307d414e4..9f8a7a229 100644 --- a/cli/src/test/java/de/jplag/cli/LanguageTest.java +++ b/cli/src/test/java/de/jplag/cli/LanguageTest.java @@ -28,7 +28,7 @@ void testInvalidLanguage() throws Exception { @Test void testLoading() { var languages = LanguageLoader.getAllAvailableLanguages(); - assertEquals(14, languages.size(), "Loaded Languages: " + languages.keySet()); + assertEquals(15, languages.size(), "Loaded Languages: " + languages.keySet()); } @Test diff --git a/languages/llvmir/src/main/antlr4/de/jplag/llvmir/grammar/LLVMIR.g4 b/languages/llvmir/src/main/antlr4/de/jplag/llvmir/grammar/LLVMIR.g4 index 466266603..29983cb8a 100644 --- a/languages/llvmir/src/main/antlr4/de/jplag/llvmir/grammar/LLVMIR.g4 +++ b/languages/llvmir/src/main/antlr4/de/jplag/llvmir/grammar/LLVMIR.g4 @@ -822,6 +822,7 @@ returnAttr: | 'noalias' | 'nonnull' | 'noundef' + | align | 'signext' | 'zeroext'; overflowFlag: 'nsw' | 'nuw'; From 3d4b21188a032b62105bb9b7b5eefd441f7bda7a Mon Sep 17 00:00:00 2001 From: Niklas Heneka <93838730+NiklasHeneka@users.noreply.github.com> Date: Sun, 16 Jul 2023 18:34:34 +0200 Subject: [PATCH 013/232] Create separate tokens for operations. --- .../de/jplag/llvmir/JPlagLLVMIRListener.java | 58 +++++++++---------- .../java/de/jplag/llvmir/LLVMIRTokenType.java | 28 ++++++--- 2 files changed, 47 insertions(+), 39 deletions(-) diff --git a/languages/llvmir/src/main/java/de/jplag/llvmir/JPlagLLVMIRListener.java b/languages/llvmir/src/main/java/de/jplag/llvmir/JPlagLLVMIRListener.java index 674be1a33..56bf897eb 100644 --- a/languages/llvmir/src/main/java/de/jplag/llvmir/JPlagLLVMIRListener.java +++ b/languages/llvmir/src/main/java/de/jplag/llvmir/JPlagLLVMIRListener.java @@ -345,7 +345,7 @@ public void exitBrTerm(LLVMIRParser.BrTermContext ctx) { @Override public void enterCondBrTerm(LLVMIRParser.CondBrTermContext ctx) { - transformToken(LLVMIRTokenType.COND_BRANCH, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.BRANCH, ctx.getStart(), ctx.getStop()); super.enterCondBrTerm(ctx); } @@ -355,7 +355,7 @@ public void exitCondBrTerm(LLVMIRParser.CondBrTermContext ctx) { @Override public void enterSwitchTerm(LLVMIRParser.SwitchTermContext ctx) { - transformToken(LLVMIRTokenType.SWITCH, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.BRANCH, ctx.getStart(), ctx.getStop()); super.enterSwitchTerm(ctx); } @@ -365,7 +365,7 @@ public void exitSwitchTerm(LLVMIRParser.SwitchTermContext ctx) { @Override public void enterIndirectBrTerm(LLVMIRParser.IndirectBrTermContext ctx) { - transformToken(LLVMIRTokenType.INDIRECT_BRANCH, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.BRANCH, ctx.getStart(), ctx.getStop()); super.enterIndirectBrTerm(ctx); } @@ -1359,8 +1359,6 @@ public void exitFenceInst(LLVMIRParser.FenceInstContext ctx) { @Override public void enterFNegInst(LLVMIRParser.FNegInstContext ctx) { - transformToken(LLVMIRTokenType.OPERATION, ctx.getStart(), ctx.getStop()); - super.enterFNegInst(ctx); } @Override @@ -1369,7 +1367,7 @@ public void exitFNegInst(LLVMIRParser.FNegInstContext ctx) { @Override public void enterAddInst(LLVMIRParser.AddInstContext ctx) { - transformToken(LLVMIRTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.ADD, ctx.getStart(), ctx.getStop()); super.enterAddInst(ctx); } @@ -1379,7 +1377,7 @@ public void exitAddInst(LLVMIRParser.AddInstContext ctx) { @Override public void enterFAddInst(LLVMIRParser.FAddInstContext ctx) { - transformToken(LLVMIRTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.ADD, ctx.getStart(), ctx.getStop()); super.enterFAddInst(ctx); } @@ -1389,7 +1387,7 @@ public void exitFAddInst(LLVMIRParser.FAddInstContext ctx) { @Override public void enterSubInst(LLVMIRParser.SubInstContext ctx) { - transformToken(LLVMIRTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.SUB, ctx.getStart(), ctx.getStop()); super.enterSubInst(ctx); } @@ -1399,7 +1397,7 @@ public void exitSubInst(LLVMIRParser.SubInstContext ctx) { @Override public void enterFSubInst(LLVMIRParser.FSubInstContext ctx) { - transformToken(LLVMIRTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.SUB, ctx.getStart(), ctx.getStop()); super.enterFSubInst(ctx); } @@ -1409,7 +1407,7 @@ public void exitFSubInst(LLVMIRParser.FSubInstContext ctx) { @Override public void enterMulInst(LLVMIRParser.MulInstContext ctx) { - transformToken(LLVMIRTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.MUL, ctx.getStart(), ctx.getStop()); super.enterMulInst(ctx); } @@ -1419,7 +1417,7 @@ public void exitMulInst(LLVMIRParser.MulInstContext ctx) { @Override public void enterFMulInst(LLVMIRParser.FMulInstContext ctx) { - transformToken(LLVMIRTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.MUL, ctx.getStart(), ctx.getStop()); super.enterFMulInst(ctx); } @@ -1429,7 +1427,7 @@ public void exitFMulInst(LLVMIRParser.FMulInstContext ctx) { @Override public void enterUDivInst(LLVMIRParser.UDivInstContext ctx) { - transformToken(LLVMIRTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.DIV, ctx.getStart(), ctx.getStop()); super.enterUDivInst(ctx); } @@ -1439,7 +1437,7 @@ public void exitUDivInst(LLVMIRParser.UDivInstContext ctx) { @Override public void enterSDivInst(LLVMIRParser.SDivInstContext ctx) { - transformToken(LLVMIRTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.DIV, ctx.getStart(), ctx.getStop()); super.enterSDivInst(ctx); } @@ -1449,7 +1447,7 @@ public void exitSDivInst(LLVMIRParser.SDivInstContext ctx) { @Override public void enterFDivInst(LLVMIRParser.FDivInstContext ctx) { - transformToken(LLVMIRTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.DIV, ctx.getStart(), ctx.getStop()); super.enterFDivInst(ctx); } @@ -1459,7 +1457,7 @@ public void exitFDivInst(LLVMIRParser.FDivInstContext ctx) { @Override public void enterURemInst(LLVMIRParser.URemInstContext ctx) { - transformToken(LLVMIRTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.REM, ctx.getStart(), ctx.getStop()); super.enterURemInst(ctx); } @@ -1469,7 +1467,7 @@ public void exitURemInst(LLVMIRParser.URemInstContext ctx) { @Override public void enterSRemInst(LLVMIRParser.SRemInstContext ctx) { - transformToken(LLVMIRTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.REM, ctx.getStart(), ctx.getStop()); super.enterSRemInst(ctx); } @@ -1479,7 +1477,7 @@ public void exitSRemInst(LLVMIRParser.SRemInstContext ctx) { @Override public void enterFRemInst(LLVMIRParser.FRemInstContext ctx) { - transformToken(LLVMIRTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.REM, ctx.getStart(), ctx.getStop()); super.enterFRemInst(ctx); } @@ -1489,7 +1487,7 @@ public void exitFRemInst(LLVMIRParser.FRemInstContext ctx) { @Override public void enterShlInst(LLVMIRParser.ShlInstContext ctx) { - transformToken(LLVMIRTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.SHIFT, ctx.getStart(), ctx.getStop()); super.enterShlInst(ctx); } @@ -1499,7 +1497,7 @@ public void exitShlInst(LLVMIRParser.ShlInstContext ctx) { @Override public void enterLShrInst(LLVMIRParser.LShrInstContext ctx) { - transformToken(LLVMIRTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.SHIFT, ctx.getStart(), ctx.getStop()); super.enterLShrInst(ctx); } @@ -1509,7 +1507,7 @@ public void exitLShrInst(LLVMIRParser.LShrInstContext ctx) { @Override public void enterAShrInst(LLVMIRParser.AShrInstContext ctx) { - transformToken(LLVMIRTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.SHIFT, ctx.getStart(), ctx.getStop()); super.enterAShrInst(ctx); } @@ -1519,7 +1517,7 @@ public void exitAShrInst(LLVMIRParser.AShrInstContext ctx) { @Override public void enterAndInst(LLVMIRParser.AndInstContext ctx) { - transformToken(LLVMIRTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.AND, ctx.getStart(), ctx.getStop()); super.enterAndInst(ctx); } @@ -1529,7 +1527,7 @@ public void exitAndInst(LLVMIRParser.AndInstContext ctx) { @Override public void enterOrInst(LLVMIRParser.OrInstContext ctx) { - transformToken(LLVMIRTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.OR, ctx.getStart(), ctx.getStop()); super.enterOrInst(ctx); } @@ -1539,7 +1537,7 @@ public void exitOrInst(LLVMIRParser.OrInstContext ctx) { @Override public void enterXorInst(LLVMIRParser.XorInstContext ctx) { - transformToken(LLVMIRTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.XOR, ctx.getStart(), ctx.getStop()); super.enterXorInst(ctx); } @@ -1549,7 +1547,7 @@ public void exitXorInst(LLVMIRParser.XorInstContext ctx) { @Override public void enterExtractElementInst(LLVMIRParser.ExtractElementInstContext ctx) { - transformToken(LLVMIRTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.EXTRACT_ELEM, ctx.getStart(), ctx.getStop()); super.enterExtractElementInst(ctx); } @@ -1559,7 +1557,7 @@ public void exitExtractElementInst(LLVMIRParser.ExtractElementInstContext ctx) { @Override public void enterInsertElementInst(LLVMIRParser.InsertElementInstContext ctx) { - transformToken(LLVMIRTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.INSERT_ELEM, ctx.getStart(), ctx.getStop()); super.enterInsertElementInst(ctx); } @@ -1569,7 +1567,7 @@ public void exitInsertElementInst(LLVMIRParser.InsertElementInstContext ctx) { @Override public void enterShuffleVectorInst(LLVMIRParser.ShuffleVectorInstContext ctx) { - transformToken(LLVMIRTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.SHUFFLE_VEC, ctx.getStart(), ctx.getStop()); super.enterShuffleVectorInst(ctx); } @@ -1579,7 +1577,7 @@ public void exitShuffleVectorInst(LLVMIRParser.ShuffleVectorInstContext ctx) { @Override public void enterExtractValueInst(LLVMIRParser.ExtractValueInstContext ctx) { - transformToken(LLVMIRTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.EXTRACT_VAL, ctx.getStart(), ctx.getStop()); super.enterExtractValueInst(ctx); } @@ -1589,7 +1587,7 @@ public void exitExtractValueInst(LLVMIRParser.ExtractValueInstContext ctx) { @Override public void enterInsertValueInst(LLVMIRParser.InsertValueInstContext ctx) { - transformToken(LLVMIRTokenType.OPERATION, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.INSERT_VAL, ctx.getStart(), ctx.getStop()); super.enterInsertValueInst(ctx); } @@ -1819,8 +1817,6 @@ public void exitSelectInst(LLVMIRParser.SelectInstContext ctx) { @Override public void enterFreezeInst(LLVMIRParser.FreezeInstContext ctx) { - transformToken(LLVMIRTokenType.FREEZE, ctx.getStart(), ctx.getStop()); - super.exitFreezeInst(ctx); } @Override @@ -1839,8 +1835,6 @@ public void exitCallInst(LLVMIRParser.CallInstContext ctx) { @Override public void enterVaargInst(LLVMIRParser.VaargInstContext ctx) { - transformToken(LLVMIRTokenType.VA_ARG, ctx.getStart(), ctx.getStop()); - super.enterVaargInst(ctx); } @Override diff --git a/languages/llvmir/src/main/java/de/jplag/llvmir/LLVMIRTokenType.java b/languages/llvmir/src/main/java/de/jplag/llvmir/LLVMIRTokenType.java index de44361e0..956a9f8d9 100644 --- a/languages/llvmir/src/main/java/de/jplag/llvmir/LLVMIRTokenType.java +++ b/languages/llvmir/src/main/java/de/jplag/llvmir/LLVMIRTokenType.java @@ -13,18 +13,34 @@ public enum LLVMIRTokenType implements TokenType { // Terminator Instructions RETURN("RET"), BRANCH("BR"), - COND_BRANCH("COND_BR"), INVOKE("TRY"), CALL_BRANCH("CALL_BR"), - SWITCH("SWITCH"), - INDIRECT_BRANCH("INDIRECT_BRANCH"), RESUME("THROW"), CATCH_SWITCH("CATCH_SWITCH"), CATCH_RETURN("CATCH"), CLEAN_UP_RETURN("CLEAN_UP_RET"), - // Operations - OPERATION("OP"), + // Binary Operations + ADD("ADDITION"), + SUB("SUBTRACTION"), + MUL("MULTIPLICATION"), + DIV("DIVISION"), + REM("REMAINDER"), + + // Bitwise instruction + SHIFT("SHIFT"), + AND("AND"), + OR("OR"), + XOR("XOR"), + + //Vector operations + EXTRACT_ELEM("EXTRACT_ELEMENT"), + INSERT_ELEM("INSERT_ELEM"), + SHUFFLE_VEC("SHUFFLE_VECTOR"), + + // Aggregate Operations + EXTRACT_VAL("EXTRACT_VALUE"), + INSERT_VAL("INSERT_VALUE"), // Memory Operations ALLOCATION("ALLOC"), @@ -42,9 +58,7 @@ public enum LLVMIRTokenType implements TokenType { COMPARISON("COMP"), PHI("PHI"), SELECT("SELECT"), - FREEZE("FREEZE"), CALL("CALL"), - VA_ARG("VA_ARG"), LANDING_PAD("LANDING_PAD"), CATCH_PAD("CATCH_PAD"), CLEAN_UP_PAD("CLEAN_UP_PAD"); From ad7a2cff86a86b97338bfd18880b204c6afc896e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 Jul 2023 09:31:59 +0000 Subject: [PATCH 014/232] Dependency(deps-dev): Bump vue-tsc from 1.8.4 to 1.8.5 in /report-viewer Bumps [vue-tsc](https://github.com/vuejs/language-tools/tree/HEAD/packages/vue-tsc) from 1.8.4 to 1.8.5. - [Release notes](https://github.com/vuejs/language-tools/releases) - [Changelog](https://github.com/vuejs/language-tools/blob/master/CHANGELOG.md) - [Commits](https://github.com/vuejs/language-tools/commits/v1.8.5/packages/vue-tsc) --- updated-dependencies: - dependency-name: vue-tsc dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- report-viewer/package-lock.json | 60 ++++++++++++++++----------------- report-viewer/package.json | 2 +- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/report-viewer/package-lock.json b/report-viewer/package-lock.json index eaabb6bc2..f96e1c703 100644 --- a/report-viewer/package-lock.json +++ b/report-viewer/package-lock.json @@ -47,7 +47,7 @@ "typescript": "^5.1.6", "vite": "^4.3.9", "vitest": "^0.32.4", - "vue-tsc": "^1.8.4" + "vue-tsc": "^1.8.5" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -728,30 +728,30 @@ } }, "node_modules/@volar/language-core": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/@volar/language-core/-/language-core-1.8.0.tgz", - "integrity": "sha512-ZHTvZPM3pEbOOuaq+ybNz5TQlHUqPQPK0G1+SonvApGq0e3qgGijjhtL5T7hsCtUEmxfix8FrAuCH14tMBOhTg==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@volar/language-core/-/language-core-1.9.0.tgz", + "integrity": "sha512-+PTRrGanAD2PxqMty0ZC46xhgW5BWzb67RLHhZyB3Im4+eMXsKlYjFUt7Z8ZCwTWQQOnj8NQ6gSgUEoOTwAHrQ==", "dev": true, "dependencies": { - "@volar/source-map": "1.8.0" + "@volar/source-map": "1.9.0" } }, "node_modules/@volar/source-map": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/@volar/source-map/-/source-map-1.8.0.tgz", - "integrity": "sha512-d35aV0yFkIrkynRSKgrN5hgbMv6ekkFvcJsJGmOZ8UEjqLStto9zq7RSvpp6/PZ7/pa4Gn1f6K1qDt0bq0oUew==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@volar/source-map/-/source-map-1.9.0.tgz", + "integrity": "sha512-TQWLY8ozUOHBHTMC2pHZsNbtM25Q9QCEwAL8JFR/gmR9Yv0d9qup/gQdd5sDI7RmoPYKD+gqjLrbM4Ib41QSJQ==", "dev": true, "dependencies": { "muggle-string": "^0.3.1" } }, "node_modules/@volar/typescript": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/@volar/typescript/-/typescript-1.8.0.tgz", - "integrity": "sha512-T/U1XLLhXv6tNr40Awznfc6QZWizSL99t6M0DeXtIMbnvSCqjjCVRnwlsq+DK9C1RlO3k8+i0Z8iJn7O1GGtoA==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@volar/typescript/-/typescript-1.9.0.tgz", + "integrity": "sha512-B8X4/H6V93uD7zu5VCw05eB0Ukcc39SFKsZoeylkAk2sJ50oaJLpajnQ8Ov4c+FnVQ6iPA6Xy1qdWoWJjh6xEg==", "dev": true, "dependencies": { - "@volar/language-core": "1.8.0" + "@volar/language-core": "1.9.0" } }, "node_modules/@vue/compiler-core": { @@ -844,13 +844,13 @@ } }, "node_modules/@vue/language-core": { - "version": "1.8.4", - "resolved": "https://registry.npmjs.org/@vue/language-core/-/language-core-1.8.4.tgz", - "integrity": "sha512-pnNtNcJVfkGYluW0vsVO+Y1gyX+eA0voaS7+1JOhCp5zKeCaL/PAmGYOgfvwML62neL+2H8pnhY7sffmrGpEhw==", + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@vue/language-core/-/language-core-1.8.5.tgz", + "integrity": "sha512-DKQNiNQzNV7nrkZQujvjfX73zqKdj2+KoM4YeKl+ft3f+crO3JB4ycPnmgaRMNX/ULJootdQPGHKFRl5cXxwaw==", "dev": true, "dependencies": { - "@volar/language-core": "~1.8.0", - "@volar/source-map": "~1.8.0", + "@volar/language-core": "~1.9.0", + "@volar/source-map": "~1.9.0", "@vue/compiler-dom": "^3.3.0", "@vue/reactivity": "^3.3.0", "@vue/shared": "^3.3.0", @@ -877,9 +877,9 @@ } }, "node_modules/@vue/language-core/node_modules/minimatch": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.2.tgz", - "integrity": "sha512-PZOT9g5v2ojiTL7r1xF6plNHLtOeTpSlDI007As2NlA2aYBMfVom17yqa6QzhmDP8QOhn7LjHTg7DFCVSSa6yg==", + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", "dev": true, "dependencies": { "brace-expansion": "^2.0.1" @@ -977,13 +977,13 @@ "dev": true }, "node_modules/@vue/typescript": { - "version": "1.8.4", - "resolved": "https://registry.npmjs.org/@vue/typescript/-/typescript-1.8.4.tgz", - "integrity": "sha512-sioQfIY5xcmEAz+cPLvv6CtzGPtGhIdR0Za87zB8M4mPe4OSsE3MBGkXcslf+EzQgF+fm6Gr1SRMSX8r5ZmzDA==", + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@vue/typescript/-/typescript-1.8.5.tgz", + "integrity": "sha512-domFBbNr3PEcjGBeB+cmgUM3cI6pJsJezguIUKZ1rphkfIkICyoMjCd3TitoP32yo2KABLiaXcGFzgFfQf6B3w==", "dev": true, "dependencies": { - "@volar/typescript": "~1.8.0", - "@vue/language-core": "1.8.4" + "@volar/typescript": "~1.9.0", + "@vue/language-core": "1.8.5" } }, "node_modules/abab": { @@ -6045,13 +6045,13 @@ } }, "node_modules/vue-tsc": { - "version": "1.8.4", - "resolved": "https://registry.npmjs.org/vue-tsc/-/vue-tsc-1.8.4.tgz", - "integrity": "sha512-+hgpOhIx11vbi8/AxEdaPj3fiRwN9wy78LpsNNw2V995/IWa6TMyQxHbaw2ZKUpdwjySSHgrT6ohDEhUgFxGYw==", + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/vue-tsc/-/vue-tsc-1.8.5.tgz", + "integrity": "sha512-Jr8PTghJIwp69MFsEZoADDcv2l+lXA8juyN/5AYA5zxyZNvIHjSbgKgkYIYc1qnihrOyIG1VOnfk4ZE0jqn8bw==", "dev": true, "dependencies": { - "@vue/language-core": "1.8.4", - "@vue/typescript": "1.8.4", + "@vue/language-core": "1.8.5", + "@vue/typescript": "1.8.5", "semver": "^7.3.8" }, "bin": { diff --git a/report-viewer/package.json b/report-viewer/package.json index 80d03537e..0dce9a610 100644 --- a/report-viewer/package.json +++ b/report-viewer/package.json @@ -56,6 +56,6 @@ "typescript": "^5.1.6", "vite": "^4.3.9", "vitest": "^0.32.4", - "vue-tsc": "^1.8.4" + "vue-tsc": "^1.8.5" } } From 1557ad22469aa3022d8567e21c2e4fad6e070310 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 Jul 2023 09:32:46 +0000 Subject: [PATCH 015/232] Dependency(deps-dev): Bump eslint in /report-viewer Bumps [eslint](https://github.com/eslint/eslint) from 8.44.0 to 8.45.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.44.0...v8.45.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- report-viewer/package-lock.json | 10 ++++------ report-viewer/package.json | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/report-viewer/package-lock.json b/report-viewer/package-lock.json index f96e1c703..f36ab10c8 100644 --- a/report-viewer/package-lock.json +++ b/report-viewer/package-lock.json @@ -35,7 +35,7 @@ "@vue/test-utils": "^2.4.0", "@vue/tsconfig": "^0.4.0", "autoprefixer": "^10.4.14", - "eslint": "^8.44.0", + "eslint": "^8.45.0", "eslint-plugin-vue": "^9.15.1", "husky": "^8.0.0", "jsdom": "^22.1.0", @@ -1959,9 +1959,9 @@ } }, "node_modules/eslint": { - "version": "8.44.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.44.0.tgz", - "integrity": "sha512-0wpHoUbDUHgNCyvFB5aXLiQVfK9B0at6gUvzy83k4kAsQ/u769TQDX6iKC+aO4upIHO9WSaA3QoXYQDHbNwf1A==", + "version": "8.45.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.45.0.tgz", + "integrity": "sha512-pd8KSxiQpdYRfYa9Wufvdoct3ZPQQuVuU5O6scNgMuOMYuxvH0IGaYK0wUFjo4UYYQQCUndlXiMbnxopwvvTiw==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", @@ -1989,7 +1989,6 @@ "globals": "^13.19.0", "graphemer": "^1.4.0", "ignore": "^5.2.0", - "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", "is-path-inside": "^3.0.3", @@ -2001,7 +2000,6 @@ "natural-compare": "^1.4.0", "optionator": "^0.9.3", "strip-ansi": "^6.0.1", - "strip-json-comments": "^3.1.0", "text-table": "^0.2.0" }, "bin": { diff --git a/report-viewer/package.json b/report-viewer/package.json index 0dce9a610..762ef14e7 100644 --- a/report-viewer/package.json +++ b/report-viewer/package.json @@ -44,7 +44,7 @@ "@vue/test-utils": "^2.4.0", "@vue/tsconfig": "^0.4.0", "autoprefixer": "^10.4.14", - "eslint": "^8.44.0", + "eslint": "^8.45.0", "eslint-plugin-vue": "^9.15.1", "husky": "^8.0.0", "jsdom": "^22.1.0", From 0d90630011b07e80cd37522f675ebbb72a4dcf69 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 Jul 2023 09:32:55 +0000 Subject: [PATCH 016/232] Dependency(deps-dev): Bump postcss in /report-viewer Bumps [postcss](https://github.com/postcss/postcss) from 8.4.25 to 8.4.26. - [Release notes](https://github.com/postcss/postcss/releases) - [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md) - [Commits](https://github.com/postcss/postcss/compare/8.4.25...8.4.26) --- updated-dependencies: - dependency-name: postcss dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- report-viewer/package-lock.json | 8 ++++---- report-viewer/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/report-viewer/package-lock.json b/report-viewer/package-lock.json index f36ab10c8..868b16a59 100644 --- a/report-viewer/package-lock.json +++ b/report-viewer/package-lock.json @@ -41,7 +41,7 @@ "jsdom": "^22.1.0", "lint-staged": "^13.2.3", "npm-run-all": "^4.1.5", - "postcss": "^8.4.25", + "postcss": "^8.4.26", "prettier": "^3.0.0", "tailwindcss": "^3.3.2", "typescript": "^5.1.6", @@ -4434,9 +4434,9 @@ } }, "node_modules/postcss": { - "version": "8.4.25", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.25.tgz", - "integrity": "sha512-7taJ/8t2av0Z+sQEvNzCkpDynl0tX3uJMCODi6nT3PfASC7dYCWV9aQ+uiCf+KBD4SEFcu+GvJdGdwzQ6OSjCw==", + "version": "8.4.26", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.26.tgz", + "integrity": "sha512-jrXHFF8iTloAenySjM/ob3gSj7pCu0Ji49hnjqzsgSRa50hkWCKD0HQ+gMNJkW38jBI68MpAAg7ZWwHwX8NMMw==", "funding": [ { "type": "opencollective", diff --git a/report-viewer/package.json b/report-viewer/package.json index 762ef14e7..ac4a00918 100644 --- a/report-viewer/package.json +++ b/report-viewer/package.json @@ -50,7 +50,7 @@ "jsdom": "^22.1.0", "lint-staged": "^13.2.3", "npm-run-all": "^4.1.5", - "postcss": "^8.4.25", + "postcss": "^8.4.26", "prettier": "^3.0.0", "tailwindcss": "^3.3.2", "typescript": "^5.1.6", From 84ed262fc4cf15996d96fbf93241e8488ac137d6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 Jul 2023 13:06:00 +0000 Subject: [PATCH 017/232] Dependency(deps-dev): Bump tailwindcss in /report-viewer Bumps [tailwindcss](https://github.com/tailwindlabs/tailwindcss) from 3.3.2 to 3.3.3. - [Release notes](https://github.com/tailwindlabs/tailwindcss/releases) - [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/v3.3.3/CHANGELOG.md) - [Commits](https://github.com/tailwindlabs/tailwindcss/compare/v3.3.2...v3.3.3) --- updated-dependencies: - dependency-name: tailwindcss dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- report-viewer/package-lock.json | 9 ++++----- report-viewer/package.json | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/report-viewer/package-lock.json b/report-viewer/package-lock.json index 868b16a59..13597f849 100644 --- a/report-viewer/package-lock.json +++ b/report-viewer/package-lock.json @@ -43,7 +43,7 @@ "npm-run-all": "^4.1.5", "postcss": "^8.4.26", "prettier": "^3.0.0", - "tailwindcss": "^3.3.2", + "tailwindcss": "^3.3.3", "typescript": "^5.1.6", "vite": "^4.3.9", "vitest": "^0.32.4", @@ -5452,9 +5452,9 @@ "dev": true }, "node_modules/tailwindcss": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.3.2.tgz", - "integrity": "sha512-9jPkMiIBXvPc2KywkraqsUfbfj+dHDb+JPWtSJa9MLFdrPyazI7q6WX2sUrm7R9eVR7qqv3Pas7EvQFzxKnI6w==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.3.3.tgz", + "integrity": "sha512-A0KgSkef7eE4Mf+nKJ83i75TMyq8HqY3qmFIJSWy8bNt0v1lG7jUcpGpoTFxAwYcWOphcTBLPPJg+bDfhDf52w==", "dev": true, "dependencies": { "@alloc/quick-lru": "^5.2.0", @@ -5477,7 +5477,6 @@ "postcss-load-config": "^4.0.1", "postcss-nested": "^6.0.1", "postcss-selector-parser": "^6.0.11", - "postcss-value-parser": "^4.2.0", "resolve": "^1.22.2", "sucrase": "^3.32.0" }, diff --git a/report-viewer/package.json b/report-viewer/package.json index ac4a00918..dd8c1d713 100644 --- a/report-viewer/package.json +++ b/report-viewer/package.json @@ -52,7 +52,7 @@ "npm-run-all": "^4.1.5", "postcss": "^8.4.26", "prettier": "^3.0.0", - "tailwindcss": "^3.3.2", + "tailwindcss": "^3.3.3", "typescript": "^5.1.6", "vite": "^4.3.9", "vitest": "^0.32.4", From 03c11f5b73ae00ba0c558a515a5d932ab42e812c Mon Sep 17 00:00:00 2001 From: Niklas Heneka <93838730+NiklasHeneka@users.noreply.github.com> Date: Wed, 19 Jul 2023 18:10:00 +0200 Subject: [PATCH 018/232] Add new token types to the LLVMIR language module. --- .../java/de/jplag/llvmir/JPlagLLVMIRListener.java | 12 ++++++++++++ .../main/java/de/jplag/llvmir/LLVMIRTokenType.java | 6 ++++++ 2 files changed, 18 insertions(+) diff --git a/languages/llvmir/src/main/java/de/jplag/llvmir/JPlagLLVMIRListener.java b/languages/llvmir/src/main/java/de/jplag/llvmir/JPlagLLVMIRListener.java index 56bf897eb..886be3c79 100644 --- a/languages/llvmir/src/main/java/de/jplag/llvmir/JPlagLLVMIRListener.java +++ b/languages/llvmir/src/main/java/de/jplag/llvmir/JPlagLLVMIRListener.java @@ -53,6 +53,8 @@ public void exitTargetDef(LLVMIRParser.TargetDefContext ctx) { @Override public void enterSourceFilename(LLVMIRParser.SourceFilenameContext ctx) { + transformToken(LLVMIRTokenType.FILENAME, ctx.getStart(), ctx.getStop()); + super.enterSourceFilename(ctx); } @Override @@ -85,6 +87,8 @@ public void exitTopLevelEntity(LLVMIRParser.TopLevelEntityContext ctx) { @Override public void enterModuleAsm(LLVMIRParser.ModuleAsmContext ctx) { + transformToken(LLVMIRTokenType.ASSEMBLY, ctx.getStart(), ctx.getStop()); + super.enterModuleAsm(ctx); } @Override @@ -109,6 +113,8 @@ public void exitComdatDef(LLVMIRParser.ComdatDefContext ctx) { @Override public void enterGlobalDecl(LLVMIRParser.GlobalDeclContext ctx) { + transformToken(LLVMIRTokenType.GLOBAL_VARIABLE, ctx.getStart(), ctx.getStop()); + super.enterGlobalDecl(ctx); } @Override @@ -117,6 +123,8 @@ public void exitGlobalDecl(LLVMIRParser.GlobalDeclContext ctx) { @Override public void enterGlobalDef(LLVMIRParser.GlobalDefContext ctx) { + transformToken(LLVMIRTokenType.GLOBAL_VARIABLE, ctx.getStart(), ctx.getStop()); + super.enterGlobalDef(ctx); } @Override @@ -723,6 +731,8 @@ public void exitValue(LLVMIRParser.ValueContext ctx) { @Override public void enterInlineAsm(LLVMIRParser.InlineAsmContext ctx) { + transformToken(LLVMIRTokenType.ASSEMBLY, ctx.getStart(), ctx.getStop()); + super.enterInlineAsm(ctx); } @Override @@ -1003,6 +1013,8 @@ public void exitArrayType(LLVMIRParser.ArrayTypeContext ctx) { @Override public void enterStructType(LLVMIRParser.StructTypeContext ctx) { + transformToken(LLVMIRTokenType.STRUCTURE, ctx.getStart(), ctx.getStop()); + super.enterStructType(ctx); } @Override diff --git a/languages/llvmir/src/main/java/de/jplag/llvmir/LLVMIRTokenType.java b/languages/llvmir/src/main/java/de/jplag/llvmir/LLVMIRTokenType.java index 956a9f8d9..aa8ae8020 100644 --- a/languages/llvmir/src/main/java/de/jplag/llvmir/LLVMIRTokenType.java +++ b/languages/llvmir/src/main/java/de/jplag/llvmir/LLVMIRTokenType.java @@ -4,12 +4,18 @@ public enum LLVMIRTokenType implements TokenType { + FILENAME("FILENAME"), + // Functions FUNCTION_BODY_BEGIN("FUNC{"), FUNCTION_BODY_END("}FUNC"), FUNCTION_DECL("FUNC_DECL"), FUNCTION_DEF("FUNC_DEF"), + STRUCTURE("STRUCT"), + GLOBAL_VARIABLE("GLOBAL_VAR"), + ASSEMBLY("ASM"), + // Terminator Instructions RETURN("RET"), BRANCH("BR"), From 9887d514f8b563c92d7c6d092d32db95bdba7130 Mon Sep 17 00:00:00 2001 From: Alex | Kronox Date: Thu, 20 Jul 2023 10:32:59 +0200 Subject: [PATCH 019/232] fixed --- report-viewer/package-lock.json | 419 +++++++++++++++++++++++++++++--- report-viewer/package.json | 2 +- report-viewer/vitest.config.ts | 19 +- 3 files changed, 389 insertions(+), 51 deletions(-) diff --git a/report-viewer/package-lock.json b/report-viewer/package-lock.json index 13597f849..9f1a57778 100644 --- a/report-viewer/package-lock.json +++ b/report-viewer/package-lock.json @@ -45,7 +45,7 @@ "prettier": "^3.0.0", "tailwindcss": "^3.3.3", "typescript": "^5.1.6", - "vite": "^4.3.9", + "vite": "^4.4.4", "vitest": "^0.32.4", "vue-tsc": "^1.8.5" } @@ -82,10 +82,346 @@ "node": ">=6.0.0" } }, + "node_modules/@esbuild/android-arm": { + "version": "0.18.14", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.14.tgz", + "integrity": "sha512-blODaaL+lngG5bdK/t4qZcQvq2BBqrABmYwqPPcS5VRxrCSGHb9R/rA3fqxh7R18I7WU4KKv+NYkt22FDfalcg==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.18.14", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.18.14.tgz", + "integrity": "sha512-rZ2v+Luba5/3D6l8kofWgTnqE+qsC/L5MleKIKFyllHTKHrNBMqeRCnZI1BtRx8B24xMYxeU32iIddRQqMsOsg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.18.14", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.14.tgz", + "integrity": "sha512-qSwh8y38QKl+1Iqg+YhvCVYlSk3dVLk9N88VO71U4FUjtiSFylMWK3Ugr8GC6eTkkP4Tc83dVppt2n8vIdlSGg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.18.14", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.14.tgz", + "integrity": "sha512-9Hl2D2PBeDYZiNbnRKRWuxwHa9v5ssWBBjisXFkVcSP5cZqzZRFBUWEQuqBHO4+PKx4q4wgHoWtfQ1S7rUqJ2Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.18.14", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.18.14.tgz", + "integrity": "sha512-ZnI3Dg4ElQ6tlv82qLc/UNHtFsgZSKZ7KjsUNAo1BF1SoYDjkGKHJyCrYyWjFecmXpvvG/KJ9A/oe0H12odPLQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.18.14", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.14.tgz", + "integrity": "sha512-h3OqR80Da4oQCIa37zl8tU5MwHQ7qgPV0oVScPfKJK21fSRZEhLE4IIVpmcOxfAVmqjU6NDxcxhYaM8aDIGRLw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.18.14", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.18.14.tgz", + "integrity": "sha512-ha4BX+S6CZG4BoH9tOZTrFIYC1DH13UTCRHzFc3GWX74nz3h/N6MPF3tuR3XlsNjMFUazGgm35MPW5tHkn2lzQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.18.14", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.18.14.tgz", + "integrity": "sha512-5+7vehI1iqru5WRtJyU2XvTOvTGURw3OZxe3YTdE9muNNIdmKAVmSHpB3Vw2LazJk2ifEdIMt/wTWnVe5V98Kg==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.18.14", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.18.14.tgz", + "integrity": "sha512-IXORRe22In7U65NZCzjwAUc03nn8SDIzWCnfzJ6t/8AvGx5zBkcLfknI+0P+hhuftufJBmIXxdSTbzWc8X/V4w==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.18.14", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.18.14.tgz", + "integrity": "sha512-BfHlMa0nibwpjG+VXbOoqJDmFde4UK2gnW351SQ2Zd4t1N3zNdmUEqRkw/srC1Sa1DRBE88Dbwg4JgWCbNz/FQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.18.14", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.18.14.tgz", + "integrity": "sha512-j2/Ex++DRUWIAaUDprXd3JevzGtZ4/d7VKz+AYDoHZ3HjJzCyYBub9CU1wwIXN+viOP0b4VR3RhGClsvyt/xSw==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.18.14", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.18.14.tgz", + "integrity": "sha512-qn2+nc+ZCrJmiicoAnJXJJkZWt8Nwswgu1crY7N+PBR8ChBHh89XRxj38UU6Dkthl2yCVO9jWuafZ24muzDC/A==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.18.14", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.18.14.tgz", + "integrity": "sha512-aGzXzd+djqeEC5IRkDKt3kWzvXoXC6K6GyYKxd+wsFJ2VQYnOWE954qV2tvy5/aaNrmgPTb52cSCHFE+Z7Z0yg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.18.14", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.18.14.tgz", + "integrity": "sha512-8C6vWbfr0ygbAiMFLS6OPz0BHvApkT2gCboOGV76YrYw+sD/MQJzyITNsjZWDXJwPu9tjrFQOVG7zijRzBCnLw==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.18.14", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.18.14.tgz", + "integrity": "sha512-G/Lf9iu8sRMM60OVGOh94ZW2nIStksEcITkXdkD09/T6QFD/o+g0+9WVyR/jajIb3A0LvBJ670tBnGe1GgXMgw==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.18.14", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.14.tgz", + "integrity": "sha512-TBgStYBQaa3EGhgqIDM+ECnkreb0wkcKqL7H6m+XPcGUoU4dO7dqewfbm0mWEQYH3kzFHrzjOFNpSAVzDZRSJw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.18.14", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.18.14.tgz", + "integrity": "sha512-stvCcjyCQR2lMTroqNhAbvROqRjxPEq0oQ380YdXxA81TaRJEucH/PzJ/qsEtsHgXlWFW6Ryr/X15vxQiyRXVg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.18.14", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.18.14.tgz", + "integrity": "sha512-apAOJF14CIsN5ht1PA57PboEMsNV70j3FUdxLmA2liZ20gEQnfTG5QU0FhENo5nwbTqCB2O3WDsXAihfODjHYw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.18.14", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.18.14.tgz", + "integrity": "sha512-fYRaaS8mDgZcGybPn2MQbn1ZNZx+UXFSUoS5Hd2oEnlsyUcr/l3c6RnXf1bLDRKKdLRSabTmyCy7VLQ7VhGdOQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.18.14", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.18.14.tgz", + "integrity": "sha512-1c44RcxKEJPrVj62XdmYhxXaU/V7auELCmnD+Ri+UCt+AGxTvzxl9uauQhrFso8gj6ZV1DaORV0sT9XSHOAk8Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.18.14", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.18.14.tgz", + "integrity": "sha512-EXAFttrdAxZkFQmpvcAQ2bywlWUsONp/9c2lcfvPUhu8vXBBenCXpoq9YkUvVP639ld3YGiYx0YUQ6/VQz3Maw==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, "node_modules/@esbuild/win32-x64": { - "version": "0.17.14", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.17.14.tgz", - "integrity": "sha512-gPQmsi2DKTaEgG14hc3CHXHp62k8g6qr0Pas+I4lUxRMugGSATh/Bi8Dgusoz9IQ0IfdrvLpco6kujEIBoaogA==", + "version": "0.18.14", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.18.14.tgz", + "integrity": "sha512-K0QjGbcskx+gY+qp3v4/940qg8JitpXbdxFhRDA1aYoNaPff88+aEwoq45aqJ+ogpxQxmU0ZTjgnrQD/w8iiUg==", "cpu": [ "x64" ], @@ -1901,9 +2237,9 @@ } }, "node_modules/esbuild": { - "version": "0.17.14", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.17.14.tgz", - "integrity": "sha512-vOO5XhmVj/1XQR9NQ1UPq6qvMYL7QFJU57J5fKBKBKxp17uDt5PgxFDb4A2nEiXhr1qQs4x0F5+66hVVw4ruNw==", + "version": "0.18.14", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.14.tgz", + "integrity": "sha512-uNPj5oHPYmj+ZhSQeYQVFZ+hAlJZbAGOmmILWIqrGvPVlNLbyOvU5Bu6Woi8G8nskcx0vwY0iFoMPrzT86Ko+w==", "dev": true, "hasInstallScript": true, "bin": { @@ -1913,28 +2249,28 @@ "node": ">=12" }, "optionalDependencies": { - "@esbuild/android-arm": "0.17.14", - "@esbuild/android-arm64": "0.17.14", - "@esbuild/android-x64": "0.17.14", - "@esbuild/darwin-arm64": "0.17.14", - "@esbuild/darwin-x64": "0.17.14", - "@esbuild/freebsd-arm64": "0.17.14", - "@esbuild/freebsd-x64": "0.17.14", - "@esbuild/linux-arm": "0.17.14", - "@esbuild/linux-arm64": "0.17.14", - "@esbuild/linux-ia32": "0.17.14", - "@esbuild/linux-loong64": "0.17.14", - "@esbuild/linux-mips64el": "0.17.14", - "@esbuild/linux-ppc64": "0.17.14", - "@esbuild/linux-riscv64": "0.17.14", - "@esbuild/linux-s390x": "0.17.14", - "@esbuild/linux-x64": "0.17.14", - "@esbuild/netbsd-x64": "0.17.14", - "@esbuild/openbsd-x64": "0.17.14", - "@esbuild/sunos-x64": "0.17.14", - "@esbuild/win32-arm64": "0.17.14", - "@esbuild/win32-ia32": "0.17.14", - "@esbuild/win32-x64": "0.17.14" + "@esbuild/android-arm": "0.18.14", + "@esbuild/android-arm64": "0.18.14", + "@esbuild/android-x64": "0.18.14", + "@esbuild/darwin-arm64": "0.18.14", + "@esbuild/darwin-x64": "0.18.14", + "@esbuild/freebsd-arm64": "0.18.14", + "@esbuild/freebsd-x64": "0.18.14", + "@esbuild/linux-arm": "0.18.14", + "@esbuild/linux-arm64": "0.18.14", + "@esbuild/linux-ia32": "0.18.14", + "@esbuild/linux-loong64": "0.18.14", + "@esbuild/linux-mips64el": "0.18.14", + "@esbuild/linux-ppc64": "0.18.14", + "@esbuild/linux-riscv64": "0.18.14", + "@esbuild/linux-s390x": "0.18.14", + "@esbuild/linux-x64": "0.18.14", + "@esbuild/netbsd-x64": "0.18.14", + "@esbuild/openbsd-x64": "0.18.14", + "@esbuild/sunos-x64": "0.18.14", + "@esbuild/win32-arm64": "0.18.14", + "@esbuild/win32-ia32": "0.18.14", + "@esbuild/win32-x64": "0.18.14" } }, "node_modules/escalade": { @@ -4897,9 +5233,9 @@ } }, "node_modules/rollup": { - "version": "3.21.6", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.21.6.tgz", - "integrity": "sha512-SXIICxvxQxR3D4dp/3LDHZIJPC8a4anKMHd4E3Jiz2/JnY+2bEjqrOokAauc5ShGVNFHlEFjBXAXlaxkJqIqSg==", + "version": "3.26.3", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.26.3.tgz", + "integrity": "sha512-7Tin0C8l86TkpcMtXvQu6saWH93nhG3dGQ1/+l5V2TDMceTxO7kDiK6GzbfLWNNxqJXm591PcEZUozZm51ogwQ==", "dev": true, "bin": { "rollup": "dist/bin/rollup" @@ -5766,14 +6102,14 @@ } }, "node_modules/vite": { - "version": "4.3.9", - "resolved": "https://registry.npmjs.org/vite/-/vite-4.3.9.tgz", - "integrity": "sha512-qsTNZjO9NoJNW7KnOrgYwczm0WctJ8m/yqYAMAK9Lxt4SoySUfS5S8ia9K7JHpa3KEeMfyF8LoJ3c5NeBJy6pg==", + "version": "4.4.4", + "resolved": "https://registry.npmjs.org/vite/-/vite-4.4.4.tgz", + "integrity": "sha512-4mvsTxjkveWrKDJI70QmelfVqTm+ihFAb6+xf4sjEU2TmUCTlVX87tmg/QooPEMQb/lM9qGHT99ebqPziEd3wg==", "dev": true, "dependencies": { - "esbuild": "^0.17.5", - "postcss": "^8.4.23", - "rollup": "^3.21.0" + "esbuild": "^0.18.10", + "postcss": "^8.4.25", + "rollup": "^3.25.2" }, "bin": { "vite": "bin/vite.js" @@ -5781,12 +6117,16 @@ "engines": { "node": "^14.18.0 || >=16.0.0" }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, "optionalDependencies": { "fsevents": "~2.3.2" }, "peerDependencies": { "@types/node": ">= 14", "less": "*", + "lightningcss": "^1.21.0", "sass": "*", "stylus": "*", "sugarss": "*", @@ -5799,6 +6139,9 @@ "less": { "optional": true }, + "lightningcss": { + "optional": true + }, "sass": { "optional": true }, diff --git a/report-viewer/package.json b/report-viewer/package.json index dd8c1d713..ec16c785a 100644 --- a/report-viewer/package.json +++ b/report-viewer/package.json @@ -54,7 +54,7 @@ "prettier": "^3.0.0", "tailwindcss": "^3.3.3", "typescript": "^5.1.6", - "vite": "^4.3.9", + "vite": "^4.4.4", "vitest": "^0.32.4", "vue-tsc": "^1.8.5" } diff --git a/report-viewer/vitest.config.ts b/report-viewer/vitest.config.ts index 23da12e5c..1a9b1be61 100644 --- a/report-viewer/vitest.config.ts +++ b/report-viewer/vitest.config.ts @@ -1,15 +1,10 @@ import { fileURLToPath } from 'node:url' -import { mergeConfig } from 'vite' import { configDefaults, defineConfig } from 'vitest/config' -import viteConfig from './vite.config' -export default mergeConfig( - viteConfig, - defineConfig({ - test: { - environment: 'jsdom', - exclude: [...configDefaults.exclude, 'tests/e2e/*'], - root: fileURLToPath(new URL('./', import.meta.url)) - } - }) -) +export default defineConfig({ + test: { + environment: 'jsdom', + exclude: [...configDefaults.exclude, 'tests/e2e/*'], + root: fileURLToPath(new URL('./', import.meta.url)) + } +}) From a6209d76bbb883e598f51077b6980a8e3c3f7c1a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 Jul 2023 09:46:24 +0000 Subject: [PATCH 020/232] Dependency(deps): Bump spotless-maven-plugin from 2.37.0 to 2.38.0 Bumps [spotless-maven-plugin](https://github.com/diffplug/spotless) from 2.37.0 to 2.38.0. - [Changelog](https://github.com/diffplug/spotless/blob/main/CHANGES.md) - [Commits](https://github.com/diffplug/spotless/compare/lib/2.37.0...lib/2.38.0) --- updated-dependencies: - dependency-name: com.diffplug.spotless:spotless-maven-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 242d8b994..23471f318 100644 --- a/pom.xml +++ b/pom.xml @@ -74,7 +74,7 @@ 17 17 - 2.37.0 + 2.38.0 2.0.7 5.9.3 From 61235e57919eb57fca32e3eb38e492f18e9ed80e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 Jul 2023 09:46:19 +0000 Subject: [PATCH 021/232] Dependency(deps): Bump scalameta_2.13 from 4.8.3 to 4.8.5 Bumps [scalameta_2.13](https://github.com/scalameta/scalameta) from 4.8.3 to 4.8.5. - [Release notes](https://github.com/scalameta/scalameta/releases) - [Commits](https://github.com/scalameta/scalameta/compare/v4.8.3...v4.8.5) --- updated-dependencies: - dependency-name: org.scalameta:scalameta_2.13 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- languages/scala/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/languages/scala/pom.xml b/languages/scala/pom.xml index 02fc41aa2..0f91c68a1 100644 --- a/languages/scala/pom.xml +++ b/languages/scala/pom.xml @@ -25,7 +25,7 @@ org.scalameta scalameta_${scala.compat.version} - 4.8.3 + 4.8.5 From 67feef7d772b19c436375a1c9ab931cfd786967d Mon Sep 17 00:00:00 2001 From: Niklas Heneka <93838730+NiklasHeneka@users.noreply.github.com> Date: Fri, 21 Jul 2023 13:15:28 +0200 Subject: [PATCH 022/232] Add token types for constants and constant expressions. --- .../de/jplag/llvmir/JPlagLLVMIRListener.java | 66 ++++++++++++++++++- .../java/de/jplag/llvmir/LLVMIRTokenType.java | 4 ++ .../main/java/de/jplag/llvmir/Language.java | 2 +- 3 files changed, 69 insertions(+), 3 deletions(-) diff --git a/languages/llvmir/src/main/java/de/jplag/llvmir/JPlagLLVMIRListener.java b/languages/llvmir/src/main/java/de/jplag/llvmir/JPlagLLVMIRListener.java index 886be3c79..4af8b56bf 100644 --- a/languages/llvmir/src/main/java/de/jplag/llvmir/JPlagLLVMIRListener.java +++ b/languages/llvmir/src/main/java/de/jplag/llvmir/JPlagLLVMIRListener.java @@ -587,6 +587,8 @@ public void exitNoneConst(LLVMIRParser.NoneConstContext ctx) { @Override public void enterStructConst(LLVMIRParser.StructConstContext ctx) { + transformToken(LLVMIRTokenType.STRUCTURE, ctx.getStart(), ctx.getStop()); + super.enterStructConst(ctx); } @Override @@ -595,6 +597,8 @@ public void exitStructConst(LLVMIRParser.StructConstContext ctx) { @Override public void enterArrayConst(LLVMIRParser.ArrayConstContext ctx) { + transformToken(LLVMIRTokenType.ARRAY, ctx.getStart(), ctx.getStop()); + super.enterArrayConst(ctx); } @Override @@ -603,6 +607,8 @@ public void exitArrayConst(LLVMIRParser.ArrayConstContext ctx) { @Override public void enterVectorConst(LLVMIRParser.VectorConstContext ctx) { + transformToken(LLVMIRTokenType.VECTOR, ctx.getStart(), ctx.getStop()); + super.enterVectorConst(ctx); } @Override @@ -1013,8 +1019,6 @@ public void exitArrayType(LLVMIRParser.ArrayTypeContext ctx) { @Override public void enterStructType(LLVMIRParser.StructTypeContext ctx) { - transformToken(LLVMIRTokenType.STRUCTURE, ctx.getStart(), ctx.getStop()); - super.enterStructType(ctx); } @Override @@ -1079,6 +1083,8 @@ public void exitMetadataType(LLVMIRParser.MetadataTypeContext ctx) { @Override public void enterBitCastExpr(LLVMIRParser.BitCastExprContext ctx) { + transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + super.enterBitCastExpr(ctx); } @Override @@ -1087,6 +1093,8 @@ public void exitBitCastExpr(LLVMIRParser.BitCastExprContext ctx) { @Override public void enterGetElementPtrExpr(LLVMIRParser.GetElementPtrExprContext ctx) { + transformToken(LLVMIRTokenType.GET_ELEMENT_POINTER, ctx.getStart(), ctx.getStop()); + super.enterGetElementPtrExpr(ctx); } @Override @@ -1103,6 +1111,8 @@ public void exitGepIndex(LLVMIRParser.GepIndexContext ctx) { @Override public void enterAddrSpaceCastExpr(LLVMIRParser.AddrSpaceCastExprContext ctx) { + transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + super.enterAddrSpaceCastExpr(ctx); } @Override @@ -1111,6 +1121,8 @@ public void exitAddrSpaceCastExpr(LLVMIRParser.AddrSpaceCastExprContext ctx) { @Override public void enterIntToPtrExpr(LLVMIRParser.IntToPtrExprContext ctx) { + transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + super.enterIntToPtrExpr(ctx); } @Override @@ -1119,6 +1131,8 @@ public void exitIntToPtrExpr(LLVMIRParser.IntToPtrExprContext ctx) { @Override public void enterICmpExpr(LLVMIRParser.ICmpExprContext ctx) { + transformToken(LLVMIRTokenType.COMPARISON, ctx.getStart(), ctx.getStop()); + super.enterICmpExpr(ctx); } @Override @@ -1127,6 +1141,8 @@ public void exitICmpExpr(LLVMIRParser.ICmpExprContext ctx) { @Override public void enterFCmpExpr(LLVMIRParser.FCmpExprContext ctx) { + transformToken(LLVMIRTokenType.COMPARISON, ctx.getStart(), ctx.getStop()); + super.enterFCmpExpr(ctx); } @Override @@ -1135,6 +1151,8 @@ public void exitFCmpExpr(LLVMIRParser.FCmpExprContext ctx) { @Override public void enterSelectExpr(LLVMIRParser.SelectExprContext ctx) { + transformToken(LLVMIRTokenType.SELECT, ctx.getStart(), ctx.getStop()); + super.enterSelectExpr(ctx); } @Override @@ -1143,6 +1161,8 @@ public void exitSelectExpr(LLVMIRParser.SelectExprContext ctx) { @Override public void enterTruncExpr(LLVMIRParser.TruncExprContext ctx) { + transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + super.enterTruncExpr(ctx); } @Override @@ -1151,6 +1171,8 @@ public void exitTruncExpr(LLVMIRParser.TruncExprContext ctx) { @Override public void enterZExtExpr(LLVMIRParser.ZExtExprContext ctx) { + transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + super.enterZExtExpr(ctx); } @Override @@ -1159,6 +1181,8 @@ public void exitZExtExpr(LLVMIRParser.ZExtExprContext ctx) { @Override public void enterSExtExpr(LLVMIRParser.SExtExprContext ctx) { + transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + super.enterSExtExpr(ctx); } @Override @@ -1167,6 +1191,8 @@ public void exitSExtExpr(LLVMIRParser.SExtExprContext ctx) { @Override public void enterFpTruncExpr(LLVMIRParser.FpTruncExprContext ctx) { + transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + super.enterFpTruncExpr(ctx); } @Override @@ -1175,6 +1201,8 @@ public void exitFpTruncExpr(LLVMIRParser.FpTruncExprContext ctx) { @Override public void enterFpExtExpr(LLVMIRParser.FpExtExprContext ctx) { + transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + super.enterFpExtExpr(ctx); } @Override @@ -1183,6 +1211,8 @@ public void exitFpExtExpr(LLVMIRParser.FpExtExprContext ctx) { @Override public void enterFpToUiExpr(LLVMIRParser.FpToUiExprContext ctx) { + transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + super.enterFpToUiExpr(ctx); } @Override @@ -1191,6 +1221,8 @@ public void exitFpToUiExpr(LLVMIRParser.FpToUiExprContext ctx) { @Override public void enterFpToSiExpr(LLVMIRParser.FpToSiExprContext ctx) { + transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + super.enterFpToSiExpr(ctx); } @Override @@ -1199,6 +1231,8 @@ public void exitFpToSiExpr(LLVMIRParser.FpToSiExprContext ctx) { @Override public void enterUiToFpExpr(LLVMIRParser.UiToFpExprContext ctx) { + transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + super.enterUiToFpExpr(ctx); } @Override @@ -1207,6 +1241,8 @@ public void exitUiToFpExpr(LLVMIRParser.UiToFpExprContext ctx) { @Override public void enterSiToFpExpr(LLVMIRParser.SiToFpExprContext ctx) { + transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + super.enterSiToFpExpr(ctx); } @Override @@ -1215,6 +1251,8 @@ public void exitSiToFpExpr(LLVMIRParser.SiToFpExprContext ctx) { @Override public void enterPtrToIntExpr(LLVMIRParser.PtrToIntExprContext ctx) { + transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + super.enterPtrToIntExpr(ctx); } @Override @@ -1223,6 +1261,8 @@ public void exitPtrToIntExpr(LLVMIRParser.PtrToIntExprContext ctx) { @Override public void enterExtractElementExpr(LLVMIRParser.ExtractElementExprContext ctx) { + transformToken(LLVMIRTokenType.EXTRACT_ELEM, ctx.getStart(), ctx.getStop()); + super.enterExtractElementExpr(ctx); } @Override @@ -1231,6 +1271,8 @@ public void exitExtractElementExpr(LLVMIRParser.ExtractElementExprContext ctx) { @Override public void enterInsertElementExpr(LLVMIRParser.InsertElementExprContext ctx) { + transformToken(LLVMIRTokenType.INSERT_ELEM, ctx.getStart(), ctx.getStop()); + super.enterInsertElementExpr(ctx); } @Override @@ -1239,6 +1281,8 @@ public void exitInsertElementExpr(LLVMIRParser.InsertElementExprContext ctx) { @Override public void enterShuffleVectorExpr(LLVMIRParser.ShuffleVectorExprContext ctx) { + transformToken(LLVMIRTokenType.SHUFFLE_VEC, ctx.getStart(), ctx.getStop()); + super.enterShuffleVectorExpr(ctx); } @Override @@ -1247,6 +1291,8 @@ public void exitShuffleVectorExpr(LLVMIRParser.ShuffleVectorExprContext ctx) { @Override public void enterShlExpr(LLVMIRParser.ShlExprContext ctx) { + transformToken(LLVMIRTokenType.SHIFT, ctx.getStart(), ctx.getStop()); + super.enterShlExpr(ctx); } @Override @@ -1255,6 +1301,8 @@ public void exitShlExpr(LLVMIRParser.ShlExprContext ctx) { @Override public void enterLShrExpr(LLVMIRParser.LShrExprContext ctx) { + transformToken(LLVMIRTokenType.SHIFT, ctx.getStart(), ctx.getStop()); + super.enterLShrExpr(ctx); } @Override @@ -1263,6 +1311,8 @@ public void exitLShrExpr(LLVMIRParser.LShrExprContext ctx) { @Override public void enterAShrExpr(LLVMIRParser.AShrExprContext ctx) { + transformToken(LLVMIRTokenType.SHIFT, ctx.getStart(), ctx.getStop()); + super.enterAShrExpr(ctx); } @Override @@ -1271,6 +1321,8 @@ public void exitAShrExpr(LLVMIRParser.AShrExprContext ctx) { @Override public void enterAndExpr(LLVMIRParser.AndExprContext ctx) { + transformToken(LLVMIRTokenType.AND, ctx.getStart(), ctx.getStop()); + super.enterAndExpr(ctx); } @Override @@ -1279,6 +1331,8 @@ public void exitAndExpr(LLVMIRParser.AndExprContext ctx) { @Override public void enterOrExpr(LLVMIRParser.OrExprContext ctx) { + transformToken(LLVMIRTokenType.OR, ctx.getStart(), ctx.getStop()); + super.enterOrExpr(ctx); } @Override @@ -1287,6 +1341,8 @@ public void exitOrExpr(LLVMIRParser.OrExprContext ctx) { @Override public void enterXorExpr(LLVMIRParser.XorExprContext ctx) { + transformToken(LLVMIRTokenType.XOR, ctx.getStart(), ctx.getStop()); + super.enterXorExpr(ctx); } @Override @@ -1295,6 +1351,8 @@ public void exitXorExpr(LLVMIRParser.XorExprContext ctx) { @Override public void enterAddExpr(LLVMIRParser.AddExprContext ctx) { + transformToken(LLVMIRTokenType.ADD, ctx.getStart(), ctx.getStop()); + super.enterAddExpr(ctx); } @Override @@ -1303,6 +1361,8 @@ public void exitAddExpr(LLVMIRParser.AddExprContext ctx) { @Override public void enterSubExpr(LLVMIRParser.SubExprContext ctx) { + transformToken(LLVMIRTokenType.SUB, ctx.getStart(), ctx.getStop()); + super.enterSubExpr(ctx); } @Override @@ -1311,6 +1371,8 @@ public void exitSubExpr(LLVMIRParser.SubExprContext ctx) { @Override public void enterMulExpr(LLVMIRParser.MulExprContext ctx) { + transformToken(LLVMIRTokenType.MUL, ctx.getStart(), ctx.getStop()); + super.enterMulExpr(ctx); } @Override diff --git a/languages/llvmir/src/main/java/de/jplag/llvmir/LLVMIRTokenType.java b/languages/llvmir/src/main/java/de/jplag/llvmir/LLVMIRTokenType.java index aa8ae8020..3fb44eb12 100644 --- a/languages/llvmir/src/main/java/de/jplag/llvmir/LLVMIRTokenType.java +++ b/languages/llvmir/src/main/java/de/jplag/llvmir/LLVMIRTokenType.java @@ -16,6 +16,10 @@ public enum LLVMIRTokenType implements TokenType { GLOBAL_VARIABLE("GLOBAL_VAR"), ASSEMBLY("ASM"), + // Constants + ARRAY("ARR"), + VECTOR("VEC"), + // Terminator Instructions RETURN("RET"), BRANCH("BR"), diff --git a/languages/llvmir/src/main/java/de/jplag/llvmir/Language.java b/languages/llvmir/src/main/java/de/jplag/llvmir/Language.java index 1e6c5bcdf..e1568209d 100644 --- a/languages/llvmir/src/main/java/de/jplag/llvmir/Language.java +++ b/languages/llvmir/src/main/java/de/jplag/llvmir/Language.java @@ -17,7 +17,7 @@ public class Language implements de.jplag.Language { private static final String NAME = "LLVMIR Parser"; private static final String IDENTIFIER = "llvmir"; - private static final int DEFAULT_MIN_TOKEN_MATCH = 15; + private static final int DEFAULT_MIN_TOKEN_MATCH = 20; private static final String[] FILE_EXTENSIONS = {".ll"}; private final LLVMIRParserAdapter parserAdapter; From 5186b410f8bf14460f2c92a50dd4042a075bf722 Mon Sep 17 00:00:00 2001 From: Niklas Heneka <93838730+NiklasHeneka@users.noreply.github.com> Date: Fri, 21 Jul 2023 18:26:22 +0200 Subject: [PATCH 023/232] Add draft for test file. --- languages/llvmir/README.md | 4 + .../java/de/jplag/llvmir/LLVMIRTokenType.java | 4 +- .../de/jplag/llvmir/LLVMIRLanguageTest.java | 150 ++++++++++++++++++ .../resources/de/jplag/llvmir/Complete.ll | 0 4 files changed, 156 insertions(+), 2 deletions(-) create mode 100644 languages/llvmir/src/test/java/de/jplag/llvmir/LLVMIRLanguageTest.java create mode 100644 languages/llvmir/src/test/resources/de/jplag/llvmir/Complete.ll diff --git a/languages/llvmir/README.md b/languages/llvmir/README.md index 2e8fbb75a..8e17599b3 100644 --- a/languages/llvmir/README.md +++ b/languages/llvmir/README.md @@ -14,6 +14,10 @@ If the grammar is updated to a more recent1 TODO +### Token Extraction + +Changes to the grammar. + ### Usage To use the LLVM IR module, add the `-l llvmir` flag in the CLI, or use a `JPlagOption` object with `new de.jplag.llvmir.Language()` as `language` in the Java API as described in the usage information in the [readme of the main project](https://github.com/jplag/JPlag#usage) and [in the wiki](https://github.com/jplag/JPlag/wiki/1.-How-to-Use-JPlag). diff --git a/languages/llvmir/src/main/java/de/jplag/llvmir/LLVMIRTokenType.java b/languages/llvmir/src/main/java/de/jplag/llvmir/LLVMIRTokenType.java index 3fb44eb12..ace01d419 100644 --- a/languages/llvmir/src/main/java/de/jplag/llvmir/LLVMIRTokenType.java +++ b/languages/llvmir/src/main/java/de/jplag/llvmir/LLVMIRTokenType.java @@ -12,11 +12,11 @@ public enum LLVMIRTokenType implements TokenType { FUNCTION_DECL("FUNC_DECL"), FUNCTION_DEF("FUNC_DEF"), - STRUCTURE("STRUCT"), GLOBAL_VARIABLE("GLOBAL_VAR"), ASSEMBLY("ASM"), // Constants + STRUCTURE("STRUCT"), ARRAY("ARR"), VECTOR("VEC"), @@ -43,7 +43,7 @@ public enum LLVMIRTokenType implements TokenType { OR("OR"), XOR("XOR"), - //Vector operations + // Vector operations EXTRACT_ELEM("EXTRACT_ELEMENT"), INSERT_ELEM("INSERT_ELEM"), SHUFFLE_VEC("SHUFFLE_VECTOR"), diff --git a/languages/llvmir/src/test/java/de/jplag/llvmir/LLVMIRLanguageTest.java b/languages/llvmir/src/test/java/de/jplag/llvmir/LLVMIRLanguageTest.java new file mode 100644 index 000000000..f583fb359 --- /dev/null +++ b/languages/llvmir/src/test/java/de/jplag/llvmir/LLVMIRLanguageTest.java @@ -0,0 +1,150 @@ +package de.jplag.llvmir; + +import static org.junit.jupiter.api.Assertions.*; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Arrays; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.IntStream; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import de.jplag.ParsingException; +import de.jplag.SharedTokenType; +import de.jplag.Token; +import de.jplag.TokenPrinter; + +@Disabled +class LLVMIRLanguageTest { + + /** + * Test source file that is supposed to produce a complete set of tokens, i.e. all types of tokens. + */ + private static final String COMPLETE_TEST_FILE = "Complete.ll"; + + /** + * Regular expression that describes lines consisting only of whitespace and optionally a line comment. + */ + private static final String EMPTY_OR_SINGLE_LINE_COMMENT = "\\s*(//.*|/\\*.*\\*/)?"; + + /** + * Regular expression that describes lines containing the start of a multiline comment and no code before it. + */ + private static final String DELIMITED_COMMENT_START = "\\s*/\\*(?:(?!\\*/).)*$"; + + /** + * Regular expression that describes lines containing the end of a multiline comment and no more code after that. + */ + private static final String DELIMITED_COMMENT_END = ".*\\*/\\s*$"; + + private final Logger logger = LoggerFactory.getLogger(LLVMIRLanguageTest.class); + private final String[] testFiles = new String[] {COMPLETE_TEST_FILE}; + private final File testFileLocation = Path.of("src", "test", "resources", "de", "jplag", "llvmir").toFile(); + private Language language; + + @BeforeEach + void setup() { + language = new Language(); + } + + @Test + void parseTestFiles() throws ParsingException { + for (String fileName : testFiles) { + List tokens = language.parse(Set.of(new File(testFileLocation, fileName))); + String output = TokenPrinter.printTokens(tokens, testFileLocation); + logger.info(output); + + testSourceCoverage(fileName, tokens); + if (fileName.equals(COMPLETE_TEST_FILE)) { + testTokenCoverage(tokens, fileName); + } + + } + } + + /** + * Confirms that the code is covered to a basic extent, i.e. each line of code contains at least one token. + * @param fileName a code sample file name + * @param tokens the list of tokens generated from the sample + */ + private void testSourceCoverage(String fileName, List tokens) { + File testFile = new File(testFileLocation, fileName); + + try { + List lines = Files.readAllLines(testFile.toPath()); + + // All lines that contain code + var codeLines = getCodeLines(lines); + // All lines that contain token + var tokenLines = tokens.stream().mapToInt(Token::getLine).filter(line -> line != Token.NO_VALUE).distinct().toArray(); + + if (codeLines.length > tokenLines.length) { + var diffLine = IntStream.range(0, codeLines.length) + .dropWhile(lineIdx -> lineIdx < tokenLines.length && codeLines[lineIdx] == tokenLines[lineIdx]).findFirst(); + diffLine.ifPresent( + lineIdx -> fail("Line %d of file '%s' is not represented in the token list.".formatted(codeLines[lineIdx], fileName))); + } + assertArrayEquals(codeLines, tokenLines); + } catch (IOException exception) { + logger.info("Error while reading test file %s".formatted(fileName), exception); + fail(); + } + } + + /** + * Gets the line numbers of lines containing actual code, omitting empty lines and comment lines. + * @param lines lines of a code file + * @return an array of the line numbers of code lines + */ + private int[] getCodeLines(List lines) { + // This boxed boolean can be accessed from within the lambda method below + var state = new Object() { + boolean insideComment = false; + }; + + var codeLines = IntStream.rangeClosed(1, lines.size()).sequential().filter(idx -> { + String line = lines.get(idx - 1); + if (line.matches(EMPTY_OR_SINGLE_LINE_COMMENT)) { + return false; + } else if (line.matches(DELIMITED_COMMENT_START)) { + state.insideComment = true; + return false; + } else if (state.insideComment) { + // This fails if code follows after '*/'. If the code is formatted well, this should not happen. + if (line.matches(DELIMITED_COMMENT_END)) { + state.insideComment = false; + } + return false; + } + return true; + }); + + return codeLines.toArray(); + + } + + /** + * Confirms that all Token types are 'reachable' with a complete code example. + * @param tokens list of tokens which is supposed to contain all types of tokens + * @param fileName The file name of the complete code example + */ + private void testTokenCoverage(List tokens, String fileName) { + var annotatedTokens = tokens.stream().map(Token::getType).collect(Collectors.toSet()); + assertTrue(annotatedTokens.contains(SharedTokenType.FILE_END)); + var annotatedLLVMIRTokens = annotatedTokens.stream().filter(LLVMIRTokenType.class::isInstance).collect(Collectors.toSet()); + var allLLVMIRTokens = LLVMIRTokenType.values(); + var missingLLVMIRTokens = Arrays.stream(allLLVMIRTokens).filter(token -> !annotatedLLVMIRTokens.contains(token)).toList(); + assertTrue(missingLLVMIRTokens.isEmpty(), "The following llvmir tokens are missing in the code example '%s':\n".formatted(fileName) + + String.join("\n", missingLLVMIRTokens.stream().map(LLVMIRTokenType::getDescription).toList())); + } + +} \ No newline at end of file diff --git a/languages/llvmir/src/test/resources/de/jplag/llvmir/Complete.ll b/languages/llvmir/src/test/resources/de/jplag/llvmir/Complete.ll new file mode 100644 index 000000000..e69de29bb From 6b23104e59c362b679ed53787ec146759cda8e99 Mon Sep 17 00:00:00 2001 From: Alex | Kronox Date: Sat, 22 Jul 2023 20:02:38 +0200 Subject: [PATCH 024/232] hundred value distribution and add old format again --- core/src/main/java/de/jplag/JPlagResult.java | 2 +- .../reportobject/mapper/MetricMapperTest.java | 10 ++- .../src/components/DistributionDiagram.vue | 8 +-- report-viewer/src/model/Distribution.ts | 11 +-- .../src/model/PercentileDistribution.ts | 18 +++++ .../src/model/TenthPercentileDistribution.ts | 11 +++ .../src/model/factories/OverviewFactory.ts | 71 ++++++++++++++++++- 7 files changed, 116 insertions(+), 15 deletions(-) create mode 100644 report-viewer/src/model/PercentileDistribution.ts create mode 100644 report-viewer/src/model/TenthPercentileDistribution.ts diff --git a/core/src/main/java/de/jplag/JPlagResult.java b/core/src/main/java/de/jplag/JPlagResult.java index 8b4d123d9..2b1aabd32 100644 --- a/core/src/main/java/de/jplag/JPlagResult.java +++ b/core/src/main/java/de/jplag/JPlagResult.java @@ -23,7 +23,7 @@ public class JPlagResult { private final int[] similarityDistribution; // 10-element array representing the similarity distribution of the detected matches. private List> clusteringResult; - private final int SIMILARITY_DISTRIBUTION_SIZE = 10; + private final int SIMILARITY_DISTRIBUTION_SIZE = 100; public JPlagResult(List comparisons, SubmissionSet submissions, long durationInMillis, JPlagOptions options) { // sort by similarity (descending) diff --git a/core/src/test/java/de/jplag/reporting/reportobject/mapper/MetricMapperTest.java b/core/src/test/java/de/jplag/reporting/reportobject/mapper/MetricMapperTest.java index 4a3667896..6419fda3b 100644 --- a/core/src/test/java/de/jplag/reporting/reportobject/mapper/MetricMapperTest.java +++ b/core/src/test/java/de/jplag/reporting/reportobject/mapper/MetricMapperTest.java @@ -19,8 +19,14 @@ import de.jplag.reporting.reportobject.model.TopComparison; public class MetricMapperTest { - private static final List EXPECTED_AVG_DISTRIBUTION = List.of(29, 23, 19, 17, 13, 11, 7, 5, 3, 2); - private static final List EXPECTED_MAX_DISTRIBUTION = List.of(50, 48, 20, 13, 10, 1, 3, 1, 0, 0); + private static final List EXPECTED_AVG_DISTRIBUTION = List.of(1, 0, 0, 2, 3, 15, 5, 2, 16, 5, 2, 18, 3, 21, 2, 1, 5, 0, 14, 32, 25, 4, 2, + 12, 3, 2, 5, 5, 0, 5, 1, 5, 2, 5, 4, 5, 3, 5, 18, 21, 30, 4, 3, 10, 2, 3, 17, 28, 4, 10, 2, 4, 3, 0, 2, 20, 4, 0, 19, 5, 25, 9, 4, 18, 1, + 1, 1, 0, 31, 15, 35, 38, 40, 43, 45, 49, 50, 50, 50, 53, 60, 71, 73, 74, 80, 83, 87, 93, 95, 99, 102, 105, 106, 110, 113, 113, 117, 117, + 122, 124); + private static final List EXPECTED_MAX_DISTRIBUTION = List.of(130, 129, 124, 116, 114, 110, 110, 108, 103, 101, 99, 97, 96, 92, 82, 81, + 70, 67, 64, 63, 59, 56, 52, 50, 50, 50, 49, 47, 43, 5, 6, 11, 4, 2, 3, 20, 37, 5, 0, 2, 33, 30, 19, 4, 5, 24, 40, 6, 3, 9, 2, 3, 18, 3, 5, + 1, 4, 1, 0, 0, 5, 5, 14, 5, 42, 4, 18, 0, 0, 10, 4, 3, 17, 33, 4, 4, 3, 4, 39, 0, 20, 2, 4, 9, 0, 5, 0, 8, 23, 4, 2, 39, 3, 4, 1, 0, 3, + 33, 2, 1); private final MetricMapper metricMapper = new MetricMapper(Submission::getName); @Test diff --git a/report-viewer/src/components/DistributionDiagram.vue b/report-viewer/src/components/DistributionDiagram.vue index e161b860a..55a0d82d4 100644 --- a/report-viewer/src/components/DistributionDiagram.vue +++ b/report-viewer/src/components/DistributionDiagram.vue @@ -23,7 +23,7 @@ const props = defineProps({ } }) -const maxVal = ref(Math.max(...props.distribution.distribution)) +const maxVal = ref(Math.max(...props.distribution.getTenthPercentileFormattedValues())) const labels = [ '91-100%', '81-90%', @@ -51,7 +51,7 @@ const chartData = ref({ datasets: [ { ...dataSetStyle.value, - data: props.distribution.distribution + data: props.distribution.getTenthPercentileFormattedValues() } ] }) @@ -109,12 +109,12 @@ watch( datasets: [ { ...dataSetStyle.value, - data: val.distribution + data: val.getTenthPercentileFormattedValues() } ] } - maxVal.value = Math.max(...val.distribution) + maxVal.value = Math.max(...val.getTenthPercentileFormattedValues()) options.value.scales.x.suggestedMax = maxVal.value + 5 } ) diff --git a/report-viewer/src/model/Distribution.ts b/report-viewer/src/model/Distribution.ts index d05544b53..fdfb87015 100644 --- a/report-viewer/src/model/Distribution.ts +++ b/report-viewer/src/model/Distribution.ts @@ -1,11 +1,12 @@ -export default class Distribution { - private readonly _distribution: Array +export default abstract class Distribution { + protected readonly _distribution: Array constructor(distribution: Array) { this._distribution = distribution } - get distribution(): Array { - return this._distribution - } + /** + * Returns the distribution summed at every tenth percentile + */ + public abstract getTenthPercentileFormattedValues(): Array } diff --git a/report-viewer/src/model/PercentileDistribution.ts b/report-viewer/src/model/PercentileDistribution.ts new file mode 100644 index 000000000..f28086802 --- /dev/null +++ b/report-viewer/src/model/PercentileDistribution.ts @@ -0,0 +1,18 @@ +import Distribution from './Distribution' + +export default class HundredValueDistribution extends Distribution { + constructor(distribution: number[]) { + super(distribution) + } + + /** + * Returns the distribution summed at every tenth percentile + */ + public getTenthPercentileFormattedValues(): number[] { + const tenValueArray = new Array(10).fill(0) + for (let i = 0; i < 100; i++) { + tenValueArray[Math.floor(i / 10)] += this._distribution[i] + } + return tenValueArray + } +} diff --git a/report-viewer/src/model/TenthPercentileDistribution.ts b/report-viewer/src/model/TenthPercentileDistribution.ts new file mode 100644 index 000000000..85282d247 --- /dev/null +++ b/report-viewer/src/model/TenthPercentileDistribution.ts @@ -0,0 +1,11 @@ +import Distribution from './Distribution' + +export default class TenValueDistribution extends Distribution { + constructor(distribution: number[]) { + super(distribution) + } + + public getTenthPercentileFormattedValues(): number[] { + return this._distribution + } +} diff --git a/report-viewer/src/model/factories/OverviewFactory.ts b/report-viewer/src/model/factories/OverviewFactory.ts index 25f61dfcf..cdf957e53 100644 --- a/report-viewer/src/model/factories/OverviewFactory.ts +++ b/report-viewer/src/model/factories/OverviewFactory.ts @@ -7,6 +7,8 @@ import versionJson from '@/version.json' import Distribution from '../Distribution' import MetricType from '../MetricType' import { BaseFactory } from './BaseFactory' +import PercentileDistribution from '../PercentileDistribution' +import TenValueDistribution from '../TenthPercentileDistribution' export class OverviewFactory extends BaseFactory { static reportViewerVersion: Version = @@ -68,18 +70,47 @@ export class OverviewFactory extends BaseFactory { private static extractDistributions( json: Record ): Record { - const distributionsMap = json.distributions as Record> + if (json.distributions) { + return this.extractDistributionsFromMap(json.distributions as Record>) + } else if (json.metrics) { + return this.extractDistributionsFromMetrics(json.metrics as Array>) + } + throw new Error('No distributions found') + } + + private static extractDistributionsFromMap( + distributionsMap: Record> + ): Record { const distributions = {} as Record for (const [key, value] of Object.entries(distributionsMap)) { - distributions[key as MetricType] = new Distribution(value as Array) + distributions[key as MetricType] = new PercentileDistribution(value as Array) } return distributions } + private static extractDistributionsFromMetrics( + metrics: Array> + ): Record { + return { + [MetricType.AVERAGE]: new TenValueDistribution(metrics[0].distribution as Array), + [MetricType.MAXIMUM]: new TenValueDistribution(metrics[1].distribution as Array) + } + } + private static extractTopComparisons( json: Record ): Array { - const jsonComparisons = json.top_comparisons as Array> + if (json.top_comparisons) { + return this.extractTopComparisonsFromMap( + json.top_comparisons as Array> + ) + } else if (json.metrics) { + return this.extractTopComparisonsFromMetrics(json.metrics as Array>) + } + throw new Error('No top comparisons found') + } + + private static extractTopComparisonsFromMap(jsonComparisons: Array>) { const comparisons = [] as Array let counter = 0 for (const topComparison of jsonComparisons) { @@ -93,6 +124,40 @@ export class OverviewFactory extends BaseFactory { } return comparisons } + + private static extractTopComparisonsFromMetrics(metrics: Array>) { + const averageSimilarities: Map = new Map() + const comparisons = [] as Array + + // Average + for (const comparison of metrics[0].topComparisons as Array>) { + averageSimilarities.set( + (comparison.first_submission as string) + '-' + (comparison.second_submission as string), + comparison.similarity as number + ) + } + + // Max + let counter = 0 + for (const comparison of metrics[1].topComparisons as Array>) { + const avg = averageSimilarities.get( + (comparison.first_submission as string) + '-' + (comparison.second_submission as string) + ) + comparisons.push({ + sortingPlace: counter++, + id: counter, + firstSubmissionId: comparison.first_submission as string, + secondSubmissionId: comparison.second_submission as string, + similarities: { + [MetricType.AVERAGE]: avg as number, + [MetricType.MAXIMUM]: comparison.similarity as number + } + }) + } + + return comparisons + } + private static extractClusters(json: Record): Array { if (!json.clusters) { return [] From 2bddcab56f3c95d7793a6f2f3170379eb8aa982f Mon Sep 17 00:00:00 2001 From: Alex | Kronox Date: Sun, 23 Jul 2023 10:44:43 +0200 Subject: [PATCH 025/232] fix tests --- core/src/test/java/de/jplag/BaseCodeTest.java | 4 ++-- core/src/test/java/de/jplag/BasicFunctionalityTest.java | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/core/src/test/java/de/jplag/BaseCodeTest.java b/core/src/test/java/de/jplag/BaseCodeTest.java index bd307dc43..193482b8b 100644 --- a/core/src/test/java/de/jplag/BaseCodeTest.java +++ b/core/src/test/java/de/jplag/BaseCodeTest.java @@ -46,7 +46,7 @@ protected void verifyResults(JPlagResult result) { assertEquals(2, result.getNumberOfSubmissions()); assertEquals(1, result.getAllComparisons().size()); assertEquals(1, result.getAllComparisons().get(0).matches().size()); - assertEquals(1, result.getSimilarityDistribution()[8]); + assertEquals(1, result.getSimilarityDistribution()[81]); assertEquals(0.8125, result.getAllComparisons().get(0).similarity(), DELTA); } @@ -94,7 +94,7 @@ protected void verifySimpleSubdirectoryDuplicate(JPlagResult result, int submiss assertEquals(submissions, result.getNumberOfSubmissions()); assertEquals(comparisons, result.getAllComparisons().size()); assertEquals(1, result.getAllComparisons().get(0).matches().size()); - assertEquals(1, result.getSimilarityDistribution()[9]); + assertEquals(1, result.getSimilarityDistribution()[94]); assertEquals(0.9473, result.getAllComparisons().get(0).similarity(), DELTA); } diff --git a/core/src/test/java/de/jplag/BasicFunctionalityTest.java b/core/src/test/java/de/jplag/BasicFunctionalityTest.java index 4bf4bf347..3c993644d 100644 --- a/core/src/test/java/de/jplag/BasicFunctionalityTest.java +++ b/core/src/test/java/de/jplag/BasicFunctionalityTest.java @@ -22,14 +22,15 @@ void testSimpleDuplicate() throws ExitException { assertEquals(2, result.getNumberOfSubmissions()); assertEquals(1, result.getAllComparisons().size()); assertEquals(1, result.getAllComparisons().get(0).matches().size()); - assertEquals(1, result.getSimilarityDistribution()[6]); + assertEquals(1, result.getSimilarityDistribution()[66]); assertEquals(0.666, result.getAllComparisons().get(0).similarity(), DELTA); } @Test @DisplayName("test submissions with a custom minimum token match") void testWithMinTokenMatch() throws ExitException { - var expectedDistribution = new int[] {0, 0, 0, 0, 0, 0, 0, 0, 0, 1}; + var expectedDistribution = new int[100]; + expectedDistribution[96] = 1; JPlagResult result = runJPlag("SimpleDuplicate", it -> it.withMinimumTokenMatch(4)); assertEquals(2, result.getNumberOfSubmissions()); @@ -90,7 +91,7 @@ void testSingleFileSubmisssions() throws ExitException { assertEquals(2, result.getNumberOfSubmissions()); assertEquals(1, result.getAllComparisons().size()); - assertEquals(1, result.getSimilarityDistribution()[6]); + assertEquals(1, result.getSimilarityDistribution()[66]); assertEquals(0.666, result.getAllComparisons().get(0).similarity(), DELTA); var matches = result.getAllComparisons().get(0).matches(); From 6c1396c89be3c3f79e2035f5484a3cdbe8257d0c Mon Sep 17 00:00:00 2001 From: Niklas Heneka <93838730+NiklasHeneka@users.noreply.github.com> Date: Mon, 24 Jul 2023 18:02:15 +0200 Subject: [PATCH 026/232] Remove unnecessary listener methods and add tokens for switch statements. --- .../de/jplag/llvmir/JPlagLLVMIRListener.java | 3231 ++--------------- .../java/de/jplag/llvmir/LLVMIRTokenType.java | 3 + 2 files changed, 263 insertions(+), 2971 deletions(-) diff --git a/languages/llvmir/src/main/java/de/jplag/llvmir/JPlagLLVMIRListener.java b/languages/llvmir/src/main/java/de/jplag/llvmir/JPlagLLVMIRListener.java index 4af8b56bf..eebe937c6 100644 --- a/languages/llvmir/src/main/java/de/jplag/llvmir/JPlagLLVMIRListener.java +++ b/languages/llvmir/src/main/java/de/jplag/llvmir/JPlagLLVMIRListener.java @@ -1,6 +1,5 @@ package de.jplag.llvmir; -import org.antlr.v4.runtime.ParserRuleContext; import org.antlr.v4.runtime.Token; import org.antlr.v4.runtime.tree.TerminalNode; @@ -35,102 +34,34 @@ private void transformToken(LLVMIRTokenType tokenType, Token start, Token end) { parserAdapter.addToken(tokenType, start.getLine(), start.getCharPositionInLine() + 1, end.getStopIndex() - start.getStartIndex() + 1); } - @Override - public void enterCompilationUnit(LLVMIRParser.CompilationUnitContext ctx) { - } - - @Override - public void exitCompilationUnit(LLVMIRParser.CompilationUnitContext ctx) { - } - - @Override - public void enterTargetDef(LLVMIRParser.TargetDefContext ctx) { - } - - @Override - public void exitTargetDef(LLVMIRParser.TargetDefContext ctx) { - } - @Override public void enterSourceFilename(LLVMIRParser.SourceFilenameContext ctx) { transformToken(LLVMIRTokenType.FILENAME, ctx.getStart(), ctx.getStop()); super.enterSourceFilename(ctx); } - @Override - public void exitSourceFilename(LLVMIRParser.SourceFilenameContext ctx) { - } - - @Override - public void enterTargetDataLayout(LLVMIRParser.TargetDataLayoutContext ctx) { - } - - @Override - public void exitTargetDataLayout(LLVMIRParser.TargetDataLayoutContext ctx) { - } - - @Override - public void enterTargetTriple(LLVMIRParser.TargetTripleContext ctx) { - } - - @Override - public void exitTargetTriple(LLVMIRParser.TargetTripleContext ctx) { - } - - @Override - public void enterTopLevelEntity(LLVMIRParser.TopLevelEntityContext ctx) { - } - - @Override - public void exitTopLevelEntity(LLVMIRParser.TopLevelEntityContext ctx) { - } - @Override public void enterModuleAsm(LLVMIRParser.ModuleAsmContext ctx) { transformToken(LLVMIRTokenType.ASSEMBLY, ctx.getStart(), ctx.getStop()); super.enterModuleAsm(ctx); } - @Override - public void exitModuleAsm(LLVMIRParser.ModuleAsmContext ctx) { - } - @Override public void enterTypeDef(LLVMIRParser.TypeDefContext ctx) { } - @Override - public void exitTypeDef(LLVMIRParser.TypeDefContext ctx) { - } - - @Override - public void enterComdatDef(LLVMIRParser.ComdatDefContext ctx) { - } - - @Override - public void exitComdatDef(LLVMIRParser.ComdatDefContext ctx) { - } - @Override public void enterGlobalDecl(LLVMIRParser.GlobalDeclContext ctx) { transformToken(LLVMIRTokenType.GLOBAL_VARIABLE, ctx.getStart(), ctx.getStop()); super.enterGlobalDecl(ctx); } - @Override - public void exitGlobalDecl(LLVMIRParser.GlobalDeclContext ctx) { - } - @Override public void enterGlobalDef(LLVMIRParser.GlobalDefContext ctx) { transformToken(LLVMIRTokenType.GLOBAL_VARIABLE, ctx.getStart(), ctx.getStop()); super.enterGlobalDef(ctx); } - @Override - public void exitGlobalDef(LLVMIRParser.GlobalDefContext ctx) { - } - @Override public void enterIndirectSymbolDef(LLVMIRParser.IndirectSymbolDefContext ctx) { } @@ -145,68 +76,12 @@ public void enterFuncDecl(LLVMIRParser.FuncDeclContext ctx) { super.enterFuncDecl(ctx); } - @Override - public void exitFuncDecl(LLVMIRParser.FuncDeclContext ctx) { - } - @Override public void enterFuncDef(LLVMIRParser.FuncDefContext ctx) { transformToken(LLVMIRTokenType.FUNCTION_DEF, ctx.getStart(), ctx.getStop()); super.enterFuncDef(ctx); } - @Override - public void exitFuncDef(LLVMIRParser.FuncDefContext ctx) { - } - - @Override - public void enterAttrGroupDef(LLVMIRParser.AttrGroupDefContext ctx) { - } - - @Override - public void exitAttrGroupDef(LLVMIRParser.AttrGroupDefContext ctx) { - } - - @Override - public void enterNamedMetadataDef(LLVMIRParser.NamedMetadataDefContext ctx) { - } - - @Override - public void exitNamedMetadataDef(LLVMIRParser.NamedMetadataDefContext ctx) { - } - - @Override - public void enterMetadataDef(LLVMIRParser.MetadataDefContext ctx) { - } - - @Override - public void exitMetadataDef(LLVMIRParser.MetadataDefContext ctx) { - } - - @Override - public void enterUseListOrder(LLVMIRParser.UseListOrderContext ctx) { - } - - @Override - public void exitUseListOrder(LLVMIRParser.UseListOrderContext ctx) { - } - - @Override - public void enterUseListOrderBB(LLVMIRParser.UseListOrderBBContext ctx) { - } - - @Override - public void exitUseListOrderBB(LLVMIRParser.UseListOrderBBContext ctx) { - } - - @Override - public void enterFuncHeader(LLVMIRParser.FuncHeaderContext ctx) { - } - - @Override - public void exitFuncHeader(LLVMIRParser.FuncHeaderContext ctx) { - } - @Override public void enterIndirectSymbol(LLVMIRParser.IndirectSymbolContext ctx) { } @@ -215,70 +90,6 @@ public void enterIndirectSymbol(LLVMIRParser.IndirectSymbolContext ctx) { public void exitIndirectSymbol(LLVMIRParser.IndirectSymbolContext ctx) { } - @Override - public void enterCallingConv(LLVMIRParser.CallingConvContext ctx) { - } - - @Override - public void exitCallingConv(LLVMIRParser.CallingConvContext ctx) { - } - - @Override - public void enterCallingConvInt(LLVMIRParser.CallingConvIntContext ctx) { - } - - @Override - public void exitCallingConvInt(LLVMIRParser.CallingConvIntContext ctx) { - } - - @Override - public void enterFuncHdrField(LLVMIRParser.FuncHdrFieldContext ctx) { - } - - @Override - public void exitFuncHdrField(LLVMIRParser.FuncHdrFieldContext ctx) { - } - - @Override - public void enterGc(LLVMIRParser.GcContext ctx) { - } - - @Override - public void exitGc(LLVMIRParser.GcContext ctx) { - } - - @Override - public void enterPrefix(LLVMIRParser.PrefixContext ctx) { - } - - @Override - public void exitPrefix(LLVMIRParser.PrefixContext ctx) { - } - - @Override - public void enterPrologue(LLVMIRParser.PrologueContext ctx) { - } - - @Override - public void exitPrologue(LLVMIRParser.PrologueContext ctx) { - } - - @Override - public void enterPersonality(LLVMIRParser.PersonalityContext ctx) { - } - - @Override - public void exitPersonality(LLVMIRParser.PersonalityContext ctx) { - } - - @Override - public void enterReturnAttribute(LLVMIRParser.ReturnAttributeContext ctx) { - } - - @Override - public void exitReturnAttribute(LLVMIRParser.ReturnAttributeContext ctx) { - } - @Override public void enterFuncBody(LLVMIRParser.FuncBodyContext ctx) { transformToken(LLVMIRTokenType.FUNCTION_BODY_BEGIN, ctx.getStart(), ctx.getStop()); @@ -291,298 +102,76 @@ public void exitFuncBody(LLVMIRParser.FuncBodyContext ctx) { super.exitFuncBody(ctx); } - @Override - public void enterBasicBlock(LLVMIRParser.BasicBlockContext ctx) { - } - - @Override - public void exitBasicBlock(LLVMIRParser.BasicBlockContext ctx) { - } - - @Override - public void enterInstruction(LLVMIRParser.InstructionContext ctx) { - } - - @Override - public void exitInstruction(LLVMIRParser.InstructionContext ctx) { - } - - @Override - public void enterTerminator(LLVMIRParser.TerminatorContext ctx) { - } - - @Override - public void exitTerminator(LLVMIRParser.TerminatorContext ctx) { - } - - @Override - public void enterLocalDefTerm(LLVMIRParser.LocalDefTermContext ctx) { - } - - @Override - public void exitLocalDefTerm(LLVMIRParser.LocalDefTermContext ctx) { - } - - @Override - public void enterValueTerminator(LLVMIRParser.ValueTerminatorContext ctx) { - } - - @Override - public void exitValueTerminator(LLVMIRParser.ValueTerminatorContext ctx) { - } - @Override public void enterRetTerm(LLVMIRParser.RetTermContext ctx) { transformToken(LLVMIRTokenType.RETURN, ctx.getStart(), ctx.getStop()); super.enterRetTerm(ctx); } - @Override - public void exitRetTerm(LLVMIRParser.RetTermContext ctx) { - } - @Override public void enterBrTerm(LLVMIRParser.BrTermContext ctx) { transformToken(LLVMIRTokenType.BRANCH, ctx.getStart(), ctx.getStop()); super.enterBrTerm(ctx); } - @Override - public void exitBrTerm(LLVMIRParser.BrTermContext ctx) { - } - @Override public void enterCondBrTerm(LLVMIRParser.CondBrTermContext ctx) { - transformToken(LLVMIRTokenType.BRANCH, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.CONDITIONAL_BRANCH, ctx.getStart(), ctx.getStop()); super.enterCondBrTerm(ctx); } - @Override - public void exitCondBrTerm(LLVMIRParser.CondBrTermContext ctx) { - } - @Override public void enterSwitchTerm(LLVMIRParser.SwitchTermContext ctx) { - transformToken(LLVMIRTokenType.BRANCH, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.SWITCH, ctx.getStart(), ctx.getStop()); super.enterSwitchTerm(ctx); } - @Override - public void exitSwitchTerm(LLVMIRParser.SwitchTermContext ctx) { - } - @Override public void enterIndirectBrTerm(LLVMIRParser.IndirectBrTermContext ctx) { transformToken(LLVMIRTokenType.BRANCH, ctx.getStart(), ctx.getStop()); super.enterIndirectBrTerm(ctx); } - @Override - public void exitIndirectBrTerm(LLVMIRParser.IndirectBrTermContext ctx) { - } - @Override public void enterResumeTerm(LLVMIRParser.ResumeTermContext ctx) { transformToken(LLVMIRTokenType.RESUME, ctx.getStart(), ctx.getStop()); super.enterResumeTerm(ctx); } - @Override - public void exitResumeTerm(LLVMIRParser.ResumeTermContext ctx) { - } - @Override public void enterCatchRetTerm(LLVMIRParser.CatchRetTermContext ctx) { transformToken(LLVMIRTokenType.CATCH_RETURN, ctx.getStart(), ctx.getStop()); super.enterCatchRetTerm(ctx); } - @Override - public void exitCatchRetTerm(LLVMIRParser.CatchRetTermContext ctx) { - } - @Override public void enterCleanupRetTerm(LLVMIRParser.CleanupRetTermContext ctx) { transformToken(LLVMIRTokenType.CLEAN_UP_RETURN, ctx.getStart(), ctx.getStop()); super.enterCleanupRetTerm(ctx); } - @Override - public void exitCleanupRetTerm(LLVMIRParser.CleanupRetTermContext ctx) { - } - - @Override - public void enterUnreachableTerm(LLVMIRParser.UnreachableTermContext ctx) { - } - - @Override - public void exitUnreachableTerm(LLVMIRParser.UnreachableTermContext ctx) { - } - @Override public void enterInvokeTerm(LLVMIRParser.InvokeTermContext ctx) { transformToken(LLVMIRTokenType.INVOKE, ctx.getStart(), ctx.getStop()); super.enterInvokeTerm(ctx); } - @Override - public void exitInvokeTerm(LLVMIRParser.InvokeTermContext ctx) { - } - @Override public void enterCallBrTerm(LLVMIRParser.CallBrTermContext ctx) { transformToken(LLVMIRTokenType.CALL_BRANCH, ctx.getStart(), ctx.getStop()); super.enterCallBrTerm(ctx); } - @Override - public void exitCallBrTerm(LLVMIRParser.CallBrTermContext ctx) { - } - @Override public void enterCatchSwitchTerm(LLVMIRParser.CatchSwitchTermContext ctx) { transformToken(LLVMIRTokenType.CATCH_SWITCH, ctx.getStart(), ctx.getStop()); super.enterCatchSwitchTerm(ctx); } - @Override - public void exitCatchSwitchTerm(LLVMIRParser.CatchSwitchTermContext ctx) { - } - - @Override - public void enterLabel(LLVMIRParser.LabelContext ctx) { - } - - @Override - public void exitLabel(LLVMIRParser.LabelContext ctx) { - } - @Override public void enterCase(LLVMIRParser.CaseContext ctx) { - } - - @Override - public void exitCase(LLVMIRParser.CaseContext ctx) { - } - - @Override - public void enterUnwindTarget(LLVMIRParser.UnwindTargetContext ctx) { - } - - @Override - public void exitUnwindTarget(LLVMIRParser.UnwindTargetContext ctx) { - } - - @Override - public void enterHandlers(LLVMIRParser.HandlersContext ctx) { - } - - @Override - public void exitHandlers(LLVMIRParser.HandlersContext ctx) { - } - - @Override - public void enterMetadataNode(LLVMIRParser.MetadataNodeContext ctx) { - } - - @Override - public void exitMetadataNode(LLVMIRParser.MetadataNodeContext ctx) { - } - - @Override - public void enterDiExpression(LLVMIRParser.DiExpressionContext ctx) { - } - - @Override - public void exitDiExpression(LLVMIRParser.DiExpressionContext ctx) { - } - - @Override - public void enterDiExpressionField(LLVMIRParser.DiExpressionFieldContext ctx) { - } - - @Override - public void exitDiExpressionField(LLVMIRParser.DiExpressionFieldContext ctx) { - } - - @Override - public void enterGlobalField(LLVMIRParser.GlobalFieldContext ctx) { - } - - @Override - public void exitGlobalField(LLVMIRParser.GlobalFieldContext ctx) { - } - - @Override - public void enterSection(LLVMIRParser.SectionContext ctx) { - } - - @Override - public void exitSection(LLVMIRParser.SectionContext ctx) { - } - - @Override - public void enterComdat(LLVMIRParser.ComdatContext ctx) { - } - - @Override - public void exitComdat(LLVMIRParser.ComdatContext ctx) { - } - - @Override - public void enterPartition(LLVMIRParser.PartitionContext ctx) { - } - - @Override - public void exitPartition(LLVMIRParser.PartitionContext ctx) { - } - - @Override - public void enterConstant(LLVMIRParser.ConstantContext ctx) { - } - - @Override - public void exitConstant(LLVMIRParser.ConstantContext ctx) { - } - - @Override - public void enterBoolConst(LLVMIRParser.BoolConstContext ctx) { - } - - @Override - public void exitBoolConst(LLVMIRParser.BoolConstContext ctx) { - } - - @Override - public void enterIntConst(LLVMIRParser.IntConstContext ctx) { - } - - @Override - public void exitIntConst(LLVMIRParser.IntConstContext ctx) { - } - - @Override - public void enterFloatConst(LLVMIRParser.FloatConstContext ctx) { - } - - @Override - public void exitFloatConst(LLVMIRParser.FloatConstContext ctx) { - } - - @Override - public void enterNullConst(LLVMIRParser.NullConstContext ctx) { - } - - @Override - public void exitNullConst(LLVMIRParser.NullConstContext ctx) { - } - - @Override - public void enterNoneConst(LLVMIRParser.NoneConstContext ctx) { - } - - @Override - public void exitNoneConst(LLVMIRParser.NoneConstContext ctx) { + transformToken(LLVMIRTokenType.CASE, ctx.getStart(), ctx.getStop()); + super.enterCase(ctx); } @Override @@ -592,2829 +181,529 @@ public void enterStructConst(LLVMIRParser.StructConstContext ctx) { } @Override - public void exitStructConst(LLVMIRParser.StructConstContext ctx) { - } - - @Override - public void enterArrayConst(LLVMIRParser.ArrayConstContext ctx) { - transformToken(LLVMIRTokenType.ARRAY, ctx.getStart(), ctx.getStop()); - super.enterArrayConst(ctx); - } - - @Override - public void exitArrayConst(LLVMIRParser.ArrayConstContext ctx) { - } - - @Override - public void enterVectorConst(LLVMIRParser.VectorConstContext ctx) { - transformToken(LLVMIRTokenType.VECTOR, ctx.getStart(), ctx.getStop()); - super.enterVectorConst(ctx); - } - - @Override - public void exitVectorConst(LLVMIRParser.VectorConstContext ctx) { - } - - @Override - public void enterZeroInitializerConst(LLVMIRParser.ZeroInitializerConstContext ctx) { - } - - @Override - public void exitZeroInitializerConst(LLVMIRParser.ZeroInitializerConstContext ctx) { - } - - @Override - public void enterUndefConst(LLVMIRParser.UndefConstContext ctx) { - } - - @Override - public void exitUndefConst(LLVMIRParser.UndefConstContext ctx) { - } - - @Override - public void enterPoisonConst(LLVMIRParser.PoisonConstContext ctx) { - } - - @Override - public void exitPoisonConst(LLVMIRParser.PoisonConstContext ctx) { - } - - @Override - public void enterBlockAddressConst(LLVMIRParser.BlockAddressConstContext ctx) { - } - - @Override - public void exitBlockAddressConst(LLVMIRParser.BlockAddressConstContext ctx) { - } - - @Override - public void enterDsoLocalEquivalentConst(LLVMIRParser.DsoLocalEquivalentConstContext ctx) { - } - - @Override - public void exitDsoLocalEquivalentConst(LLVMIRParser.DsoLocalEquivalentConstContext ctx) { - } - - @Override - public void enterNoCFIConst(LLVMIRParser.NoCFIConstContext ctx) { - } - - @Override - public void exitNoCFIConst(LLVMIRParser.NoCFIConstContext ctx) { - } - - @Override - public void enterConstantExpr(LLVMIRParser.ConstantExprContext ctx) { - } - - @Override - public void exitConstantExpr(LLVMIRParser.ConstantExprContext ctx) { - } - - @Override - public void enterTypeConst(LLVMIRParser.TypeConstContext ctx) { - } - - @Override - public void exitTypeConst(LLVMIRParser.TypeConstContext ctx) { - } - - @Override - public void enterMetadataAttachment(LLVMIRParser.MetadataAttachmentContext ctx) { - } - - @Override - public void exitMetadataAttachment(LLVMIRParser.MetadataAttachmentContext ctx) { - } - - @Override - public void enterMdNode(LLVMIRParser.MdNodeContext ctx) { - } - - @Override - public void exitMdNode(LLVMIRParser.MdNodeContext ctx) { - } - - @Override - public void enterMdTuple(LLVMIRParser.MdTupleContext ctx) { - } - - @Override - public void exitMdTuple(LLVMIRParser.MdTupleContext ctx) { - } - - @Override - public void enterMetadata(LLVMIRParser.MetadataContext ctx) { - } - - @Override - public void exitMetadata(LLVMIRParser.MetadataContext ctx) { - } - - @Override - public void enterDiArgList(LLVMIRParser.DiArgListContext ctx) { - } - - @Override - public void exitDiArgList(LLVMIRParser.DiArgListContext ctx) { - } - - @Override - public void enterTypeValue(LLVMIRParser.TypeValueContext ctx) { - } - - @Override - public void exitTypeValue(LLVMIRParser.TypeValueContext ctx) { - } - - @Override - public void enterValue(LLVMIRParser.ValueContext ctx) { - } - - @Override - public void exitValue(LLVMIRParser.ValueContext ctx) { - } - - @Override - public void enterInlineAsm(LLVMIRParser.InlineAsmContext ctx) { - transformToken(LLVMIRTokenType.ASSEMBLY, ctx.getStart(), ctx.getStop()); - super.enterInlineAsm(ctx); - } - - @Override - public void exitInlineAsm(LLVMIRParser.InlineAsmContext ctx) { - } - - @Override - public void enterMdString(LLVMIRParser.MdStringContext ctx) { - } - - @Override - public void exitMdString(LLVMIRParser.MdStringContext ctx) { - } - - @Override - public void enterMdFieldOrInt(LLVMIRParser.MdFieldOrIntContext ctx) { - } - - @Override - public void exitMdFieldOrInt(LLVMIRParser.MdFieldOrIntContext ctx) { - } - - @Override - public void enterDiSPFlag(LLVMIRParser.DiSPFlagContext ctx) { - } - - @Override - public void exitDiSPFlag(LLVMIRParser.DiSPFlagContext ctx) { - } - - @Override - public void enterFuncAttribute(LLVMIRParser.FuncAttributeContext ctx) { - } - - @Override - public void exitFuncAttribute(LLVMIRParser.FuncAttributeContext ctx) { - } - - @Override - public void enterType(LLVMIRParser.TypeContext ctx) { - } - - @Override - public void exitType(LLVMIRParser.TypeContext ctx) { - } - - @Override - public void enterParams(LLVMIRParser.ParamsContext ctx) { - } - - @Override - public void exitParams(LLVMIRParser.ParamsContext ctx) { - } - - @Override - public void enterParam(LLVMIRParser.ParamContext ctx) { - } - - @Override - public void exitParam(LLVMIRParser.ParamContext ctx) { - } - - @Override - public void enterParamAttribute(LLVMIRParser.ParamAttributeContext ctx) { - } - - @Override - public void exitParamAttribute(LLVMIRParser.ParamAttributeContext ctx) { - } - - @Override - public void enterAttrString(LLVMIRParser.AttrStringContext ctx) { - } - - @Override - public void exitAttrString(LLVMIRParser.AttrStringContext ctx) { - } - - @Override - public void enterAttrPair(LLVMIRParser.AttrPairContext ctx) { - } - - @Override - public void exitAttrPair(LLVMIRParser.AttrPairContext ctx) { - } - - @Override - public void enterAlign(LLVMIRParser.AlignContext ctx) { - } - - @Override - public void exitAlign(LLVMIRParser.AlignContext ctx) { - } - - @Override - public void enterAlignPair(LLVMIRParser.AlignPairContext ctx) { - } - - @Override - public void exitAlignPair(LLVMIRParser.AlignPairContext ctx) { - } - - @Override - public void enterAlignStack(LLVMIRParser.AlignStackContext ctx) { - } - - @Override - public void exitAlignStack(LLVMIRParser.AlignStackContext ctx) { - } - - @Override - public void enterAlignStackPair(LLVMIRParser.AlignStackPairContext ctx) { - } - - @Override - public void exitAlignStackPair(LLVMIRParser.AlignStackPairContext ctx) { - } - - @Override - public void enterAllocKind(LLVMIRParser.AllocKindContext ctx) { - } - - @Override - public void exitAllocKind(LLVMIRParser.AllocKindContext ctx) { - } - - @Override - public void enterAllocSize(LLVMIRParser.AllocSizeContext ctx) { - } - - @Override - public void exitAllocSize(LLVMIRParser.AllocSizeContext ctx) { - } - - @Override - public void enterUnwindTable(LLVMIRParser.UnwindTableContext ctx) { - } - - @Override - public void exitUnwindTable(LLVMIRParser.UnwindTableContext ctx) { - } - - @Override - public void enterVectorScaleRange(LLVMIRParser.VectorScaleRangeContext ctx) { - } - - @Override - public void exitVectorScaleRange(LLVMIRParser.VectorScaleRangeContext ctx) { - } - - @Override - public void enterByRefAttr(LLVMIRParser.ByRefAttrContext ctx) { - } - - @Override - public void exitByRefAttr(LLVMIRParser.ByRefAttrContext ctx) { - } - - @Override - public void enterByval(LLVMIRParser.ByvalContext ctx) { - } - - @Override - public void exitByval(LLVMIRParser.ByvalContext ctx) { - } - - @Override - public void enterDereferenceable(LLVMIRParser.DereferenceableContext ctx) { - } - - @Override - public void exitDereferenceable(LLVMIRParser.DereferenceableContext ctx) { - } - - @Override - public void enterElementType(LLVMIRParser.ElementTypeContext ctx) { - } - - @Override - public void exitElementType(LLVMIRParser.ElementTypeContext ctx) { - } - - @Override - public void enterInAlloca(LLVMIRParser.InAllocaContext ctx) { - } - - @Override - public void exitInAlloca(LLVMIRParser.InAllocaContext ctx) { - } - - @Override - public void enterParamAttr(LLVMIRParser.ParamAttrContext ctx) { - } - - @Override - public void exitParamAttr(LLVMIRParser.ParamAttrContext ctx) { - } - - @Override - public void enterPreallocated(LLVMIRParser.PreallocatedContext ctx) { - } - - @Override - public void exitPreallocated(LLVMIRParser.PreallocatedContext ctx) { - } - - @Override - public void enterStructRetAttr(LLVMIRParser.StructRetAttrContext ctx) { - } - - @Override - public void exitStructRetAttr(LLVMIRParser.StructRetAttrContext ctx) { - } - - @Override - public void enterFirstClassType(LLVMIRParser.FirstClassTypeContext ctx) { - } - - @Override - public void exitFirstClassType(LLVMIRParser.FirstClassTypeContext ctx) { - } - - @Override - public void enterConcreteType(LLVMIRParser.ConcreteTypeContext ctx) { - } - - @Override - public void exitConcreteType(LLVMIRParser.ConcreteTypeContext ctx) { - } - - @Override - public void enterIntType(LLVMIRParser.IntTypeContext ctx) { - } - - @Override - public void exitIntType(LLVMIRParser.IntTypeContext ctx) { - } - - @Override - public void enterFloatType(LLVMIRParser.FloatTypeContext ctx) { - } - - @Override - public void exitFloatType(LLVMIRParser.FloatTypeContext ctx) { - } - - @Override - public void enterPointerType(LLVMIRParser.PointerTypeContext ctx) { - } - - @Override - public void exitPointerType(LLVMIRParser.PointerTypeContext ctx) { - } - - @Override - public void enterVectorType(LLVMIRParser.VectorTypeContext ctx) { - } - - @Override - public void exitVectorType(LLVMIRParser.VectorTypeContext ctx) { - } - - @Override - public void enterLabelType(LLVMIRParser.LabelTypeContext ctx) { - } - - @Override - public void exitLabelType(LLVMIRParser.LabelTypeContext ctx) { - } - - @Override - public void enterArrayType(LLVMIRParser.ArrayTypeContext ctx) { - } - - @Override - public void exitArrayType(LLVMIRParser.ArrayTypeContext ctx) { - } - - @Override - public void enterStructType(LLVMIRParser.StructTypeContext ctx) { - } - - @Override - public void exitStructType(LLVMIRParser.StructTypeContext ctx) { - } - - @Override - public void enterNamedType(LLVMIRParser.NamedTypeContext ctx) { - } - - @Override - public void exitNamedType(LLVMIRParser.NamedTypeContext ctx) { - } - - @Override - public void enterMmxType(LLVMIRParser.MmxTypeContext ctx) { - } - - @Override - public void exitMmxType(LLVMIRParser.MmxTypeContext ctx) { - } - - @Override - public void enterTokenType(LLVMIRParser.TokenTypeContext ctx) { - } - - @Override - public void exitTokenType(LLVMIRParser.TokenTypeContext ctx) { - } - - @Override - public void enterOpaquePointerType(LLVMIRParser.OpaquePointerTypeContext ctx) { - } - - @Override - public void exitOpaquePointerType(LLVMIRParser.OpaquePointerTypeContext ctx) { - } - - @Override - public void enterAddrSpace(LLVMIRParser.AddrSpaceContext ctx) { - } - - @Override - public void exitAddrSpace(LLVMIRParser.AddrSpaceContext ctx) { - } - - @Override - public void enterThreadLocal(LLVMIRParser.ThreadLocalContext ctx) { - } - - @Override - public void exitThreadLocal(LLVMIRParser.ThreadLocalContext ctx) { - } - - @Override - public void enterMetadataType(LLVMIRParser.MetadataTypeContext ctx) { - } - - @Override - public void exitMetadataType(LLVMIRParser.MetadataTypeContext ctx) { - } - - @Override - public void enterBitCastExpr(LLVMIRParser.BitCastExprContext ctx) { - transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); - super.enterBitCastExpr(ctx); - } - - @Override - public void exitBitCastExpr(LLVMIRParser.BitCastExprContext ctx) { - } - - @Override - public void enterGetElementPtrExpr(LLVMIRParser.GetElementPtrExprContext ctx) { - transformToken(LLVMIRTokenType.GET_ELEMENT_POINTER, ctx.getStart(), ctx.getStop()); - super.enterGetElementPtrExpr(ctx); - } - - @Override - public void exitGetElementPtrExpr(LLVMIRParser.GetElementPtrExprContext ctx) { - } - - @Override - public void enterGepIndex(LLVMIRParser.GepIndexContext ctx) { - } - - @Override - public void exitGepIndex(LLVMIRParser.GepIndexContext ctx) { - } - - @Override - public void enterAddrSpaceCastExpr(LLVMIRParser.AddrSpaceCastExprContext ctx) { - transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); - super.enterAddrSpaceCastExpr(ctx); - } - - @Override - public void exitAddrSpaceCastExpr(LLVMIRParser.AddrSpaceCastExprContext ctx) { - } - - @Override - public void enterIntToPtrExpr(LLVMIRParser.IntToPtrExprContext ctx) { - transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); - super.enterIntToPtrExpr(ctx); - } - - @Override - public void exitIntToPtrExpr(LLVMIRParser.IntToPtrExprContext ctx) { - } - - @Override - public void enterICmpExpr(LLVMIRParser.ICmpExprContext ctx) { - transformToken(LLVMIRTokenType.COMPARISON, ctx.getStart(), ctx.getStop()); - super.enterICmpExpr(ctx); - } - - @Override - public void exitICmpExpr(LLVMIRParser.ICmpExprContext ctx) { - } - - @Override - public void enterFCmpExpr(LLVMIRParser.FCmpExprContext ctx) { - transformToken(LLVMIRTokenType.COMPARISON, ctx.getStart(), ctx.getStop()); - super.enterFCmpExpr(ctx); - } - - @Override - public void exitFCmpExpr(LLVMIRParser.FCmpExprContext ctx) { - } - - @Override - public void enterSelectExpr(LLVMIRParser.SelectExprContext ctx) { - transformToken(LLVMIRTokenType.SELECT, ctx.getStart(), ctx.getStop()); - super.enterSelectExpr(ctx); - } - - @Override - public void exitSelectExpr(LLVMIRParser.SelectExprContext ctx) { - } - - @Override - public void enterTruncExpr(LLVMIRParser.TruncExprContext ctx) { - transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); - super.enterTruncExpr(ctx); - } - - @Override - public void exitTruncExpr(LLVMIRParser.TruncExprContext ctx) { - } - - @Override - public void enterZExtExpr(LLVMIRParser.ZExtExprContext ctx) { - transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); - super.enterZExtExpr(ctx); - } - - @Override - public void exitZExtExpr(LLVMIRParser.ZExtExprContext ctx) { - } - - @Override - public void enterSExtExpr(LLVMIRParser.SExtExprContext ctx) { - transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); - super.enterSExtExpr(ctx); - } - - @Override - public void exitSExtExpr(LLVMIRParser.SExtExprContext ctx) { - } - - @Override - public void enterFpTruncExpr(LLVMIRParser.FpTruncExprContext ctx) { - transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); - super.enterFpTruncExpr(ctx); - } - - @Override - public void exitFpTruncExpr(LLVMIRParser.FpTruncExprContext ctx) { - } - - @Override - public void enterFpExtExpr(LLVMIRParser.FpExtExprContext ctx) { - transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); - super.enterFpExtExpr(ctx); - } - - @Override - public void exitFpExtExpr(LLVMIRParser.FpExtExprContext ctx) { - } - - @Override - public void enterFpToUiExpr(LLVMIRParser.FpToUiExprContext ctx) { - transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); - super.enterFpToUiExpr(ctx); - } - - @Override - public void exitFpToUiExpr(LLVMIRParser.FpToUiExprContext ctx) { - } - - @Override - public void enterFpToSiExpr(LLVMIRParser.FpToSiExprContext ctx) { - transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); - super.enterFpToSiExpr(ctx); - } - - @Override - public void exitFpToSiExpr(LLVMIRParser.FpToSiExprContext ctx) { - } - - @Override - public void enterUiToFpExpr(LLVMIRParser.UiToFpExprContext ctx) { - transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); - super.enterUiToFpExpr(ctx); - } - - @Override - public void exitUiToFpExpr(LLVMIRParser.UiToFpExprContext ctx) { - } - - @Override - public void enterSiToFpExpr(LLVMIRParser.SiToFpExprContext ctx) { - transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); - super.enterSiToFpExpr(ctx); - } - - @Override - public void exitSiToFpExpr(LLVMIRParser.SiToFpExprContext ctx) { - } - - @Override - public void enterPtrToIntExpr(LLVMIRParser.PtrToIntExprContext ctx) { - transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); - super.enterPtrToIntExpr(ctx); - } - - @Override - public void exitPtrToIntExpr(LLVMIRParser.PtrToIntExprContext ctx) { - } - - @Override - public void enterExtractElementExpr(LLVMIRParser.ExtractElementExprContext ctx) { - transformToken(LLVMIRTokenType.EXTRACT_ELEM, ctx.getStart(), ctx.getStop()); - super.enterExtractElementExpr(ctx); - } - - @Override - public void exitExtractElementExpr(LLVMIRParser.ExtractElementExprContext ctx) { - } - - @Override - public void enterInsertElementExpr(LLVMIRParser.InsertElementExprContext ctx) { - transformToken(LLVMIRTokenType.INSERT_ELEM, ctx.getStart(), ctx.getStop()); - super.enterInsertElementExpr(ctx); - } - - @Override - public void exitInsertElementExpr(LLVMIRParser.InsertElementExprContext ctx) { - } - - @Override - public void enterShuffleVectorExpr(LLVMIRParser.ShuffleVectorExprContext ctx) { - transformToken(LLVMIRTokenType.SHUFFLE_VEC, ctx.getStart(), ctx.getStop()); - super.enterShuffleVectorExpr(ctx); - } - - @Override - public void exitShuffleVectorExpr(LLVMIRParser.ShuffleVectorExprContext ctx) { - } - - @Override - public void enterShlExpr(LLVMIRParser.ShlExprContext ctx) { - transformToken(LLVMIRTokenType.SHIFT, ctx.getStart(), ctx.getStop()); - super.enterShlExpr(ctx); - } - - @Override - public void exitShlExpr(LLVMIRParser.ShlExprContext ctx) { - } - - @Override - public void enterLShrExpr(LLVMIRParser.LShrExprContext ctx) { - transformToken(LLVMIRTokenType.SHIFT, ctx.getStart(), ctx.getStop()); - super.enterLShrExpr(ctx); - } - - @Override - public void exitLShrExpr(LLVMIRParser.LShrExprContext ctx) { - } - - @Override - public void enterAShrExpr(LLVMIRParser.AShrExprContext ctx) { - transformToken(LLVMIRTokenType.SHIFT, ctx.getStart(), ctx.getStop()); - super.enterAShrExpr(ctx); - } - - @Override - public void exitAShrExpr(LLVMIRParser.AShrExprContext ctx) { - } - - @Override - public void enterAndExpr(LLVMIRParser.AndExprContext ctx) { - transformToken(LLVMIRTokenType.AND, ctx.getStart(), ctx.getStop()); - super.enterAndExpr(ctx); - } - - @Override - public void exitAndExpr(LLVMIRParser.AndExprContext ctx) { - } - - @Override - public void enterOrExpr(LLVMIRParser.OrExprContext ctx) { - transformToken(LLVMIRTokenType.OR, ctx.getStart(), ctx.getStop()); - super.enterOrExpr(ctx); - } - - @Override - public void exitOrExpr(LLVMIRParser.OrExprContext ctx) { - } - - @Override - public void enterXorExpr(LLVMIRParser.XorExprContext ctx) { - transformToken(LLVMIRTokenType.XOR, ctx.getStart(), ctx.getStop()); - super.enterXorExpr(ctx); - } - - @Override - public void exitXorExpr(LLVMIRParser.XorExprContext ctx) { - } - - @Override - public void enterAddExpr(LLVMIRParser.AddExprContext ctx) { - transformToken(LLVMIRTokenType.ADD, ctx.getStart(), ctx.getStop()); - super.enterAddExpr(ctx); - } - - @Override - public void exitAddExpr(LLVMIRParser.AddExprContext ctx) { - } - - @Override - public void enterSubExpr(LLVMIRParser.SubExprContext ctx) { - transformToken(LLVMIRTokenType.SUB, ctx.getStart(), ctx.getStop()); - super.enterSubExpr(ctx); - } - - @Override - public void exitSubExpr(LLVMIRParser.SubExprContext ctx) { - } - - @Override - public void enterMulExpr(LLVMIRParser.MulExprContext ctx) { - transformToken(LLVMIRTokenType.MUL, ctx.getStart(), ctx.getStop()); - super.enterMulExpr(ctx); - } - - @Override - public void exitMulExpr(LLVMIRParser.MulExprContext ctx) { - } - - @Override - public void enterFNegExpr(LLVMIRParser.FNegExprContext ctx) { - } - - @Override - public void exitFNegExpr(LLVMIRParser.FNegExprContext ctx) { - } - - @Override - public void enterLocalDefInst(LLVMIRParser.LocalDefInstContext ctx) { - } - - @Override - public void exitLocalDefInst(LLVMIRParser.LocalDefInstContext ctx) { - } - - @Override - public void enterValueInstruction(LLVMIRParser.ValueInstructionContext ctx) { - } - - @Override - public void exitValueInstruction(LLVMIRParser.ValueInstructionContext ctx) { - } - - @Override - public void enterStoreInst(LLVMIRParser.StoreInstContext ctx) { - transformToken(LLVMIRTokenType.STORE, ctx.getStart(), ctx.getStop()); - super.enterStoreInst(ctx); - } - - @Override - public void exitStoreInst(LLVMIRParser.StoreInstContext ctx) { - } - - @Override - public void enterSyncScope(LLVMIRParser.SyncScopeContext ctx) { - } - - @Override - public void exitSyncScope(LLVMIRParser.SyncScopeContext ctx) { - } - - @Override - public void enterFenceInst(LLVMIRParser.FenceInstContext ctx) { - transformToken(LLVMIRTokenType.FENCE, ctx.getStart(), ctx.getStop()); - super.enterFenceInst(ctx); - } - - @Override - public void exitFenceInst(LLVMIRParser.FenceInstContext ctx) { - } - - @Override - public void enterFNegInst(LLVMIRParser.FNegInstContext ctx) { - } - - @Override - public void exitFNegInst(LLVMIRParser.FNegInstContext ctx) { - } - - @Override - public void enterAddInst(LLVMIRParser.AddInstContext ctx) { - transformToken(LLVMIRTokenType.ADD, ctx.getStart(), ctx.getStop()); - super.enterAddInst(ctx); - } - - @Override - public void exitAddInst(LLVMIRParser.AddInstContext ctx) { - } - - @Override - public void enterFAddInst(LLVMIRParser.FAddInstContext ctx) { - transformToken(LLVMIRTokenType.ADD, ctx.getStart(), ctx.getStop()); - super.enterFAddInst(ctx); - } - - @Override - public void exitFAddInst(LLVMIRParser.FAddInstContext ctx) { - } - - @Override - public void enterSubInst(LLVMIRParser.SubInstContext ctx) { - transformToken(LLVMIRTokenType.SUB, ctx.getStart(), ctx.getStop()); - super.enterSubInst(ctx); - } - - @Override - public void exitSubInst(LLVMIRParser.SubInstContext ctx) { - } - - @Override - public void enterFSubInst(LLVMIRParser.FSubInstContext ctx) { - transformToken(LLVMIRTokenType.SUB, ctx.getStart(), ctx.getStop()); - super.enterFSubInst(ctx); - } - - @Override - public void exitFSubInst(LLVMIRParser.FSubInstContext ctx) { - } - - @Override - public void enterMulInst(LLVMIRParser.MulInstContext ctx) { - transformToken(LLVMIRTokenType.MUL, ctx.getStart(), ctx.getStop()); - super.enterMulInst(ctx); - } - - @Override - public void exitMulInst(LLVMIRParser.MulInstContext ctx) { - } - - @Override - public void enterFMulInst(LLVMIRParser.FMulInstContext ctx) { - transformToken(LLVMIRTokenType.MUL, ctx.getStart(), ctx.getStop()); - super.enterFMulInst(ctx); - } - - @Override - public void exitFMulInst(LLVMIRParser.FMulInstContext ctx) { - } - - @Override - public void enterUDivInst(LLVMIRParser.UDivInstContext ctx) { - transformToken(LLVMIRTokenType.DIV, ctx.getStart(), ctx.getStop()); - super.enterUDivInst(ctx); - } - - @Override - public void exitUDivInst(LLVMIRParser.UDivInstContext ctx) { - } - - @Override - public void enterSDivInst(LLVMIRParser.SDivInstContext ctx) { - transformToken(LLVMIRTokenType.DIV, ctx.getStart(), ctx.getStop()); - super.enterSDivInst(ctx); - } - - @Override - public void exitSDivInst(LLVMIRParser.SDivInstContext ctx) { - } - - @Override - public void enterFDivInst(LLVMIRParser.FDivInstContext ctx) { - transformToken(LLVMIRTokenType.DIV, ctx.getStart(), ctx.getStop()); - super.enterFDivInst(ctx); - } - - @Override - public void exitFDivInst(LLVMIRParser.FDivInstContext ctx) { - } - - @Override - public void enterURemInst(LLVMIRParser.URemInstContext ctx) { - transformToken(LLVMIRTokenType.REM, ctx.getStart(), ctx.getStop()); - super.enterURemInst(ctx); - } - - @Override - public void exitURemInst(LLVMIRParser.URemInstContext ctx) { - } - - @Override - public void enterSRemInst(LLVMIRParser.SRemInstContext ctx) { - transformToken(LLVMIRTokenType.REM, ctx.getStart(), ctx.getStop()); - super.enterSRemInst(ctx); - } - - @Override - public void exitSRemInst(LLVMIRParser.SRemInstContext ctx) { - } - - @Override - public void enterFRemInst(LLVMIRParser.FRemInstContext ctx) { - transformToken(LLVMIRTokenType.REM, ctx.getStart(), ctx.getStop()); - super.enterFRemInst(ctx); - } - - @Override - public void exitFRemInst(LLVMIRParser.FRemInstContext ctx) { - } - - @Override - public void enterShlInst(LLVMIRParser.ShlInstContext ctx) { - transformToken(LLVMIRTokenType.SHIFT, ctx.getStart(), ctx.getStop()); - super.enterShlInst(ctx); - } - - @Override - public void exitShlInst(LLVMIRParser.ShlInstContext ctx) { - } - - @Override - public void enterLShrInst(LLVMIRParser.LShrInstContext ctx) { - transformToken(LLVMIRTokenType.SHIFT, ctx.getStart(), ctx.getStop()); - super.enterLShrInst(ctx); - } - - @Override - public void exitLShrInst(LLVMIRParser.LShrInstContext ctx) { - } - - @Override - public void enterAShrInst(LLVMIRParser.AShrInstContext ctx) { - transformToken(LLVMIRTokenType.SHIFT, ctx.getStart(), ctx.getStop()); - super.enterAShrInst(ctx); - } - - @Override - public void exitAShrInst(LLVMIRParser.AShrInstContext ctx) { - } - - @Override - public void enterAndInst(LLVMIRParser.AndInstContext ctx) { - transformToken(LLVMIRTokenType.AND, ctx.getStart(), ctx.getStop()); - super.enterAndInst(ctx); - } - - @Override - public void exitAndInst(LLVMIRParser.AndInstContext ctx) { - } - - @Override - public void enterOrInst(LLVMIRParser.OrInstContext ctx) { - transformToken(LLVMIRTokenType.OR, ctx.getStart(), ctx.getStop()); - super.enterOrInst(ctx); - } - - @Override - public void exitOrInst(LLVMIRParser.OrInstContext ctx) { - } - - @Override - public void enterXorInst(LLVMIRParser.XorInstContext ctx) { - transformToken(LLVMIRTokenType.XOR, ctx.getStart(), ctx.getStop()); - super.enterXorInst(ctx); - } - - @Override - public void exitXorInst(LLVMIRParser.XorInstContext ctx) { - } - - @Override - public void enterExtractElementInst(LLVMIRParser.ExtractElementInstContext ctx) { - transformToken(LLVMIRTokenType.EXTRACT_ELEM, ctx.getStart(), ctx.getStop()); - super.enterExtractElementInst(ctx); - } - - @Override - public void exitExtractElementInst(LLVMIRParser.ExtractElementInstContext ctx) { - } - - @Override - public void enterInsertElementInst(LLVMIRParser.InsertElementInstContext ctx) { - transformToken(LLVMIRTokenType.INSERT_ELEM, ctx.getStart(), ctx.getStop()); - super.enterInsertElementInst(ctx); - } - - @Override - public void exitInsertElementInst(LLVMIRParser.InsertElementInstContext ctx) { - } - - @Override - public void enterShuffleVectorInst(LLVMIRParser.ShuffleVectorInstContext ctx) { - transformToken(LLVMIRTokenType.SHUFFLE_VEC, ctx.getStart(), ctx.getStop()); - super.enterShuffleVectorInst(ctx); - } - - @Override - public void exitShuffleVectorInst(LLVMIRParser.ShuffleVectorInstContext ctx) { - } - - @Override - public void enterExtractValueInst(LLVMIRParser.ExtractValueInstContext ctx) { - transformToken(LLVMIRTokenType.EXTRACT_VAL, ctx.getStart(), ctx.getStop()); - super.enterExtractValueInst(ctx); - } - - @Override - public void exitExtractValueInst(LLVMIRParser.ExtractValueInstContext ctx) { - } - - @Override - public void enterInsertValueInst(LLVMIRParser.InsertValueInstContext ctx) { - transformToken(LLVMIRTokenType.INSERT_VAL, ctx.getStart(), ctx.getStop()); - super.enterInsertValueInst(ctx); - } - - @Override - public void exitInsertValueInst(LLVMIRParser.InsertValueInstContext ctx) { - } - - @Override - public void enterAllocaInst(LLVMIRParser.AllocaInstContext ctx) { - transformToken(LLVMIRTokenType.ALLOCATION, ctx.getStart(), ctx.getStop()); - super.enterAllocaInst(ctx); - } - - @Override - public void exitAllocaInst(LLVMIRParser.AllocaInstContext ctx) { - } - - @Override - public void enterLoadInst(LLVMIRParser.LoadInstContext ctx) { - transformToken(LLVMIRTokenType.LOAD, ctx.getStart(), ctx.getStop()); - super.enterLoadInst(ctx); - } - - @Override - public void exitLoadInst(LLVMIRParser.LoadInstContext ctx) { - } - - @Override - public void enterCmpXchgInst(LLVMIRParser.CmpXchgInstContext ctx) { - transformToken(LLVMIRTokenType.COMPARE_EXCHANGE, ctx.getStart(), ctx.getStop()); - super.enterCmpXchgInst(ctx); - } - - @Override - public void exitCmpXchgInst(LLVMIRParser.CmpXchgInstContext ctx) { - } - - @Override - public void enterAtomicRMWInst(LLVMIRParser.AtomicRMWInstContext ctx) { - transformToken(LLVMIRTokenType.ATOMIC_CRMW, ctx.getStart(), ctx.getStop()); - super.enterAtomicRMWInst(ctx); - } - - @Override - public void exitAtomicRMWInst(LLVMIRParser.AtomicRMWInstContext ctx) { - } - - @Override - public void enterGetElementPtrInst(LLVMIRParser.GetElementPtrInstContext ctx) { - transformToken(LLVMIRTokenType.GET_ELEMENT_POINTER, ctx.getStart(), ctx.getStop()); - super.enterGetElementPtrInst(ctx); - } - - @Override - public void exitGetElementPtrInst(LLVMIRParser.GetElementPtrInstContext ctx) { - } - - @Override - public void enterTruncInst(LLVMIRParser.TruncInstContext ctx) { - transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); - super.enterTruncInst(ctx); - } - - @Override - public void exitTruncInst(LLVMIRParser.TruncInstContext ctx) { - } - - @Override - public void enterZExtInst(LLVMIRParser.ZExtInstContext ctx) { - transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); - super.enterZExtInst(ctx); - } - - @Override - public void exitZExtInst(LLVMIRParser.ZExtInstContext ctx) { - } - - @Override - public void enterSExtInst(LLVMIRParser.SExtInstContext ctx) { - transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); - super.enterSExtInst(ctx); - } - - @Override - public void exitSExtInst(LLVMIRParser.SExtInstContext ctx) { - } - - @Override - public void enterFpTruncInst(LLVMIRParser.FpTruncInstContext ctx) { - transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); - super.enterFpTruncInst(ctx); - } - - @Override - public void exitFpTruncInst(LLVMIRParser.FpTruncInstContext ctx) { - } - - @Override - public void enterFpExtInst(LLVMIRParser.FpExtInstContext ctx) { - transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); - super.enterFpExtInst(ctx); - } - - @Override - public void exitFpExtInst(LLVMIRParser.FpExtInstContext ctx) { - } - - @Override - public void enterFpToUiInst(LLVMIRParser.FpToUiInstContext ctx) { - transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); - super.enterFpToUiInst(ctx); - } - - @Override - public void exitFpToUiInst(LLVMIRParser.FpToUiInstContext ctx) { - } - - @Override - public void enterFpToSiInst(LLVMIRParser.FpToSiInstContext ctx) { - transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); - super.enterFpToSiInst(ctx); - } - - @Override - public void exitFpToSiInst(LLVMIRParser.FpToSiInstContext ctx) { - } - - @Override - public void enterUiToFpInst(LLVMIRParser.UiToFpInstContext ctx) { - transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); - super.enterUiToFpInst(ctx); - } - - @Override - public void exitUiToFpInst(LLVMIRParser.UiToFpInstContext ctx) { - } - - @Override - public void enterSiToFpInst(LLVMIRParser.SiToFpInstContext ctx) { - transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); - super.enterSiToFpInst(ctx); - } - - @Override - public void exitSiToFpInst(LLVMIRParser.SiToFpInstContext ctx) { - } - - @Override - public void enterPtrToIntInst(LLVMIRParser.PtrToIntInstContext ctx) { - transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); - super.enterPtrToIntInst(ctx); - } - - @Override - public void exitPtrToIntInst(LLVMIRParser.PtrToIntInstContext ctx) { - } - - @Override - public void enterIntToPtrInst(LLVMIRParser.IntToPtrInstContext ctx) { - transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); - super.enterIntToPtrInst(ctx); - } - - @Override - public void exitIntToPtrInst(LLVMIRParser.IntToPtrInstContext ctx) { - } - - @Override - public void enterBitCastInst(LLVMIRParser.BitCastInstContext ctx) { - transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); - super.enterBitCastInst(ctx); - } - - @Override - public void exitBitCastInst(LLVMIRParser.BitCastInstContext ctx) { - } - - @Override - public void enterAddrSpaceCastInst(LLVMIRParser.AddrSpaceCastInstContext ctx) { - transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); - super.enterAddrSpaceCastInst(ctx); - } - - @Override - public void exitAddrSpaceCastInst(LLVMIRParser.AddrSpaceCastInstContext ctx) { - } - - @Override - public void enterICmpInst(LLVMIRParser.ICmpInstContext ctx) { - transformToken(LLVMIRTokenType.COMPARISON, ctx.getStart(), ctx.getStop()); - super.enterICmpInst(ctx); - } - - @Override - public void exitICmpInst(LLVMIRParser.ICmpInstContext ctx) { - } - - @Override - public void enterFCmpInst(LLVMIRParser.FCmpInstContext ctx) { - transformToken(LLVMIRTokenType.COMPARISON, ctx.getStart(), ctx.getStop()); - super.enterFCmpInst(ctx); - } - - @Override - public void exitFCmpInst(LLVMIRParser.FCmpInstContext ctx) { - } - - @Override - public void enterPhiInst(LLVMIRParser.PhiInstContext ctx) { - transformToken(LLVMIRTokenType.PHI, ctx.getStart(), ctx.getStop()); - super.enterPhiInst(ctx); - } - - @Override - public void exitPhiInst(LLVMIRParser.PhiInstContext ctx) { - } - - @Override - public void enterSelectInst(LLVMIRParser.SelectInstContext ctx) { - transformToken(LLVMIRTokenType.SELECT, ctx.getStart(), ctx.getStop()); - super.enterSelectInst(ctx); - } - - @Override - public void exitSelectInst(LLVMIRParser.SelectInstContext ctx) { - } - - @Override - public void enterFreezeInst(LLVMIRParser.FreezeInstContext ctx) { - } - - @Override - public void exitFreezeInst(LLVMIRParser.FreezeInstContext ctx) { - } - - @Override - public void enterCallInst(LLVMIRParser.CallInstContext ctx) { - transformToken(LLVMIRTokenType.CALL, ctx.getStart(), ctx.getStop()); - super.enterCallInst(ctx); - } - - @Override - public void exitCallInst(LLVMIRParser.CallInstContext ctx) { - } - - @Override - public void enterVaargInst(LLVMIRParser.VaargInstContext ctx) { - } - - @Override - public void exitVaargInst(LLVMIRParser.VaargInstContext ctx) { - } - - @Override - public void enterLandingPadInst(LLVMIRParser.LandingPadInstContext ctx) { - transformToken(LLVMIRTokenType.LANDING_PAD, ctx.getStart(), ctx.getStop()); - super.enterLandingPadInst(ctx); - } - - @Override - public void exitLandingPadInst(LLVMIRParser.LandingPadInstContext ctx) { - } - - @Override - public void enterCatchPadInst(LLVMIRParser.CatchPadInstContext ctx) { - transformToken(LLVMIRTokenType.CATCH_PAD, ctx.getStart(), ctx.getStop()); - super.enterCatchPadInst(ctx); - } - - @Override - public void exitCatchPadInst(LLVMIRParser.CatchPadInstContext ctx) { - } - - @Override - public void enterCleanupPadInst(LLVMIRParser.CleanupPadInstContext ctx) { - transformToken(LLVMIRTokenType.CLEAN_UP_PAD, ctx.getStart(), ctx.getStop()); - super.enterCleanupPadInst(ctx); - } - - @Override - public void exitCleanupPadInst(LLVMIRParser.CleanupPadInstContext ctx) { - } - - @Override - public void enterInc(LLVMIRParser.IncContext ctx) { - } - - @Override - public void exitInc(LLVMIRParser.IncContext ctx) { - } - - @Override - public void enterOperandBundle(LLVMIRParser.OperandBundleContext ctx) { - } - - @Override - public void exitOperandBundle(LLVMIRParser.OperandBundleContext ctx) { - } - - @Override - public void enterClause(LLVMIRParser.ClauseContext ctx) { - } - - @Override - public void exitClause(LLVMIRParser.ClauseContext ctx) { - } - - @Override - public void enterArgs(LLVMIRParser.ArgsContext ctx) { - } - - @Override - public void exitArgs(LLVMIRParser.ArgsContext ctx) { - } - - @Override - public void enterArg(LLVMIRParser.ArgContext ctx) { - } - - @Override - public void exitArg(LLVMIRParser.ArgContext ctx) { - } - - @Override - public void enterExceptionArg(LLVMIRParser.ExceptionArgContext ctx) { - } - - @Override - public void exitExceptionArg(LLVMIRParser.ExceptionArgContext ctx) { - } - - @Override - public void enterExceptionPad(LLVMIRParser.ExceptionPadContext ctx) { - } - - @Override - public void exitExceptionPad(LLVMIRParser.ExceptionPadContext ctx) { - } - - @Override - public void enterExternalLinkage(LLVMIRParser.ExternalLinkageContext ctx) { - } - - @Override - public void exitExternalLinkage(LLVMIRParser.ExternalLinkageContext ctx) { - } - - @Override - public void enterInternalLinkage(LLVMIRParser.InternalLinkageContext ctx) { - } - - @Override - public void exitInternalLinkage(LLVMIRParser.InternalLinkageContext ctx) { - } - - @Override - public void enterLinkage(LLVMIRParser.LinkageContext ctx) { - } - - @Override - public void exitLinkage(LLVMIRParser.LinkageContext ctx) { - } - - @Override - public void enterPreemption(LLVMIRParser.PreemptionContext ctx) { - } - - @Override - public void exitPreemption(LLVMIRParser.PreemptionContext ctx) { - } - - @Override - public void enterVisibility(LLVMIRParser.VisibilityContext ctx) { - } - - @Override - public void exitVisibility(LLVMIRParser.VisibilityContext ctx) { - } - - @Override - public void enterDllStorageClass(LLVMIRParser.DllStorageClassContext ctx) { - } - - @Override - public void exitDllStorageClass(LLVMIRParser.DllStorageClassContext ctx) { - } - - @Override - public void enterTlsModel(LLVMIRParser.TlsModelContext ctx) { - } - - @Override - public void exitTlsModel(LLVMIRParser.TlsModelContext ctx) { - } - - @Override - public void enterUnnamedAddr(LLVMIRParser.UnnamedAddrContext ctx) { - } - - @Override - public void exitUnnamedAddr(LLVMIRParser.UnnamedAddrContext ctx) { - } - - @Override - public void enterExternallyInitialized(LLVMIRParser.ExternallyInitializedContext ctx) { - } - - @Override - public void exitExternallyInitialized(LLVMIRParser.ExternallyInitializedContext ctx) { - } - - @Override - public void enterImmutable(LLVMIRParser.ImmutableContext ctx) { - } - - @Override - public void exitImmutable(LLVMIRParser.ImmutableContext ctx) { - } - - @Override - public void enterFuncAttr(LLVMIRParser.FuncAttrContext ctx) { - } - - @Override - public void exitFuncAttr(LLVMIRParser.FuncAttrContext ctx) { - } - - @Override - public void enterDistinct(LLVMIRParser.DistinctContext ctx) { - } - - @Override - public void exitDistinct(LLVMIRParser.DistinctContext ctx) { - } - - @Override - public void enterInBounds(LLVMIRParser.InBoundsContext ctx) { - } - - @Override - public void exitInBounds(LLVMIRParser.InBoundsContext ctx) { - } - - @Override - public void enterReturnAttr(LLVMIRParser.ReturnAttrContext ctx) { - } - - @Override - public void exitReturnAttr(LLVMIRParser.ReturnAttrContext ctx) { - } - - @Override - public void enterOverflowFlag(LLVMIRParser.OverflowFlagContext ctx) { - } - - @Override - public void exitOverflowFlag(LLVMIRParser.OverflowFlagContext ctx) { - } - - @Override - public void enterIPred(LLVMIRParser.IPredContext ctx) { - } - - @Override - public void exitIPred(LLVMIRParser.IPredContext ctx) { - } - - @Override - public void enterFPred(LLVMIRParser.FPredContext ctx) { - } - - @Override - public void exitFPred(LLVMIRParser.FPredContext ctx) { - } - - @Override - public void enterAtomicOrdering(LLVMIRParser.AtomicOrderingContext ctx) { - } - - @Override - public void exitAtomicOrdering(LLVMIRParser.AtomicOrderingContext ctx) { - } - - @Override - public void enterCallingConvEnum(LLVMIRParser.CallingConvEnumContext ctx) { - } - - @Override - public void exitCallingConvEnum(LLVMIRParser.CallingConvEnumContext ctx) { - } - - @Override - public void enterFastMathFlag(LLVMIRParser.FastMathFlagContext ctx) { - } - - @Override - public void exitFastMathFlag(LLVMIRParser.FastMathFlagContext ctx) { - } - - @Override - public void enterAtomicOp(LLVMIRParser.AtomicOpContext ctx) { - } - - @Override - public void exitAtomicOp(LLVMIRParser.AtomicOpContext ctx) { - } - - @Override - public void enterFloatKind(LLVMIRParser.FloatKindContext ctx) { - } - - @Override - public void exitFloatKind(LLVMIRParser.FloatKindContext ctx) { - } - - @Override - public void enterSpecializedMDNode(LLVMIRParser.SpecializedMDNodeContext ctx) { - } - - @Override - public void exitSpecializedMDNode(LLVMIRParser.SpecializedMDNodeContext ctx) { - } - - @Override - public void enterDiBasicType(LLVMIRParser.DiBasicTypeContext ctx) { - } - - @Override - public void exitDiBasicType(LLVMIRParser.DiBasicTypeContext ctx) { - } - - @Override - public void enterDiCommonBlock(LLVMIRParser.DiCommonBlockContext ctx) { - } - - @Override - public void exitDiCommonBlock(LLVMIRParser.DiCommonBlockContext ctx) { - } - - @Override - public void enterDiCompileUnit(LLVMIRParser.DiCompileUnitContext ctx) { - } - - @Override - public void exitDiCompileUnit(LLVMIRParser.DiCompileUnitContext ctx) { - } - - @Override - public void enterDiCompositeType(LLVMIRParser.DiCompositeTypeContext ctx) { - } - - @Override - public void exitDiCompositeType(LLVMIRParser.DiCompositeTypeContext ctx) { - } - - @Override - public void enterDiCompositeTypeField(LLVMIRParser.DiCompositeTypeFieldContext ctx) { - } - - @Override - public void exitDiCompositeTypeField(LLVMIRParser.DiCompositeTypeFieldContext ctx) { - } - - @Override - public void enterDiDerivedType(LLVMIRParser.DiDerivedTypeContext ctx) { - } - - @Override - public void exitDiDerivedType(LLVMIRParser.DiDerivedTypeContext ctx) { - } - - @Override - public void enterDiDerivedTypeField(LLVMIRParser.DiDerivedTypeFieldContext ctx) { - } - - @Override - public void exitDiDerivedTypeField(LLVMIRParser.DiDerivedTypeFieldContext ctx) { - } - - @Override - public void enterDiEnumerator(LLVMIRParser.DiEnumeratorContext ctx) { - } - - @Override - public void exitDiEnumerator(LLVMIRParser.DiEnumeratorContext ctx) { - } - - @Override - public void enterDiEnumeratorField(LLVMIRParser.DiEnumeratorFieldContext ctx) { - } - - @Override - public void exitDiEnumeratorField(LLVMIRParser.DiEnumeratorFieldContext ctx) { - } - - @Override - public void enterDiFile(LLVMIRParser.DiFileContext ctx) { - } - - @Override - public void exitDiFile(LLVMIRParser.DiFileContext ctx) { - } - - @Override - public void enterDiFileField(LLVMIRParser.DiFileFieldContext ctx) { - } - - @Override - public void exitDiFileField(LLVMIRParser.DiFileFieldContext ctx) { - } - - @Override - public void enterDiGlobalVariable(LLVMIRParser.DiGlobalVariableContext ctx) { - } - - @Override - public void exitDiGlobalVariable(LLVMIRParser.DiGlobalVariableContext ctx) { - } - - @Override - public void enterDiGlobalVariableField(LLVMIRParser.DiGlobalVariableFieldContext ctx) { - } - - @Override - public void exitDiGlobalVariableField(LLVMIRParser.DiGlobalVariableFieldContext ctx) { - } - - @Override - public void enterDiGlobalVariableExpression(LLVMIRParser.DiGlobalVariableExpressionContext ctx) { - } - - @Override - public void exitDiGlobalVariableExpression(LLVMIRParser.DiGlobalVariableExpressionContext ctx) { - } - - @Override - public void enterDiGlobalVariableExpressionField(LLVMIRParser.DiGlobalVariableExpressionFieldContext ctx) { - } - - @Override - public void exitDiGlobalVariableExpressionField(LLVMIRParser.DiGlobalVariableExpressionFieldContext ctx) { - } - - @Override - public void enterDiImportedEntity(LLVMIRParser.DiImportedEntityContext ctx) { - } - - @Override - public void exitDiImportedEntity(LLVMIRParser.DiImportedEntityContext ctx) { - } - - @Override - public void enterDiImportedEntityField(LLVMIRParser.DiImportedEntityFieldContext ctx) { - } - - @Override - public void exitDiImportedEntityField(LLVMIRParser.DiImportedEntityFieldContext ctx) { - } - - @Override - public void enterDiLabel(LLVMIRParser.DiLabelContext ctx) { - } - - @Override - public void exitDiLabel(LLVMIRParser.DiLabelContext ctx) { - } - - @Override - public void enterDiLabelField(LLVMIRParser.DiLabelFieldContext ctx) { - } - - @Override - public void exitDiLabelField(LLVMIRParser.DiLabelFieldContext ctx) { - } - - @Override - public void enterDiLexicalBlock(LLVMIRParser.DiLexicalBlockContext ctx) { - } - - @Override - public void exitDiLexicalBlock(LLVMIRParser.DiLexicalBlockContext ctx) { - } - - @Override - public void enterDiLexicalBlockField(LLVMIRParser.DiLexicalBlockFieldContext ctx) { - } - - @Override - public void exitDiLexicalBlockField(LLVMIRParser.DiLexicalBlockFieldContext ctx) { - } - - @Override - public void enterDiLexicalBlockFile(LLVMIRParser.DiLexicalBlockFileContext ctx) { - } - - @Override - public void exitDiLexicalBlockFile(LLVMIRParser.DiLexicalBlockFileContext ctx) { - } - - @Override - public void enterDiLexicalBlockFileField(LLVMIRParser.DiLexicalBlockFileFieldContext ctx) { - } - - @Override - public void exitDiLexicalBlockFileField(LLVMIRParser.DiLexicalBlockFileFieldContext ctx) { - } - - @Override - public void enterDiLocalVariable(LLVMIRParser.DiLocalVariableContext ctx) { - } - - @Override - public void exitDiLocalVariable(LLVMIRParser.DiLocalVariableContext ctx) { - } - - @Override - public void enterDiLocalVariableField(LLVMIRParser.DiLocalVariableFieldContext ctx) { - } - - @Override - public void exitDiLocalVariableField(LLVMIRParser.DiLocalVariableFieldContext ctx) { - } - - @Override - public void enterDiLocation(LLVMIRParser.DiLocationContext ctx) { - } - - @Override - public void exitDiLocation(LLVMIRParser.DiLocationContext ctx) { - } - - @Override - public void enterDiLocationField(LLVMIRParser.DiLocationFieldContext ctx) { - } - - @Override - public void exitDiLocationField(LLVMIRParser.DiLocationFieldContext ctx) { - } - - @Override - public void enterDiMacro(LLVMIRParser.DiMacroContext ctx) { - } - - @Override - public void exitDiMacro(LLVMIRParser.DiMacroContext ctx) { - } - - @Override - public void enterDiMacroField(LLVMIRParser.DiMacroFieldContext ctx) { - } - - @Override - public void exitDiMacroField(LLVMIRParser.DiMacroFieldContext ctx) { - } - - @Override - public void enterDiMacroFile(LLVMIRParser.DiMacroFileContext ctx) { - } - - @Override - public void exitDiMacroFile(LLVMIRParser.DiMacroFileContext ctx) { - } - - @Override - public void enterDiMacroFileField(LLVMIRParser.DiMacroFileFieldContext ctx) { - } - - @Override - public void exitDiMacroFileField(LLVMIRParser.DiMacroFileFieldContext ctx) { - } - - @Override - public void enterDiModule(LLVMIRParser.DiModuleContext ctx) { - } - - @Override - public void exitDiModule(LLVMIRParser.DiModuleContext ctx) { - } - - @Override - public void enterDiModuleField(LLVMIRParser.DiModuleFieldContext ctx) { - } - - @Override - public void exitDiModuleField(LLVMIRParser.DiModuleFieldContext ctx) { - } - - @Override - public void enterDiNamespace(LLVMIRParser.DiNamespaceContext ctx) { - } - - @Override - public void exitDiNamespace(LLVMIRParser.DiNamespaceContext ctx) { - } - - @Override - public void enterDiNamespaceField(LLVMIRParser.DiNamespaceFieldContext ctx) { - } - - @Override - public void exitDiNamespaceField(LLVMIRParser.DiNamespaceFieldContext ctx) { - } - - @Override - public void enterDiObjCProperty(LLVMIRParser.DiObjCPropertyContext ctx) { - } - - @Override - public void exitDiObjCProperty(LLVMIRParser.DiObjCPropertyContext ctx) { - } - - @Override - public void enterDiObjCPropertyField(LLVMIRParser.DiObjCPropertyFieldContext ctx) { - } - - @Override - public void exitDiObjCPropertyField(LLVMIRParser.DiObjCPropertyFieldContext ctx) { - } - - @Override - public void enterDiStringType(LLVMIRParser.DiStringTypeContext ctx) { - } - - @Override - public void exitDiStringType(LLVMIRParser.DiStringTypeContext ctx) { - } - - @Override - public void enterDiStringTypeField(LLVMIRParser.DiStringTypeFieldContext ctx) { - } - - @Override - public void exitDiStringTypeField(LLVMIRParser.DiStringTypeFieldContext ctx) { - } - - @Override - public void enterDiSubprogram(LLVMIRParser.DiSubprogramContext ctx) { - } - - @Override - public void exitDiSubprogram(LLVMIRParser.DiSubprogramContext ctx) { - } - - @Override - public void enterDiSubprogramField(LLVMIRParser.DiSubprogramFieldContext ctx) { - } - - @Override - public void exitDiSubprogramField(LLVMIRParser.DiSubprogramFieldContext ctx) { - } - - @Override - public void enterDiSubrange(LLVMIRParser.DiSubrangeContext ctx) { - } - - @Override - public void exitDiSubrange(LLVMIRParser.DiSubrangeContext ctx) { - } - - @Override - public void enterDiSubrangeField(LLVMIRParser.DiSubrangeFieldContext ctx) { - } - - @Override - public void exitDiSubrangeField(LLVMIRParser.DiSubrangeFieldContext ctx) { - } - - @Override - public void enterDiSubroutineType(LLVMIRParser.DiSubroutineTypeContext ctx) { - } - - @Override - public void exitDiSubroutineType(LLVMIRParser.DiSubroutineTypeContext ctx) { - } - - @Override - public void enterDiTemplateTypeParameter(LLVMIRParser.DiTemplateTypeParameterContext ctx) { - } - - @Override - public void exitDiTemplateTypeParameter(LLVMIRParser.DiTemplateTypeParameterContext ctx) { - } - - @Override - public void enterDiTemplateValueParameter(LLVMIRParser.DiTemplateValueParameterContext ctx) { - } - - @Override - public void exitDiTemplateValueParameter(LLVMIRParser.DiTemplateValueParameterContext ctx) { - } - - @Override - public void enterGenericDiNode(LLVMIRParser.GenericDiNodeContext ctx) { - } - - @Override - public void exitGenericDiNode(LLVMIRParser.GenericDiNodeContext ctx) { - } - - @Override - public void enterDiTemplateTypeParameterField(LLVMIRParser.DiTemplateTypeParameterFieldContext ctx) { - } - - @Override - public void exitDiTemplateTypeParameterField(LLVMIRParser.DiTemplateTypeParameterFieldContext ctx) { - } - - @Override - public void enterDiCompileUnitField(LLVMIRParser.DiCompileUnitFieldContext ctx) { - } - - @Override - public void exitDiCompileUnitField(LLVMIRParser.DiCompileUnitFieldContext ctx) { - } - - @Override - public void enterDiCommonBlockField(LLVMIRParser.DiCommonBlockFieldContext ctx) { - } - - @Override - public void exitDiCommonBlockField(LLVMIRParser.DiCommonBlockFieldContext ctx) { - } - - @Override - public void enterDiBasicTypeField(LLVMIRParser.DiBasicTypeFieldContext ctx) { - } - - @Override - public void exitDiBasicTypeField(LLVMIRParser.DiBasicTypeFieldContext ctx) { - } - - @Override - public void enterGenericDINodeField(LLVMIRParser.GenericDINodeFieldContext ctx) { - } - - @Override - public void exitGenericDINodeField(LLVMIRParser.GenericDINodeFieldContext ctx) { - } - - @Override - public void enterTagField(LLVMIRParser.TagFieldContext ctx) { - } - - @Override - public void exitTagField(LLVMIRParser.TagFieldContext ctx) { - } - - @Override - public void enterHeaderField(LLVMIRParser.HeaderFieldContext ctx) { - } - - @Override - public void exitHeaderField(LLVMIRParser.HeaderFieldContext ctx) { - } - - @Override - public void enterOperandsField(LLVMIRParser.OperandsFieldContext ctx) { - } - - @Override - public void exitOperandsField(LLVMIRParser.OperandsFieldContext ctx) { - } - - @Override - public void enterDiTemplateValueParameterField(LLVMIRParser.DiTemplateValueParameterFieldContext ctx) { - } - - @Override - public void exitDiTemplateValueParameterField(LLVMIRParser.DiTemplateValueParameterFieldContext ctx) { - } - - @Override - public void enterNameField(LLVMIRParser.NameFieldContext ctx) { - } - - @Override - public void exitNameField(LLVMIRParser.NameFieldContext ctx) { - } - - @Override - public void enterTypeField(LLVMIRParser.TypeFieldContext ctx) { - } - - @Override - public void exitTypeField(LLVMIRParser.TypeFieldContext ctx) { - } - - @Override - public void enterDefaultedField(LLVMIRParser.DefaultedFieldContext ctx) { - } - - @Override - public void exitDefaultedField(LLVMIRParser.DefaultedFieldContext ctx) { - } - - @Override - public void enterValueField(LLVMIRParser.ValueFieldContext ctx) { - } - - @Override - public void exitValueField(LLVMIRParser.ValueFieldContext ctx) { - } - - @Override - public void enterMdField(LLVMIRParser.MdFieldContext ctx) { - } - - @Override - public void exitMdField(LLVMIRParser.MdFieldContext ctx) { - } - - @Override - public void enterDiSubroutineTypeField(LLVMIRParser.DiSubroutineTypeFieldContext ctx) { - } - - @Override - public void exitDiSubroutineTypeField(LLVMIRParser.DiSubroutineTypeFieldContext ctx) { - } - - @Override - public void enterFlagsField(LLVMIRParser.FlagsFieldContext ctx) { - } - - @Override - public void exitFlagsField(LLVMIRParser.FlagsFieldContext ctx) { - } - - @Override - public void enterDiFlags(LLVMIRParser.DiFlagsContext ctx) { - } - - @Override - public void exitDiFlags(LLVMIRParser.DiFlagsContext ctx) { - } - - @Override - public void enterCcField(LLVMIRParser.CcFieldContext ctx) { - } - - @Override - public void exitCcField(LLVMIRParser.CcFieldContext ctx) { - } - - @Override - public void enterAlignField(LLVMIRParser.AlignFieldContext ctx) { - } - - @Override - public void exitAlignField(LLVMIRParser.AlignFieldContext ctx) { - } - - @Override - public void enterAllocatedField(LLVMIRParser.AllocatedFieldContext ctx) { - } - - @Override - public void exitAllocatedField(LLVMIRParser.AllocatedFieldContext ctx) { - } - - @Override - public void enterAnnotationsField(LLVMIRParser.AnnotationsFieldContext ctx) { - } - - @Override - public void exitAnnotationsField(LLVMIRParser.AnnotationsFieldContext ctx) { - } - - @Override - public void enterArgField(LLVMIRParser.ArgFieldContext ctx) { - } - - @Override - public void exitArgField(LLVMIRParser.ArgFieldContext ctx) { - } - - @Override - public void enterAssociatedField(LLVMIRParser.AssociatedFieldContext ctx) { - } - - @Override - public void exitAssociatedField(LLVMIRParser.AssociatedFieldContext ctx) { - } - - @Override - public void enterAttributesField(LLVMIRParser.AttributesFieldContext ctx) { - } - - @Override - public void exitAttributesField(LLVMIRParser.AttributesFieldContext ctx) { - } - - @Override - public void enterBaseTypeField(LLVMIRParser.BaseTypeFieldContext ctx) { - } - - @Override - public void exitBaseTypeField(LLVMIRParser.BaseTypeFieldContext ctx) { - } - - @Override - public void enterChecksumField(LLVMIRParser.ChecksumFieldContext ctx) { - } - - @Override - public void exitChecksumField(LLVMIRParser.ChecksumFieldContext ctx) { - } - - @Override - public void enterChecksumkindField(LLVMIRParser.ChecksumkindFieldContext ctx) { - } - - @Override - public void exitChecksumkindField(LLVMIRParser.ChecksumkindFieldContext ctx) { - } - - @Override - public void enterColumnField(LLVMIRParser.ColumnFieldContext ctx) { - } - - @Override - public void exitColumnField(LLVMIRParser.ColumnFieldContext ctx) { - } - - @Override - public void enterConfigMacrosField(LLVMIRParser.ConfigMacrosFieldContext ctx) { - } - - @Override - public void exitConfigMacrosField(LLVMIRParser.ConfigMacrosFieldContext ctx) { - } - - @Override - public void enterContainingTypeField(LLVMIRParser.ContainingTypeFieldContext ctx) { - } - - @Override - public void exitContainingTypeField(LLVMIRParser.ContainingTypeFieldContext ctx) { - } - - @Override - public void enterCountField(LLVMIRParser.CountFieldContext ctx) { - } - - @Override - public void exitCountField(LLVMIRParser.CountFieldContext ctx) { - } - - @Override - public void enterDebugInfoForProfilingField(LLVMIRParser.DebugInfoForProfilingFieldContext ctx) { - } - - @Override - public void exitDebugInfoForProfilingField(LLVMIRParser.DebugInfoForProfilingFieldContext ctx) { - } - - @Override - public void enterDeclarationField(LLVMIRParser.DeclarationFieldContext ctx) { - } - - @Override - public void exitDeclarationField(LLVMIRParser.DeclarationFieldContext ctx) { - } - - @Override - public void enterDirectoryField(LLVMIRParser.DirectoryFieldContext ctx) { - } - - @Override - public void exitDirectoryField(LLVMIRParser.DirectoryFieldContext ctx) { - } - - @Override - public void enterDiscriminatorField(LLVMIRParser.DiscriminatorFieldContext ctx) { - } - - @Override - public void exitDiscriminatorField(LLVMIRParser.DiscriminatorFieldContext ctx) { - } - - @Override - public void enterDataLocationField(LLVMIRParser.DataLocationFieldContext ctx) { - } - - @Override - public void exitDataLocationField(LLVMIRParser.DataLocationFieldContext ctx) { - } - - @Override - public void enterDiscriminatorIntField(LLVMIRParser.DiscriminatorIntFieldContext ctx) { - } - - @Override - public void exitDiscriminatorIntField(LLVMIRParser.DiscriminatorIntFieldContext ctx) { - } - - @Override - public void enterDwarfAddressSpaceField(LLVMIRParser.DwarfAddressSpaceFieldContext ctx) { - } - - @Override - public void exitDwarfAddressSpaceField(LLVMIRParser.DwarfAddressSpaceFieldContext ctx) { - } - - @Override - public void enterDwoIdField(LLVMIRParser.DwoIdFieldContext ctx) { - } - - @Override - public void exitDwoIdField(LLVMIRParser.DwoIdFieldContext ctx) { - } - - @Override - public void enterElementsField(LLVMIRParser.ElementsFieldContext ctx) { - } - - @Override - public void exitElementsField(LLVMIRParser.ElementsFieldContext ctx) { - } - - @Override - public void enterEmissionKindField(LLVMIRParser.EmissionKindFieldContext ctx) { - } - - @Override - public void exitEmissionKindField(LLVMIRParser.EmissionKindFieldContext ctx) { - } - - @Override - public void enterEncodingField(LLVMIRParser.EncodingFieldContext ctx) { - } - - @Override - public void exitEncodingField(LLVMIRParser.EncodingFieldContext ctx) { - } - - @Override - public void enterEntityField(LLVMIRParser.EntityFieldContext ctx) { - } - - @Override - public void exitEntityField(LLVMIRParser.EntityFieldContext ctx) { - } - - @Override - public void enterEnumsField(LLVMIRParser.EnumsFieldContext ctx) { - } - - @Override - public void exitEnumsField(LLVMIRParser.EnumsFieldContext ctx) { - } - - @Override - public void enterExportSymbolsField(LLVMIRParser.ExportSymbolsFieldContext ctx) { - } - - @Override - public void exitExportSymbolsField(LLVMIRParser.ExportSymbolsFieldContext ctx) { - } - - @Override - public void enterExprField(LLVMIRParser.ExprFieldContext ctx) { - } - - @Override - public void exitExprField(LLVMIRParser.ExprFieldContext ctx) { - } - - @Override - public void enterExtraDataField(LLVMIRParser.ExtraDataFieldContext ctx) { - } - - @Override - public void exitExtraDataField(LLVMIRParser.ExtraDataFieldContext ctx) { - } - - @Override - public void enterFileField(LLVMIRParser.FileFieldContext ctx) { - } - - @Override - public void exitFileField(LLVMIRParser.FileFieldContext ctx) { - } - - @Override - public void enterFilenameField(LLVMIRParser.FilenameFieldContext ctx) { - } - - @Override - public void exitFilenameField(LLVMIRParser.FilenameFieldContext ctx) { - } - - @Override - public void enterFlagsStringField(LLVMIRParser.FlagsStringFieldContext ctx) { - } - - @Override - public void exitFlagsStringField(LLVMIRParser.FlagsStringFieldContext ctx) { - } - - @Override - public void enterGetterField(LLVMIRParser.GetterFieldContext ctx) { - } - - @Override - public void exitGetterField(LLVMIRParser.GetterFieldContext ctx) { - } - - @Override - public void enterGlobalsField(LLVMIRParser.GlobalsFieldContext ctx) { - } - - @Override - public void exitGlobalsField(LLVMIRParser.GlobalsFieldContext ctx) { - } - - @Override - public void enterIdentifierField(LLVMIRParser.IdentifierFieldContext ctx) { - } - - @Override - public void exitIdentifierField(LLVMIRParser.IdentifierFieldContext ctx) { - } - - @Override - public void enterImportsField(LLVMIRParser.ImportsFieldContext ctx) { - } - - @Override - public void exitImportsField(LLVMIRParser.ImportsFieldContext ctx) { - } - - @Override - public void enterIncludePathField(LLVMIRParser.IncludePathFieldContext ctx) { - } - - @Override - public void exitIncludePathField(LLVMIRParser.IncludePathFieldContext ctx) { - } - - @Override - public void enterInlinedAtField(LLVMIRParser.InlinedAtFieldContext ctx) { - } - - @Override - public void exitInlinedAtField(LLVMIRParser.InlinedAtFieldContext ctx) { - } - - @Override - public void enterIsDeclField(LLVMIRParser.IsDeclFieldContext ctx) { - } - - @Override - public void exitIsDeclField(LLVMIRParser.IsDeclFieldContext ctx) { - } - - @Override - public void enterIsDefinitionField(LLVMIRParser.IsDefinitionFieldContext ctx) { - } - - @Override - public void exitIsDefinitionField(LLVMIRParser.IsDefinitionFieldContext ctx) { - } - - @Override - public void enterIsImplicitCodeField(LLVMIRParser.IsImplicitCodeFieldContext ctx) { - } - - @Override - public void exitIsImplicitCodeField(LLVMIRParser.IsImplicitCodeFieldContext ctx) { - } - - @Override - public void enterIsLocalField(LLVMIRParser.IsLocalFieldContext ctx) { - } - - @Override - public void exitIsLocalField(LLVMIRParser.IsLocalFieldContext ctx) { - } - - @Override - public void enterIsOptimizedField(LLVMIRParser.IsOptimizedFieldContext ctx) { - } - - @Override - public void exitIsOptimizedField(LLVMIRParser.IsOptimizedFieldContext ctx) { - } - - @Override - public void enterIsUnsignedField(LLVMIRParser.IsUnsignedFieldContext ctx) { - } - - @Override - public void exitIsUnsignedField(LLVMIRParser.IsUnsignedFieldContext ctx) { - } - - @Override - public void enterApiNotesField(LLVMIRParser.ApiNotesFieldContext ctx) { + public void enterArrayConst(LLVMIRParser.ArrayConstContext ctx) { + transformToken(LLVMIRTokenType.ARRAY, ctx.getStart(), ctx.getStop()); + super.enterArrayConst(ctx); } @Override - public void exitApiNotesField(LLVMIRParser.ApiNotesFieldContext ctx) { + public void enterVectorConst(LLVMIRParser.VectorConstContext ctx) { + transformToken(LLVMIRTokenType.VECTOR, ctx.getStart(), ctx.getStop()); + super.enterVectorConst(ctx); } @Override - public void enterLanguageField(LLVMIRParser.LanguageFieldContext ctx) { + public void enterInlineAsm(LLVMIRParser.InlineAsmContext ctx) { + transformToken(LLVMIRTokenType.ASSEMBLY, ctx.getStart(), ctx.getStop()); + super.enterInlineAsm(ctx); } @Override - public void exitLanguageField(LLVMIRParser.LanguageFieldContext ctx) { + public void enterBitCastExpr(LLVMIRParser.BitCastExprContext ctx) { + transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + super.enterBitCastExpr(ctx); } @Override - public void enterLineField(LLVMIRParser.LineFieldContext ctx) { + public void enterGetElementPtrExpr(LLVMIRParser.GetElementPtrExprContext ctx) { + transformToken(LLVMIRTokenType.GET_ELEMENT_POINTER, ctx.getStart(), ctx.getStop()); + super.enterGetElementPtrExpr(ctx); } @Override - public void exitLineField(LLVMIRParser.LineFieldContext ctx) { + public void enterAddrSpaceCastExpr(LLVMIRParser.AddrSpaceCastExprContext ctx) { + transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + super.enterAddrSpaceCastExpr(ctx); } @Override - public void enterLinkageNameField(LLVMIRParser.LinkageNameFieldContext ctx) { + public void enterIntToPtrExpr(LLVMIRParser.IntToPtrExprContext ctx) { + transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + super.enterIntToPtrExpr(ctx); } @Override - public void exitLinkageNameField(LLVMIRParser.LinkageNameFieldContext ctx) { + public void enterICmpExpr(LLVMIRParser.ICmpExprContext ctx) { + transformToken(LLVMIRTokenType.COMPARISON, ctx.getStart(), ctx.getStop()); + super.enterICmpExpr(ctx); } @Override - public void enterLowerBoundField(LLVMIRParser.LowerBoundFieldContext ctx) { + public void enterFCmpExpr(LLVMIRParser.FCmpExprContext ctx) { + transformToken(LLVMIRTokenType.COMPARISON, ctx.getStart(), ctx.getStop()); + super.enterFCmpExpr(ctx); } @Override - public void exitLowerBoundField(LLVMIRParser.LowerBoundFieldContext ctx) { + public void enterSelectExpr(LLVMIRParser.SelectExprContext ctx) { + transformToken(LLVMIRTokenType.SELECT, ctx.getStart(), ctx.getStop()); + super.enterSelectExpr(ctx); } @Override - public void enterMacrosField(LLVMIRParser.MacrosFieldContext ctx) { + public void enterTruncExpr(LLVMIRParser.TruncExprContext ctx) { + transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + super.enterTruncExpr(ctx); } @Override - public void exitMacrosField(LLVMIRParser.MacrosFieldContext ctx) { + public void enterZExtExpr(LLVMIRParser.ZExtExprContext ctx) { + transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + super.enterZExtExpr(ctx); } @Override - public void enterNameTableKindField(LLVMIRParser.NameTableKindFieldContext ctx) { + public void enterSExtExpr(LLVMIRParser.SExtExprContext ctx) { + transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + super.enterSExtExpr(ctx); } @Override - public void exitNameTableKindField(LLVMIRParser.NameTableKindFieldContext ctx) { + public void enterFpTruncExpr(LLVMIRParser.FpTruncExprContext ctx) { + transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + super.enterFpTruncExpr(ctx); } @Override - public void enterNodesField(LLVMIRParser.NodesFieldContext ctx) { + public void enterFpExtExpr(LLVMIRParser.FpExtExprContext ctx) { + transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + super.enterFpExtExpr(ctx); } @Override - public void exitNodesField(LLVMIRParser.NodesFieldContext ctx) { + public void enterFpToUiExpr(LLVMIRParser.FpToUiExprContext ctx) { + transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + super.enterFpToUiExpr(ctx); } @Override - public void enterOffsetField(LLVMIRParser.OffsetFieldContext ctx) { + public void enterFpToSiExpr(LLVMIRParser.FpToSiExprContext ctx) { + transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + super.enterFpToSiExpr(ctx); } @Override - public void exitOffsetField(LLVMIRParser.OffsetFieldContext ctx) { + public void enterUiToFpExpr(LLVMIRParser.UiToFpExprContext ctx) { + transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + super.enterUiToFpExpr(ctx); } @Override - public void enterProducerField(LLVMIRParser.ProducerFieldContext ctx) { + public void enterSiToFpExpr(LLVMIRParser.SiToFpExprContext ctx) { + transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + super.enterSiToFpExpr(ctx); } @Override - public void exitProducerField(LLVMIRParser.ProducerFieldContext ctx) { + public void enterPtrToIntExpr(LLVMIRParser.PtrToIntExprContext ctx) { + transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + super.enterPtrToIntExpr(ctx); } @Override - public void enterRangesBaseAddressField(LLVMIRParser.RangesBaseAddressFieldContext ctx) { + public void enterExtractElementExpr(LLVMIRParser.ExtractElementExprContext ctx) { + transformToken(LLVMIRTokenType.EXTRACT_ELEM, ctx.getStart(), ctx.getStop()); + super.enterExtractElementExpr(ctx); } @Override - public void exitRangesBaseAddressField(LLVMIRParser.RangesBaseAddressFieldContext ctx) { + public void enterInsertElementExpr(LLVMIRParser.InsertElementExprContext ctx) { + transformToken(LLVMIRTokenType.INSERT_ELEM, ctx.getStart(), ctx.getStop()); + super.enterInsertElementExpr(ctx); } @Override - public void enterRankField(LLVMIRParser.RankFieldContext ctx) { + public void enterShuffleVectorExpr(LLVMIRParser.ShuffleVectorExprContext ctx) { + transformToken(LLVMIRTokenType.SHUFFLE_VEC, ctx.getStart(), ctx.getStop()); + super.enterShuffleVectorExpr(ctx); } @Override - public void exitRankField(LLVMIRParser.RankFieldContext ctx) { + public void enterShlExpr(LLVMIRParser.ShlExprContext ctx) { + transformToken(LLVMIRTokenType.SHIFT, ctx.getStart(), ctx.getStop()); + super.enterShlExpr(ctx); } @Override - public void enterRetainedNodesField(LLVMIRParser.RetainedNodesFieldContext ctx) { + public void enterLShrExpr(LLVMIRParser.LShrExprContext ctx) { + transformToken(LLVMIRTokenType.SHIFT, ctx.getStart(), ctx.getStop()); + super.enterLShrExpr(ctx); } @Override - public void exitRetainedNodesField(LLVMIRParser.RetainedNodesFieldContext ctx) { + public void enterAShrExpr(LLVMIRParser.AShrExprContext ctx) { + transformToken(LLVMIRTokenType.SHIFT, ctx.getStart(), ctx.getStop()); + super.enterAShrExpr(ctx); } @Override - public void enterRetainedTypesField(LLVMIRParser.RetainedTypesFieldContext ctx) { + public void enterAndExpr(LLVMIRParser.AndExprContext ctx) { + transformToken(LLVMIRTokenType.AND, ctx.getStart(), ctx.getStop()); + super.enterAndExpr(ctx); } @Override - public void exitRetainedTypesField(LLVMIRParser.RetainedTypesFieldContext ctx) { + public void enterOrExpr(LLVMIRParser.OrExprContext ctx) { + transformToken(LLVMIRTokenType.OR, ctx.getStart(), ctx.getStop()); + super.enterOrExpr(ctx); } @Override - public void enterRuntimeLangField(LLVMIRParser.RuntimeLangFieldContext ctx) { + public void enterXorExpr(LLVMIRParser.XorExprContext ctx) { + transformToken(LLVMIRTokenType.XOR, ctx.getStart(), ctx.getStop()); + super.enterXorExpr(ctx); } @Override - public void exitRuntimeLangField(LLVMIRParser.RuntimeLangFieldContext ctx) { + public void enterAddExpr(LLVMIRParser.AddExprContext ctx) { + transformToken(LLVMIRTokenType.ADD, ctx.getStart(), ctx.getStop()); + super.enterAddExpr(ctx); } @Override - public void enterRuntimeVersionField(LLVMIRParser.RuntimeVersionFieldContext ctx) { + public void enterSubExpr(LLVMIRParser.SubExprContext ctx) { + transformToken(LLVMIRTokenType.SUB, ctx.getStart(), ctx.getStop()); + super.enterSubExpr(ctx); } @Override - public void exitRuntimeVersionField(LLVMIRParser.RuntimeVersionFieldContext ctx) { + public void enterMulExpr(LLVMIRParser.MulExprContext ctx) { + transformToken(LLVMIRTokenType.MUL, ctx.getStart(), ctx.getStop()); + super.enterMulExpr(ctx); } @Override - public void enterScopeField(LLVMIRParser.ScopeFieldContext ctx) { + public void enterFNegExpr(LLVMIRParser.FNegExprContext ctx) { } @Override - public void exitScopeField(LLVMIRParser.ScopeFieldContext ctx) { + public void enterStoreInst(LLVMIRParser.StoreInstContext ctx) { + transformToken(LLVMIRTokenType.STORE, ctx.getStart(), ctx.getStop()); + super.enterStoreInst(ctx); } @Override - public void enterScopeLineField(LLVMIRParser.ScopeLineFieldContext ctx) { + public void enterFenceInst(LLVMIRParser.FenceInstContext ctx) { + transformToken(LLVMIRTokenType.FENCE, ctx.getStart(), ctx.getStop()); + super.enterFenceInst(ctx); } @Override - public void exitScopeLineField(LLVMIRParser.ScopeLineFieldContext ctx) { + public void enterFNegInst(LLVMIRParser.FNegInstContext ctx) { } @Override - public void enterSdkField(LLVMIRParser.SdkFieldContext ctx) { + public void enterAddInst(LLVMIRParser.AddInstContext ctx) { + transformToken(LLVMIRTokenType.ADD, ctx.getStart(), ctx.getStop()); + super.enterAddInst(ctx); } @Override - public void exitSdkField(LLVMIRParser.SdkFieldContext ctx) { + public void enterFAddInst(LLVMIRParser.FAddInstContext ctx) { + transformToken(LLVMIRTokenType.ADD, ctx.getStart(), ctx.getStop()); + super.enterFAddInst(ctx); } @Override - public void enterSetterField(LLVMIRParser.SetterFieldContext ctx) { + public void enterSubInst(LLVMIRParser.SubInstContext ctx) { + transformToken(LLVMIRTokenType.SUB, ctx.getStart(), ctx.getStop()); + super.enterSubInst(ctx); } @Override - public void exitSetterField(LLVMIRParser.SetterFieldContext ctx) { + public void enterFSubInst(LLVMIRParser.FSubInstContext ctx) { + transformToken(LLVMIRTokenType.SUB, ctx.getStart(), ctx.getStop()); + super.enterFSubInst(ctx); } @Override - public void enterSizeField(LLVMIRParser.SizeFieldContext ctx) { + public void enterMulInst(LLVMIRParser.MulInstContext ctx) { + transformToken(LLVMIRTokenType.MUL, ctx.getStart(), ctx.getStop()); + super.enterMulInst(ctx); } @Override - public void exitSizeField(LLVMIRParser.SizeFieldContext ctx) { + public void enterFMulInst(LLVMIRParser.FMulInstContext ctx) { + transformToken(LLVMIRTokenType.MUL, ctx.getStart(), ctx.getStop()); + super.enterFMulInst(ctx); } @Override - public void enterSourceField(LLVMIRParser.SourceFieldContext ctx) { + public void enterUDivInst(LLVMIRParser.UDivInstContext ctx) { + transformToken(LLVMIRTokenType.DIV, ctx.getStart(), ctx.getStop()); + super.enterUDivInst(ctx); } @Override - public void exitSourceField(LLVMIRParser.SourceFieldContext ctx) { + public void enterSDivInst(LLVMIRParser.SDivInstContext ctx) { + transformToken(LLVMIRTokenType.DIV, ctx.getStart(), ctx.getStop()); + super.enterSDivInst(ctx); } @Override - public void enterSpFlagsField(LLVMIRParser.SpFlagsFieldContext ctx) { + public void enterFDivInst(LLVMIRParser.FDivInstContext ctx) { + transformToken(LLVMIRTokenType.DIV, ctx.getStart(), ctx.getStop()); + super.enterFDivInst(ctx); } @Override - public void exitSpFlagsField(LLVMIRParser.SpFlagsFieldContext ctx) { + public void enterURemInst(LLVMIRParser.URemInstContext ctx) { + transformToken(LLVMIRTokenType.REM, ctx.getStart(), ctx.getStop()); + super.enterURemInst(ctx); } @Override - public void enterSplitDebugFilenameField(LLVMIRParser.SplitDebugFilenameFieldContext ctx) { + public void enterSRemInst(LLVMIRParser.SRemInstContext ctx) { + transformToken(LLVMIRTokenType.REM, ctx.getStart(), ctx.getStop()); + super.enterSRemInst(ctx); } @Override - public void exitSplitDebugFilenameField(LLVMIRParser.SplitDebugFilenameFieldContext ctx) { + public void enterFRemInst(LLVMIRParser.FRemInstContext ctx) { + transformToken(LLVMIRTokenType.REM, ctx.getStart(), ctx.getStop()); + super.enterFRemInst(ctx); } @Override - public void enterSplitDebugInliningField(LLVMIRParser.SplitDebugInliningFieldContext ctx) { + public void enterShlInst(LLVMIRParser.ShlInstContext ctx) { + transformToken(LLVMIRTokenType.SHIFT, ctx.getStart(), ctx.getStop()); + super.enterShlInst(ctx); } @Override - public void exitSplitDebugInliningField(LLVMIRParser.SplitDebugInliningFieldContext ctx) { + public void enterLShrInst(LLVMIRParser.LShrInstContext ctx) { + transformToken(LLVMIRTokenType.SHIFT, ctx.getStart(), ctx.getStop()); + super.enterLShrInst(ctx); } @Override - public void enterStrideField(LLVMIRParser.StrideFieldContext ctx) { + public void enterAShrInst(LLVMIRParser.AShrInstContext ctx) { + transformToken(LLVMIRTokenType.SHIFT, ctx.getStart(), ctx.getStop()); + super.enterAShrInst(ctx); } @Override - public void exitStrideField(LLVMIRParser.StrideFieldContext ctx) { + public void enterAndInst(LLVMIRParser.AndInstContext ctx) { + transformToken(LLVMIRTokenType.AND, ctx.getStart(), ctx.getStop()); + super.enterAndInst(ctx); } @Override - public void enterStringLengthField(LLVMIRParser.StringLengthFieldContext ctx) { + public void enterOrInst(LLVMIRParser.OrInstContext ctx) { + transformToken(LLVMIRTokenType.OR, ctx.getStart(), ctx.getStop()); + super.enterOrInst(ctx); } @Override - public void exitStringLengthField(LLVMIRParser.StringLengthFieldContext ctx) { + public void enterXorInst(LLVMIRParser.XorInstContext ctx) { + transformToken(LLVMIRTokenType.XOR, ctx.getStart(), ctx.getStop()); + super.enterXorInst(ctx); } @Override - public void enterStringLengthExpressionField(LLVMIRParser.StringLengthExpressionFieldContext ctx) { + public void enterExtractElementInst(LLVMIRParser.ExtractElementInstContext ctx) { + transformToken(LLVMIRTokenType.EXTRACT_ELEM, ctx.getStart(), ctx.getStop()); + super.enterExtractElementInst(ctx); } @Override - public void exitStringLengthExpressionField(LLVMIRParser.StringLengthExpressionFieldContext ctx) { + public void enterInsertElementInst(LLVMIRParser.InsertElementInstContext ctx) { + transformToken(LLVMIRTokenType.INSERT_ELEM, ctx.getStart(), ctx.getStop()); + super.enterInsertElementInst(ctx); } @Override - public void enterStringLocationExpressionField(LLVMIRParser.StringLocationExpressionFieldContext ctx) { + public void enterShuffleVectorInst(LLVMIRParser.ShuffleVectorInstContext ctx) { + transformToken(LLVMIRTokenType.SHUFFLE_VEC, ctx.getStart(), ctx.getStop()); + super.enterShuffleVectorInst(ctx); } @Override - public void exitStringLocationExpressionField(LLVMIRParser.StringLocationExpressionFieldContext ctx) { + public void enterExtractValueInst(LLVMIRParser.ExtractValueInstContext ctx) { + transformToken(LLVMIRTokenType.EXTRACT_VAL, ctx.getStart(), ctx.getStop()); + super.enterExtractValueInst(ctx); } @Override - public void enterSysrootField(LLVMIRParser.SysrootFieldContext ctx) { + public void enterInsertValueInst(LLVMIRParser.InsertValueInstContext ctx) { + transformToken(LLVMIRTokenType.INSERT_VAL, ctx.getStart(), ctx.getStop()); + super.enterInsertValueInst(ctx); } @Override - public void exitSysrootField(LLVMIRParser.SysrootFieldContext ctx) { + public void enterAllocaInst(LLVMIRParser.AllocaInstContext ctx) { + transformToken(LLVMIRTokenType.ALLOCATION, ctx.getStart(), ctx.getStop()); + super.enterAllocaInst(ctx); } @Override - public void enterTargetFuncNameField(LLVMIRParser.TargetFuncNameFieldContext ctx) { + public void enterLoadInst(LLVMIRParser.LoadInstContext ctx) { + transformToken(LLVMIRTokenType.LOAD, ctx.getStart(), ctx.getStop()); + super.enterLoadInst(ctx); } @Override - public void exitTargetFuncNameField(LLVMIRParser.TargetFuncNameFieldContext ctx) { + public void enterCmpXchgInst(LLVMIRParser.CmpXchgInstContext ctx) { + transformToken(LLVMIRTokenType.COMPARE_EXCHANGE, ctx.getStart(), ctx.getStop()); + super.enterCmpXchgInst(ctx); } @Override - public void enterTemplateParamsField(LLVMIRParser.TemplateParamsFieldContext ctx) { + public void enterAtomicRMWInst(LLVMIRParser.AtomicRMWInstContext ctx) { + transformToken(LLVMIRTokenType.ATOMIC_CRMW, ctx.getStart(), ctx.getStop()); + super.enterAtomicRMWInst(ctx); } @Override - public void exitTemplateParamsField(LLVMIRParser.TemplateParamsFieldContext ctx) { + public void enterGetElementPtrInst(LLVMIRParser.GetElementPtrInstContext ctx) { + transformToken(LLVMIRTokenType.GET_ELEMENT_POINTER, ctx.getStart(), ctx.getStop()); + super.enterGetElementPtrInst(ctx); } @Override - public void enterThisAdjustmentField(LLVMIRParser.ThisAdjustmentFieldContext ctx) { + public void enterTruncInst(LLVMIRParser.TruncInstContext ctx) { + transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + super.enterTruncInst(ctx); } @Override - public void exitThisAdjustmentField(LLVMIRParser.ThisAdjustmentFieldContext ctx) { + public void enterZExtInst(LLVMIRParser.ZExtInstContext ctx) { + transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + super.enterZExtInst(ctx); } @Override - public void enterThrownTypesField(LLVMIRParser.ThrownTypesFieldContext ctx) { + public void enterSExtInst(LLVMIRParser.SExtInstContext ctx) { + transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + super.enterSExtInst(ctx); } @Override - public void exitThrownTypesField(LLVMIRParser.ThrownTypesFieldContext ctx) { + public void enterFpTruncInst(LLVMIRParser.FpTruncInstContext ctx) { + transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + super.enterFpTruncInst(ctx); } @Override - public void enterTypeMacinfoField(LLVMIRParser.TypeMacinfoFieldContext ctx) { + public void enterFpExtInst(LLVMIRParser.FpExtInstContext ctx) { + transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + super.enterFpExtInst(ctx); } @Override - public void exitTypeMacinfoField(LLVMIRParser.TypeMacinfoFieldContext ctx) { + public void enterFpToUiInst(LLVMIRParser.FpToUiInstContext ctx) { + transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + super.enterFpToUiInst(ctx); } @Override - public void enterTypesField(LLVMIRParser.TypesFieldContext ctx) { + public void enterFpToSiInst(LLVMIRParser.FpToSiInstContext ctx) { + transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + super.enterFpToSiInst(ctx); } @Override - public void exitTypesField(LLVMIRParser.TypesFieldContext ctx) { + public void enterUiToFpInst(LLVMIRParser.UiToFpInstContext ctx) { + transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + super.enterUiToFpInst(ctx); } @Override - public void enterUnitField(LLVMIRParser.UnitFieldContext ctx) { + public void enterSiToFpInst(LLVMIRParser.SiToFpInstContext ctx) { + transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + super.enterSiToFpInst(ctx); } @Override - public void exitUnitField(LLVMIRParser.UnitFieldContext ctx) { + public void enterPtrToIntInst(LLVMIRParser.PtrToIntInstContext ctx) { + transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + super.enterPtrToIntInst(ctx); } @Override - public void enterUpperBoundField(LLVMIRParser.UpperBoundFieldContext ctx) { + public void enterIntToPtrInst(LLVMIRParser.IntToPtrInstContext ctx) { + transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + super.enterIntToPtrInst(ctx); } @Override - public void exitUpperBoundField(LLVMIRParser.UpperBoundFieldContext ctx) { + public void enterBitCastInst(LLVMIRParser.BitCastInstContext ctx) { + transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + super.enterBitCastInst(ctx); } @Override - public void enterValueIntField(LLVMIRParser.ValueIntFieldContext ctx) { + public void enterAddrSpaceCastInst(LLVMIRParser.AddrSpaceCastInstContext ctx) { + transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); + super.enterAddrSpaceCastInst(ctx); } @Override - public void exitValueIntField(LLVMIRParser.ValueIntFieldContext ctx) { + public void enterICmpInst(LLVMIRParser.ICmpInstContext ctx) { + transformToken(LLVMIRTokenType.COMPARISON, ctx.getStart(), ctx.getStop()); + super.enterICmpInst(ctx); } @Override - public void enterValueStringField(LLVMIRParser.ValueStringFieldContext ctx) { + public void enterFCmpInst(LLVMIRParser.FCmpInstContext ctx) { + transformToken(LLVMIRTokenType.COMPARISON, ctx.getStart(), ctx.getStop()); + super.enterFCmpInst(ctx); } @Override - public void exitValueStringField(LLVMIRParser.ValueStringFieldContext ctx) { + public void enterPhiInst(LLVMIRParser.PhiInstContext ctx) { + transformToken(LLVMIRTokenType.PHI, ctx.getStart(), ctx.getStop()); + super.enterPhiInst(ctx); } @Override - public void enterVarField(LLVMIRParser.VarFieldContext ctx) { + public void enterSelectInst(LLVMIRParser.SelectInstContext ctx) { + transformToken(LLVMIRTokenType.SELECT, ctx.getStart(), ctx.getStop()); + super.enterSelectInst(ctx); } @Override - public void exitVarField(LLVMIRParser.VarFieldContext ctx) { + public void enterCallInst(LLVMIRParser.CallInstContext ctx) { + transformToken(LLVMIRTokenType.CALL, ctx.getStart(), ctx.getStop()); + super.enterCallInst(ctx); } @Override - public void enterVirtualIndexField(LLVMIRParser.VirtualIndexFieldContext ctx) { + public void enterLandingPadInst(LLVMIRParser.LandingPadInstContext ctx) { + transformToken(LLVMIRTokenType.LANDING_PAD, ctx.getStart(), ctx.getStop()); + super.enterLandingPadInst(ctx); } @Override - public void exitVirtualIndexField(LLVMIRParser.VirtualIndexFieldContext ctx) { + public void enterCatchPadInst(LLVMIRParser.CatchPadInstContext ctx) { + transformToken(LLVMIRTokenType.CATCH_PAD, ctx.getStart(), ctx.getStop()); + super.enterCatchPadInst(ctx); } @Override - public void enterVirtualityField(LLVMIRParser.VirtualityFieldContext ctx) { + public void enterCleanupPadInst(LLVMIRParser.CleanupPadInstContext ctx) { + transformToken(LLVMIRTokenType.CLEAN_UP_PAD, ctx.getStart(), ctx.getStop()); + super.enterCleanupPadInst(ctx); } @Override - public void exitVirtualityField(LLVMIRParser.VirtualityFieldContext ctx) { + public void enterClause(LLVMIRParser.ClauseContext ctx) { } @Override - public void enterVtableHolderField(LLVMIRParser.VtableHolderFieldContext ctx) { + public void enterAtomicOrdering(LLVMIRParser.AtomicOrderingContext ctx) { } @Override - public void exitVtableHolderField(LLVMIRParser.VtableHolderFieldContext ctx) { + public void exitAtomicOrdering(LLVMIRParser.AtomicOrderingContext ctx) { } @Override - public void enterEveryRule(ParserRuleContext ctx) { + public void enterAtomicOp(LLVMIRParser.AtomicOpContext ctx) { } @Override - public void exitEveryRule(ParserRuleContext ctx) { + public void exitAtomicOp(LLVMIRParser.AtomicOpContext ctx) { } @Override diff --git a/languages/llvmir/src/main/java/de/jplag/llvmir/LLVMIRTokenType.java b/languages/llvmir/src/main/java/de/jplag/llvmir/LLVMIRTokenType.java index ace01d419..9ebcaeb56 100644 --- a/languages/llvmir/src/main/java/de/jplag/llvmir/LLVMIRTokenType.java +++ b/languages/llvmir/src/main/java/de/jplag/llvmir/LLVMIRTokenType.java @@ -23,6 +23,9 @@ public enum LLVMIRTokenType implements TokenType { // Terminator Instructions RETURN("RET"), BRANCH("BR"), + SWITCH("SWITCH"), + CASE("CASE"), + CONDITIONAL_BRANCH("COND_BR"), INVOKE("TRY"), CALL_BRANCH("CALL_BR"), RESUME("THROW"), From e6409fea0288a047b40521672beca8f1c6c30672 Mon Sep 17 00:00:00 2001 From: Niklas Heneka <93838730+NiklasHeneka@users.noreply.github.com> Date: Mon, 24 Jul 2023 23:32:52 +0200 Subject: [PATCH 027/232] Add first code to the test file. --- .../resources/de/jplag/llvmir/Complete.ll | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) diff --git a/languages/llvmir/src/test/resources/de/jplag/llvmir/Complete.ll b/languages/llvmir/src/test/resources/de/jplag/llvmir/Complete.ll index e69de29bb..9c2364a81 100644 --- a/languages/llvmir/src/test/resources/de/jplag/llvmir/Complete.ll +++ b/languages/llvmir/src/test/resources/de/jplag/llvmir/Complete.ll @@ -0,0 +1,81 @@ +; ModuleID = 'Complete.c' +source_filename = "Complete.c" +target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128" +target triple = "arm64-apple-macosx13.0.0" + +%Type_Def = type i8 +@Global_Var = private unnamed_addr constant [13 x i8] c"Hello World!\00", align 1 +@struct.const = private constant {i32 , float } {i32 4, float 17.8} + +%struct.Struct = type { i32 } + +module asm "movl $1, %eax" + +; Function Attrs: noinline nounwind optnone ssp uwtable +define i32 @main() #0 { + %1 = alloca i32, align 4 + %2 = alloca i32, align 4 + %3 = alloca i32, align 4 + %4 = alloca float, align 4 + %5 = alloca %struct.Struct, align 4 + store i32 0, ptr %1, align 4 + store i32 4, ptr %2, align 4 + %6 = load i32, ptr %2, align 4 + %7 = add nsw i32 5, %6 + store i32 %7, ptr %3, align 4 + %8 = load i32, ptr %2, align 4 + %9 = sub nsw i32 5, %8 + store i32 %9, ptr %3, align 4 + %10 = load i32, ptr %2, align 4 + %11 = mul nsw i32 5, %10 + store i32 %11, ptr %3, align 4 + %12 = load i32, ptr %2, align 4 + %13 = sdiv i32 5, %12 + %14 = sitofp i32 %13 to float + store float %14, ptr %4, align 4 + %15 = load i32, ptr %2, align 4 + %16 = srem i32 5, %15 + store i32 %16, ptr %3, align 4 + %17 = load i32, ptr %2, align 4 + %18 = shl i32 %17, 5 + store i32 %18, ptr %3, align 4 + %19 = load i32, ptr %2, align 4 + %20 = and i32 %19, 5 + store i32 %20, ptr %3, align 4 + %21 = load i32, ptr %2, align 4 + %22 = or i32 %21, 5 + store i32 %22, ptr %3, align 4 + %23 = load i32, ptr %2, align 4 + %24 = xor i32 %23, 5 + store i32 %24, ptr %3, align 4 + %25 = call i32 (ptr, ...) @printf(ptr noundef @Global_Var) + %26 = getelementptr inbounds %struct.Struct, ptr %5, i32 0, i32 0 + store i32 1, ptr %26, align 4 + + %vec = shufflevector <4 x i32> %v1, <4 x i32> %v2, <4 x i32> + %vec = insertelement <4 x i32> %vec, i32 1, i32 0 + %elem = extractelement <4 x i32> %vec, i32 0 + %val = extractvalue {i32, float } %agg, 0 + %struc = insertvalue {i32, float} undef, i32 1, 0 + + fence acquire + %old = atomicrmw add ptr %ptr, i32 1 acquire + + %orig = load atomic i32, ptr %ptr unordered, align 4 ; yields i32 + br label %loop + +loop: + %cmp = phi i32 [ %orig, %entry ], [%value_loaded, %loop] + %squared = mul i32 %cmp, %cmp + %val_success = cmpxchg ptr %ptr, i32 %cmp, i32 %squared acq_rel monotonic ; yields { i32, i1 } + %value_loaded = extractvalue { i32, i1 } %val_success, 0 + %success = extractvalue { i32, i1 } %val_success, 1 + br i1 %success, label %done, label %loop + +done: + %false = icmp eq i32 4, 5 + ret i32 0 +} + + +declare i32 @printf(ptr noundef, ...) #1 From 083c09f46d934641d1a584f9a5272e652cfb248f Mon Sep 17 00:00:00 2001 From: Niklas Heneka <93838730+NiklasHeneka@users.noreply.github.com> Date: Mon, 24 Jul 2023 23:33:32 +0200 Subject: [PATCH 028/232] Change some token types and add listener methods. --- .../de/jplag/llvmir/JPlagLLVMIRListener.java | 20 ++++++++++++++++--- .../java/de/jplag/llvmir/LLVMIRTokenType.java | 7 ++++--- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/languages/llvmir/src/main/java/de/jplag/llvmir/JPlagLLVMIRListener.java b/languages/llvmir/src/main/java/de/jplag/llvmir/JPlagLLVMIRListener.java index eebe937c6..150d654e1 100644 --- a/languages/llvmir/src/main/java/de/jplag/llvmir/JPlagLLVMIRListener.java +++ b/languages/llvmir/src/main/java/de/jplag/llvmir/JPlagLLVMIRListener.java @@ -48,6 +48,8 @@ public void enterModuleAsm(LLVMIRParser.ModuleAsmContext ctx) { @Override public void enterTypeDef(LLVMIRParser.TypeDefContext ctx) { + transformToken(LLVMIRTokenType.TYPE_DEFINITION, ctx.getStart(), ctx.getStop()); + super.enterTypeDef(ctx); } @Override @@ -92,13 +94,13 @@ public void exitIndirectSymbol(LLVMIRParser.IndirectSymbolContext ctx) { @Override public void enterFuncBody(LLVMIRParser.FuncBodyContext ctx) { - transformToken(LLVMIRTokenType.FUNCTION_BODY_BEGIN, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.FUNCTION_BODY_BEGIN, ctx.getStart()); super.enterFuncBody(ctx); } @Override public void exitFuncBody(LLVMIRParser.FuncBodyContext ctx) { - transformToken(LLVMIRTokenType.FUNCTION_BODY_END, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.FUNCTION_BODY_END, ctx.getStop()); super.exitFuncBody(ctx); } @@ -198,6 +200,18 @@ public void enterInlineAsm(LLVMIRParser.InlineAsmContext ctx) { super.enterInlineAsm(ctx); } + @Override + public void enterVectorType(LLVMIRParser.VectorTypeContext ctx) { + } + + @Override + public void enterArrayType(LLVMIRParser.ArrayTypeContext ctx) { + } + + @Override + public void enterStructType(LLVMIRParser.StructTypeContext ctx) { + } + @Override public void enterBitCastExpr(LLVMIRParser.BitCastExprContext ctx) { transformToken(LLVMIRTokenType.CONVERSION, ctx.getStart(), ctx.getStop()); @@ -550,7 +564,7 @@ public void enterCmpXchgInst(LLVMIRParser.CmpXchgInstContext ctx) { @Override public void enterAtomicRMWInst(LLVMIRParser.AtomicRMWInstContext ctx) { - transformToken(LLVMIRTokenType.ATOMIC_CRMW, ctx.getStart(), ctx.getStop()); + transformToken(LLVMIRTokenType.ATOMIC_READ_MODIFY_WRITE, ctx.getStart(), ctx.getStop()); super.enterAtomicRMWInst(ctx); } diff --git a/languages/llvmir/src/main/java/de/jplag/llvmir/LLVMIRTokenType.java b/languages/llvmir/src/main/java/de/jplag/llvmir/LLVMIRTokenType.java index 9ebcaeb56..317bf9ab5 100644 --- a/languages/llvmir/src/main/java/de/jplag/llvmir/LLVMIRTokenType.java +++ b/languages/llvmir/src/main/java/de/jplag/llvmir/LLVMIRTokenType.java @@ -14,6 +14,7 @@ public enum LLVMIRTokenType implements TokenType { GLOBAL_VARIABLE("GLOBAL_VAR"), ASSEMBLY("ASM"), + TYPE_DEFINITION("TYPE_DEF"), // Constants STRUCTURE("STRUCT"), @@ -28,9 +29,9 @@ public enum LLVMIRTokenType implements TokenType { CONDITIONAL_BRANCH("COND_BR"), INVOKE("TRY"), CALL_BRANCH("CALL_BR"), - RESUME("THROW"), + RESUME("RESUME"), CATCH_SWITCH("CATCH_SWITCH"), - CATCH_RETURN("CATCH"), + CATCH_RETURN("CATCH_RET"), CLEAN_UP_RETURN("CLEAN_UP_RET"), // Binary Operations @@ -61,7 +62,7 @@ public enum LLVMIRTokenType implements TokenType { STORE("STORE"), FENCE("FENCE"), COMPARE_EXCHANGE("CMP_XCHG"), - ATOMIC_CRMW("ATOMIC_CRMW"), + ATOMIC_READ_MODIFY_WRITE("ATOMIC_RMW"), GET_ELEMENT_POINTER("GET_ELEMENT_PTR"), // Conversion Operations From e7a1173c1ac07c50627e53120f11cf2fb346fff5 Mon Sep 17 00:00:00 2001 From: Alexander Vogt Date: Tue, 25 Jul 2023 10:29:01 +0200 Subject: [PATCH 029/232] add keeping token order --- .../src/main/java/de/jplag/antlr/AbstractAntlrListener.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/language-antlr-utils/src/main/java/de/jplag/antlr/AbstractAntlrListener.java b/language-antlr-utils/src/main/java/de/jplag/antlr/AbstractAntlrListener.java index b80fdde6a..b8a38cd28 100644 --- a/language-antlr-utils/src/main/java/de/jplag/antlr/AbstractAntlrListener.java +++ b/language-antlr-utils/src/main/java/de/jplag/antlr/AbstractAntlrListener.java @@ -25,7 +25,6 @@ public class AbstractAntlrListener implements ParseTreeListener { private final List> startMappings; private final List> endMappings; - private final List> rangeMappings; private final List terminalMapping; @@ -46,7 +45,6 @@ public AbstractAntlrListener(TokenCollector collector, File currentFile, boolean this.startMappings = new ArrayList<>(); this.endMappings = new ArrayList<>(); - this.rangeMappings = new ArrayList<>(); this.terminalMapping = new ArrayList<>(); @@ -78,8 +76,6 @@ public void visitErrorNode(ErrorNode errorNode) { @Override public void enterEveryRule(ParserRuleContext rule) { this.startMappings.stream().filter(mapping -> mapping.matches(rule)).forEach(mapping -> mapping.createToken(rule, variableRegistry)); - - this.rangeMappings.stream().filter(mapping -> mapping.matches(rule)).forEach(mapping -> mapping.createToken(rule, variableRegistry)); } @Override @@ -163,7 +159,7 @@ protected ContextTokenBuilder mapRange(Class @SuppressWarnings("unchecked") protected ContextTokenBuilder mapRange(Class antlrType, TokenType jplagType, Predicate condition) { ContextTokenBuilder builder = initTypeBuilder(antlrType, jplagType, condition, ContextTokenBuilderType.RANGE); - this.rangeMappings.add((ContextTokenBuilder) builder); + this.startMappings.add((ContextTokenBuilder) builder); return builder; } From 597d0fc181d213c0acc1d09c96579fa4da1b37d3 Mon Sep 17 00:00:00 2001 From: Alexander Milster Date: Tue, 25 Jul 2023 13:01:33 +0200 Subject: [PATCH 030/232] Updated the java tests to use the new test framework --- .../java/TokenGeneratingTreeScanner.java | 8 +-- .../jplag/java/AbstractJavaLanguageTest.java | 54 ------------------- .../java/de/jplag/java/JavaBlockTest.java | 33 ------------ .../java/de/jplag/java/JavaIfElseTest.java | 39 -------------- .../java/de/jplag/java/JavaLanguageTest.java | 31 +++++++++++ .../test/java/de/jplag/java/JavaTryTest.java | 20 ------- .../{ => de/jplag}/java/Compact.java | 0 .../resources/{ => de/jplag}/java/IfElse.java | 0 .../{ => de/jplag}/java/IfElseIf.java | 0 .../resources/{ => de/jplag}/java/IfIf.java | 0 .../{ => de/jplag}/java/IfWithBraces.java | 0 .../{ => de/jplag}/java/IfWithoutBraces.java | 0 .../resources/{ => de/jplag}/java/Try.java | 0 .../{ => de/jplag}/java/TryWithResource.java | 0 .../{ => de/jplag}/java/Verbose.java | 0 15 files changed, 35 insertions(+), 150 deletions(-) delete mode 100644 languages/java/src/test/java/de/jplag/java/AbstractJavaLanguageTest.java delete mode 100644 languages/java/src/test/java/de/jplag/java/JavaBlockTest.java delete mode 100644 languages/java/src/test/java/de/jplag/java/JavaIfElseTest.java create mode 100644 languages/java/src/test/java/de/jplag/java/JavaLanguageTest.java delete mode 100644 languages/java/src/test/java/de/jplag/java/JavaTryTest.java rename languages/java/src/test/resources/{ => de/jplag}/java/Compact.java (100%) rename languages/java/src/test/resources/{ => de/jplag}/java/IfElse.java (100%) rename languages/java/src/test/resources/{ => de/jplag}/java/IfElseIf.java (100%) rename languages/java/src/test/resources/{ => de/jplag}/java/IfIf.java (100%) rename languages/java/src/test/resources/{ => de/jplag}/java/IfWithBraces.java (100%) rename languages/java/src/test/resources/{ => de/jplag}/java/IfWithoutBraces.java (100%) rename languages/java/src/test/resources/{ => de/jplag}/java/Try.java (100%) rename languages/java/src/test/resources/{ => de/jplag}/java/TryWithResource.java (100%) rename languages/java/src/test/resources/{ => de/jplag}/java/Verbose.java (100%) diff --git a/languages/java/src/main/java/de/jplag/java/TokenGeneratingTreeScanner.java b/languages/java/src/main/java/de/jplag/java/TokenGeneratingTreeScanner.java index 6dfca328a..079050c24 100644 --- a/languages/java/src/main/java/de/jplag/java/TokenGeneratingTreeScanner.java +++ b/languages/java/src/main/java/de/jplag/java/TokenGeneratingTreeScanner.java @@ -66,9 +66,9 @@ final class TokenGeneratingTreeScanner extends TreeScanner { private final SourcePositions positions; private final CompilationUnitTree ast; - private List parsingExceptions = new ArrayList<>(); + private final List parsingExceptions = new ArrayList<>(); - private VariableRegistry variableRegistry; + private final VariableRegistry variableRegistry; private static final Set IMMUTABLES = Set.of( // from https://medium.com/@bpnorlander/java-understanding-primitive-types-and-wrapper-objects-a6798fb2afe9 @@ -292,7 +292,6 @@ public Void visitTry(TryTree node, Void unused) { scan(node.getResources(), null); scan(node.getBlock(), null); long end = positions.getEndPosition(ast, node); - addToken(JavaTokenType.J_TRY_END, end, 1, CodeSemantics.createControl()); scan(node.getCatches(), null); if (node.getFinallyBlock() != null) { start = positions.getStartPosition(ast, node.getFinallyBlock()); @@ -301,6 +300,7 @@ public Void visitTry(TryTree node, Void unused) { end = positions.getEndPosition(ast, node.getFinallyBlock()); addToken(JavaTokenType.J_FINALLY_END, end, 1, CodeSemantics.createControl()); } + addToken(JavaTokenType.J_TRY_END, end, 1, CodeSemantics.createControl()); return null; } @@ -372,7 +372,7 @@ public Void visitThrow(ThrowTree node, Void unused) { @Override public Void visitNewClass(NewClassTree node, Void unused) { long start = positions.getStartPosition(ast, node); - if (node.getTypeArguments().size() > 0) { + if (!node.getTypeArguments().isEmpty()) { addToken(JavaTokenType.J_GENERIC, start, 3 + node.getIdentifier().toString().length(), new CodeSemantics()); } addToken(JavaTokenType.J_NEWCLASS, start, 3, new CodeSemantics()); diff --git a/languages/java/src/test/java/de/jplag/java/AbstractJavaLanguageTest.java b/languages/java/src/test/java/de/jplag/java/AbstractJavaLanguageTest.java deleted file mode 100644 index 77a25c789..000000000 --- a/languages/java/src/test/java/de/jplag/java/AbstractJavaLanguageTest.java +++ /dev/null @@ -1,54 +0,0 @@ -package de.jplag.java; - -import static org.junit.jupiter.api.Assertions.assertTrue; - -import java.io.File; -import java.nio.file.Path; -import java.util.List; -import java.util.Set; - -import org.junit.jupiter.api.BeforeEach; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import de.jplag.ParsingException; -import de.jplag.Token; -import de.jplag.TokenPrinter; -import de.jplag.TokenType; - -/** - * Basic test class for testing the Java language module. - */ -public abstract class AbstractJavaLanguageTest { - - private static final Path BASE_PATH = Path.of("src", "test", "resources", "java"); - private static final String LOG_MESSAGE = "Tokens of {}: {}"; - private final Logger logger = LoggerFactory.getLogger(JavaBlockTest.class); - private de.jplag.Language language; - protected File baseDirectory; - - /** - * Sets up the base directory and the language module. - */ - @BeforeEach - void setUp() { - language = new JavaLanguage(); - baseDirectory = BASE_PATH.toFile(); - assertTrue(baseDirectory.exists(), "Could not find base directory!"); - } - - /** - * Parses a java file in the {@link AbstractJavaLanguageTest#baseDirectory} and returns the list of token types. - * @param fileName is the name of the file to parse. - * @return the token types. - * @throws ParsingException if parsing fails. - */ - protected List parseJavaFile(String fileName) throws ParsingException { - List parsedTokens = language.parse(Set.of(new File(baseDirectory, fileName))); - List tokenTypes = parsedTokens.stream().map(Token::getType).toList(); - logger.info(LOG_MESSAGE, fileName, tokenTypes); - logger.info(TokenPrinter.printTokens(parsedTokens, BASE_PATH.toAbsolutePath().toFile())); - return tokenTypes; - } - -} \ No newline at end of file diff --git a/languages/java/src/test/java/de/jplag/java/JavaBlockTest.java b/languages/java/src/test/java/de/jplag/java/JavaBlockTest.java deleted file mode 100644 index 57f52c704..000000000 --- a/languages/java/src/test/java/de/jplag/java/JavaBlockTest.java +++ /dev/null @@ -1,33 +0,0 @@ -package de.jplag.java; - -import static org.junit.jupiter.api.Assertions.assertIterableEquals; - -import java.util.stream.Stream; - -import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.Arguments; -import org.junit.jupiter.params.provider.MethodSource; - -import de.jplag.ParsingException; - -/** - * Test cases regarding the extraction from implicit vs. explicit blocks in Java code. - */ -class JavaBlockTest extends AbstractJavaLanguageTest { - @ParameterizedTest - @MethodSource("provideClassPairs") - @DisplayName("Test pairs of classes with explicit vs. implicit blocks.") - void testJavaClassPair(String fileName1, String fileName2) throws ParsingException { - assertIterableEquals(parseJavaFile(fileName1), parseJavaFile(fileName2)); - } - - /** - * Argument source for the test case {@link testJavaClassPair(String, String)). - */ - private static Stream provideClassPairs() { - return Stream.of(Arguments.of("IfWithBraces.java", "IfWithoutBraces.java"), // just if conditions - Arguments.of("Verbose.java", "Compact.java")); // complex case with different blocks - } - -} diff --git a/languages/java/src/test/java/de/jplag/java/JavaIfElseTest.java b/languages/java/src/test/java/de/jplag/java/JavaIfElseTest.java deleted file mode 100644 index 62e8be0a5..000000000 --- a/languages/java/src/test/java/de/jplag/java/JavaIfElseTest.java +++ /dev/null @@ -1,39 +0,0 @@ - -package de.jplag.java; - -import static org.junit.jupiter.api.Assertions.assertIterableEquals; - -import java.util.stream.Stream; - -import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.Arguments; -import org.junit.jupiter.params.provider.MethodSource; - -import de.jplag.ParsingException; - -/** - * Test cases regarding the extraction from if and else conditions. - */ -class JavaIfElseTest extends AbstractJavaLanguageTest { - private static final String IF_ELSE_IF = "IfElseIf.java"; - private static final String IF_IF = "IfIf.java"; - private static final String IF_ELSE = "IfElse.java"; - - @ParameterizedTest - @MethodSource("provideClassPairs") - @DisplayName("Test difference between if-else, if-if and if-else-if.") - void testJavaClassPair(String fileName1, String fileName2) throws ParsingException { - assertIterableEquals(parseJavaFile(fileName1), parseJavaFile(fileName2)); - } - - /** - * Argument source for the test case {@link testJavaClassPair(String, String)). - */ - private static Stream provideClassPairs() { - return Stream.of(Arguments.of(IF_ELSE, IF_IF), // if instead of else - Arguments.of(IF_ELSE, IF_ELSE_IF),// add if to else - Arguments.of(IF_ELSE_IF, IF_IF)); // removal of else - } - -} diff --git a/languages/java/src/test/java/de/jplag/java/JavaLanguageTest.java b/languages/java/src/test/java/de/jplag/java/JavaLanguageTest.java new file mode 100644 index 000000000..57a011e57 --- /dev/null +++ b/languages/java/src/test/java/de/jplag/java/JavaLanguageTest.java @@ -0,0 +1,31 @@ +package de.jplag.java; + +import de.jplag.testutils.LanguageModuleTest; +import de.jplag.testutils.datacollector.TestDataCollector; +import de.jplag.testutils.datacollector.TestSourceIgnoredLinesCollector; + +import static de.jplag.java.JavaTokenType.*; + +public class JavaLanguageTest extends LanguageModuleTest { + public JavaLanguageTest() { + super(new JavaLanguage(), JavaTokenType.class); + } + + @Override + protected void collectTestData(TestDataCollector collector) { + collector.testFile("IfElse.java", "IfIf.java", "IfElseIf.java").testSourceCoverage().testTokenSequence(J_IMPORT, J_CLASS_BEGIN, J_METHOD_BEGIN, J_VARDEF, J_IF_BEGIN, J_THROW, J_NEWCLASS, J_IF_END, J_IF_BEGIN, J_APPLY, J_APPLY, J_IF_END, J_METHOD_END, J_CLASS_END); + collector.testFile("IfWithBraces.java", "IfWithoutBraces.java").testSourceCoverage().testTokenSequence(J_PACKAGE, J_IMPORT, J_CLASS_BEGIN, J_METHOD_BEGIN, J_VARDEF, J_IF_BEGIN, J_THROW, J_NEWCLASS, J_IF_END, J_IF_BEGIN, J_APPLY, J_APPLY, J_IF_END, J_IF_BEGIN, J_APPLY, J_IF_END, J_METHOD_END, J_CLASS_END); + collector.testFile("Verbose.java", "Compact.java").testSourceCoverage().testTokenSequence(J_PACKAGE, J_IMPORT, J_CLASS_BEGIN, J_METHOD_BEGIN, J_VARDEF, J_VARDEF, J_IF_BEGIN, J_APPLY, J_RETURN, J_IF_END, J_VARDEF, J_FOR_BEGIN, J_VARDEF, J_APPLY, J_ASSIGN, J_IF_BEGIN, J_APPLY, J_APPLY, J_ASSIGN, J_IF_END, J_FOR_END, J_IF_BEGIN, J_APPLY, J_ASSIGN, J_IF_END, J_IF_BEGIN, J_APPLY, J_APPLY, J_ASSIGN, J_IF_END, J_RETURN, J_METHOD_END, J_CLASS_END); + collector.testFile("Try.java", "TryWithResource.java").testSourceCoverage().testTokenSequence(J_PACKAGE, J_IMPORT, J_IMPORT, J_IMPORT, J_CLASS_BEGIN, J_METHOD_BEGIN, J_VARDEF, J_APPLY, J_NEWCLASS, J_METHOD_END, J_METHOD_BEGIN, J_VARDEF, J_VARDEF, J_TRY_BEGIN, J_VARDEF, J_ASSIGN, J_NEWCLASS, J_NEWCLASS, J_WHILE_BEGIN, J_APPLY, J_APPLY, J_APPLY, J_WHILE_END, J_CATCH_BEGIN, J_VARDEF, J_APPLY, J_CATCH_END, J_FINALLY_BEGIN, J_IF_BEGIN, J_APPLY, J_IF_END, J_FINALLY_END, J_TRY_END, J_METHOD_END, J_CLASS_END); + + collector.testFile("CLI.java").testSourceCoverage().testContainedTokens(J_TRY_END, J_IMPORT, J_VARDEF, J_FOR_BEGIN, J_ARRAY_INIT_BEGIN, J_IF_BEGIN, J_CATCH_END, J_COND, J_ARRAY_INIT_END, J_METHOD_BEGIN, J_TRY_BEGIN, J_CLASS_END, J_RETURN, J_ASSIGN, J_METHOD_END, J_IF_END, J_CLASS_BEGIN, J_NEWARRAY, J_PACKAGE, J_APPLY, J_FOR_END, J_THROW, J_NEWCLASS, J_CATCH_BEGIN); + } + + @Override + protected void configureIgnoredLines(TestSourceIgnoredLinesCollector collector) { + collector.ignoreLinesByPrefix("//"); + collector.ignoreMultipleLines("/*", "*/"); + collector.ignoreLinesByPrefix("})"); + collector.ignoreByCondition(line -> line.contains("else") && !line.contains("if")); + } +} diff --git a/languages/java/src/test/java/de/jplag/java/JavaTryTest.java b/languages/java/src/test/java/de/jplag/java/JavaTryTest.java deleted file mode 100644 index c5ee683d9..000000000 --- a/languages/java/src/test/java/de/jplag/java/JavaTryTest.java +++ /dev/null @@ -1,20 +0,0 @@ - -package de.jplag.java; - -import static org.junit.jupiter.api.Assertions.assertIterableEquals; - -import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.api.Test; - -import de.jplag.ParsingException; - -/** - * Test cases regarding the extraction from try vs. try with resource. - */ -class JavaTryTest extends AbstractJavaLanguageTest { - @Test - @DisplayName("Test difference between try block and try-with-resource block.") - void testJavaClassPair() throws ParsingException { - assertIterableEquals(parseJavaFile("Try.java"), parseJavaFile("TryWithResource.java")); - } -} diff --git a/languages/java/src/test/resources/java/Compact.java b/languages/java/src/test/resources/de/jplag/java/Compact.java similarity index 100% rename from languages/java/src/test/resources/java/Compact.java rename to languages/java/src/test/resources/de/jplag/java/Compact.java diff --git a/languages/java/src/test/resources/java/IfElse.java b/languages/java/src/test/resources/de/jplag/java/IfElse.java similarity index 100% rename from languages/java/src/test/resources/java/IfElse.java rename to languages/java/src/test/resources/de/jplag/java/IfElse.java diff --git a/languages/java/src/test/resources/java/IfElseIf.java b/languages/java/src/test/resources/de/jplag/java/IfElseIf.java similarity index 100% rename from languages/java/src/test/resources/java/IfElseIf.java rename to languages/java/src/test/resources/de/jplag/java/IfElseIf.java diff --git a/languages/java/src/test/resources/java/IfIf.java b/languages/java/src/test/resources/de/jplag/java/IfIf.java similarity index 100% rename from languages/java/src/test/resources/java/IfIf.java rename to languages/java/src/test/resources/de/jplag/java/IfIf.java diff --git a/languages/java/src/test/resources/java/IfWithBraces.java b/languages/java/src/test/resources/de/jplag/java/IfWithBraces.java similarity index 100% rename from languages/java/src/test/resources/java/IfWithBraces.java rename to languages/java/src/test/resources/de/jplag/java/IfWithBraces.java diff --git a/languages/java/src/test/resources/java/IfWithoutBraces.java b/languages/java/src/test/resources/de/jplag/java/IfWithoutBraces.java similarity index 100% rename from languages/java/src/test/resources/java/IfWithoutBraces.java rename to languages/java/src/test/resources/de/jplag/java/IfWithoutBraces.java diff --git a/languages/java/src/test/resources/java/Try.java b/languages/java/src/test/resources/de/jplag/java/Try.java similarity index 100% rename from languages/java/src/test/resources/java/Try.java rename to languages/java/src/test/resources/de/jplag/java/Try.java diff --git a/languages/java/src/test/resources/java/TryWithResource.java b/languages/java/src/test/resources/de/jplag/java/TryWithResource.java similarity index 100% rename from languages/java/src/test/resources/java/TryWithResource.java rename to languages/java/src/test/resources/de/jplag/java/TryWithResource.java diff --git a/languages/java/src/test/resources/java/Verbose.java b/languages/java/src/test/resources/de/jplag/java/Verbose.java similarity index 100% rename from languages/java/src/test/resources/java/Verbose.java rename to languages/java/src/test/resources/de/jplag/java/Verbose.java From cda7a66e1ddf484e70a42fac63eee06c53603b83 Mon Sep 17 00:00:00 2001 From: Alexander Milster Date: Tue, 25 Jul 2023 13:02:45 +0200 Subject: [PATCH 031/232] Spotless --- .../java/de/jplag/java/JavaLanguageTest.java | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/languages/java/src/test/java/de/jplag/java/JavaLanguageTest.java b/languages/java/src/test/java/de/jplag/java/JavaLanguageTest.java index 57a011e57..a68f85a3e 100644 --- a/languages/java/src/test/java/de/jplag/java/JavaLanguageTest.java +++ b/languages/java/src/test/java/de/jplag/java/JavaLanguageTest.java @@ -1,11 +1,11 @@ package de.jplag.java; +import static de.jplag.java.JavaTokenType.*; + import de.jplag.testutils.LanguageModuleTest; import de.jplag.testutils.datacollector.TestDataCollector; import de.jplag.testutils.datacollector.TestSourceIgnoredLinesCollector; -import static de.jplag.java.JavaTokenType.*; - public class JavaLanguageTest extends LanguageModuleTest { public JavaLanguageTest() { super(new JavaLanguage(), JavaTokenType.class); @@ -13,12 +13,24 @@ public JavaLanguageTest() { @Override protected void collectTestData(TestDataCollector collector) { - collector.testFile("IfElse.java", "IfIf.java", "IfElseIf.java").testSourceCoverage().testTokenSequence(J_IMPORT, J_CLASS_BEGIN, J_METHOD_BEGIN, J_VARDEF, J_IF_BEGIN, J_THROW, J_NEWCLASS, J_IF_END, J_IF_BEGIN, J_APPLY, J_APPLY, J_IF_END, J_METHOD_END, J_CLASS_END); - collector.testFile("IfWithBraces.java", "IfWithoutBraces.java").testSourceCoverage().testTokenSequence(J_PACKAGE, J_IMPORT, J_CLASS_BEGIN, J_METHOD_BEGIN, J_VARDEF, J_IF_BEGIN, J_THROW, J_NEWCLASS, J_IF_END, J_IF_BEGIN, J_APPLY, J_APPLY, J_IF_END, J_IF_BEGIN, J_APPLY, J_IF_END, J_METHOD_END, J_CLASS_END); - collector.testFile("Verbose.java", "Compact.java").testSourceCoverage().testTokenSequence(J_PACKAGE, J_IMPORT, J_CLASS_BEGIN, J_METHOD_BEGIN, J_VARDEF, J_VARDEF, J_IF_BEGIN, J_APPLY, J_RETURN, J_IF_END, J_VARDEF, J_FOR_BEGIN, J_VARDEF, J_APPLY, J_ASSIGN, J_IF_BEGIN, J_APPLY, J_APPLY, J_ASSIGN, J_IF_END, J_FOR_END, J_IF_BEGIN, J_APPLY, J_ASSIGN, J_IF_END, J_IF_BEGIN, J_APPLY, J_APPLY, J_ASSIGN, J_IF_END, J_RETURN, J_METHOD_END, J_CLASS_END); - collector.testFile("Try.java", "TryWithResource.java").testSourceCoverage().testTokenSequence(J_PACKAGE, J_IMPORT, J_IMPORT, J_IMPORT, J_CLASS_BEGIN, J_METHOD_BEGIN, J_VARDEF, J_APPLY, J_NEWCLASS, J_METHOD_END, J_METHOD_BEGIN, J_VARDEF, J_VARDEF, J_TRY_BEGIN, J_VARDEF, J_ASSIGN, J_NEWCLASS, J_NEWCLASS, J_WHILE_BEGIN, J_APPLY, J_APPLY, J_APPLY, J_WHILE_END, J_CATCH_BEGIN, J_VARDEF, J_APPLY, J_CATCH_END, J_FINALLY_BEGIN, J_IF_BEGIN, J_APPLY, J_IF_END, J_FINALLY_END, J_TRY_END, J_METHOD_END, J_CLASS_END); + collector.testFile("IfElse.java", "IfIf.java", "IfElseIf.java").testSourceCoverage().testTokenSequence(J_IMPORT, J_CLASS_BEGIN, + J_METHOD_BEGIN, J_VARDEF, J_IF_BEGIN, J_THROW, J_NEWCLASS, J_IF_END, J_IF_BEGIN, J_APPLY, J_APPLY, J_IF_END, J_METHOD_END, + J_CLASS_END); + collector.testFile("IfWithBraces.java", "IfWithoutBraces.java").testSourceCoverage().testTokenSequence(J_PACKAGE, J_IMPORT, J_CLASS_BEGIN, + J_METHOD_BEGIN, J_VARDEF, J_IF_BEGIN, J_THROW, J_NEWCLASS, J_IF_END, J_IF_BEGIN, J_APPLY, J_APPLY, J_IF_END, J_IF_BEGIN, J_APPLY, + J_IF_END, J_METHOD_END, J_CLASS_END); + collector.testFile("Verbose.java", "Compact.java").testSourceCoverage().testTokenSequence(J_PACKAGE, J_IMPORT, J_CLASS_BEGIN, J_METHOD_BEGIN, + J_VARDEF, J_VARDEF, J_IF_BEGIN, J_APPLY, J_RETURN, J_IF_END, J_VARDEF, J_FOR_BEGIN, J_VARDEF, J_APPLY, J_ASSIGN, J_IF_BEGIN, J_APPLY, + J_APPLY, J_ASSIGN, J_IF_END, J_FOR_END, J_IF_BEGIN, J_APPLY, J_ASSIGN, J_IF_END, J_IF_BEGIN, J_APPLY, J_APPLY, J_ASSIGN, J_IF_END, + J_RETURN, J_METHOD_END, J_CLASS_END); + collector.testFile("Try.java", "TryWithResource.java").testSourceCoverage().testTokenSequence(J_PACKAGE, J_IMPORT, J_IMPORT, J_IMPORT, + J_CLASS_BEGIN, J_METHOD_BEGIN, J_VARDEF, J_APPLY, J_NEWCLASS, J_METHOD_END, J_METHOD_BEGIN, J_VARDEF, J_VARDEF, J_TRY_BEGIN, J_VARDEF, + J_ASSIGN, J_NEWCLASS, J_NEWCLASS, J_WHILE_BEGIN, J_APPLY, J_APPLY, J_APPLY, J_WHILE_END, J_CATCH_BEGIN, J_VARDEF, J_APPLY, + J_CATCH_END, J_FINALLY_BEGIN, J_IF_BEGIN, J_APPLY, J_IF_END, J_FINALLY_END, J_TRY_END, J_METHOD_END, J_CLASS_END); - collector.testFile("CLI.java").testSourceCoverage().testContainedTokens(J_TRY_END, J_IMPORT, J_VARDEF, J_FOR_BEGIN, J_ARRAY_INIT_BEGIN, J_IF_BEGIN, J_CATCH_END, J_COND, J_ARRAY_INIT_END, J_METHOD_BEGIN, J_TRY_BEGIN, J_CLASS_END, J_RETURN, J_ASSIGN, J_METHOD_END, J_IF_END, J_CLASS_BEGIN, J_NEWARRAY, J_PACKAGE, J_APPLY, J_FOR_END, J_THROW, J_NEWCLASS, J_CATCH_BEGIN); + collector.testFile("CLI.java").testSourceCoverage().testContainedTokens(J_TRY_END, J_IMPORT, J_VARDEF, J_FOR_BEGIN, J_ARRAY_INIT_BEGIN, + J_IF_BEGIN, J_CATCH_END, J_COND, J_ARRAY_INIT_END, J_METHOD_BEGIN, J_TRY_BEGIN, J_CLASS_END, J_RETURN, J_ASSIGN, J_METHOD_END, + J_IF_END, J_CLASS_BEGIN, J_NEWARRAY, J_PACKAGE, J_APPLY, J_FOR_END, J_THROW, J_NEWCLASS, J_CATCH_BEGIN); } @Override From a707bced32db07b4814d46903ee3d5ea73764498 Mon Sep 17 00:00:00 2001 From: Alex | Kronox Date: Tue, 25 Jul 2023 17:22:58 +0200 Subject: [PATCH 032/232] rename --- report-viewer/src/components/DistributionDiagram.vue | 8 ++++---- report-viewer/src/model/Distribution.ts | 6 +++--- report-viewer/src/model/PercentileDistribution.ts | 2 +- report-viewer/src/model/TenthPercentileDistribution.ts | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/report-viewer/src/components/DistributionDiagram.vue b/report-viewer/src/components/DistributionDiagram.vue index 55a0d82d4..3cc12413c 100644 --- a/report-viewer/src/components/DistributionDiagram.vue +++ b/report-viewer/src/components/DistributionDiagram.vue @@ -23,7 +23,7 @@ const props = defineProps({ } }) -const maxVal = ref(Math.max(...props.distribution.getTenthPercentileFormattedValues())) +const maxVal = ref(Math.max(...props.distribution.splitIntoTenBuckets())) const labels = [ '91-100%', '81-90%', @@ -51,7 +51,7 @@ const chartData = ref({ datasets: [ { ...dataSetStyle.value, - data: props.distribution.getTenthPercentileFormattedValues() + data: props.distribution.splitIntoTenBuckets() } ] }) @@ -109,12 +109,12 @@ watch( datasets: [ { ...dataSetStyle.value, - data: val.getTenthPercentileFormattedValues() + data: val.splitIntoTenBuckets() } ] } - maxVal.value = Math.max(...val.getTenthPercentileFormattedValues()) + maxVal.value = Math.max(...val.splitIntoTenBuckets()) options.value.scales.x.suggestedMax = maxVal.value + 5 } ) diff --git a/report-viewer/src/model/Distribution.ts b/report-viewer/src/model/Distribution.ts index fdfb87015..622f334a5 100644 --- a/report-viewer/src/model/Distribution.ts +++ b/report-viewer/src/model/Distribution.ts @@ -1,12 +1,12 @@ export default abstract class Distribution { - protected readonly _distribution: Array + protected readonly _distribution: number[] - constructor(distribution: Array) { + constructor(distribution: number[]) { this._distribution = distribution } /** * Returns the distribution summed at every tenth percentile */ - public abstract getTenthPercentileFormattedValues(): Array + public abstract splitIntoTenBuckets(): number[] } diff --git a/report-viewer/src/model/PercentileDistribution.ts b/report-viewer/src/model/PercentileDistribution.ts index f28086802..bdfb70274 100644 --- a/report-viewer/src/model/PercentileDistribution.ts +++ b/report-viewer/src/model/PercentileDistribution.ts @@ -8,7 +8,7 @@ export default class HundredValueDistribution extends Distribution { /** * Returns the distribution summed at every tenth percentile */ - public getTenthPercentileFormattedValues(): number[] { + public splitIntoTenBuckets(): number[] { const tenValueArray = new Array(10).fill(0) for (let i = 0; i < 100; i++) { tenValueArray[Math.floor(i / 10)] += this._distribution[i] diff --git a/report-viewer/src/model/TenthPercentileDistribution.ts b/report-viewer/src/model/TenthPercentileDistribution.ts index 85282d247..c0305acc9 100644 --- a/report-viewer/src/model/TenthPercentileDistribution.ts +++ b/report-viewer/src/model/TenthPercentileDistribution.ts @@ -5,7 +5,7 @@ export default class TenValueDistribution extends Distribution { super(distribution) } - public getTenthPercentileFormattedValues(): number[] { + public splitIntoTenBuckets(): number[] { return this._distribution } } From 1435002ddde2eb657cb646ccee912f145d52abb2 Mon Sep 17 00:00:00 2001 From: Alex | Kronox Date: Tue, 25 Jul 2023 19:00:59 +0200 Subject: [PATCH 033/232] rename --- .../{PercentileDistribution.ts => HundredValueDistribution.ts} | 0 .../{TenthPercentileDistribution.ts => TenValueDistribution.ts} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename report-viewer/src/model/{PercentileDistribution.ts => HundredValueDistribution.ts} (100%) rename report-viewer/src/model/{TenthPercentileDistribution.ts => TenValueDistribution.ts} (100%) diff --git a/report-viewer/src/model/PercentileDistribution.ts b/report-viewer/src/model/HundredValueDistribution.ts similarity index 100% rename from report-viewer/src/model/PercentileDistribution.ts rename to report-viewer/src/model/HundredValueDistribution.ts diff --git a/report-viewer/src/model/TenthPercentileDistribution.ts b/report-viewer/src/model/TenValueDistribution.ts similarity index 100% rename from report-viewer/src/model/TenthPercentileDistribution.ts rename to report-viewer/src/model/TenValueDistribution.ts From 153423d0ab333f6980166d5e948ce0d25658262f Mon Sep 17 00:00:00 2001 From: Alex | Kronox Date: Tue, 25 Jul 2023 19:11:35 +0200 Subject: [PATCH 034/232] overview factory tests --- .../src/model/factories/OverviewFactory.ts | 4 +- .../tests/unit/model/OverviewFactory.test.ts | 178 ++++++++++++++++++ .../tests/unit/model/ValidNewOverview.json | 79 ++++++++ .../tests/unit/model/ValidOldOverview.json | 56 ++++++ report-viewer/vitest.config.ts | 5 + 5 files changed, 320 insertions(+), 2 deletions(-) create mode 100644 report-viewer/tests/unit/model/OverviewFactory.test.ts create mode 100644 report-viewer/tests/unit/model/ValidNewOverview.json create mode 100644 report-viewer/tests/unit/model/ValidOldOverview.json diff --git a/report-viewer/src/model/factories/OverviewFactory.ts b/report-viewer/src/model/factories/OverviewFactory.ts index cdf957e53..9b1801b46 100644 --- a/report-viewer/src/model/factories/OverviewFactory.ts +++ b/report-viewer/src/model/factories/OverviewFactory.ts @@ -7,8 +7,8 @@ import versionJson from '@/version.json' import Distribution from '../Distribution' import MetricType from '../MetricType' import { BaseFactory } from './BaseFactory' -import PercentileDistribution from '../PercentileDistribution' -import TenValueDistribution from '../TenthPercentileDistribution' +import PercentileDistribution from '../HundredValueDistribution' +import TenValueDistribution from '../TenValueDistribution' export class OverviewFactory extends BaseFactory { static reportViewerVersion: Version = diff --git a/report-viewer/tests/unit/model/OverviewFactory.test.ts b/report-viewer/tests/unit/model/OverviewFactory.test.ts new file mode 100644 index 000000000..803abe82f --- /dev/null +++ b/report-viewer/tests/unit/model/OverviewFactory.test.ts @@ -0,0 +1,178 @@ +import { beforeAll, describe, expect, it, vi } from 'vitest' +import { OverviewFactory } from '@/model/factories/OverviewFactory' +import MetricType from '@/model/MetricType' +import HundredValueDistribution from '@/model/HundredValueDistribution' +import TenValueDistribution from '@/model/TenValueDistribution' +import validNew from './ValidNewOverview.json' +import validOld from './ValidOldOverview.json' + +const store = { + state: { + localModeUsed: false, + zipModeUsed: true, + singleModeUsed: false, + files: {} + }, + saveSubmissionNames: (map) => { + expect(map.has('A')).toBeTruthy() + expect(map.has('B')).toBeTruthy() + expect(map.has('C')).toBeTruthy() + expect(map.has('D')).toBeTruthy() + }, + saveComparisonFileLookup: (map) => { + console.log(map) + expect(map.has('A')).toBeTruthy() + expect(map.has('B')).toBeTruthy() + } +} + +describe('Test JSON to Overview', () => { + beforeAll(() => { + vi.mock('@/stores/store', () => ({ + default: vi.fn(() => { + return store + }) + })) + + vi.spyOn(global.window, 'alert').mockImplementation(() => {}) + }) + + it('Post 5.0', () => { + store.state.files['overview.json'] = JSON.stringify(validNew) + + expect(OverviewFactory.getOverview()).toEqual({ + _submissionFolderPath: ['files'], + _baseCodeFolderPath: '', + _language: 'Javac based AST plugin', + _fileExtensions: ['.java', '.JAVA'], + _matchSensitivity: 9, + _dateOfExecution: '12/07/23', + _durationOfExecution: 12, + _topComparisons: [ + { + firstSubmissionId: 'A', + secondSubmissionId: 'C', + similarities: { + [MetricType.AVERAGE]: 0.9960435212660732, + [MetricType.MAXIMUM]: 0.9960435212660732 + }, + sortingPlace: 0, + id: 1 + }, + { + firstSubmissionId: 'D', + secondSubmissionId: 'A', + similarities: { + [MetricType.AVERAGE]: 0.751044776119403, + [MetricType.MAXIMUM]: 0.947289156626506 + }, + sortingPlace: 1, + id: 2 + }, + { + firstSubmissionId: 'D', + secondSubmissionId: 'C', + similarities: { + [MetricType.AVERAGE]: 0.751044776119403, + [MetricType.MAXIMUM]: 0.947289156626506 + }, + sortingPlace: 2, + id: 3 + }, + { + firstSubmissionId: 'B', + secondSubmissionId: 'D', + similarities: { + [MetricType.AVERAGE]: 0.28322981366459626, + [MetricType.MAXIMUM]: 0.8085106382978723 + }, + sortingPlace: 3, + id: 4 + }, + { + firstSubmissionId: 'B', + secondSubmissionId: 'A', + similarities: { + [MetricType.AVERAGE]: 0.2378472222222222, + [MetricType.MAXIMUM]: 0.9716312056737588 + }, + sortingPlace: 4, + id: 5 + }, + { + firstSubmissionId: 'B', + secondSubmissionId: 'C', + similarities: { + [MetricType.AVERAGE]: 0.2378472222222222, + [MetricType.MAXIMUM]: 0.9716312056737588 + }, + sortingPlace: 5, + id: 6 + } + ], + _distributions: { + [MetricType.MAXIMUM]: new HundredValueDistribution([ + 1, 0, 2, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + ]), + [MetricType.AVERAGE]: new HundredValueDistribution([ + 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + ]) + }, + _clusters: [ + { + averageSimilarity: 94.746956, + strength: 0.0, + members: ['C', 'A', 'B', 'D'] + } + ], + _totalComparisons: 6 + }) + }) + + it('Pre 5.0', () => { + store.state.files['overview.json'] = JSON.stringify(validOld) + expect(OverviewFactory.getOverview()).toEqual({ + _submissionFolderPath: ['test'], + _baseCodeFolderPath: '', + _language: 'Javac based AST plugin', + _fileExtensions: ['.java', '.JAVA'], + _matchSensitivity: 9, + _dateOfExecution: '12/07/23', + _durationOfExecution: 34, + _topComparisons: [ + { + firstSubmissionId: 'A', + secondSubmissionId: 'B', + similarities: { + [MetricType.AVERAGE]: 0.6900452488687783, + [MetricType.MAXIMUM]: 0.9457364341085271 + }, + sortingPlace: 0, + id: 1 + }, + { + firstSubmissionId: 'C', + secondSubmissionId: 'D', + similarities: { + [MetricType.AVERAGE]: 0.6954045248868778, + [MetricType.MAXIMUM]: 0.83500530023 + }, + sortingPlace: 1, + id: 2 + } + ], + _distributions: { + [MetricType.AVERAGE]: new TenValueDistribution([0, 0, 0, 1, 0, 0, 0, 0, 0, 0]), + [MetricType.MAXIMUM]: new TenValueDistribution([1, 0, 0, 0, 0, 0, 0, 0, 0, 0]) + }, + _clusters: [], + _totalComparisons: 6 + }) + }) +}) diff --git a/report-viewer/tests/unit/model/ValidNewOverview.json b/report-viewer/tests/unit/model/ValidNewOverview.json new file mode 100644 index 000000000..8fb36cc51 --- /dev/null +++ b/report-viewer/tests/unit/model/ValidNewOverview.json @@ -0,0 +1,79 @@ +{ + "jplag_version": { "major": 0, "minor": 0, "patch": 0 }, + "submission_folder_path": ["files"], + "base_code_folder_path": "", + "language": "Javac based AST plugin", + "file_extensions": [".java", ".JAVA"], + "submission_id_to_display_name": { "A": "A", "B": "B", "C": "C", "D": "D" }, + "submission_ids_to_comparison_file_name": { + "A": { "B": "B-A.json", "C": "A-C.json", "D": "D-A.json" }, + "B": { "A": "B-A.json", "C": "B-C.json", "D": "B-D.json" }, + "C": { "A": "A-C.json", "B": "B-C.json", "D": "D-C.json" }, + "D": { "A": "D-A.json", "B": "B-D.json", "C": "D-C.json" } + }, + "failed_submission_names": [], + "excluded_files": [], + "match_sensitivity": 9, + "date_of_execution": "12/07/23", + "execution_time": 12, + "distributions": { + "MAX": [ + 1, 0, 2, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + ], + "AVG": [ + 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, + 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + ] + }, + "top_comparisons": [ + { + "first_submission": "A", + "second_submission": "C", + "similarities": { "AVG": 0.9960435212660732, "MAX": 0.9960435212660732 } + }, + { + "first_submission": "D", + "second_submission": "A", + "similarities": { "AVG": 0.751044776119403, "MAX": 0.947289156626506 } + }, + { + "first_submission": "D", + "second_submission": "C", + "similarities": { "AVG": 0.751044776119403, "MAX": 0.947289156626506 } + }, + { + "first_submission": "B", + "second_submission": "D", + "similarities": { "AVG": 0.28322981366459626, "MAX": 0.8085106382978723 } + }, + { + "first_submission": "B", + "second_submission": "A", + "similarities": { "AVG": 0.2378472222222222, "MAX": 0.9716312056737588 } + }, + { + "first_submission": "B", + "second_submission": "C", + "similarities": { "AVG": 0.2378472222222222, "MAX": 0.9716312056737588 } + } + ], + "clusters": [ + { + "average_similarity": 94.746956, + "strength": 0.0, + "members": [ + "C", + "A", + "B", + "D" + ] + } + ], + "total_comparisons": 6 + } + \ No newline at end of file diff --git a/report-viewer/tests/unit/model/ValidOldOverview.json b/report-viewer/tests/unit/model/ValidOldOverview.json new file mode 100644 index 000000000..981fca99f --- /dev/null +++ b/report-viewer/tests/unit/model/ValidOldOverview.json @@ -0,0 +1,56 @@ +{ + "jplag_version": { "major": 4, "minor": 2, "patch": 0 }, + "submission_folder_path": ["test"], + "base_code_folder_path": "", + "language": "Javac based AST plugin", + "file_extensions": [".java", ".JAVA"], + "submission_id_to_display_name": { "A": "A", "B": "B", "C": "C", "D": "D" }, + "submission_ids_to_comparison_file_name": { + "A": { "B": "B-A.json" }, + "B": { "A": "B-A.json" } + }, + "failed_submission_names": [], + "excluded_files": [], + "match_sensitivity": 9, + "date_of_execution": "12/07/23", + "execution_time": 34, + "metrics": [ + { + "name": "AVG", + "distribution": [0, 0, 0, 1, 0, 0, 0, 0, 0, 0], + "topComparisons": [ + { + "first_submission": "A", + "second_submission": "B", + "similarity": 0.6900452488687783 + }, + { + "first_submission": "C", + "second_submission": "D", + "similarity": 0.6954045248868778 + } + ], + "description": "Average of both program coverages. This is the default similarity which works in most cases: Matches with a high average similarity indicate that the programs work in a very similar way." + }, + { + "name": "MAX", + "distribution": [1, 0, 0, 0, 0, 0, 0, 0, 0, 0], + "topComparisons": [ + { + "first_submission": "A", + "second_submission": "B", + "similarity": 0.9457364341085271 + }, + { + "first_submission": "C", + "second_submission": "D", + "similarity": 0.83500530023 + } + ], + "description": "Maximum of both program coverages. This ranking is especially useful if the programs are very different in size. This can happen when dead code was inserted to disguise the origin of the plagiarized program." + } + ], + "clusters": [], + "total_comparisons": 6 + } + \ No newline at end of file diff --git a/report-viewer/vitest.config.ts b/report-viewer/vitest.config.ts index 23da12e5c..502cfa1a8 100644 --- a/report-viewer/vitest.config.ts +++ b/report-viewer/vitest.config.ts @@ -10,6 +10,11 @@ export default mergeConfig( environment: 'jsdom', exclude: [...configDefaults.exclude, 'tests/e2e/*'], root: fileURLToPath(new URL('./', import.meta.url)) + }, + resolve: { + alias: { + '@': fileURLToPath(new URL('./src', import.meta.url)) + } } }) ) From 9a43fd1efed120124e7aa3c3d0dc6ecffac16744 Mon Sep 17 00:00:00 2001 From: Alex | Kronox Date: Tue, 25 Jul 2023 21:43:06 +0200 Subject: [PATCH 035/232] fix distribution + test --- .../src/model/HundredValueDistribution.ts | 2 +- .../tests/unit/model/Distribution.test.ts | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 report-viewer/tests/unit/model/Distribution.test.ts diff --git a/report-viewer/src/model/HundredValueDistribution.ts b/report-viewer/src/model/HundredValueDistribution.ts index bdfb70274..7eee091f6 100644 --- a/report-viewer/src/model/HundredValueDistribution.ts +++ b/report-viewer/src/model/HundredValueDistribution.ts @@ -10,7 +10,7 @@ export default class HundredValueDistribution extends Distribution { */ public splitIntoTenBuckets(): number[] { const tenValueArray = new Array(10).fill(0) - for (let i = 0; i < 100; i++) { + for (let i = 99; i >= 0; i--) { tenValueArray[Math.floor(i / 10)] += this._distribution[i] } return tenValueArray diff --git a/report-viewer/tests/unit/model/Distribution.test.ts b/report-viewer/tests/unit/model/Distribution.test.ts new file mode 100644 index 000000000..1d8b6fa65 --- /dev/null +++ b/report-viewer/tests/unit/model/Distribution.test.ts @@ -0,0 +1,18 @@ +import { describe, expect, it } from 'vitest' +import Distribution from '@/model/Distribution' +import TenValueDistribution from '@/model/TenValueDistribution' +import HundredValueDistribution from '@/model/HundredValueDistribution' + +describe('Distribution', () => { + it.each([ + new TenValueDistribution([0, 0, 0, 0, 0, 0, 26, 13209, 58955, 5231]), + new HundredValueDistribution([ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 2, 1, 0, 1, 2, 12, 8, 31, 61, 168, 273, 493, 923, 1544, 2244, 3163, 4309, 5373, 6343, 7177, + 7445, 7292, 7023, 6130, 5091, 4056, 3025, 2052, 1442, 869, 470, 225, 109, 42, 15, 7, 0 + ]) + ])('get in 10 Buckets', (distribution: Distribution) => { + expect(distribution.splitIntoTenBuckets()).toEqual([0, 0, 0, 0, 0, 0, 26, 13209, 58955, 5231]) + }) +}) From ccad5a2c2caff44c0077c2703c82aceb30de85c3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 26 Jul 2023 09:28:16 +0000 Subject: [PATCH 036/232] Dependency(deps-dev): Bump junit.version from 5.9.3 to 5.10.0 Bumps `junit.version` from 5.9.3 to 5.10.0. Updates `org.junit.jupiter:junit-jupiter-engine` from 5.9.3 to 5.10.0 - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/compare/r5.9.3...r5.10.0) Updates `org.junit.jupiter:junit-jupiter-params` from 5.9.3 to 5.10.0 - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/compare/r5.9.3...r5.10.0) --- updated-dependencies: - dependency-name: org.junit.jupiter:junit-jupiter-engine dependency-type: direct:development update-type: version-update:semver-minor - dependency-name: org.junit.jupiter:junit-jupiter-params dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 23471f318..4116a8142 100644 --- a/pom.xml +++ b/pom.xml @@ -76,7 +76,7 @@ 17 2.38.0 2.0.7 - 5.9.3 + 5.10.0 2.7.7 4.13.0 From 8b767890d8f604433bd1bf4901bff2068538309b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 26 Jul 2023 09:08:25 +0000 Subject: [PATCH 037/232] Dependency(deps-dev): Bump @vue/test-utils in /report-viewer Bumps [@vue/test-utils](https://github.com/vuejs/test-utils) from 2.4.0 to 2.4.1. - [Release notes](https://github.com/vuejs/test-utils/releases) - [Commits](https://github.com/vuejs/test-utils/compare/v2.4.0...v2.4.1) --- updated-dependencies: - dependency-name: "@vue/test-utils" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- report-viewer/package-lock.json | 138 ++++++++++++++------------------ report-viewer/package.json | 2 +- 2 files changed, 63 insertions(+), 77 deletions(-) diff --git a/report-viewer/package-lock.json b/report-viewer/package-lock.json index 9f1a57778..9cf7392ba 100644 --- a/report-viewer/package-lock.json +++ b/report-viewer/package-lock.json @@ -32,7 +32,7 @@ "@vitejs/plugin-vue": "^4.2.3", "@vue/eslint-config-prettier": "^7.1.0", "@vue/eslint-config-typescript": "^11.0.3", - "@vue/test-utils": "^2.4.0", + "@vue/test-utils": "^2.4.1", "@vue/tsconfig": "^0.4.0", "autoprefixer": "^10.4.14", "eslint": "^8.45.0", @@ -677,6 +677,12 @@ "node": ">= 8" } }, + "node_modules/@one-ini/wasm": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@one-ini/wasm/-/wasm-0.1.1.tgz", + "integrity": "sha512-XuySG1E38YScSJoMlqovLru4KTUNSjgVTIjyh7qMX6aNN5HY5Ct5LhRJdxO79JtTzKfzV/bnWpz+zquYrISsvw==", + "dev": true + }, "node_modules/@playwright/test": { "version": "1.36.0", "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.36.0.tgz", @@ -1284,23 +1290,19 @@ "integrity": "sha512-7OjdcV8vQ74eiz1TZLzZP4JwqM5fA94K6yntPS5Z25r9HDuGNzaGdgvwKYq6S+MxwF0TFRwe50fIR/MYnakdkQ==" }, "node_modules/@vue/test-utils": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/@vue/test-utils/-/test-utils-2.4.0.tgz", - "integrity": "sha512-BKB9aj1yky63/I3IwSr1FjUeHYsKXI7D6S9F378AHt7a5vC0dLkOBtSsFXoRGC/7BfHmiB9HRhT+i9xrUHoAKw==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@vue/test-utils/-/test-utils-2.4.1.tgz", + "integrity": "sha512-VO8nragneNzUZUah6kOjiFmD/gwRjUauG9DROh6oaOeFwX1cZRUNHhdeogE8635cISigXFTtGLUQWx5KCb0xeg==", "dev": true, "dependencies": { - "js-beautify": "1.14.6", - "vue-component-type-helpers": "1.6.5" + "js-beautify": "1.14.9", + "vue-component-type-helpers": "1.8.4" }, "peerDependencies": { - "@vue/compiler-dom": "^3.0.1", "@vue/server-renderer": "^3.0.1", "vue": "^3.0.1" }, "peerDependenciesMeta": { - "@vue/compiler-dom": { - "optional": true - }, "@vue/server-renderer": { "optional": true } @@ -1882,10 +1884,13 @@ } }, "node_modules/commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", + "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", + "dev": true, + "engines": { + "node": ">=14" + } }, "node_modules/concat-map": { "version": "0.0.1", @@ -2101,27 +2106,45 @@ "dev": true }, "node_modules/editorconfig": { - "version": "0.15.3", - "resolved": "https://registry.npmjs.org/editorconfig/-/editorconfig-0.15.3.tgz", - "integrity": "sha512-M9wIMFx96vq0R4F+gRpY3o2exzb8hEj/n9S8unZtHSvYjibBp/iMufSzvmOcV/laG0ZtuTVGtiJggPOSW2r93g==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/editorconfig/-/editorconfig-1.0.4.tgz", + "integrity": "sha512-L9Qe08KWTlqYMVvMcTIvMAdl1cDUubzRNYL+WfA4bLDMHe4nemKkpmYzkznE1FwLKu0EEmy6obgQKzMJrg4x9Q==", "dev": true, "dependencies": { - "commander": "^2.19.0", - "lru-cache": "^4.1.5", - "semver": "^5.6.0", - "sigmund": "^1.0.1" + "@one-ini/wasm": "0.1.1", + "commander": "^10.0.0", + "minimatch": "9.0.1", + "semver": "^7.5.3" }, "bin": { "editorconfig": "bin/editorconfig" + }, + "engines": { + "node": ">=14" } }, - "node_modules/editorconfig/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "node_modules/editorconfig/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, - "bin": { - "semver": "bin/semver" + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/editorconfig/node_modules/minimatch": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.1.tgz", + "integrity": "sha512-0jWhJpD/MdhPXwPuiRkCbfYfSKp2qnn2eOc279qI7f+osl/l+prKSrvhg157zSYvx/1nmgn2NqdT6k2Z7zSH9w==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/electron-to-chromium": { @@ -3525,14 +3548,14 @@ } }, "node_modules/js-beautify": { - "version": "1.14.6", - "resolved": "https://registry.npmjs.org/js-beautify/-/js-beautify-1.14.6.tgz", - "integrity": "sha512-GfofQY5zDp+cuHc+gsEXKPpNw2KbPddreEo35O6jT6i0RVK6LhsoYBhq5TvK4/n74wnA0QbK8gGd+jUZwTMKJw==", + "version": "1.14.9", + "resolved": "https://registry.npmjs.org/js-beautify/-/js-beautify-1.14.9.tgz", + "integrity": "sha512-coM7xq1syLcMyuVGyToxcj2AlzhkDjmfklL8r0JgJ7A76wyGMpJ1oA35mr4APdYNO/o/4YY8H54NQIJzhMbhBg==", "dev": true, "dependencies": { "config-chain": "^1.1.13", - "editorconfig": "^0.15.3", - "glob": "^8.0.3", + "editorconfig": "^1.0.3", + "glob": "^8.1.0", "nopt": "^6.0.0" }, "bin": { @@ -3541,7 +3564,7 @@ "js-beautify": "js/bin/js-beautify.js" }, "engines": { - "node": ">=10" + "node": ">=12" } }, "node_modules/js-yaml": { @@ -3711,15 +3734,6 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/lint-staged/node_modules/commander": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.0.tgz", - "integrity": "sha512-zS5PnTI22FIRM6ylNW8G4Ap0IEOyk62fhLSD0+uHRT9McRCLGpkVNvao4bjimpK/GShynyQkFFxHhwMcETmduA==", - "dev": true, - "engines": { - "node": ">=14" - } - }, "node_modules/lint-staged/node_modules/pidtree": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.6.0.tgz", @@ -3964,16 +3978,6 @@ "get-func-name": "^2.0.0" } }, - "node_modules/lru-cache": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", - "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", - "dev": true, - "dependencies": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - } - }, "node_modules/magic-string": { "version": "0.30.0", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.0.tgz", @@ -4972,12 +4976,6 @@ "integrity": "sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==", "dev": true }, - "node_modules/pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==", - "dev": true - }, "node_modules/psl": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", @@ -5330,9 +5328,9 @@ } }, "node_modules/semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -5417,12 +5415,6 @@ "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", "dev": true }, - "node_modules/sigmund": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", - "integrity": "sha512-fCvEXfh6NWpm+YSuY2bpXb/VIihqWA6hLsgboC+0nl71Q7N7o2eaCW8mJa/NLvQhs6jpd3VZV4UiUQlV6+lc8g==", - "dev": true - }, "node_modules/signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", @@ -6284,9 +6276,9 @@ } }, "node_modules/vue-component-type-helpers": { - "version": "1.6.5", - "resolved": "https://registry.npmjs.org/vue-component-type-helpers/-/vue-component-type-helpers-1.6.5.tgz", - "integrity": "sha512-iGdlqtajmiqed8ptURKPJ/Olz0/mwripVZszg6tygfZSIL9kYFPJTNY6+Q6OjWGznl2L06vxG5HvNvAnWrnzbg==", + "version": "1.8.4", + "resolved": "https://registry.npmjs.org/vue-component-type-helpers/-/vue-component-type-helpers-1.8.4.tgz", + "integrity": "sha512-6bnLkn8O0JJyiFSIF0EfCogzeqNXpnjJ0vW/SZzNHfe6sPx30lTtTXlE5TFs2qhJlAtDFybStVNpL73cPe3OMQ==", "dev": true }, "node_modules/vue-draggable-next": { @@ -6624,12 +6616,6 @@ "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", "dev": true }, - "node_modules/yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==", - "dev": true - }, "node_modules/yaml": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.2.2.tgz", diff --git a/report-viewer/package.json b/report-viewer/package.json index ec16c785a..49b9cfdcf 100644 --- a/report-viewer/package.json +++ b/report-viewer/package.json @@ -41,7 +41,7 @@ "@vitejs/plugin-vue": "^4.2.3", "@vue/eslint-config-prettier": "^7.1.0", "@vue/eslint-config-typescript": "^11.0.3", - "@vue/test-utils": "^2.4.0", + "@vue/test-utils": "^2.4.1", "@vue/tsconfig": "^0.4.0", "autoprefixer": "^10.4.14", "eslint": "^8.45.0", From 299b51ec2a982560044360a17b104928a2b1d11e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 26 Jul 2023 13:20:44 +0000 Subject: [PATCH 038/232] Dependency(deps-dev): Bump @playwright/test in /report-viewer Bumps [@playwright/test](https://github.com/Microsoft/playwright) from 1.36.0 to 1.36.2. - [Release notes](https://github.com/Microsoft/playwright/releases) - [Commits](https://github.com/Microsoft/playwright/compare/v1.36.0...v1.36.2) --- updated-dependencies: - dependency-name: "@playwright/test" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- report-viewer/package-lock.json | 16 ++++++++-------- report-viewer/package.json | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/report-viewer/package-lock.json b/report-viewer/package-lock.json index 9cf7392ba..19144816e 100644 --- a/report-viewer/package-lock.json +++ b/report-viewer/package-lock.json @@ -25,7 +25,7 @@ "vue-virtual-scroller": "^2.0.0-beta.8" }, "devDependencies": { - "@playwright/test": "^1.36.0", + "@playwright/test": "^1.36.2", "@rushstack/eslint-patch": "^1.3.2", "@types/jsdom": "^21.1.0", "@types/node": "^20.4.2", @@ -684,13 +684,13 @@ "dev": true }, "node_modules/@playwright/test": { - "version": "1.36.0", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.36.0.tgz", - "integrity": "sha512-yN+fvMYtiyLFDCQos+lWzoX4XW3DNuaxjBu68G0lkgLgC6BP+m/iTxJQoSicz/x2G5EsrqlZTqTIP9sTgLQerg==", + "version": "1.36.2", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.36.2.tgz", + "integrity": "sha512-2rVZeyPRjxfPH6J0oGJqE8YxiM1IBRyM8hyrXYK7eSiAqmbNhxwcLa7dZ7fy9Kj26V7FYia5fh9XJRq4Dqme+g==", "dev": true, "dependencies": { "@types/node": "*", - "playwright-core": "1.36.0" + "playwright-core": "1.36.2" }, "bin": { "playwright": "cli.js" @@ -4762,9 +4762,9 @@ } }, "node_modules/playwright-core": { - "version": "1.36.0", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.36.0.tgz", - "integrity": "sha512-7RTr8P6YJPAqB+8j5ATGHqD6LvLLM39sYVNsslh78g8QeLcBs5750c6+msjrHUwwGt+kEbczBj1XB22WMwn+WA==", + "version": "1.36.2", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.36.2.tgz", + "integrity": "sha512-sQYZt31dwkqxOrP7xy2ggDfEzUxM1lodjhsQ3NMMv5uGTRDsLxU0e4xf4wwMkF2gplIxf17QMBCodSFgm6bFVQ==", "dev": true, "bin": { "playwright-core": "cli.js" diff --git a/report-viewer/package.json b/report-viewer/package.json index 49b9cfdcf..dabd5fb2d 100644 --- a/report-viewer/package.json +++ b/report-viewer/package.json @@ -34,7 +34,7 @@ "vue-virtual-scroller": "^2.0.0-beta.8" }, "devDependencies": { - "@playwright/test": "^1.36.0", + "@playwright/test": "^1.36.2", "@rushstack/eslint-patch": "^1.3.2", "@types/jsdom": "^21.1.0", "@types/node": "^20.4.2", From fe8b73edd0379b28807c932d4d7bfe2e04d95b6b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 26 Jul 2023 09:08:01 +0000 Subject: [PATCH 039/232] Dependency(deps-dev): Bump vue-tsc from 1.8.5 to 1.8.6 in /report-viewer Bumps [vue-tsc](https://github.com/vuejs/language-tools/tree/HEAD/packages/vue-tsc) from 1.8.5 to 1.8.6. - [Release notes](https://github.com/vuejs/language-tools/releases) - [Changelog](https://github.com/vuejs/language-tools/blob/master/CHANGELOG.md) - [Commits](https://github.com/vuejs/language-tools/commits/v1.8.6/packages/vue-tsc) --- updated-dependencies: - dependency-name: vue-tsc dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- report-viewer/package-lock.json | 48 ++++++++++++++++----------------- report-viewer/package.json | 2 +- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/report-viewer/package-lock.json b/report-viewer/package-lock.json index 19144816e..388aba60d 100644 --- a/report-viewer/package-lock.json +++ b/report-viewer/package-lock.json @@ -47,7 +47,7 @@ "typescript": "^5.1.6", "vite": "^4.4.4", "vitest": "^0.32.4", - "vue-tsc": "^1.8.5" + "vue-tsc": "^1.8.6" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -1070,30 +1070,30 @@ } }, "node_modules/@volar/language-core": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@volar/language-core/-/language-core-1.9.0.tgz", - "integrity": "sha512-+PTRrGanAD2PxqMty0ZC46xhgW5BWzb67RLHhZyB3Im4+eMXsKlYjFUt7Z8ZCwTWQQOnj8NQ6gSgUEoOTwAHrQ==", + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/@volar/language-core/-/language-core-1.9.2.tgz", + "integrity": "sha512-9GTes/IUPOl0YoV5RQWhCP5a4EDFFfJZGwZn1xA5ug1FO0G6GOVoJI6tQatujtcQmDOQlOM5/0NewnlumygPkQ==", "dev": true, "dependencies": { - "@volar/source-map": "1.9.0" + "@volar/source-map": "1.9.2" } }, "node_modules/@volar/source-map": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@volar/source-map/-/source-map-1.9.0.tgz", - "integrity": "sha512-TQWLY8ozUOHBHTMC2pHZsNbtM25Q9QCEwAL8JFR/gmR9Yv0d9qup/gQdd5sDI7RmoPYKD+gqjLrbM4Ib41QSJQ==", + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/@volar/source-map/-/source-map-1.9.2.tgz", + "integrity": "sha512-rYTvV/HMf2CSRkd6oiVxcjX4rnSxEsVfJmw1KTmD4VTBXlz1+b16VIysQX4+1p/eZd2TyCeFblyylIxbZ+YOGg==", "dev": true, "dependencies": { "muggle-string": "^0.3.1" } }, "node_modules/@volar/typescript": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@volar/typescript/-/typescript-1.9.0.tgz", - "integrity": "sha512-B8X4/H6V93uD7zu5VCw05eB0Ukcc39SFKsZoeylkAk2sJ50oaJLpajnQ8Ov4c+FnVQ6iPA6Xy1qdWoWJjh6xEg==", + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/@volar/typescript/-/typescript-1.9.2.tgz", + "integrity": "sha512-l4DA+S3ZVOWGACDdRNVSYZ41nuTWOH8OMS/yVeFV2fTmr/IuD37+3wzzGnjIPwCUa0w+fpg8vJPalzYetmlFTQ==", "dev": true, "dependencies": { - "@volar/language-core": "1.9.0" + "@volar/language-core": "1.9.2" } }, "node_modules/@vue/compiler-core": { @@ -1186,9 +1186,9 @@ } }, "node_modules/@vue/language-core": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@vue/language-core/-/language-core-1.8.5.tgz", - "integrity": "sha512-DKQNiNQzNV7nrkZQujvjfX73zqKdj2+KoM4YeKl+ft3f+crO3JB4ycPnmgaRMNX/ULJootdQPGHKFRl5cXxwaw==", + "version": "1.8.6", + "resolved": "https://registry.npmjs.org/@vue/language-core/-/language-core-1.8.6.tgz", + "integrity": "sha512-PyYDMArbR7hnhqw9OEupr0s4ut0/ZfITp7WEjigF58cd2R0lRLNM1HPvzFMuULpy3ImBEOZI11KRIDirqOe+tQ==", "dev": true, "dependencies": { "@volar/language-core": "~1.9.0", @@ -1315,13 +1315,13 @@ "dev": true }, "node_modules/@vue/typescript": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@vue/typescript/-/typescript-1.8.5.tgz", - "integrity": "sha512-domFBbNr3PEcjGBeB+cmgUM3cI6pJsJezguIUKZ1rphkfIkICyoMjCd3TitoP32yo2KABLiaXcGFzgFfQf6B3w==", + "version": "1.8.6", + "resolved": "https://registry.npmjs.org/@vue/typescript/-/typescript-1.8.6.tgz", + "integrity": "sha512-sDQ5tltrSVS3lAkE3JtMRGJo91CLIxcWPy7yms/DT+ssxXpwxbVRD5Gok68HenEZBA4Klq7nW99sG/nTRnpPuQ==", "dev": true, "dependencies": { "@volar/typescript": "~1.9.0", - "@vue/language-core": "1.8.5" + "@vue/language-core": "1.8.6" } }, "node_modules/abab": { @@ -6377,13 +6377,13 @@ } }, "node_modules/vue-tsc": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/vue-tsc/-/vue-tsc-1.8.5.tgz", - "integrity": "sha512-Jr8PTghJIwp69MFsEZoADDcv2l+lXA8juyN/5AYA5zxyZNvIHjSbgKgkYIYc1qnihrOyIG1VOnfk4ZE0jqn8bw==", + "version": "1.8.6", + "resolved": "https://registry.npmjs.org/vue-tsc/-/vue-tsc-1.8.6.tgz", + "integrity": "sha512-8ffD4NGfwyATjw/s40Lw2EgB7L2/PAqnGlJBaVQLgblr3SU4EYdhJ67TNXXuDD8NMbDAFSM24V8i3ZIJgTs32Q==", "dev": true, "dependencies": { - "@vue/language-core": "1.8.5", - "@vue/typescript": "1.8.5", + "@vue/language-core": "1.8.6", + "@vue/typescript": "1.8.6", "semver": "^7.3.8" }, "bin": { diff --git a/report-viewer/package.json b/report-viewer/package.json index dabd5fb2d..179d784cf 100644 --- a/report-viewer/package.json +++ b/report-viewer/package.json @@ -56,6 +56,6 @@ "typescript": "^5.1.6", "vite": "^4.4.4", "vitest": "^0.32.4", - "vue-tsc": "^1.8.5" + "vue-tsc": "^1.8.6" } } From 3ddaaadbd9cc7a66c92b3e1b9d793da8d9f6565b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 26 Jul 2023 13:25:59 +0000 Subject: [PATCH 040/232] Dependency(deps-dev): Bump @types/node in /report-viewer Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.4.2 to 20.4.5. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- report-viewer/package-lock.json | 8 ++++---- report-viewer/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/report-viewer/package-lock.json b/report-viewer/package-lock.json index 388aba60d..e65fd8265 100644 --- a/report-viewer/package-lock.json +++ b/report-viewer/package-lock.json @@ -28,7 +28,7 @@ "@playwright/test": "^1.36.2", "@rushstack/eslint-patch": "^1.3.2", "@types/jsdom": "^21.1.0", - "@types/node": "^20.4.2", + "@types/node": "^20.4.5", "@vitejs/plugin-vue": "^4.2.3", "@vue/eslint-config-prettier": "^7.1.0", "@vue/eslint-config-typescript": "^11.0.3", @@ -756,9 +756,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.4.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.4.2.tgz", - "integrity": "sha512-Dd0BYtWgnWJKwO1jkmTrzofjK2QXXcai0dmtzvIBhcA+RsG5h8R3xlyta0kGOZRNfL9GuRtb1knmPEhQrePCEw==", + "version": "20.4.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.4.5.tgz", + "integrity": "sha512-rt40Nk13II9JwQBdeYqmbn2Q6IVTA5uPhvSO+JVqdXw/6/4glI6oR9ezty/A9Hg5u7JH4OmYmuQ+XvjKm0Datg==", "dev": true }, "node_modules/@types/semver": { diff --git a/report-viewer/package.json b/report-viewer/package.json index 179d784cf..c4eb835ce 100644 --- a/report-viewer/package.json +++ b/report-viewer/package.json @@ -37,7 +37,7 @@ "@playwright/test": "^1.36.2", "@rushstack/eslint-patch": "^1.3.2", "@types/jsdom": "^21.1.0", - "@types/node": "^20.4.2", + "@types/node": "^20.4.5", "@vitejs/plugin-vue": "^4.2.3", "@vue/eslint-config-prettier": "^7.1.0", "@vue/eslint-config-typescript": "^11.0.3", From 2ffb05dbe183631e077b09ce6ca791a669a43f44 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 26 Jul 2023 09:08:18 +0000 Subject: [PATCH 041/232] Dependency(deps-dev): Bump postcss in /report-viewer Bumps [postcss](https://github.com/postcss/postcss) from 8.4.26 to 8.4.27. - [Release notes](https://github.com/postcss/postcss/releases) - [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md) - [Commits](https://github.com/postcss/postcss/compare/8.4.26...8.4.27) --- updated-dependencies: - dependency-name: postcss dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- report-viewer/package-lock.json | 8 ++++---- report-viewer/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/report-viewer/package-lock.json b/report-viewer/package-lock.json index e65fd8265..47d067a22 100644 --- a/report-viewer/package-lock.json +++ b/report-viewer/package-lock.json @@ -41,7 +41,7 @@ "jsdom": "^22.1.0", "lint-staged": "^13.2.3", "npm-run-all": "^4.1.5", - "postcss": "^8.4.26", + "postcss": "^8.4.27", "prettier": "^3.0.0", "tailwindcss": "^3.3.3", "typescript": "^5.1.6", @@ -4774,9 +4774,9 @@ } }, "node_modules/postcss": { - "version": "8.4.26", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.26.tgz", - "integrity": "sha512-jrXHFF8iTloAenySjM/ob3gSj7pCu0Ji49hnjqzsgSRa50hkWCKD0HQ+gMNJkW38jBI68MpAAg7ZWwHwX8NMMw==", + "version": "8.4.27", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.27.tgz", + "integrity": "sha512-gY/ACJtJPSmUFPDCHtX78+01fHa64FaU4zaaWfuh1MhGJISufJAH4cun6k/8fwsHYeK4UQmENQK+tRLCFJE8JQ==", "funding": [ { "type": "opencollective", diff --git a/report-viewer/package.json b/report-viewer/package.json index c4eb835ce..fbd378ed8 100644 --- a/report-viewer/package.json +++ b/report-viewer/package.json @@ -50,7 +50,7 @@ "jsdom": "^22.1.0", "lint-staged": "^13.2.3", "npm-run-all": "^4.1.5", - "postcss": "^8.4.26", + "postcss": "^8.4.27", "prettier": "^3.0.0", "tailwindcss": "^3.3.3", "typescript": "^5.1.6", From 7a443d1c17b3318b29f4cf666a121c6d1a07f535 Mon Sep 17 00:00:00 2001 From: Alex | Kronox Date: Wed, 26 Jul 2023 15:42:36 +0200 Subject: [PATCH 042/232] move tests --- .../tests/unit/model/{ => factories}/OverviewFactory.test.ts | 1 - .../tests/unit/model/{ => factories}/ValidNewOverview.json | 0 .../tests/unit/model/{ => factories}/ValidOldOverview.json | 0 3 files changed, 1 deletion(-) rename report-viewer/tests/unit/model/{ => factories}/OverviewFactory.test.ts (99%) rename report-viewer/tests/unit/model/{ => factories}/ValidNewOverview.json (100%) rename report-viewer/tests/unit/model/{ => factories}/ValidOldOverview.json (100%) diff --git a/report-viewer/tests/unit/model/OverviewFactory.test.ts b/report-viewer/tests/unit/model/factories/OverviewFactory.test.ts similarity index 99% rename from report-viewer/tests/unit/model/OverviewFactory.test.ts rename to report-viewer/tests/unit/model/factories/OverviewFactory.test.ts index 803abe82f..5385d697a 100644 --- a/report-viewer/tests/unit/model/OverviewFactory.test.ts +++ b/report-viewer/tests/unit/model/factories/OverviewFactory.test.ts @@ -20,7 +20,6 @@ const store = { expect(map.has('D')).toBeTruthy() }, saveComparisonFileLookup: (map) => { - console.log(map) expect(map.has('A')).toBeTruthy() expect(map.has('B')).toBeTruthy() } diff --git a/report-viewer/tests/unit/model/ValidNewOverview.json b/report-viewer/tests/unit/model/factories/ValidNewOverview.json similarity index 100% rename from report-viewer/tests/unit/model/ValidNewOverview.json rename to report-viewer/tests/unit/model/factories/ValidNewOverview.json diff --git a/report-viewer/tests/unit/model/ValidOldOverview.json b/report-viewer/tests/unit/model/factories/ValidOldOverview.json similarity index 100% rename from report-viewer/tests/unit/model/ValidOldOverview.json rename to report-viewer/tests/unit/model/factories/ValidOldOverview.json From 97d727a7bdf18e14b7039a4d1c57daeeb022e808 Mon Sep 17 00:00:00 2001 From: Alex | Kronox Date: Wed, 26 Jul 2023 18:27:30 +0200 Subject: [PATCH 043/232] remove line of code --- report-viewer/src/components/CodePanel.vue | 68 +++++++++++---------- report-viewer/src/components/LineOfCode.vue | 65 -------------------- 2 files changed, 36 insertions(+), 97 deletions(-) delete mode 100644 report-viewer/src/components/LineOfCode.vue diff --git a/report-viewer/src/components/CodePanel.vue b/report-viewer/src/components/CodePanel.vue index 311e6ee48..c643e2e91 100644 --- a/report-viewer/src/components/CodePanel.vue +++ b/report-viewer/src/components/CodePanel.vue @@ -15,38 +15,17 @@ {{ title }}
-
-
-
- -
-
+
+ + + + + +
{{ index + 1 }} +

+            
-

Empty File

+ Empty File
@@ -56,8 +35,8 @@ + + diff --git a/report-viewer/src/components/LineOfCode.vue b/report-viewer/src/components/LineOfCode.vue deleted file mode 100644 index 67f210042..000000000 --- a/report-viewer/src/components/LineOfCode.vue +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - From a275d464ce0fbe936b95f55e3e4360b55b7fed1f Mon Sep 17 00:00:00 2001 From: Alex | Kronox Date: Thu, 27 Jul 2023 17:31:22 +0200 Subject: [PATCH 044/232] rework link --- report-viewer/src/components/CodePanel.vue | 135 +++++++----------- .../src/components/FilesContainer.vue | 44 +++--- report-viewer/src/components/MatchList.vue | 2 +- report-viewer/src/model/MatchInSingleFile.ts | 45 +++++- .../src/model/factories/ComparisonFactory.ts | 26 +--- report-viewer/src/views/ComparisonView.vue | 54 ++----- 6 files changed, 124 insertions(+), 182 deletions(-) diff --git a/report-viewer/src/components/CodePanel.vue b/report-viewer/src/components/CodePanel.vue index c643e2e91..00f9247f9 100644 --- a/report-viewer/src/components/CodePanel.vue +++ b/report-viewer/src/components/CodePanel.vue @@ -2,25 +2,29 @@ Panel which displays a submission files with its line of code. -->