diff options
author | Eric Christopher <echristo@gmail.com> | 2015-07-06 23:51:59 +0000 |
---|---|---|
committer | Eric Christopher <echristo@gmail.com> | 2015-07-06 23:51:59 +0000 |
commit | af4d608d13eb810752b89cb6e5af2c211d8e63da (patch) | |
tree | 05b6710cecd4e1a6d9c375c71f8f745eee5a6b71 /clang/lib/CodeGen | |
parent | 93d6adfb46877b95d62b0e699a17fa70aeffa46d (diff) | |
download | bcm5719-llvm-af4d608d13eb810752b89cb6e5af2c211d8e63da.tar.gz bcm5719-llvm-af4d608d13eb810752b89cb6e5af2c211d8e63da.zip |
Handle arbitrary whitespace in the target attribute support.
This allows us to deal a bit more gracefully with inclusions done
by macros, token pasting, or just code layout/formatting.
llvm-svn: 241525
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r-- | clang/lib/CodeGen/CGCall.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp index 0535c05da5d..ac014d3220a 100644 --- a/clang/lib/CodeGen/CGCall.cpp +++ b/clang/lib/CodeGen/CGCall.cpp @@ -1514,9 +1514,13 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI, // Grab the various features and prepend a "+" to turn on the feature to // the backend and add them to our existing set of features. for (auto &Feature : AttrFeatures) { + // Go ahead and trim whitespace rather than either erroring or + // accepting it weirdly. + Feature = Feature.trim(); + // While we're here iterating check for a different target cpu. if (Feature.startswith("arch=")) - TargetCPU = Feature.split("=").second; + TargetCPU = Feature.split("=").second.trim(); else if (Feature.startswith("tune=")) // We don't support cpu tuning this way currently. ; |