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

Side by Side Diff: src/llvm2ice.cpp

Issue 476323004: Start adding an integrated assembler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: lit test to check encodings, swap complexi8 Created 6 years, 3 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
OLDNEW
1 //===- subzero/src/llvm2ice.cpp - Driver for testing ----------------------===// 1 //===- subzero/src/llvm2ice.cpp - Driver for testing ----------------------===//
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 defines a driver that uses LLVM capabilities to parse a 10 // This file defines a driver that uses LLVM capabilities to parse a
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 "bitcode-format", cl::desc("Define format of input file:"), 101 "bitcode-format", cl::desc("Define format of input file:"),
102 cl::values(clEnumValN(LLVMFormat, "llvm", "LLVM file (default)"), 102 cl::values(clEnumValN(LLVMFormat, "llvm", "LLVM file (default)"),
103 clEnumValN(PNaClFormat, "pnacl", "PNaCl bitcode file"), 103 clEnumValN(PNaClFormat, "pnacl", "PNaCl bitcode file"),
104 clEnumValEnd), 104 clEnumValEnd),
105 cl::init(LLVMFormat)); 105 cl::init(LLVMFormat));
106 106
107 static cl::opt<bool> 107 static cl::opt<bool>
108 BuildOnRead("build-on-read", 108 BuildOnRead("build-on-read",
109 cl::desc("Build ICE instructions when reading bitcode"), 109 cl::desc("Build ICE instructions when reading bitcode"),
110 cl::init(false)); 110 cl::init(false));
111 static cl::opt<bool>
112 UseIntegratedAssembler("integrated-as",
113 cl::desc("Use integrated assembler (default yes)"),
114 cl::init(true));
111 115
112 int main(int argc, char **argv) { 116 int main(int argc, char **argv) {
113 117
114 cl::ParseCommandLineOptions(argc, argv); 118 cl::ParseCommandLineOptions(argc, argv);
115 119
116 Ice::VerboseMask VMask = Ice::IceV_None; 120 Ice::VerboseMask VMask = Ice::IceV_None;
117 for (unsigned i = 0; i != VerboseList.size(); ++i) 121 for (unsigned i = 0; i != VerboseList.size(); ++i)
118 VMask |= VerboseList[i]; 122 VMask |= VerboseList[i];
119 123
120 std::ofstream Ofs; 124 std::ofstream Ofs;
(...skipping 10 matching lines...) Expand all
131 raw_os_ostream *Ls = new raw_os_ostream(LogFilename == "-" ? std::cout : Lfs); 135 raw_os_ostream *Ls = new raw_os_ostream(LogFilename == "-" ? std::cout : Lfs);
132 Ls->SetUnbuffered(); 136 Ls->SetUnbuffered();
133 137
134 Ice::ClFlags Flags; 138 Ice::ClFlags Flags;
135 Flags.DisableInternal = DisableInternal; 139 Flags.DisableInternal = DisableInternal;
136 Flags.SubzeroTimingEnabled = SubzeroTimingEnabled; 140 Flags.SubzeroTimingEnabled = SubzeroTimingEnabled;
137 Flags.DisableTranslation = DisableTranslation; 141 Flags.DisableTranslation = DisableTranslation;
138 Flags.DisableGlobals = DisableGlobals; 142 Flags.DisableGlobals = DisableGlobals;
139 Flags.FunctionSections = FunctionSections; 143 Flags.FunctionSections = FunctionSections;
140 Flags.UseSandboxing = UseSandboxing; 144 Flags.UseSandboxing = UseSandboxing;
145 Flags.UseIntegratedAssembler = UseIntegratedAssembler;
141 146
142 Ice::GlobalContext Ctx(Ls, Os, VMask, TargetArch, OptLevel, TestPrefix, 147 Ice::GlobalContext Ctx(Ls, Os, VMask, TargetArch, OptLevel, TestPrefix,
143 Flags); 148 Flags);
144 149
145 if (BuildOnRead) { 150 if (BuildOnRead) {
146 Ice::PNaClTranslator Translator(&Ctx, Flags); 151 Ice::PNaClTranslator Translator(&Ctx, Flags);
147 Translator.translate(IRFilename); 152 Translator.translate(IRFilename);
148 return Translator.getErrorStatus(); 153 return Translator.getErrorStatus();
149 } else { 154 } else {
150 // Parse the input LLVM IR file into a module. 155 // Parse the input LLVM IR file into a module.
(...skipping 10 matching lines...) Expand all
161 if (!Mod) { 166 if (!Mod) {
162 Err.print(argv[0], errs()); 167 Err.print(argv[0], errs());
163 return 1; 168 return 1;
164 } 169 }
165 170
166 Ice::Converter Converter(Mod, &Ctx, Flags); 171 Ice::Converter Converter(Mod, &Ctx, Flags);
167 Converter.convertToIce(); 172 Converter.convertToIce();
168 return Converter.getErrorStatus(); 173 return Converter.getErrorStatus();
169 } 174 }
170 } 175 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698