Skip to content

Fix a bug when writing LLVM assembly to an existing file #373

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

Open
wants to merge 3 commits into
base: llvm-9
Choose a base branch
from

Conversation

UnkindPartition
Copy link
Contributor

Previously, writeLLVMAssemblyToFile and other similar functions would not truncate an existing file when writing to it.

This means that when there are two calls to writeLLVMAssemblyToFile, and the second one results in a smaller file, there would be remainings of the first module at the end of the file, making it invalid.

This PR fixes that and removes the excl boolean argument to file-writing functions, as there's no use for it in the code base. It would have to be applied to other branches too (I checked that the issue is still present on the llvm-12 branch).

Otherwise, if we write to an existing file that is larger than the one
we want to write, the result will be a mix of the two.
This used to be done in one particular optimization test and have effect
on the tests that ran later. However, if only a subset of tests is run,
the targets could remain uninitialized, leading to test failures.
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.

1 participant
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy