Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(531)

Side by Side Diff: lib/Transforms/NaCl/FlattenGlobals.cpp

Issue 846953002: Work around MSVC bug 1085387. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-llvm.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- FlattenGlobals.cpp - Flatten global variable initializers-----------===// 1 //===- FlattenGlobals.cpp - Flatten global variable initializers-----------===//
2 // 2 //
3 // The LLVM Compiler Infrastructure 3 // The LLVM Compiler Infrastructure
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 // 9 //
10 // This pass converts initializers for global variables into a 10 // This pass converts initializers for global variables into a
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 uint8_t *BufEnd; 168 uint8_t *BufEnd;
169 169
170 // 2) an array of relocations. 170 // 2) an array of relocations.
171 class Reloc { 171 class Reloc {
172 private: 172 private:
173 unsigned RelOffset; // Offset at which the relocation is to be applied. 173 unsigned RelOffset; // Offset at which the relocation is to be applied.
174 RelocUserType *RelocUser; 174 RelocUserType *RelocUser;
175 public: 175 public:
176 176
177 unsigned getRelOffset() const { return RelOffset; } 177 unsigned getRelOffset() const { return RelOffset; }
178 Constant *getRelocUse() const { return ::getRelocUseConstant(RelocUser); } 178 Constant *getRelocUse() const { return getRelocUseConstant(RelocUser); }
179 Reloc(FlattenGlobalsState &State, unsigned RelOffset, Constant *NewVal) 179 Reloc(FlattenGlobalsState &State, unsigned RelOffset, Constant *NewVal)
180 : RelOffset(RelOffset), RelocUser(State.getRelocUserHandle(NewVal)) {} 180 : RelOffset(RelOffset), RelocUser(State.getRelocUserHandle(NewVal)) {}
181 181
182 explicit Reloc(const Reloc &R) 182 explicit Reloc(const Reloc &R)
183 : RelOffset(R.RelOffset), RelocUser(R.RelocUser) {} 183 : RelOffset(R.RelOffset), RelocUser(R.RelocUser) {}
184 184
185 void operator=(const Reloc &R) { 185 void operator=(const Reloc &R) {
186 RelOffset = R.RelOffset; 186 RelOffset = R.RelOffset;
187 RelocUser = R.RelocUser; 187 RelocUser = R.RelocUser;
188 } 188 }
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 State.flattenGlobalsWithInitializers(); 537 State.flattenGlobalsWithInitializers();
538 State.removeDeadInitializerConstants(); 538 State.removeDeadInitializerConstants();
539 State.replaceGlobalsWithFlattenedGlobals(); 539 State.replaceGlobalsWithFlattenedGlobals();
540 State.installFlattenedGlobalInitializers(); 540 State.installFlattenedGlobalInitializers();
541 return State.Modified; 541 return State.Modified;
542 } 542 }
543 543
544 ModulePass *llvm::createFlattenGlobalsPass() { 544 ModulePass *llvm::createFlattenGlobalsPass() {
545 return new FlattenGlobals(); 545 return new FlattenGlobals();
546 } 546 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698