Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/llvm-dialects/Dialect/Dialect.td
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ def : AttrLlvmType<AttrI32, I32>;
def : AttrLlvmType<AttrI64, I64>;

def ImmutableStringAttr : Attr<"::llvm::StringRef"> {
let toLlvmValue = [{ $_builder.CreateGlobalString($0, "str") }];
let toLlvmValue = [{ $_builder.CreateGlobalString($0, "str", 0, nullptr, /* AddNull */ false) }];
let fromLlvmValue = [{ ::llvm::cast<::llvm::ConstantDataArray>(::llvm::cast<::llvm::GlobalVariable>($0)->getInitializer())->getAsString() }];
let isImmutable = true;
}
Expand Down
2 changes: 1 addition & 1 deletion test/example/generated/ExampleDialect.cpp.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2543,7 +2543,7 @@ initial


::llvm::SmallVector<::llvm::Value*, 1> args = {
b.CreateGlobalString(val, "str")
b.CreateGlobalString(val, "str", 0, nullptr, /* AddNull */ false)
};

return ::llvm::cast<StringAttrOp>(b.CreateCall(fn, args, instName));
Expand Down
2 changes: 1 addition & 1 deletion test/example/test-builder.test
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
; RUN: llvm-dialects-example - | FileCheck --check-prefixes=CHECK %s

;.
; CHECK: @str = private unnamed_addr constant [13 x i8] c"Hello world!\00", align 1
; CHECK: @str = private unnamed_addr constant [12 x i8] c"Hello world!", align 1
;.
; CHECK-LABEL: define void @example() {
; CHECK-NEXT: [[ENTRY:.*:]]
Expand Down
2 changes: 1 addition & 1 deletion test/example/visitor-basic.ll
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
; DEFAULT-NEXT: visiting ReturnInst: ret void
; DEFAULT-NEXT: inner.counter = 1

@0 = private unnamed_addr constant [13 x i8] c"Hello world!\00", align 1
@0 = private unnamed_addr constant [12 x i8] c"Hello world!", align 1

define void @test1(ptr %p) {
entry:
Expand Down