forked from google/gematria
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added patch to llvm & works on loading mir files
- Loading branch information
Showing
5 changed files
with
44 additions
and
2 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
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
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
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
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,22 @@ | ||
diff --git a/llvm/lib/MC/MCContext.cpp b/llvm/lib/MC/MCContext.cpp | ||
index a1dde3e1fecb..88d8b11180e1 100644 | ||
--- a/llvm/lib/MC/MCContext.cpp | ||
+++ b/llvm/lib/MC/MCContext.cpp | ||
@@ -201,8 +201,15 @@ MCInst *MCContext::createMCInst() { | ||
MCSymbol *MCContext::getOrCreateSymbol(const Twine &Name) { | ||
SmallString<128> NameSV; | ||
StringRef NameRef = Name.toStringRef(NameSV); | ||
- | ||
- assert(!NameRef.empty() && "Normal symbols cannot be unnamed!"); | ||
+ static int cnt = 0; | ||
+ if (NameRef.empty()){ | ||
+ // Append cnt to the end of NameRef | ||
+ std::string ModifiedName = ("INVALID" + std::to_string(cnt)); | ||
+ cnt++; // Increment cnt | ||
+ | ||
+ // Convert ModifiedName back to StringRef | ||
+ NameRef = StringRef(ModifiedName); | ||
+ } | ||
|
||
MCSymbol *&Sym = Symbols[NameRef]; | ||
if (!Sym) |