summaryrefslogtreecommitdiffstats
path: root/llvm/lib
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
commit6a833f6806d4add51101fa4c7244767757aa1a35 (patch)
tree950a9b4bd02e229b0b2ed1cd59c24d33c43f905c /llvm/lib
parentb4bed3a497390d1be9f9add3f246bc1900222aa5 (diff)
downloadbcm5719-llvm-6a833f6806d4add51101fa4c7244767757aa1a35.tar.gz
bcm5719-llvm-6a833f6806d4add51101fa4c7244767757aa1a35.zip
add a helper method for creating MCSymbol and MCSymbolRefExpr at
the same time. llvm-svn: 81984
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/MC/MCExpr.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCExpr.cpp b/llvm/lib/MC/MCExpr.cpp
index c0ecad0361a..0f3e053de8e 100644
--- a/llvm/lib/MC/MCExpr.cpp
+++ b/llvm/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 {
OpenPOWER on IntegriCloud