summaryrefslogtreecommitdiffstats
path: root/llvm/lib/AsmParser/LLParser.h
diff options
context:
space:
mode:
authorAlex Lorenz <arphaman@gmail.com>2015-06-23 17:10:10 +0000
committerAlex Lorenz <arphaman@gmail.com>2015-06-23 17:10:10 +0000
commit8955f7d7046779668232f79984e9b3ab43bb8b10 (patch)
tree5f3af0a58f5514f601ab93094739e20c6e48478e /llvm/lib/AsmParser/LLParser.h
parent82a56b01aef8d71e822fcda90146df72d4ca1e08 (diff)
downloadbcm5719-llvm-8955f7d7046779668232f79984e9b3ab43bb8b10.tar.gz
bcm5719-llvm-8955f7d7046779668232f79984e9b3ab43bb8b10.zip
AsmParser: Extend the API to make the global value and metadata node slot mappings publicly accessible.
This commit creates a new structure called 'SlotMapping' in the AsmParser library. This structure can be passed into the public parsing APIs from the AsmParser library in order to extract the data structures that map from slot numbers to unnamed global values and metadata nodes. This change is useful for MIR Serialization, as the MIR Parser has to lookup the unnamed global values and metadata nodes by their slot numbers. Reviewers: Duncan P. N. Exon Smith Differential Revision: http://reviews.llvm.org/D10551 llvm-svn: 240427
Diffstat (limited to 'llvm/lib/AsmParser/LLParser.h')
-rw-r--r--llvm/lib/AsmParser/LLParser.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/AsmParser/LLParser.h b/llvm/lib/AsmParser/LLParser.h
index a43a4b06a94..6e57b3e0667 100644
--- a/llvm/lib/AsmParser/LLParser.h
+++ b/llvm/lib/AsmParser/LLParser.h
@@ -37,6 +37,7 @@ namespace llvm {
class Comdat;
class MDString;
class MDNode;
+ struct SlotMapping;
class StructType;
/// ValID - Represents a reference of a definition of some sort with no type.
@@ -87,6 +88,7 @@ namespace llvm {
LLVMContext &Context;
LLLexer Lex;
Module *M;
+ SlotMapping *Slots;
// Instruction metadata resolution. Each instruction can have a list of
// MDRef info associated with them.
@@ -135,9 +137,10 @@ namespace llvm {
std::map<unsigned, AttrBuilder> NumberedAttrBuilders;
public:
- LLParser(StringRef F, SourceMgr &SM, SMDiagnostic &Err, Module *m)
- : Context(m->getContext()), Lex(F, SM, Err, m->getContext()), M(m),
- BlockAddressPFS(nullptr) {}
+ LLParser(StringRef F, SourceMgr &SM, SMDiagnostic &Err, Module *M,
+ SlotMapping *Slots = nullptr)
+ : Context(M->getContext()), Lex(F, SM, Err, M->getContext()), M(M),
+ Slots(Slots), BlockAddressPFS(nullptr) {}
bool Run();
LLVMContext &getContext() { return Context; }
OpenPOWER on IntegriCloud