[PATCH] D59419: [XCOFF] Add functionality for parsing AIX XCOFF object files header .

Hubert Tong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 2 12:06:32 PDT 2019


hubert.reinterpretcast added inline comments.


================
Comment at: llvm/lib/ObjectYAML/XCOFFYAML.cpp:17
+#include <cstdint>
+#include <vector>
+
----------------
DiggerLin wrote:
> DiggerLin wrote:
> > hubert.reinterpretcast wrote:
> > > I am not seeing a need for `<cstdint>` or `<vector>`. At the same time, `<string.h>` should be added for `::memset`.
> > I deleted the 
> > -#include "llvm/ObjectYAML/YAML.h"
> > -#include "llvm/Support/YAMLTraits.h"
> > -#include <cstdint>
> > -#include <vector>
> I think <string.h> is already be included in the headers files which be included in #include "llvm/ObjectYAML/XCOFFYAML.h" ,and I tried to use -E of g++ to preprocessor the file , I can find the string.h in the preprocessor file.
Firstly, is `::memset` part of the abstract interface (as opposed to an implementation-related detail) of any of the headers included directly by this file? I believe the answer is "no". Secondly, is `<string.h>` actually included by any of the headers in the LLVM project that are transitively included from this file? Of the 51 headers, none of them include `<string.h>` (although some include `<cstring>`, which does not have to declare `::memset`).

The 51 headers I checked are:
llvm/ObjectYAML/YAML.h llvm/ADT/ArrayRef.h llvm/ADT/DenseMapInfo.h llvm/ADT/Hashing.h llvm/ADT/None.h llvm/ADT/Optional.h llvm/ADT/PointerIntPair.h llvm/ADT/PointerUnion.h llvm/ADT/STLExtras.h llvm/ADT/SmallString.h llvm/ADT/SmallVector.h llvm/ADT/StringExtras.h llvm/ADT/StringMap.h llvm/ADT/StringRef.h llvm/ADT/StringSwitch.h llvm/ADT/Twine.h llvm/ADT/iterator.h llvm/ADT/iterator_range.h llvm/Config/abi-breaking.h llvm/Config/llvm-config.h llvm/Support/AlignOf.h llvm/Support/Allocator.h llvm/Support/CBindingWrapping.h llvm/Support/Casting.h llvm/Support/Chrono.h llvm/Support/Compiler.h llvm/Support/DataTypes.h llvm/Support/Debug.h llvm/Support/Endian.h llvm/Support/Error.h llvm/Support/ErrorHandling.h llvm/Support/ErrorOr.h llvm/Support/FileSystem.h llvm/Support/Format.h llvm/Support/FormatProviders.h llvm/Support/FormatVariadicDetails.h llvm/Support/Host.h llvm/Support/MD5.h llvm/Support/MathExtras.h llvm/Support/MemAlloc.h llvm/Support/MemoryBuffer.h llvm/Support/NativeFormatting.h llvm/Support/PointerLikeTypeTraits.h llvm/Support/Regex.h llvm/Support/SMLoc.h llvm/Support/SourceMgr.h llvm/Support/SwapByteOrder.h llvm/Support/YAMLParser.h llvm/Support/YAMLTraits.h llvm/Support/raw_ostream.h llvm/Support/type_traits.h


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59419/new/

https://reviews.llvm.org/D59419





More information about the llvm-commits mailing list