[PATCH] Convert other drivers to use WrapperNode.

Shankar Easwaran shankare at codeaurora.org
Thu Jan 8 13:35:05 PST 2015


On 1/8/2015 12:10 PM, Rui Ueyama wrote:
> ================
> Comment at: include/lld/ReaderWriter/ELFLinkingContext.h:293-313
> @@ -292,1 +292,23 @@
>   
> +  /// \brief The attributes class provides a way for a input file to look into
> +  /// all the positional attributes that were specified in the command line.
> +  /// There are few positional operators and the number of arguments to the
> +  /// ELFFileNode class keeps growing. This achieves code to be clean as well.
> +  class Attributes {
> +  public:
> +    Attributes()
> +        : _isWholeArchive(false), _asNeeded(false), _isDashlPrefix(false),
> +          _isSysRooted(false) {}
> +    void setWholeArchive(bool isWholeArchive) {
> +      _isWholeArchive = isWholeArchive;
> +    }
> +    void setAsNeeded(bool asNeeded) { _asNeeded = asNeeded; }
> +    void setDashlPrefix(bool isDashlPrefix) { _isDashlPrefix = isDashlPrefix; }
> +    void setSysRooted(bool isSysRooted) { _isSysRooted = isSysRooted; }
> +
> +    bool _isWholeArchive;
> +    bool _asNeeded;
> +    bool _isDashlPrefix;
> +    bool _isSysRooted;
> +  };
> +
> ----------------
> shankarke wrote:
>> How is the attribute accessed from the file ? I didnt see a accessor function, am I missing some detail ?
> Well, that would be a question for you. :) The code was incomplete. I moved this piece of code from other file to this file. It's not new. Apparently we need more code to support these attributes but that's out of scope of this patch.
Yeah, the context needs to have a map from file to attributes.


-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by the Linux Foundation




More information about the llvm-commits mailing list