forked from llvm-mirror/llvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PDB] Enable NativeSession to create symbols for built-in types on de…
…mand Summary: There is a reserved range of type indexes for built-in types (like integers). This will create a symbol for a built-in type if the caller askes for one by type index. This is also plumbing for being able to recall symbols by type index in general, but user-defined types will come in subsequent patches. Reviewers: rnk, zturner Subscribers: mgorny, hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D35163 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307834 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
1 parent
fa1648c
commit 39bfdfa
Showing
12 changed files
with
190 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
//===- NativeBuiltinSymbol.h -------------------------------------- C++ -*-===// | ||
// | ||
// The LLVM Compiler Infrastructure | ||
// | ||
// This file is distributed under the University of Illinois Open Source | ||
// License. See LICENSE.TXT for details. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#ifndef LLVM_DEBUGINFO_PDB_NATIVE_NATIVEBUILTINSYMBOL_H | ||
#define LLVM_DEBUGINFO_PDB_NATIVE_NATIVEBUILTINSYMBOL_H | ||
|
||
#include "llvm/DebugInfo/PDB/Native/NativeRawSymbol.h" | ||
|
||
#include "llvm/DebugInfo/PDB/PDBTypes.h" | ||
|
||
namespace llvm { | ||
namespace pdb { | ||
|
||
class NativeSession; | ||
|
||
class NativeBuiltinSymbol : public NativeRawSymbol { | ||
public: | ||
NativeBuiltinSymbol(NativeSession &PDBSession, SymIndexId Id, | ||
PDB_BuiltinType T, uint64_t L); | ||
~NativeBuiltinSymbol() override; | ||
|
||
virtual std::unique_ptr<NativeRawSymbol> clone() const override; | ||
|
||
void dump(raw_ostream &OS, int Indent) const override; | ||
|
||
PDB_SymType NativeBuiltinSymbol::getSymTag() const override; | ||
|
||
PDB_BuiltinType getBuiltinType() const override; | ||
bool isConstType() const override; | ||
uint64_t getLength() const override; | ||
bool isUnalignedType() const override; | ||
bool isVolatileType() const override; | ||
|
||
protected: | ||
NativeSession &Session; | ||
PDB_BuiltinType Type; | ||
uint64_t Length; | ||
}; | ||
|
||
} // namespace pdb | ||
} // namespace llvm | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
//===- NativeBuiltinSymbol.cpp ------------------------------------ C++ -*-===// | ||
// | ||
// The LLVM Compiler Infrastructure | ||
// | ||
// This file is distributed under the University of Illinois Open Source | ||
// License. See LICENSE.TXT for details. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#include "llvm/DebugInfo/PDB/Native/NativeBuiltinSymbol.h" | ||
|
||
#include "llvm/DebugInfo/PDB/Native/NativeSession.h" | ||
|
||
namespace llvm { | ||
namespace pdb { | ||
|
||
NativeBuiltinSymbol::NativeBuiltinSymbol(NativeSession &PDBSession, | ||
SymIndexId Id, PDB_BuiltinType T, | ||
uint64_t L) | ||
: NativeRawSymbol(PDBSession, Id), Session(PDBSession), Type(T), Length(L) { | ||
} | ||
|
||
NativeBuiltinSymbol::~NativeBuiltinSymbol() {} | ||
|
||
std::unique_ptr<NativeRawSymbol> NativeBuiltinSymbol::clone() const { | ||
return std::make_unique<NativeBuiltinSymbol>(Session, SymbolId, Type, Length); | ||
} | ||
|
||
void NativeBuiltinSymbol::dump(raw_ostream &OS, int Indent) const { | ||
// TODO: Apparently nothing needs this yet. | ||
} | ||
|
||
PDB_SymType NativeBuiltinSymbol::getSymTag() const { | ||
return PDB_SymType::BuiltinType; | ||
} | ||
|
||
PDB_BuiltinType NativeBuiltinSymbol::getBuiltinType() const { return Type; } | ||
|
||
bool NativeBuiltinSymbol::isConstType() const { return false; } | ||
|
||
uint64_t NativeBuiltinSymbol::getLength() const { return Length; } | ||
|
||
bool NativeBuiltinSymbol::isUnalignedType() const { return false; } | ||
|
||
bool NativeBuiltinSymbol::isVolatileType() const { return false; } | ||
|
||
} // namespace pdb | ||
} // namespace llvm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters