Skip to content

Document Some Values #3

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

Merged
merged 5 commits into from
Jan 9, 2017
Merged

Conversation

CodaFi
Copy link
Member

@CodaFi CodaFi commented Jan 9, 2017

Documents

  • Global
  • Module
  • PhiNode
  • Switch
  • Use

May want to consider refactoring Use. It's a weird data type that should be a Sequence.

@@ -67,17 +103,35 @@ public final class Module {
throw ModuleError.couldNotEmitBitCode(path: path)
}
}


/// Creates a type with the given name in this module if that name does not
Copy link
Member

Choose a reason for hiding this comment

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

This function doesn't create any new types, only retrieves.

public func type(named name: String) -> IRType? {
guard let type = LLVMGetTypeByName(llvm, name) else { return nil }
return convertType(type)
}


/// Creates a function with the given name in this module if that name does
Copy link
Member

Choose a reason for hiding this comment

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

Same here, only retrieves named functions

@harlanhaskins harlanhaskins self-requested a review January 9, 2017 13:14
Copy link
Member

@harlanhaskins harlanhaskins left a comment

Choose a reason for hiding this comment

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

Just those two comments. Thanks!

@harlanhaskins
Copy link
Member

harlanhaskins commented Jan 9, 2017

Re Use: Yeah, absolutely. Ideally Instruction is a sequence over which you iterate Uses, Function is a sequence over which you iterate BasicBlocks, and BasicBlock is a sequence over which you iterate Instructions.

@harlanhaskins
Copy link
Member

harlanhaskins commented Jan 9, 2017

Or we make a UseSequnce and have a uses property in Instruction, and have similar sequences on the others.

@CodaFi CodaFi force-pushed the doctored-evidence branch from 3d02cf3 to 8fdf2ce Compare January 9, 2017 20:29
@harlanhaskins harlanhaskins merged commit bf3a4ec into llvm-swift:master Jan 9, 2017
@harlanhaskins
Copy link
Member

Thanks!!

@CodaFi CodaFi deleted the doctored-evidence branch January 9, 2017 20:38
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