-
Notifications
You must be signed in to change notification settings - Fork 108
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
Conversation
abbeb28
to
700015c
Compare
} | ||
} | ||
} | ||
if (auto IC1 = dyn_cast<ImplicitCastExpr>(a)) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
No description provided.