Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle printing and globals #25

Merged
merged 1 commit into from
Nov 5, 2020
Merged

Handle printing and globals #25

merged 1 commit into from
Nov 5, 2020

Conversation

wsmoses
Copy link
Member

@wsmoses wsmoses commented Nov 4, 2020

No description provided.

@wsmoses wsmoses requested a review from chelini November 4, 2020 22:24
@wsmoses wsmoses force-pushed the rebase3 branch 2 times, most recently from abbeb28 to 700015c Compare November 4, 2020 22:33
}
}
}
if (auto IC1 = dyn_cast<ImplicitCastExpr>(a)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check is the same as the one above (line 559). Can you not move lines 571 to 575 here, and remove the duplicate check?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

LLVM::LLVMType::getFunctionTy(rt, types,
/*isVarArg=*/FD->isVariadic());

// Insert the printf function into the body of the parent module.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function seems generic why in the comment you refer to "printf" only?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

builder.setInsertionPointToStart(module.getBody());
return llvmFunctions[FD] = builder.create<LLVM::LLVMFuncOp>(module.getLoc(),
name, llvmFnType);
// return llvmFunctions[FD] = SymbolRefAttr::get(name, module.getContext());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

std::map<const VarDecl *, mlir::LLVM::GlobalOp> llvmGlobals;
mlir::LLVM::GlobalOp GetOrCreateLLVMGlobal(const VarDecl *VD);

/// Return a value representing an access into a global string with the given
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move to the .cc file?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants