[cfe-commits] [PATCH] MS style inline assembly support
Chad Rosier
mcrosier at apple.com
Mon Jun 11 14:40:55 PDT 2012
On Jun 11, 2012, at 2:01 PM, Chandler Carruth wrote:
> Other comments:
>
> Why is this not behind an extension warning? I don't think we want to blindly accept this code until the parsing and sema logic has settled significantly.
We've been blinding accepting it for months. I'll see about adding the extension warning.
>
> Also, I think the CodeGen part really isn't ready to be committed yet:
>
> +
> +void CodeGenFunction::EmitMSAsmStmt(const MSAsmStmt &S) {
> + // Analyze the asm string to decompose it into its pieces. We know that Sema
> + // has already done this, so it is guaranteed to be successful.
> +
> + // Assemble the pieces into the final asm string.
> + std::string AsmString = S.getAsmString()->getString().str();
> +
> + // Get all the output and input constraints together.
> +
> + std::vector<llvm::Value*> Args;
> + std::vector<llvm::Type *> ArgTypes;
> + std::string Constraints;
> +
> + // Keep track of inout constraints.
> +
> + // Append the "input" part of inout constraints last.
> +
> + // Clobbers
>
> This isn't even code yet. I think this shouldn't be committed until you actually have some working implementation, or it should be a simple stub function that immediately errors saying that MS-style asm codegen isn't yet supported.
This does work in the most basic of cases(, but not really… =/ ) I'm fine with converting this into a stub function that errors.
>
> Anyways, I'm excited by the work, and I'd really like to see the overall design in more detail. One thing that would be good for this is perhaps a RFC email with a sketch of the design, and then committing that as an in-progress language extension in Clang's documentation.
Good to hear. I think a RFC would be a great idea! I'll start putting something together.
Thanks fro the feedback, Chandler.
Chad
More information about the cfe-commits
mailing list