Skip to content

Commit

Permalink
LLVM BC support
Browse files Browse the repository at this point in the history
Using [rules_swift](https://github.com/bazelbuild/rules_swift) it is possible to generate LLVM IR BC files using `swift.emit_bc` feature, some days ago a [refactor](bazelbuild/rules_swift@8cf3635#diff-535d0dbea9614c6905a30dfdb0e708df3b16fc68f8930d6aba519342509dc657R1948) to use `create_compilation_outputs` from `cc_common` was merged, it is giving us the following error since the bc extension is missing, this pr fixes it

```
Error in create_compilation_outputs: 'Somefile.swift.bc' has wrong extension. The list of possible extensions for 'objects' is: .o,.obj,.pic.o,.opb
```

Closes #13889.

PiperOrigin-RevId: 392889724
  • Loading branch information
omarzl authored and Copybara-Service committed Aug 25, 2021
1 parent 2f2a437 commit f53c389
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public final class CppFileTypes {
public static final FileType OBJCPP_SOURCE = FileType.of(".mm");
public static final FileType CLIF_INPUT_PROTO = FileType.of(".ipb");
public static final FileType CLIF_OUTPUT_PROTO = FileType.of(".opb");
public static final FileType BC_SOURCE = FileType.of(".bc");

public static final FileTypeSet ALL_C_CLASS_SOURCE =
FileTypeSet.of(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ private Link() {} // uninstantiable
/** The set of object files */
public static final FileTypeSet OBJECT_FILETYPES =
FileTypeSet.of(
CppFileTypes.OBJECT_FILE, CppFileTypes.PIC_OBJECT_FILE, CppFileTypes.CLIF_OUTPUT_PROTO);
CppFileTypes.OBJECT_FILE,
CppFileTypes.PIC_OBJECT_FILE,
CppFileTypes.CLIF_OUTPUT_PROTO,
CppFileTypes.BC_SOURCE);

/**
* Whether a particular link target requires PIC code.
Expand Down

0 comments on commit f53c389

Please sign in to comment.