llvm.org GIT mirror llvm / a20bcb9
Remove all uses of 'using std::error_code' from headers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210866 91177308-0d34-0410-b5e6-96231b3b80d8 Rafael Espindola 6 years ago
22 changed file(s) with 73 addition(s) and 70 deletion(s). Raw diff Collapse all Expand all
2525 #include "llvm/Support/MemoryBuffer.h"
2626 #include "llvm/Support/raw_ostream.h"
2727 using namespace llvm;
28 using std::error_code;
2829
2930 enum {
3031 SWITCH_INST_MAGIC = 0x4B5 // May 2012 => 1205 => Hex
2525 #include
2626
2727 namespace llvm {
28 using std::error_code;
2928 class MemoryBuffer;
3029 class LLVMContext;
3130
219218 InvalidValue // Invalid version, inst number, attr number, etc
220219 };
221220
222 error_code Error(ErrorType E) {
223 return error_code(E, BitcodeErrorCategory());
221 std::error_code Error(ErrorType E) {
222 return std::error_code(E, BitcodeErrorCategory());
224223 }
225224
226225 explicit BitcodeReader(MemoryBuffer *buffer, LLVMContext &C)
249248
250249 bool isMaterializable(const GlobalValue *GV) const override;
251250 bool isDematerializable(const GlobalValue *GV) const override;
252 error_code Materialize(GlobalValue *GV) override;
253 error_code MaterializeModule(Module *M) override;
251 std::error_code Materialize(GlobalValue *GV) override;
252 std::error_code MaterializeModule(Module *M) override;
254253 void Dematerialize(GlobalValue *GV) override;
255254
256255 /// @brief Main interface to parsing a bitcode buffer.
257256 /// @returns true if an error occurred.
258 error_code ParseBitcodeInto(Module *M);
257 std::error_code ParseBitcodeInto(Module *M);
259258
260259 /// @brief Cheap mechanism to just extract module triple
261260 /// @returns true if an error occurred.
262 error_code ParseTriple(std::string &Triple);
261 std::error_code ParseTriple(std::string &Triple);
263262
264263 static uint64_t decodeSignRotatedValue(uint64_t V);
265264
346345 return getFnValueByID(ValNo, Ty);
347346 }
348347
349 error_code ParseAttrKind(uint64_t Code, Attribute::AttrKind *Kind);
350 error_code ParseModule(bool Resume);
351 error_code ParseAttributeBlock();
352 error_code ParseAttributeGroupBlock();
353 error_code ParseTypeTable();
354 error_code ParseTypeTableBody();
355
356 error_code ParseValueSymbolTable();
357 error_code ParseConstants();
358 error_code RememberAndSkipFunctionBody();
359 error_code ParseFunctionBody(Function *F);
360 error_code GlobalCleanup();
361 error_code ResolveGlobalAndAliasInits();
362 error_code ParseMetadata();
363 error_code ParseMetadataAttachment();
364 error_code ParseModuleTriple(std::string &Triple);
365 error_code ParseUseLists();
366 error_code InitStream();
367 error_code InitStreamFromBuffer();
368 error_code InitLazyStream();
369 error_code FindFunctionInStream(Function *F,
370 DenseMap::iterator DeferredFunctionInfoIterator);
348 std::error_code ParseAttrKind(uint64_t Code, Attribute::AttrKind *Kind);
349 std::error_code ParseModule(bool Resume);
350 std::error_code ParseAttributeBlock();
351 std::error_code ParseAttributeGroupBlock();
352 std::error_code ParseTypeTable();
353 std::error_code ParseTypeTableBody();
354
355 std::error_code ParseValueSymbolTable();
356 std::error_code ParseConstants();
357 std::error_code RememberAndSkipFunctionBody();
358 std::error_code ParseFunctionBody(Function *F);
359 std::error_code GlobalCleanup();
360 std::error_code ResolveGlobalAndAliasInits();
361 std::error_code ParseMetadata();
362 std::error_code ParseMetadataAttachment();
363 std::error_code ParseModuleTriple(std::string &Triple);
364 std::error_code ParseUseLists();
365 std::error_code InitStream();
366 std::error_code InitStreamFromBuffer();
367 std::error_code InitLazyStream();
368 std::error_code FindFunctionInStream(
369 Function *F,
370 DenseMap::iterator DeferredFunctionInfoIterator);
371371 };
372372
373373 } // End llvm namespace
2222
2323 using namespace llvm;
2424 using namespace llvm::object;
25 using std::error_code;
2526
2627 #define DEBUG_TYPE "dyld"
2728
2626
2727 using namespace llvm;
2828 using namespace llvm::object;
29 using std::error_code;
2930
3031 #define DEBUG_TYPE "dyld"
3132
1919 using namespace llvm;
2020
2121 namespace llvm {
22 using std::error_code;
23
2422 namespace {
2523 // Helper for extensive error checking in debug builds.
26 error_code Check(error_code Err) {
24 std::error_code Check(std::error_code Err) {
2725 if (Err) {
2826 report_fatal_error(Err.message());
2927 }
2828 using namespace llvm;
2929 using namespace object;
3030 using namespace llvm::Win64EH;
31 using std::error_code;
3132
3233 // Returns the name of the unwind code.
3334 static StringRef getUnwindCodeTypeName(uint8_t Code) {
4141 #include
4242 using namespace llvm;
4343 using namespace object;
44 using std::error_code;
4445
4546 static cl::opt
4647 UseDbg("g", cl::desc("Print line information from debug info if available"));
1515 #include "llvm/Support/StringRefMemoryObject.h"
1616
1717 namespace llvm {
18 using std::error_code;
19
2018 namespace object {
2119 class COFFObjectFile;
2220 class ObjectFile;
2725 extern cl::opt ArchName;
2826
2927 // Various helper functions.
30 bool error(error_code ec);
28 bool error(std::error_code ec);
3129 bool RelocAddressLess(object::RelocationRef a, object::RelocationRef b);
3230 void DumpBytes(StringRef bytes);
3331 void DisassembleInputMachO(StringRef Filename);
2121 #include "llvm/Support/type_traits.h"
2222
2323 namespace llvm {
24 using std::error_code;
2524 namespace ARM {
2625 namespace EHABI {
2726
188188 uint64_t Address;
189189 uint64_t Size;
190190
191 if (error_code EC = Section.getAddress(Address))
191 if (std::error_code EC = Section.getAddress(Address))
192192 return EC;
193 if (error_code EC = Section.getSize(Size))
193 if (std::error_code EC = Section.getSize(Size))
194194 return EC;
195195
196196 if (VA >= Address && (VA - Address) <= Size)
204204 for (const auto &Symbol : COFF.symbols()) {
205205 if (FunctionOnly) {
206206 SymbolRef::Type Type;
207 if (error_code EC = Symbol.getType(Type))
207 if (std::error_code EC = Symbol.getType(Type))
208208 return EC;
209209 if (Type != SymbolRef::ST_Function)
210210 continue;
211211 }
212212
213213 uint64_t Address;
214 if (error_code EC = Symbol.getAddress(Address))
214 if (std::error_code EC = Symbol.getAddress(Address))
215215 return EC;
216216 if (Address == VA)
217217 return Symbol;
727727 break;
728728 }
729729
730 error_code Decoder::dumpProcedureData(const COFFObjectFile &COFF) {
730 std::error_code Decoder::dumpProcedureData(const COFFObjectFile &COFF) {
731731 for (const auto &Section : COFF.sections()) {
732732 StringRef SectionName;
733 if (error_code EC = COFF.getSectionName(COFF.getCOFFSection(Section),
734 SectionName))
733 if (std::error_code EC =
734 COFF.getSectionName(COFF.getCOFFSection(Section), SectionName))
735735 return EC;
736736
737737 if (SectionName.startswith(".pdata"))
738738 dumpProcedureData(COFF, Section);
739739 }
740 return error_code();
741 }
742 }
743 }
744 }
745
740 return std::error_code();
741 }
742 }
743 }
744 }
745
1414 #include "llvm/Support/ErrorOr.h"
1515
1616 namespace llvm {
17 using std::error_code;
1817 namespace ARM {
1918 namespace WinEH {
2019 class RuntimeFunction;
109108
110109 public:
111110 Decoder(StreamWriter &SW) : SW(SW), OS(SW.getOStream()) {}
112 error_code dumpProcedureData(const object::COFFObjectFile &COFF);
111 std::error_code dumpProcedureData(const object::COFFObjectFile &COFF);
113112 };
114113 }
115114 }
3737 using namespace llvm;
3838 using namespace llvm::object;
3939 using namespace llvm::Win64EH;
40 using std::error_code;
4041
4142 namespace {
4243
2929 using namespace llvm;
3030 using namespace llvm::object;
3131 using namespace ELF;
32 using std::error_code;
3233
3334 #define LLVM_READOBJ_ENUM_CASE(ns, enum) \
3435 case ns::enum: return #enum;
1616 #include
1717
1818 namespace llvm {
19 using std::error_code;
2019 const std::error_category &readobj_category();
2120
2221 enum class readobj_error {
2827 unknown_symbol
2928 };
3029
31 inline error_code make_error_code(readobj_error e) {
32 return error_code(static_cast(e), readobj_category());
30 inline std::error_code make_error_code(readobj_error e) {
31 return std::error_code(static_cast(e), readobj_category());
3332 }
3433
3534 } // namespace llvm
2020
2121 using namespace llvm;
2222 using namespace object;
23 using std::error_code;
2324
2425 namespace {
2526
1313 #include
1414
1515 namespace llvm {
16 using std::error_code;
1716 namespace object {
1817 class ObjectFile;
1918 }
4443 StreamWriter& W;
4544 };
4645
47 error_code createCOFFDumper(const object::ObjectFile *Obj, StreamWriter &Writer,
48 std::unique_ptr &Result);
46 std::error_code createCOFFDumper(const object::ObjectFile *Obj,
47 StreamWriter &Writer,
48 std::unique_ptr &Result);
4949
50 error_code createELFDumper(const object::ObjectFile *Obj, StreamWriter &Writer,
51 std::unique_ptr &Result);
50 std::error_code createELFDumper(const object::ObjectFile *Obj,
51 StreamWriter &Writer,
52 std::unique_ptr &Result);
5253
53 error_code createMachODumper(const object::ObjectFile *Obj,
54 StreamWriter &Writer,
55 std::unique_ptr &Result);
54 std::error_code createMachODumper(const object::ObjectFile *Obj,
55 StreamWriter &Writer,
56 std::unique_ptr &Result);
5657
5758 } // namespace llvm
5859
1313 #include "llvm/Support/Win64EH.h"
1414
1515 namespace llvm {
16 using std::error_code;
1716 namespace object {
1817 class COFFObjectFile;
1918 class SymbolRef;
2625 raw_ostream &OS;
2726
2827 public:
29 typedef error_code (*SymbolResolver)(const object::coff_section *, uint64_t,
30 object::SymbolRef &, void *);
28 typedef std::error_code (*SymbolResolver)(const object::coff_section *,
29 uint64_t, object::SymbolRef &,
30 void *);
3131
3232 struct Context {
3333 const object::COFFObjectFile &COFF;
4040
4141 using namespace llvm;
4242 using namespace llvm::object;
43 using std::error_code;
4344
4445 namespace opts {
4546 cl::list InputFilenames(cl::Positional,
1313 #include
1414
1515 namespace llvm {
16 using std::error_code;
1716 namespace object {
1817 class RelocationRef;
1918 }
2019
2120 // Various helper functions.
22 bool error(error_code ec);
21 bool error(std::error_code ec);
2322 bool relocAddressLess(object::RelocationRef A,
2423 object::RelocationRef B);
2524 } // namespace llvm
1212 #include
1313
1414 namespace llvm {
15 using std::error_code;
1615 const std::error_category &obj2yaml_category();
1716
1817 enum class obj2yaml_error {
2221 unsupported_obj_file_format
2322 };
2423
25 inline error_code make_error_code(obj2yaml_error e) {
26 return error_code(static_cast(e), obj2yaml_category());
24 inline std::error_code make_error_code(obj2yaml_error e) {
25 return std::error_code(static_cast(e), obj2yaml_category());
2726 }
2827
2928 } // namespace llvm
1515 #include "llvm/Support/YAMLTraits.h"
1616
1717 using namespace llvm;
18 using std::error_code;
1819
1920 namespace {
2021
1717
1818 using namespace llvm;
1919 using namespace llvm::object;
20 using std::error_code;
2021
2122 static error_code dumpObject(const ObjectFile &Obj) {
2223 if (Obj.isCOFF())