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

Side by Side Diff: src/IceTargetLowering.h

Issue 1188603002: Move lowerGlobal() from target-specific code to emitGlobal() in generic code. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: .long vs .4byte Created 5 years, 6 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 | src/IceTargetLowering.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/src/IceTargetLowering.h - Lowering interface -----*- C++ -*-===// 1 //===- subzero/src/IceTargetLowering.h - Lowering interface -----*- C++ -*-===//
2 // 2 //
3 // The Subzero Code Generator 3 // The Subzero Code Generator
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 file declares the TargetLowering, LoweringContext, and 10 // This file declares the TargetLowering, LoweringContext, and
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 TargetDataLowering &operator=(const TargetDataLowering &) = delete; 377 TargetDataLowering &operator=(const TargetDataLowering &) = delete;
378 378
379 public: 379 public:
380 static std::unique_ptr<TargetDataLowering> createLowering(GlobalContext *Ctx); 380 static std::unique_ptr<TargetDataLowering> createLowering(GlobalContext *Ctx);
381 virtual ~TargetDataLowering(); 381 virtual ~TargetDataLowering();
382 382
383 virtual void lowerGlobals(std::unique_ptr<VariableDeclarationList> Vars) = 0; 383 virtual void lowerGlobals(std::unique_ptr<VariableDeclarationList> Vars) = 0;
384 virtual void lowerConstants() = 0; 384 virtual void lowerConstants() = 0;
385 385
386 protected: 386 protected:
387 void emitGlobal(const VariableDeclaration &Var);
388
389 // For now, we assume .long is the right directive for emitting 4 byte
390 // emit global relocations. However, LLVM MIPS usually uses .4byte instead.
391 // Perhaps there is some difference when the location is unaligned.
392 const char *getEmit32Directive() { return ".long"; }
393
387 explicit TargetDataLowering(GlobalContext *Ctx) : Ctx(Ctx) {} 394 explicit TargetDataLowering(GlobalContext *Ctx) : Ctx(Ctx) {}
388 GlobalContext *Ctx; 395 GlobalContext *Ctx;
389 }; 396 };
390 397
391 // TargetHeaderLowering is used to "lower" the header of an output file. 398 // TargetHeaderLowering is used to "lower" the header of an output file.
392 // It writes out the target-specific header attributes. E.g., for ARM 399 // It writes out the target-specific header attributes. E.g., for ARM
393 // this writes out the build attributes (float ABI, etc.). 400 // this writes out the build attributes (float ABI, etc.).
394 class TargetHeaderLowering { 401 class TargetHeaderLowering {
395 TargetHeaderLowering() = delete; 402 TargetHeaderLowering() = delete;
396 TargetHeaderLowering(const TargetHeaderLowering &) = delete; 403 TargetHeaderLowering(const TargetHeaderLowering &) = delete;
397 TargetHeaderLowering &operator=(const TargetHeaderLowering &) = delete; 404 TargetHeaderLowering &operator=(const TargetHeaderLowering &) = delete;
398 405
399 public: 406 public:
400 static std::unique_ptr<TargetHeaderLowering> 407 static std::unique_ptr<TargetHeaderLowering>
401 createLowering(GlobalContext *Ctx); 408 createLowering(GlobalContext *Ctx);
402 virtual ~TargetHeaderLowering(); 409 virtual ~TargetHeaderLowering();
403 410
404 virtual void lower() {} 411 virtual void lower() {}
405 412
406 protected: 413 protected:
407 explicit TargetHeaderLowering(GlobalContext *Ctx) : Ctx(Ctx) {} 414 explicit TargetHeaderLowering(GlobalContext *Ctx) : Ctx(Ctx) {}
408 GlobalContext *Ctx; 415 GlobalContext *Ctx;
409 }; 416 };
410 417
411 } // end of namespace Ice 418 } // end of namespace Ice
412 419
413 #endif // SUBZERO_SRC_ICETARGETLOWERING_H 420 #endif // SUBZERO_SRC_ICETARGETLOWERING_H
OLDNEW
« no previous file with comments | « no previous file | src/IceTargetLowering.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698