Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added the LLVM patch that I use for ocamlllvm.
- Loading branch information
1 parent
30f41f5
commit 4d745b0
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
Index: lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp | ||
=================================================================== | ||
--- lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp (revision 150367) | ||
+++ lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp (working copy) | ||
@@ -50,7 +50,13 @@ | ||
std::string SymName; | ||
SymName += "caml"; | ||
size_t Letter = SymName.size(); | ||
- SymName.append(MId.begin(), std::find(MId.begin(), MId.end(), '.')); | ||
+ // This is used to get sensible symbol names in the resulting assembly code. | ||
+ if (std::string::npos != MId.find("camlstartup")) | ||
+ SymName.append("_startup"); | ||
+ else { | ||
+ std::string foo = MId.substr(MId.find_last_of("/")+1); | ||
+ SymName.append(foo.begin(), std::find(foo.begin(), foo.end(), '.')); | ||
+ } | ||
SymName += "__"; | ||
SymName += Id; | ||
|
||
@@ -117,8 +123,7 @@ | ||
// Very rude! | ||
report_fatal_error(" Too much descriptor for ocaml GC"); | ||
} | ||
- AP.EmitInt16(NumDescriptors); | ||
- AP.EmitAlignment(IntPtrSize == 4 ? 2 : 3); | ||
+ AP.OutStreamer.EmitIntValue(NumDescriptors, IntPtrSize); | ||
|
||
for (iterator I = begin(), IE = end(); I != IE; ++I) { | ||
GCFunctionInfo &FI = **I; |