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

Unified Diff: lib/Transforms/NaCl/ExpandVarArgs.cpp

Issue 135953002: PNaCl: Fix handling of va_arg on structs in simplification passes (Closed) Base URL: http://git.chromium.org/native_client/pnacl-llvm.git@master
Patch Set: Update comment Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | lib/Transforms/NaCl/PNaClABISimplify.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/Transforms/NaCl/ExpandVarArgs.cpp
diff --git a/lib/Transforms/NaCl/ExpandVarArgs.cpp b/lib/Transforms/NaCl/ExpandVarArgs.cpp
index 0fd1a3cb44f1f11096e457ce964c22c7e8d20ee3..f4f82adf66993f026d38b782f6bd31c7323cd3a9 100644
--- a/lib/Transforms/NaCl/ExpandVarArgs.cpp
+++ b/lib/Transforms/NaCl/ExpandVarArgs.cpp
@@ -17,21 +17,15 @@
// Alignment:
//
// This pass does not add any alignment padding between the arguments
-// that are copied onto the stack. We assume that the only argument
-// types that need to be handled are 32-bit and 64-bit -- i32, i64,
-// pointers and double:
+// that are copied onto the stack. This means that if the argument
+// list contains a mixture of, say, 1-byte and 4-byte values, the code
+// generated by this pass might be inefficient due to the memory
+// accesses being unaligned.
//
-// * We won't see i1, i8, i16 and float as varargs arguments because
-// the C standard requires the compiler to promote these to the
-// types "int" and "double".
-//
-// * We won't see va_arg instructions of struct type because Clang
-// does not yet support them in PNaCl mode. See
-// https://code.google.com/p/nativeclient/issues/detail?id=2381
-//
-// If such arguments do appear in the input, this pass will generate
-// correct, working code, but this code might be inefficient due to
-// using unaligned memory accesses.
+// This should only be an issue when passing structs as varargs
+// arguments. We won't see i1, i8, i16 and float as varargs arguments
+// because the C standard requires the compiler to promote these to
+// the types "int" and "double".
//
//===----------------------------------------------------------------------===//
« no previous file with comments | « no previous file | lib/Transforms/NaCl/PNaClABISimplify.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698