Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(495)

Unified Diff: lib/Target/X86/MCTargetDesc/X86MCNaCl.cpp

Issue 1151093004: Changes from 3.7 merge to files not in upstream (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-llvm.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: lib/Target/X86/MCTargetDesc/X86MCNaCl.cpp
diff --git a/lib/Target/X86/MCTargetDesc/X86MCNaCl.cpp b/lib/Target/X86/MCTargetDesc/X86MCNaCl.cpp
index 2e3e4e5449613b651b940d62e535109c8dd2402a..724d75bbd78e0471411a12636007c1314993d766 100644
--- a/lib/Target/X86/MCTargetDesc/X86MCNaCl.cpp
+++ b/lib/Target/X86/MCTargetDesc/X86MCNaCl.cpp
@@ -48,14 +48,6 @@ unsigned getX86SubSuperRegister_(unsigned Reg, EVT VT, bool High=false);
unsigned DemoteRegTo32_(unsigned RegIn);
} // namespace
-static MCSymbol *CreateTempLabel(MCContext &Context, const char *Prefix) {
- SmallString<128> NameSV;
- raw_svector_ostream(NameSV)
- << Context.getAsmInfo()->getPrivateGlobalPrefix() // get internal label
- << Prefix << Context.getUniqueSymbolID();
- return Context.GetOrCreateSymbol(NameSV);
-}
-
static void PushReturnAddress(const llvm::MCSubtargetInfo &STI,
MCContext &Context, MCStreamer &Out,
MCSymbol *RetTarget) {
@@ -115,7 +107,7 @@ static void EmitDirectCall(const llvm::MCSubtargetInfo &STI,
MCContext &Context = Out.getContext();
// Generate a label for the return address.
- MCSymbol *RetTarget = CreateTempLabel(Context, "DirectCallRetAddr");
+ MCSymbol *RetTarget = Context.createTempSymbol("DirectCallRetAddr", true);
PushReturnAddress(STI, Context, Out, RetTarget);
@@ -205,7 +197,7 @@ static void EmitIndirectBranch(const llvm::MCSubtargetInfo &STI,
if (IsCall) {
MCContext &Context = Out.getContext();
// Generate a label for the return address.
- RetTarget = CreateTempLabel(Context, "IndirectCallRetAddr");
+ RetTarget = Context.createTempSymbol("IndirectCallRetAddr", true);
// Explicitly push the (32-bit) return address for a NaCl64 call
// instruction.
PushReturnAddress(STI, Context, Out, RetTarget);

Powered by Google App Engine
This is Rietveld 408576698