aboutsummaryrefslogtreecommitdiffstats
path: root/lib/MC
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-09-16 01:26:31 +0000
committerChris Lattner <sabre@nondot.org>2009-09-16 01:26:31 +0000
commit4f3e7aa154577c86791908e73a9fec075fdea0ba (patch)
treeeb324787e2f55281f071568cc06b5e7d756da390 /lib/MC
parent5ab9403bc2c3f1f7fc4044ff4a7c394044a1c9e9 (diff)
downloadexternal_llvm-4f3e7aa154577c86791908e73a9fec075fdea0ba.zip
external_llvm-4f3e7aa154577c86791908e73a9fec075fdea0ba.tar.gz
external_llvm-4f3e7aa154577c86791908e73a9fec075fdea0ba.tar.bz2
add a helper method for creating MCSymbol and MCSymbolRefExpr at
the same time. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81984 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC')
-rw-r--r--lib/MC/MCExpr.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/MC/MCExpr.cpp b/lib/MC/MCExpr.cpp
index c0ecad0..0f3e053 100644
--- a/lib/MC/MCExpr.cpp
+++ b/lib/MC/MCExpr.cpp
@@ -133,6 +133,12 @@ const MCSymbolRefExpr *MCSymbolRefExpr::Create(const MCSymbol *Sym,
return new (Ctx) MCSymbolRefExpr(Sym);
}
+const MCSymbolRefExpr *MCSymbolRefExpr::Create(const StringRef &Name,
+ MCContext &Ctx) {
+ return Create(Ctx.GetOrCreateSymbol(Name), Ctx);
+}
+
+
/* *** */
bool MCExpr::EvaluateAsAbsolute(MCContext &Ctx, int64_t &Res) const {