[lld] r276697 - Make ConstraintKind an enum class.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 25 15:00:10 PDT 2016
Author: ruiu
Date: Mon Jul 25 17:00:10 2016
New Revision: 276697
URL: http://llvm.org/viewvc/llvm-project?rev=276697&view=rev
Log:
Make ConstraintKind an enum class.
Modified:
lld/trunk/ELF/LinkerScript.cpp
lld/trunk/ELF/LinkerScript.h
Modified: lld/trunk/ELF/LinkerScript.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScript.cpp?rev=276697&r1=276696&r2=276697&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.cpp (original)
+++ lld/trunk/ELF/LinkerScript.cpp Mon Jul 25 17:00:10 2016
@@ -692,9 +692,9 @@ void ScriptParser::readOutputSectionDesc
// Parse constraints.
if (skip("ONLY_IF_RO"))
- Cmd->Constraint = ReadOnly;
+ Cmd->Constraint = ConstraintKind::ReadOnly;
if (skip("ONLY_IF_RW"))
- Cmd->Constraint = ReadWrite;
+ Cmd->Constraint = ConstraintKind::ReadWrite;
expect("{");
while (!Error && !skip("}")) {
Modified: lld/trunk/ELF/LinkerScript.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScript.h?rev=276697&r1=276696&r2=276697&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.h (original)
+++ lld/trunk/ELF/LinkerScript.h Mon Jul 25 17:00:10 2016
@@ -65,7 +65,7 @@ struct SymbolAssignment : BaseCommand {
// read-only
// or all of its input sections are read-write by using the keyword ONLY_IF_RO
// and ONLY_IF_RW respectively.
-enum ConstraintKind { NoConstraint, ReadOnly, ReadWrite };
+enum class ConstraintKind { NoConstraint, ReadOnly, ReadWrite };
struct OutputSectionCommand : BaseCommand {
OutputSectionCommand(StringRef Name)
@@ -76,7 +76,7 @@ struct OutputSectionCommand : BaseComman
std::vector<std::unique_ptr<BaseCommand>> Commands;
std::vector<StringRef> Phdrs;
std::vector<uint8_t> Filler;
- ConstraintKind Constraint = NoConstraint;
+ ConstraintKind Constraint = ConstraintKind::NoConstraint;
};
struct InputSectionDescription : BaseCommand {
More information about the llvm-commits
mailing list