[lld] r186382 - [PECOFF][Writer] Use defined constants instead of magic numbers.

Rui Ueyama ruiu at google.com
Mon Jul 15 21:47:02 PDT 2013


Author: ruiu
Date: Mon Jul 15 23:47:02 2013
New Revision: 186382

URL: http://llvm.org/viewvc/llvm-project?rev=186382&view=rev
Log:
[PECOFF][Writer] Use defined constants instead of magic numbers.

Modified:
    lld/trunk/lib/ReaderWriter/PECOFF/IdataPass.h

Modified: lld/trunk/lib/ReaderWriter/PECOFF/IdataPass.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/IdataPass.h?rev=186382&r1=186381&r2=186382&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/IdataPass.h (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/IdataPass.h Mon Jul 15 23:47:02 2013
@@ -280,11 +280,13 @@ private:
   /// COFFDataDirectoryAtom and set relocations to them, so that the address
   /// will be set by the writer.
   void createDataDirectoryAtoms(Context &ctx) {
-    auto *dir = new (_alloc) coff::COFFDataDirectoryAtom(ctx.file, 1);
+    auto *dir = new (_alloc) coff::COFFDataDirectoryAtom(
+        ctx.file, llvm::COFF::DataDirectoryIndex::IMPORT_TABLE);
     addDir32NBReloc(dir, ctx.importDirectories[0]);
     ctx.file.addAtom(*dir);
 
-    auto *iat = new (_alloc) coff::COFFDataDirectoryAtom(ctx.file, 12);
+    auto *iat = new (_alloc) coff::COFFDataDirectoryAtom(
+        ctx.file, llvm::COFF::DataDirectoryIndex::IAT);
     addDir32NBReloc(iat, ctx.importAddressTables[0]);
     ctx.file.addAtom(*iat);
   }





More information about the llvm-commits mailing list