summaryrefslogtreecommitdiff
path: root/include/llvm
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-01-29 02:30:38 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-01-29 02:30:38 +0000
commit916d3120b30a0e77dde8368d4f44a97ed6bee53d (patch)
tree34dab64f1ea7b1e707ce150e843b552c308505d8 /include/llvm
parent79c6a4f3478bd21558e2c779667bec7d69e94ccc (diff)
downloadllvm-916d3120b30a0e77dde8368d4f44a97ed6bee53d.tar.gz
llvm-916d3120b30a0e77dde8368d4f44a97ed6bee53d.tar.bz2
llvm-916d3120b30a0e77dde8368d4f44a97ed6bee53d.tar.xz
Use a raw_stream to implement the mangler.
This is a bit more convenient for some callers, but more importantly, it is easier to implement correctly. Doing this removes the patching of already printed data that was used for fastcall, fixing a crash with private fastcall symbols. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200367 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r--include/llvm/IR/Mangler.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/include/llvm/IR/Mangler.h b/include/llvm/IR/Mangler.h
index d4a9559819..9229dd8446 100644
--- a/include/llvm/IR/Mangler.h
+++ b/include/llvm/IR/Mangler.h
@@ -15,6 +15,7 @@
#define LLVM_TARGET_MANGLER_H
#include "llvm/ADT/DenseMap.h"
+#include "llvm/Support/raw_ostream.h"
namespace llvm {
@@ -47,14 +48,16 @@ private:
public:
Mangler(const DataLayout *DL) : DL(DL), NextAnonGlobalID(1) {}
- /// getNameWithPrefix - Fill OutName with the name of the appropriate prefix
- /// and the specified global variable's name. If the global variable doesn't
- /// have a name, this fills in a unique name for the global.
+ /// Print the appropriate prefix and the specified global variable's name.
+ /// If the global variable doesn't have a name, this fills in a unique name
+ /// for the global.
+ void getNameWithPrefix(raw_ostream &OS, const GlobalValue *GV);
void getNameWithPrefix(SmallVectorImpl<char> &OutName, const GlobalValue *GV);
- /// getNameWithPrefix - Fill OutName with the name of the appropriate prefix
- /// and the specified name as the global variable name. GVName must not be
- /// empty.
+ /// Print the appropriate prefix and the specified name as the global variable
+ /// name. GVName must not be empty.
+ void getNameWithPrefix(raw_ostream &OS, const Twine &GVName,
+ ManglerPrefixTy PrefixTy = Mangler::Default);
void getNameWithPrefix(SmallVectorImpl<char> &OutName, const Twine &GVName,
ManglerPrefixTy PrefixTy = Mangler::Default);
};