Skip to content

Commit

Permalink
TableGen: use fully qualified name for StringLiteral
Browse files Browse the repository at this point in the history
Use the qualified name for StringLiteral (llvm::StringLiteral) when
generating the sources.  This is needed as the generated files may be
used out-of-tree (e.g. swift) where you may not have a
`using namespace llvm;` resulting in an undefined lookup.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293577 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
compnerd committed Jan 31, 2017
1 parent 51c6922 commit 91f734b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utils/TableGen/IntrinsicEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,13 @@ void IntrinsicEmitter::EmitTargetInfo(const CodeGenIntrinsicTable &Ints,
OS << "// Target mapping\n";
OS << "#ifdef GET_INTRINSIC_TARGET_DATA\n";
OS << "struct IntrinsicTargetInfo {\n"
<< " StringLiteral Name;\n"
<< " llvm::StringLiteral Name;\n"
<< " size_t Offset;\n"
<< " size_t Count;\n"
<< "};\n";
OS << "static constexpr IntrinsicTargetInfo TargetInfos[] = {\n";
for (auto Target : Ints.Targets)
OS << " {StringLiteral(\"" << Target.Name << "\"), " << Target.Offset
OS << " {llvm::StringLiteral(\"" << Target.Name << "\"), " << Target.Offset
<< ", " << Target.Count << "},\n";
OS << "};\n";
OS << "#endif\n\n";
Expand Down

0 comments on commit 91f734b

Please sign in to comment.